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

Unified Diff: src/heap/heap.cc

Issue 1783313003: [heap] Use struct Entry to fill inlined promotion queue entries. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 389af1bec1108e5040d27d90666fe48275976140..2718cdf30b89cba848c3c41b2a2e31d5020b4458 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -1561,8 +1561,8 @@ void PromotionQueue::Initialize() {
DCHECK((Page::kPageSize - MemoryChunk::kBodyOffset) % (2 * kPointerSize) ==
0);
front_ = rear_ =
- reinterpret_cast<intptr_t*>(heap_->new_space()->ToSpaceEnd());
- limit_ = reinterpret_cast<intptr_t*>(
+ reinterpret_cast<struct Entry*>(heap_->new_space()->ToSpaceEnd());
+ limit_ = reinterpret_cast<struct Entry*>(
Page::FromAllocationTop(reinterpret_cast<Address>(rear_))->area_start());
emergency_stack_ = NULL;
}
@@ -1572,8 +1572,9 @@ void PromotionQueue::RelocateQueueHead() {
DCHECK(emergency_stack_ == NULL);
Page* p = Page::FromAllocationTop(reinterpret_cast<Address>(rear_));
- intptr_t* head_start = rear_;
- intptr_t* head_end = Min(front_, reinterpret_cast<intptr_t*>(p->area_end()));
+ struct Entry* head_start = rear_;
+ struct Entry* head_end =
+ Min(front_, reinterpret_cast<struct Entry*>(p->area_end()));
int entries_count =
static_cast<int>(head_end - head_start) / kEntrySizeInWords;
@@ -1581,13 +1582,12 @@ void PromotionQueue::RelocateQueueHead() {
emergency_stack_ = new List<Entry>(2 * entries_count);
while (head_start != head_end) {
- int size = static_cast<int>(*(head_start++));
- HeapObject* obj = reinterpret_cast<HeapObject*>(*(head_start++));
+ struct Entry* entry = head_start++;
// New space allocation in SemiSpaceCopyObject marked the region
// overlapping with promotion queue as uninitialized.
- MSAN_MEMORY_IS_INITIALIZED(&size, sizeof(size));
- MSAN_MEMORY_IS_INITIALIZED(&obj, sizeof(obj));
- emergency_stack_->Add(Entry(obj, size));
+ MSAN_MEMORY_IS_INITIALIZED(&entry->size_, sizeof(size));
+ MSAN_MEMORY_IS_INITIALIZED(&entry->obj_, sizeof(obj));
+ emergency_stack_->Add(*entry);
}
rear_ = head_end;
}
@@ -1945,7 +1945,7 @@ Address Heap::DoScavenge(ObjectVisitor* scavenge_visitor,
{
while (!promotion_queue()->is_empty()) {
HeapObject* target;
- int size;
+ intptr_t size;
promotion_queue()->remove(&target, &size);
// Promoted object might be already partially visited
@@ -1954,7 +1954,8 @@ Address Heap::DoScavenge(ObjectVisitor* scavenge_visitor,
// to new space.
DCHECK(!target->IsMap());
- IteratePointersToFromSpace(target, size, &Scavenger::ScavengeObject);
+ IteratePointersToFromSpace(target, static_cast<int>(size),
+ &Scavenger::ScavengeObject);
}
}
« 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