Enable double alignment for constructed arrays.
authorplind44@gmail.com <plind44@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 24 Oct 2013 19:01:30 +0000 (19:01 +0000)
committerplind44@gmail.com <plind44@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 24 Oct 2013 19:01:30 +0000 (19:01 +0000)
2nd (of 3) CL's to ensure complete alignment of FixedDoubleArrays.

TEST=
BUG=
R=hpayer@chromium.org

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

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

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

src/hydrogen.cc

index 77dab3d..3b232e6 100644 (file)
@@ -2126,6 +2126,11 @@ HValue* HGraphBuilder::JSArrayBuilder::AllocateArray(HValue* size_in_bytes,
   HAllocate* new_object = builder()->Add<HAllocate>(size_in_bytes,
       HType::JSArray(), NOT_TENURED, JS_ARRAY_TYPE);
 
+  // Folded array allocation should be aligned if it has fast double elements.
+  if (IsFastDoubleElementsKind(kind_)) {
+     new_object->MakeDoubleAligned();
+  }
+
   // Fill in the fields: map, properties, length
   HValue* map;
   if (allocation_site_payload_ == NULL) {