Make offsets to inner allocated objects aligned in allocation folding.
authorplind44@gmail.com <plind44@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 18 Dec 2013 04:27:48 +0000 (04:27 +0000)
committerplind44@gmail.com <plind44@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 18 Dec 2013 04:27:48 +0000 (04:27 +0000)
Folded allocations marked for double alignment is not aligned if old dominator
size is used for offset to inner object.

TEST=mjsunit/big-array-literal on MIPS
BUG=
R=hpayer@chromium.org

Review URL: https://codereview.chromium.org/103963005

Patch from Dusan Milosavljevic <Dusan.Milosavljevic@rt-rk.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18332 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/hydrogen-instructions.cc

index e7ad219..7f07ed5 100644 (file)
@@ -3495,11 +3495,18 @@ void HAllocate::HandleSideEffectDominator(GVNFlag side_effect,
   dominator_allocate->clear_next_map_word_ = clear_next_map_word_;
 
   // After that replace the dominated allocate instruction.
+  HInstruction* inner_offset = HConstant::CreateAndInsertBefore(
+      zone,
+      context(),
+      dominator_size_constant,
+      Representation::None(),
+      this);
+
   HInstruction* dominated_allocate_instr =
       HInnerAllocatedObject::New(zone,
                                  context(),
                                  dominator_allocate,
-                                 dominator_size,
+                                 inner_offset,
                                  type());
   dominated_allocate_instr->InsertBefore(this);
   DeleteAndReplaceWith(dominated_allocate_instr);