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.h" | 5 #include "src/builtins/builtins.h" |
6 #include "src/builtins/builtins-utils.h" | 6 #include "src/builtins/builtins-utils.h" |
7 | 7 |
8 namespace v8 { | 8 namespace v8 { |
9 namespace internal { | 9 namespace internal { |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 const char* method_name, | 24 const char* method_name, |
25 int object_offset) { | 25 int object_offset) { |
26 typedef CodeStubAssembler::Label Label; | 26 typedef CodeStubAssembler::Label Label; |
27 typedef compiler::Node Node; | 27 typedef compiler::Node Node; |
28 | 28 |
29 Node* receiver = assembler->Parameter(0); | 29 Node* receiver = assembler->Parameter(0); |
30 Node* context = assembler->Parameter(3); | 30 Node* context = assembler->Parameter(3); |
31 | 31 |
32 // Check if the {receiver} is actually a JSTypedArray. | 32 // Check if the {receiver} is actually a JSTypedArray. |
33 Label if_receiverisincompatible(assembler, Label::kDeferred); | 33 Label if_receiverisincompatible(assembler, Label::kDeferred); |
34 assembler->GotoIf(assembler->WordIsSmi(receiver), &if_receiverisincompatible); | 34 assembler->GotoIf(assembler->TaggedIsSmi(receiver), |
| 35 &if_receiverisincompatible); |
35 Node* receiver_instance_type = assembler->LoadInstanceType(receiver); | 36 Node* receiver_instance_type = assembler->LoadInstanceType(receiver); |
36 assembler->GotoUnless( | 37 assembler->GotoUnless( |
37 assembler->Word32Equal(receiver_instance_type, | 38 assembler->Word32Equal(receiver_instance_type, |
38 assembler->Int32Constant(JS_TYPED_ARRAY_TYPE)), | 39 assembler->Int32Constant(JS_TYPED_ARRAY_TYPE)), |
39 &if_receiverisincompatible); | 40 &if_receiverisincompatible); |
40 | 41 |
41 // Check if the {receiver}'s JSArrayBuffer was neutered. | 42 // Check if the {receiver}'s JSArrayBuffer was neutered. |
42 Node* receiver_buffer = | 43 Node* receiver_buffer = |
43 assembler->LoadObjectField(receiver, JSTypedArray::kBufferOffset); | 44 assembler->LoadObjectField(receiver, JSTypedArray::kBufferOffset); |
44 Node* receiver_buffer_bit_field = assembler->LoadObjectField( | 45 Node* receiver_buffer_bit_field = assembler->LoadObjectField( |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // ES6 section 22.2.3.18 get %TypedArray%.prototype.length | 93 // ES6 section 22.2.3.18 get %TypedArray%.prototype.length |
93 void Builtins::Generate_TypedArrayPrototypeLength( | 94 void Builtins::Generate_TypedArrayPrototypeLength( |
94 CodeStubAssembler* assembler) { | 95 CodeStubAssembler* assembler) { |
95 Generate_TypedArrayProtoypeGetter(assembler, | 96 Generate_TypedArrayProtoypeGetter(assembler, |
96 "get TypedArray.prototype.length", | 97 "get TypedArray.prototype.length", |
97 JSTypedArray::kLengthOffset); | 98 JSTypedArray::kLengthOffset); |
98 } | 99 } |
99 | 100 |
100 } // namespace internal | 101 } // namespace internal |
101 } // namespace v8 | 102 } // namespace v8 |
OLD | NEW |