Index: src/heap/heap.cc |
diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
index fa941814d1cba540909219a8fc8adfd7ffc1ecca..3208c3519b11a79b20222dccbb4631da7c96fba5 100644 |
--- a/src/heap/heap.cc |
+++ b/src/heap/heap.cc |
@@ -1373,7 +1373,6 @@ void PromotionQueue::Initialize() { |
front_ = rear_ = |
reinterpret_cast<intptr_t*>(heap_->new_space()->ToSpaceEnd()); |
emergency_stack_ = NULL; |
- guard_ = false; |
} |
@@ -1971,15 +1970,16 @@ class ScavengingVisitor : public StaticVisitorBase { |
HeapObject* target = NULL; // Initialization to please compiler. |
if (allocation.To(&target)) { |
+ // Order is important here: Set the promotion limit before storing a |
+ // filler for double alignment or migrating the object. Otherwise we |
+ // may end up overwriting promotion queue entries when we migrate the |
+ // object. |
+ heap->promotion_queue()->SetNewLimit(heap->new_space()->top()); |
+ |
if (alignment != kObjectAlignment) { |
target = EnsureDoubleAligned(heap, target, allocation_size); |
} |
- // Order is important here: Set the promotion limit before migrating |
- // the object. Otherwise we may end up overwriting promotion queue |
- // entries when we migrate the object. |
- heap->promotion_queue()->SetNewLimit(heap->new_space()->top()); |
- |
// Order is important: slot might be inside of the target if target |
// was allocated over a dead object and slot comes from the store |
// buffer. |