OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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.h" | 5 #include "src/builtins/builtins-utils.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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 Bind(&if_receiverisneutered); | 52 Bind(&if_receiverisneutered); |
53 { | 53 { |
54 // The {receiver}s buffer was neutered, default to zero. | 54 // The {receiver}s buffer was neutered, default to zero. |
55 Return(SmiConstant(0)); | 55 Return(SmiConstant(0)); |
56 } | 56 } |
57 | 57 |
58 Bind(&receiver_is_incompatible); | 58 Bind(&receiver_is_incompatible); |
59 { | 59 { |
60 // The {receiver} is not a valid JSTypedArray. | 60 // The {receiver} is not a valid JSTypedArray. |
61 Node* result = | 61 CallRuntime(Runtime::kThrowIncompatibleMethodReceiver, context, |
62 CallRuntime(Runtime::kThrowIncompatibleMethodReceiver, context, | 62 HeapConstant( |
63 HeapConstant(factory()->NewStringFromAsciiChecked( | 63 factory()->NewStringFromAsciiChecked(method_name, TENURED)), |
64 method_name, TENURED)), | 64 receiver); |
65 receiver); | 65 Unreachable(); |
66 Return(result); // Never reached. | |
67 } | 66 } |
68 } | 67 } |
69 | 68 |
70 // ES6 section 22.2.3.2 get %TypedArray%.prototype.byteLength | 69 // ES6 section 22.2.3.2 get %TypedArray%.prototype.byteLength |
71 TF_BUILTIN(TypedArrayPrototypeByteLength, TypedArrayBuiltinsAssembler) { | 70 TF_BUILTIN(TypedArrayPrototypeByteLength, TypedArrayBuiltinsAssembler) { |
72 GenerateTypedArrayPrototypeGetter("get TypedArray.prototype.byteLength", | 71 GenerateTypedArrayPrototypeGetter("get TypedArray.prototype.byteLength", |
73 JSTypedArray::kByteLengthOffset); | 72 JSTypedArray::kByteLengthOffset); |
74 } | 73 } |
75 | 74 |
76 // ES6 section 22.2.3.3 get %TypedArray%.prototype.byteOffset | 75 // ES6 section 22.2.3.3 get %TypedArray%.prototype.byteOffset |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 count = count * element_size; | 238 count = count * element_size; |
240 | 239 |
241 uint8_t* data = static_cast<uint8_t*>(elements->DataPtr()); | 240 uint8_t* data = static_cast<uint8_t*>(elements->DataPtr()); |
242 std::memmove(data + to, data + from, count); | 241 std::memmove(data + to, data + from, count); |
243 | 242 |
244 return *array; | 243 return *array; |
245 } | 244 } |
246 | 245 |
247 } // namespace internal | 246 } // namespace internal |
248 } // namespace v8 | 247 } // namespace v8 |
OLD | NEW |