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 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 a->Bind(¬_smi); | 45 a->Bind(¬_smi); |
46 a->Branch(a->WordEqual(a->LoadInstanceType(tagged), | 46 a->Branch(a->WordEqual(a->LoadInstanceType(tagged), |
47 a->Int32Constant(JS_TYPED_ARRAY_TYPE)), | 47 a->Int32Constant(JS_TYPED_ARRAY_TYPE)), |
48 &is_typed_array, ¬_typed_array); | 48 &is_typed_array, ¬_typed_array); |
49 a->Bind(¬_typed_array); | 49 a->Bind(¬_typed_array); |
50 a->Goto(&invalid); | 50 a->Goto(&invalid); |
51 | 51 |
52 // Fail if the array's JSArrayBuffer is not shared. | 52 // Fail if the array's JSArrayBuffer is not shared. |
53 a->Bind(&is_typed_array); | 53 a->Bind(&is_typed_array); |
54 Node* array_buffer = a->LoadObjectField(tagged, JSTypedArray::kBufferOffset); | 54 Node* array_buffer = a->LoadObjectField(tagged, JSTypedArray::kBufferOffset); |
55 Node* is_buffer_shared = a->BitFieldDecode<JSArrayBuffer::IsShared>( | 55 Node* is_buffer_shared = |
56 a->LoadObjectField(array_buffer, JSArrayBuffer::kBitFieldSlot)); | 56 a->IsSetWord32<JSArrayBuffer::IsShared>(a->LoadObjectField( |
| 57 array_buffer, JSArrayBuffer::kBitFieldSlot, MachineType::Uint32())); |
57 a->Branch(is_buffer_shared, &is_shared, ¬_shared); | 58 a->Branch(is_buffer_shared, &is_shared, ¬_shared); |
58 a->Bind(¬_shared); | 59 a->Bind(¬_shared); |
59 a->Goto(&invalid); | 60 a->Goto(&invalid); |
60 | 61 |
61 // Fail if the array's element type is float32, float64 or clamped. | 62 // Fail if the array's element type is float32, float64 or clamped. |
62 a->Bind(&is_shared); | 63 a->Bind(&is_shared); |
63 Node* elements_instance_type = a->LoadInstanceType( | 64 Node* elements_instance_type = a->LoadInstanceType( |
64 a->LoadObjectField(tagged, JSObject::kElementsOffset)); | 65 a->LoadObjectField(tagged, JSObject::kElementsOffset)); |
65 STATIC_ASSERT(FIXED_INT8_ARRAY_TYPE < FIXED_FLOAT32_ARRAY_TYPE); | 66 STATIC_ASSERT(FIXED_INT8_ARRAY_TYPE < FIXED_FLOAT32_ARRAY_TYPE); |
66 STATIC_ASSERT(FIXED_INT16_ARRAY_TYPE < FIXED_FLOAT32_ARRAY_TYPE); | 67 STATIC_ASSERT(FIXED_INT16_ARRAY_TYPE < FIXED_FLOAT32_ARRAY_TYPE); |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 a->WordShl(index_word, 2), value_word32); | 258 a->WordShl(index_word, 2), value_word32); |
258 a->Return(value_integer); | 259 a->Return(value_integer); |
259 | 260 |
260 // This shouldn't happen, we've already validated the type. | 261 // This shouldn't happen, we've already validated the type. |
261 a->Bind(&other); | 262 a->Bind(&other); |
262 a->Return(a->Int32Constant(0)); | 263 a->Return(a->Int32Constant(0)); |
263 } | 264 } |
264 | 265 |
265 } // namespace internal | 266 } // namespace internal |
266 } // namespace v8 | 267 } // namespace v8 |
OLD | NEW |