Index: src/hydrogen-instructions.h |
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
index 41f9d0d5ccdecae37ed1cf08206f09136a6f8476..721c5cdda9f477efcd76e89d6a093f88e269620e 100644 |
--- a/src/hydrogen-instructions.h |
+++ b/src/hydrogen-instructions.h |
@@ -5120,8 +5120,15 @@ class HAllocate: public HTemplateInstruction<2> { |
? ALLOCATE_IN_OLD_POINTER_SPACE : ALLOCATE_IN_OLD_DATA_SPACE) |
: ALLOCATE_IN_NEW_SPACE; |
if (instance_type == FIXED_DOUBLE_ARRAY_TYPE) { |
- flags_ = static_cast<HAllocate::Flags>(flags_ | |
- ALLOCATE_DOUBLE_ALIGNED); |
+ flags_ = static_cast<HAllocate::Flags>(flags_ | ALLOCATE_DOUBLE_ALIGNED); |
+ } |
+ // We have to fill the allocated object with one word fillers if we do |
+ // not use allocation folding since some allocations may depend on each |
+ // other, i.e., have a pointer to each other. A GC in between these |
+ // allocations may leave such objects behind in a not completely initialized |
+ // state. |
+ if (!FLAG_use_gvn || !FLAG_use_allocation_folding) { |
+ flags_ = static_cast<HAllocate::Flags>(flags_ | PREFILL_WITH_FILLER); |
} |
} |