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 #include "src/objects.h" | 8 #include "src/objects.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 261 |
262 Node* index_integer; | 262 Node* index_integer; |
263 Node* index_word32 = | 263 Node* index_word32 = |
264 ConvertTaggedAtomicIndexToWord32(index, context, &index_integer); | 264 ConvertTaggedAtomicIndexToWord32(index, context, &index_integer); |
265 Node* array_length_word32 = TruncateTaggedToWord32( | 265 Node* array_length_word32 = TruncateTaggedToWord32( |
266 context, LoadObjectField(array, JSTypedArray::kLengthOffset)); | 266 context, LoadObjectField(array, JSTypedArray::kLengthOffset)); |
267 ValidateAtomicIndex(index_word32, array_length_word32, context); | 267 ValidateAtomicIndex(index_word32, array_length_word32, context); |
268 | 268 |
269 Node* value_integer = ToInteger(context, value); | 269 Node* value_integer = ToInteger(context, value); |
270 | 270 |
271 #if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64 || \ | 271 #if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 |
272 V8_TARGET_ARCH_PPC | |
273 Return(CallRuntime(Runtime::kAtomicsExchange, context, array, index_integer, | 272 Return(CallRuntime(Runtime::kAtomicsExchange, context, array, index_integer, |
274 value_integer)); | 273 value_integer)); |
275 #else | 274 #else |
276 Node* index_word = ChangeUint32ToWord(index_word32); | 275 Node* index_word = ChangeUint32ToWord(index_word32); |
277 | 276 |
278 Node* value_word32 = TruncateTaggedToWord32(context, value_integer); | 277 Node* value_word32 = TruncateTaggedToWord32(context, value_integer); |
279 | 278 |
280 Label i8(this), u8(this), i16(this), u16(this), i32(this), u32(this), | 279 Label i8(this), u8(this), i16(this), u16(this), i32(this), u32(this), |
281 other(this); | 280 other(this); |
282 int32_t case_values[] = { | 281 int32_t case_values[] = { |
(...skipping 28 matching lines...) Expand all Loading... |
311 value_word32))); | 310 value_word32))); |
312 | 311 |
313 Bind(&u32); | 312 Bind(&u32); |
314 Return(ChangeUint32ToTagged( | 313 Return(ChangeUint32ToTagged( |
315 AtomicExchange(MachineType::Uint32(), backing_store, | 314 AtomicExchange(MachineType::Uint32(), backing_store, |
316 WordShl(index_word, 2), value_word32))); | 315 WordShl(index_word, 2), value_word32))); |
317 | 316 |
318 // This shouldn't happen, we've already validated the type. | 317 // This shouldn't happen, we've already validated the type. |
319 Bind(&other); | 318 Bind(&other); |
320 Unreachable(); | 319 Unreachable(); |
321 #endif // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64 | 320 #endif // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 |
322 // || V8_TARGET_ARCH_PPC | |
323 } | 321 } |
324 | 322 |
325 TF_BUILTIN(AtomicsCompareExchange, SharedArrayBufferBuiltinsAssembler) { | 323 TF_BUILTIN(AtomicsCompareExchange, SharedArrayBufferBuiltinsAssembler) { |
326 Node* array = Parameter(Descriptor::kArray); | 324 Node* array = Parameter(Descriptor::kArray); |
327 Node* index = Parameter(Descriptor::kIndex); | 325 Node* index = Parameter(Descriptor::kIndex); |
328 Node* old_value = Parameter(Descriptor::kOldValue); | 326 Node* old_value = Parameter(Descriptor::kOldValue); |
329 Node* new_value = Parameter(Descriptor::kNewValue); | 327 Node* new_value = Parameter(Descriptor::kNewValue); |
330 Node* context = Parameter(Descriptor::kContext); | 328 Node* context = Parameter(Descriptor::kContext); |
331 | 329 |
332 Node* instance_type; | 330 Node* instance_type; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 | 397 |
400 // This shouldn't happen, we've already validated the type. | 398 // This shouldn't happen, we've already validated the type. |
401 Bind(&other); | 399 Bind(&other); |
402 Unreachable(); | 400 Unreachable(); |
403 #endif // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64 | 401 #endif // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64 |
404 // || V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_S390X | 402 // || V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_S390X |
405 } | 403 } |
406 | 404 |
407 } // namespace internal | 405 } // namespace internal |
408 } // namespace v8 | 406 } // namespace v8 |
OLD | NEW |