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

Unified Diff: src/builtins/builtins-typedarray-gen.cc

Issue 2802003003: [builtins] Speed up TypedArrayInitialize in CodeStubAssembler (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | src/compiler/code-assembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-typedarray-gen.cc
diff --git a/src/builtins/builtins-typedarray-gen.cc b/src/builtins/builtins-typedarray-gen.cc
index 26a5c193a24b821be8ac0e8d621d70c4b181a9ec..a6cbf14f06f64b65ef1a84c0195c22712acf2414 100644
--- a/src/builtins/builtins-typedarray-gen.cc
+++ b/src/builtins/builtins-typedarray-gen.cc
@@ -214,7 +214,17 @@ void TypedArrayBuiltinsAssembler::DoInitialize(Node* const holder, Node* length,
// Allocate a FixedTypedArray and set the length, base pointer and external
// pointer.
CSA_ASSERT(this, IsRegularHeapObjectSize(total_size.value()));
- Node* elements = AllocateInNewSpace(total_size.value(), kDoubleAlignment);
+
+ Node* elements;
+ int heap_alignment =
+ ElementSizeLog2Of(MachineType::PointerRepresentation());
+
+ if (UnalignedLoadSupported(MachineType::Float64(), heap_alignment) &&
+ UnalignedStoreSupported(MachineType::Float64(), heap_alignment)) {
+ elements = AllocateInNewSpace(total_size.value());
+ } else {
+ elements = AllocateInNewSpace(total_size.value(), kDoubleAlignment);
+ }
StoreMapNoWriteBarrier(elements, fixed_typed_map.value());
StoreObjectFieldNoWriteBarrier(elements, FixedArray::kLengthOffset, length);
« no previous file with comments | « no previous file | src/compiler/code-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698