[VM/runtime] Add some asserts and remove reference to String::MakeExternal

from comments as this method does not exist anymore.

Change-Id: I484ab2bfd101cb3069ab0f285de5b781834b3932
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114980
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
This commit is contained in:
asiva 2019-08-30 23:29:09 +00:00 committed by commit-bot@chromium.org
parent 12c94c04d3
commit a2228905b5
2 changed files with 8 additions and 4 deletions

View file

@ -355,8 +355,8 @@ HeapPage* PageSpace::AllocateLargePage(intptr_t size, HeapPage::PageType type) {
page->set_next(large_pages_);
large_pages_ = page;
// Only one object in this page (at least until String::MakeExternal or
// Array::MakeFixedLength is called).
// Only one object in this page (at least until Array::MakeFixedLength
// is called).
page->set_object_end(page->object_start() + size);
}
return page;
@ -410,6 +410,9 @@ void PageSpace::FreePage(HeapPage* page, HeapPage* previous_page) {
}
void PageSpace::FreeLargePage(HeapPage* page, HeapPage* previous_page) {
// Thread should be at a safepoint when this code is called and hence
// it is not necessary to lock large_pages_.
ASSERT(Thread::Current()->IsAtSafepoint());
IncreaseCapacityInWords(-(page->memory_->size() >> kWordSizeLog2));
// Remove the page from the list.
if (previous_page != NULL) {
@ -775,6 +778,7 @@ void PageSpace::VisitObjectPointers(ObjectPointerVisitor* visitor) const {
}
void PageSpace::VisitRememberedCards(ObjectPointerVisitor* visitor) const {
ASSERT(Thread::Current()->IsAtSafepoint());
for (HeapPage* page = large_pages_; page != NULL; page = page->next()) {
page->VisitRememberedCards(visitor);
}

View file

@ -89,8 +89,8 @@ intptr_t GCSweeper::SweepLargePage(HeapPage* page) {
words_to_end = (raw_obj->HeapSize() >> kWordSizeLog2);
}
#ifdef DEBUG
// String::MakeExternal and Array::MakeFixedLength create trailing filler
// objects, but they are always unreachable. Verify that they are not marked.
// Array::MakeFixedLength creates trailing filler objects,
// but they are always unreachable. Verify that they are not marked.
uword current = RawObject::ToAddr(raw_obj) + raw_obj->HeapSize();
uword end = page->object_end();
while (current < end) {