Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(446)

Unified Diff: src/hydrogen.cc

Issue 1128433006: Make sure fixed typed array is always double aligned for doubles (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/heap.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 15c83c6cff4a1bba44cde057ad3c36d91f3ab970..a3249fe65282b3d0c4a35f09ca3a3aeec037a621 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -9889,11 +9889,8 @@ HValue* HOptimizedGraphBuilder::BuildAllocateExternalElements(
// conversion after allocation but before the new object fields are set.
length = AddUncasted<HForceRepresentation>(length, Representation::Smi());
HValue* elements =
- Add<HAllocate>(
- Add<HConstant>(ExternalArray::kAlignedSize),
- HType::HeapObject(),
- NOT_TENURED,
- external_array_map->instance_type());
+ Add<HAllocate>(Add<HConstant>(ExternalArray::kSize), HType::HeapObject(),
+ NOT_TENURED, external_array_map->instance_type());
AddStoreMapConstant(elements, external_array_map);
Add<HStoreNamedField>(elements,
@@ -9946,9 +9943,16 @@ HValue* HOptimizedGraphBuilder::BuildAllocateFixedTypedArray(
length = AddUncasted<HForceRepresentation>(length, Representation::Smi());
Handle<Map> fixed_typed_array_map(
isolate()->heap()->MapForFixedTypedArray(array_type));
- HValue* elements =
- Add<HAllocate>(total_size, HType::HeapObject(),
- NOT_TENURED, fixed_typed_array_map->instance_type());
+ HAllocate* elements =
+ Add<HAllocate>(total_size, HType::HeapObject(), NOT_TENURED,
+ fixed_typed_array_map->instance_type());
+
+#ifndef V8_HOST_ARCH_64_BIT
+ if (array_type == kExternalFloat64Array) {
+ elements->MakeDoubleAligned();
+ }
+#endif
+
AddStoreMapConstant(elements, fixed_typed_array_map);
Add<HStoreNamedField>(elements,
« no previous file with comments | « src/heap/heap.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698