From 9f8f0c6d45f030406dfa2b0ddfdfd733184f9aea Mon Sep 17 00:00:00 2001 From: "hpayer@chromium.org" Date: Tue, 27 Aug 2013 12:03:56 +0000 Subject: [PATCH] Prefill allocated objects with one word fillers if we do not use allocation folding. BUG= R=mstarzinger@chromium.org, titzer@chromium.org Review URL: https://codereview.chromium.org/22903027 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16357 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/hydrogen-instructions.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h index cf2cff7..c52e333 100644 --- a/src/hydrogen-instructions.h +++ b/src/hydrogen-instructions.h @@ -5172,8 +5172,15 @@ class HAllocate V8_FINAL : 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(flags_ | - ALLOCATE_DOUBLE_ALIGNED); + flags_ = static_cast(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(flags_ | PREFILL_WITH_FILLER); } } -- 2.7.4