OLD | NEW |
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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 Node* header_size = IntPtrConstant(FixedTypedArrayBase::kHeaderSize); | 220 Node* header_size = IntPtrConstant(FixedTypedArrayBase::kHeaderSize); |
221 total_size.Bind(IntPtrAdd(SmiToWord(byte_length), header_size)); | 221 total_size.Bind(IntPtrAdd(SmiToWord(byte_length), header_size)); |
222 Goto(&allocate_elements); | 222 Goto(&allocate_elements); |
223 } | 223 } |
224 | 224 |
225 Bind(&allocate_elements); | 225 Bind(&allocate_elements); |
226 { | 226 { |
227 // Allocate a FixedTypedArray and set the length, base pointer and external | 227 // Allocate a FixedTypedArray and set the length, base pointer and external |
228 // pointer. | 228 // pointer. |
229 CSA_ASSERT(this, IsRegularHeapObjectSize(total_size.value())); | 229 CSA_ASSERT(this, IsRegularHeapObjectSize(total_size.value())); |
230 Node* elements = Allocate(total_size.value()); | 230 Node* elements = AllocateInNewSpace(total_size.value(), kDoubleAlignment); |
231 | 231 |
232 StoreMapNoWriteBarrier(elements, fixed_typed_map.value()); | 232 StoreMapNoWriteBarrier(elements, fixed_typed_map.value()); |
233 StoreObjectFieldNoWriteBarrier(elements, FixedArray::kLengthOffset, length); | 233 StoreObjectFieldNoWriteBarrier(elements, FixedArray::kLengthOffset, length); |
234 StoreObjectFieldNoWriteBarrier( | 234 StoreObjectFieldNoWriteBarrier( |
235 elements, FixedTypedArrayBase::kBasePointerOffset, elements); | 235 elements, FixedTypedArrayBase::kBasePointerOffset, elements); |
236 StoreObjectFieldNoWriteBarrier(elements, | 236 StoreObjectFieldNoWriteBarrier(elements, |
237 FixedTypedArrayBase::kExternalPointerOffset, | 237 FixedTypedArrayBase::kExternalPointerOffset, |
238 IntPtrConstant(fta_base_data_offset), | 238 IntPtrConstant(fta_base_data_offset), |
239 MachineType::PointerRepresentation()); | 239 MachineType::PointerRepresentation()); |
240 | 240 |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 // ES6 #sec-%typedarray%.prototype.keys | 654 // ES6 #sec-%typedarray%.prototype.keys |
655 TF_BUILTIN(TypedArrayPrototypeKeys, TypedArrayBuiltinsAssembler) { | 655 TF_BUILTIN(TypedArrayPrototypeKeys, TypedArrayBuiltinsAssembler) { |
656 Node* context = Parameter(Descriptor::kContext); | 656 Node* context = Parameter(Descriptor::kContext); |
657 Node* receiver = Parameter(Descriptor::kReceiver); | 657 Node* receiver = Parameter(Descriptor::kReceiver); |
658 GenerateTypedArrayPrototypeIterationMethod( | 658 GenerateTypedArrayPrototypeIterationMethod( |
659 context, receiver, "%TypedArray%.prototype.keys()", IterationKind::kKeys); | 659 context, receiver, "%TypedArray%.prototype.keys()", IterationKind::kKeys); |
660 } | 660 } |
661 | 661 |
662 } // namespace internal | 662 } // namespace internal |
663 } // namespace v8 | 663 } // namespace v8 |
OLD | NEW |