Index: src/heap/heap.cc |
diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
index 1f7d8784f6b8fbf104e121212fc6e5c2b28a9196..f39ad43aa4c9a02be2036479d76c7fb3c56e8b6b 100644 |
--- a/src/heap/heap.cc |
+++ b/src/heap/heap.cc |
@@ -1365,7 +1365,6 @@ void PromotionQueue::Initialize() { |
front_ = rear_ = |
reinterpret_cast<intptr_t*>(heap_->new_space()->ToSpaceEnd()); |
emergency_stack_ = NULL; |
- guard_ = false; |
} |
@@ -1963,15 +1962,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. |