Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(403)

Unified Diff: src/heap/heap.cc

Issue 1900423002: [heap] Merge NewSpacePage into Page (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/heap-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index b60bbdd1ec4c0c800ee297c5538d992953c483cd..84a5039c317534db95040fe3e935ccfaf0141cb5 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -945,7 +945,7 @@ void Heap::EnsureFillerObjectAtTop() {
// may be uninitialized memory behind top. We fill the remainder of the page
// with a filler.
Address to_top = new_space_.top();
- NewSpacePage* page = NewSpacePage::FromAddress(to_top - kPointerSize);
+ Page* page = Page::FromAddress(to_top - kPointerSize);
if (page->Contains(to_top)) {
int remaining_in_page = static_cast<int>(page->area_end() - to_top);
CreateFillerObjectAt(to_top, remaining_in_page, ClearRecordedSlots::kNo);
@@ -1552,7 +1552,8 @@ void PromotionQueue::Initialize() {
front_ = rear_ =
reinterpret_cast<struct Entry*>(heap_->new_space()->ToSpaceEnd());
limit_ = reinterpret_cast<struct Entry*>(
- Page::FromAllocationTop(reinterpret_cast<Address>(rear_))->area_start());
+ Page::FromAllocationAreaAddress(reinterpret_cast<Address>(rear_))
+ ->area_start());
emergency_stack_ = NULL;
}
@@ -1560,7 +1561,7 @@ void PromotionQueue::Initialize() {
void PromotionQueue::RelocateQueueHead() {
DCHECK(emergency_stack_ == NULL);
- Page* p = Page::FromAllocationTop(reinterpret_cast<Address>(rear_));
+ Page* p = Page::FromAllocationAreaAddress(reinterpret_cast<Address>(rear_));
struct Entry* head_start = rear_;
struct Entry* head_end =
Min(front_, reinterpret_cast<struct Entry*>(p->area_end()));
@@ -1909,13 +1910,14 @@ Address Heap::DoScavenge(ObjectVisitor* scavenge_visitor,
// queue of unprocessed copied objects. Process them until the
// queue is empty.
while (new_space_front != new_space_.top()) {
- if (!NewSpacePage::IsAtEnd(new_space_front)) {
+ if (!Page::IsAlignedToPageSize(new_space_front)) {
HeapObject* object = HeapObject::FromAddress(new_space_front);
new_space_front +=
StaticScavengeVisitor::IterateBody(object->map(), object);
} else {
- new_space_front =
- NewSpacePage::FromLimit(new_space_front)->next_page()->area_start();
+ new_space_front = Page::FromAllocationAreaAddress(new_space_front)
+ ->next_page()
+ ->area_start();
}
}
@@ -4633,7 +4635,7 @@ void Heap::ZapFromSpace() {
NewSpacePageIterator it(new_space_.FromSpaceStart(),
new_space_.FromSpaceEnd());
while (it.has_next()) {
- NewSpacePage* page = it.next();
+ Page* page = it.next();
for (Address cursor = page->area_start(), limit = page->area_end();
cursor < limit; cursor += kPointerSize) {
Memory::Address_at(cursor) = kFromSpaceZapValue;
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698