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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/compiler/code-assembler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 the V8 project authors. All rights reserved. 1 // Copyright 2017 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/builtins/builtins-utils-gen.h" 5 #include "src/builtins/builtins-utils-gen.h"
6 #include "src/builtins/builtins.h" 6 #include "src/builtins/builtins.h"
7 #include "src/code-stub-assembler.h" 7 #include "src/code-stub-assembler.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 Node* header_size = IntPtrConstant(FixedTypedArrayBase::kHeaderSize); 207 Node* header_size = IntPtrConstant(FixedTypedArrayBase::kHeaderSize);
208 total_size.Bind(IntPtrAdd(SmiToWord(byte_length), header_size)); 208 total_size.Bind(IntPtrAdd(SmiToWord(byte_length), header_size));
209 Goto(&allocate_elements); 209 Goto(&allocate_elements);
210 } 210 }
211 211
212 BIND(&allocate_elements); 212 BIND(&allocate_elements);
213 { 213 {
214 // Allocate a FixedTypedArray and set the length, base pointer and external 214 // Allocate a FixedTypedArray and set the length, base pointer and external
215 // pointer. 215 // pointer.
216 CSA_ASSERT(this, IsRegularHeapObjectSize(total_size.value())); 216 CSA_ASSERT(this, IsRegularHeapObjectSize(total_size.value()));
217 Node* elements = AllocateInNewSpace(total_size.value(), kDoubleAlignment); 217
218 Node* elements;
219 int heap_alignment =
220 ElementSizeLog2Of(MachineType::PointerRepresentation());
221
222 if (UnalignedLoadSupported(MachineType::Float64(), heap_alignment) &&
223 UnalignedStoreSupported(MachineType::Float64(), heap_alignment)) {
224 elements = AllocateInNewSpace(total_size.value());
225 } else {
226 elements = AllocateInNewSpace(total_size.value(), kDoubleAlignment);
227 }
218 228
219 StoreMapNoWriteBarrier(elements, fixed_typed_map.value()); 229 StoreMapNoWriteBarrier(elements, fixed_typed_map.value());
220 StoreObjectFieldNoWriteBarrier(elements, FixedArray::kLengthOffset, length); 230 StoreObjectFieldNoWriteBarrier(elements, FixedArray::kLengthOffset, length);
221 StoreObjectFieldNoWriteBarrier( 231 StoreObjectFieldNoWriteBarrier(
222 elements, FixedTypedArrayBase::kBasePointerOffset, elements); 232 elements, FixedTypedArrayBase::kBasePointerOffset, elements);
223 StoreObjectFieldNoWriteBarrier(elements, 233 StoreObjectFieldNoWriteBarrier(elements,
224 FixedTypedArrayBase::kExternalPointerOffset, 234 FixedTypedArrayBase::kExternalPointerOffset,
225 IntPtrConstant(fta_base_data_offset), 235 IntPtrConstant(fta_base_data_offset),
226 MachineType::PointerRepresentation()); 236 MachineType::PointerRepresentation());
227 237
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 // ES6 #sec-%typedarray%.prototype.keys 723 // ES6 #sec-%typedarray%.prototype.keys
714 TF_BUILTIN(TypedArrayPrototypeKeys, TypedArrayBuiltinsAssembler) { 724 TF_BUILTIN(TypedArrayPrototypeKeys, TypedArrayBuiltinsAssembler) {
715 Node* context = Parameter(Descriptor::kContext); 725 Node* context = Parameter(Descriptor::kContext);
716 Node* receiver = Parameter(Descriptor::kReceiver); 726 Node* receiver = Parameter(Descriptor::kReceiver);
717 GenerateTypedArrayPrototypeIterationMethod( 727 GenerateTypedArrayPrototypeIterationMethod(
718 context, receiver, "%TypedArray%.prototype.keys()", IterationKind::kKeys); 728 context, receiver, "%TypedArray%.prototype.keys()", IterationKind::kKeys);
719 } 729 }
720 730
721 } // namespace internal 731 } // namespace internal
722 } // namespace v8 732 } // namespace v8
OLDNEW
« 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