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-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stub-assembler.h" | 8 #include "src/code-stub-assembler.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 | 284 |
285 Node* index_integer; | 285 Node* index_integer; |
286 Node* index_word32 = | 286 Node* index_word32 = |
287 ConvertTaggedAtomicIndexToWord32(&a, index, context, &index_integer); | 287 ConvertTaggedAtomicIndexToWord32(&a, index, context, &index_integer); |
288 Node* array_length_word32 = a.TruncateTaggedToWord32( | 288 Node* array_length_word32 = a.TruncateTaggedToWord32( |
289 context, a.LoadObjectField(array, JSTypedArray::kLengthOffset)); | 289 context, a.LoadObjectField(array, JSTypedArray::kLengthOffset)); |
290 ValidateAtomicIndex(&a, index_word32, array_length_word32, context); | 290 ValidateAtomicIndex(&a, index_word32, array_length_word32, context); |
291 | 291 |
292 Node* value_integer = a.ToInteger(context, value); | 292 Node* value_integer = a.ToInteger(context, value); |
293 | 293 |
294 #if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 | 294 #if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64 || \ |
| 295 V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_S390X |
295 // Node* index_integer = a.ToInteger(context, index); | 296 // Node* index_integer = a.ToInteger(context, index); |
296 a.Return(a.CallRuntime(Runtime::kAtomicsExchange, context, array, | 297 a.Return(a.CallRuntime(Runtime::kAtomicsExchange, context, array, |
297 index_integer, value_integer)); | 298 index_integer, value_integer)); |
298 #else | 299 #else |
299 Node* index_word = a.ChangeUint32ToWord(index_word32); | 300 Node* index_word = a.ChangeUint32ToWord(index_word32); |
300 | 301 |
301 Node* value_word32 = a.TruncateTaggedToWord32(context, value_integer); | 302 Node* value_word32 = a.TruncateTaggedToWord32(context, value_integer); |
302 | 303 |
303 CodeStubAssembler::Label i8(&a), u8(&a), i16(&a), u16(&a), i32(&a), u32(&a), | 304 CodeStubAssembler::Label i8(&a), u8(&a), i16(&a), u16(&a), i32(&a), u32(&a), |
304 other(&a); | 305 other(&a); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 a.WordShl(index_word, 2), value_word32))); | 337 a.WordShl(index_word, 2), value_word32))); |
337 | 338 |
338 a.Bind(&u32); | 339 a.Bind(&u32); |
339 a.Return(a.ChangeUint32ToTagged( | 340 a.Return(a.ChangeUint32ToTagged( |
340 a.AtomicExchange(MachineType::Uint32(), backing_store, | 341 a.AtomicExchange(MachineType::Uint32(), backing_store, |
341 a.WordShl(index_word, 2), value_word32))); | 342 a.WordShl(index_word, 2), value_word32))); |
342 | 343 |
343 // This shouldn't happen, we've already validated the type. | 344 // This shouldn't happen, we've already validated the type. |
344 a.Bind(&other); | 345 a.Bind(&other); |
345 a.Return(a.SmiConstant(0)); | 346 a.Return(a.SmiConstant(0)); |
346 #endif // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 | 347 #endif // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64 |
| 348 // || V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_S390X |
347 } | 349 } |
348 | 350 |
349 } // namespace internal | 351 } // namespace internal |
350 } // namespace v8 | 352 } // namespace v8 |
OLD | NEW |