Commit c084bd93 authored by Shu-yu Guo's avatar Shu-yu Guo Committed by Commit Bot

[atomics] Fix PPC/MIPS/S390 builds in Atomics builtins

Bug: v8:10687, v8:9921
Change-Id: I7a81e9f9882c9a50d8ca70690e2ea409dc5c6c2f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2357169Reviewed-by: 's avatarMilad Farazmand <miladfar@ca.ibm.com>
Reviewed-by: 's avatarBen Smith <binji@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69406}
parent a2268e6e
...@@ -380,6 +380,7 @@ TF_BUILTIN(AtomicsExchange, SharedArrayBufferBuiltinsAssembler) { ...@@ -380,6 +380,7 @@ TF_BUILTIN(AtomicsExchange, SharedArrayBufferBuiltinsAssembler) {
TNode<UintPtrT> index_word = ValidateAtomicAccess(array, index, context); TNode<UintPtrT> index_word = ValidateAtomicAccess(array, index, context);
#if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 #if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64
USE(array_buffer);
TNode<Number> index_number = ChangeUintPtrToTagged(index_word); TNode<Number> index_number = ChangeUintPtrToTagged(index_word);
Return(CallRuntime(Runtime::kAtomicsExchange, context, array, index_number, Return(CallRuntime(Runtime::kAtomicsExchange, context, array, index_number,
value)); value));
...@@ -480,13 +481,13 @@ TF_BUILTIN(AtomicsExchange, SharedArrayBufferBuiltinsAssembler) { ...@@ -480,13 +481,13 @@ TF_BUILTIN(AtomicsExchange, SharedArrayBufferBuiltinsAssembler) {
// This shouldn't happen, we've already validated the type. // This shouldn't happen, we've already validated the type.
BIND(&other); BIND(&other);
Unreachable(); Unreachable();
#endif // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64
BIND(&detached); BIND(&detached);
{ {
ThrowTypeError(context, MessageTemplate::kDetachedOperation, ThrowTypeError(context, MessageTemplate::kDetachedOperation,
"Atomics.exchange"); "Atomics.exchange");
} }
#endif // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64
} }
// https://tc39.es/ecma262/#sec-atomics.compareexchange // https://tc39.es/ecma262/#sec-atomics.compareexchange
...@@ -510,6 +511,7 @@ TF_BUILTIN(AtomicsCompareExchange, SharedArrayBufferBuiltinsAssembler) { ...@@ -510,6 +511,7 @@ TF_BUILTIN(AtomicsCompareExchange, SharedArrayBufferBuiltinsAssembler) {
#if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64 || \ #if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64 || \
V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_S390X V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_S390X
USE(array_buffer);
TNode<Number> index_number = ChangeUintPtrToTagged(index_word); TNode<Number> index_number = ChangeUintPtrToTagged(index_word);
Return(CallRuntime(Runtime::kAtomicsCompareExchange, context, array, Return(CallRuntime(Runtime::kAtomicsCompareExchange, context, array,
index_number, old_value, new_value)); index_number, old_value, new_value));
...@@ -628,14 +630,14 @@ TF_BUILTIN(AtomicsCompareExchange, SharedArrayBufferBuiltinsAssembler) { ...@@ -628,14 +630,14 @@ TF_BUILTIN(AtomicsCompareExchange, SharedArrayBufferBuiltinsAssembler) {
// This shouldn't happen, we've already validated the type. // This shouldn't happen, we've already validated the type.
BIND(&other); BIND(&other);
Unreachable(); Unreachable();
#endif // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64
// || V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_S390X
BIND(&detached); BIND(&detached);
{ {
ThrowTypeError(context, MessageTemplate::kDetachedOperation, ThrowTypeError(context, MessageTemplate::kDetachedOperation,
"Atomics.store"); "Atomics.store");
} }
#endif // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64
// || V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_S390X
} }
#define BINOP_BUILTIN(op, method_name) \ #define BINOP_BUILTIN(op, method_name) \
...@@ -678,6 +680,7 @@ void SharedArrayBufferBuiltinsAssembler::AtomicBinopBuiltinCommon( ...@@ -678,6 +680,7 @@ void SharedArrayBufferBuiltinsAssembler::AtomicBinopBuiltinCommon(
#if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64 || \ #if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64 || \
V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_S390X V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_S390X
USE(array_buffer);
TNode<Number> index_number = ChangeUintPtrToTagged(index_word); TNode<Number> index_number = ChangeUintPtrToTagged(index_word);
Return(CallRuntime(runtime_function, context, array, index_number, value)); Return(CallRuntime(runtime_function, context, array, index_number, value));
#else #else
...@@ -778,11 +781,11 @@ void SharedArrayBufferBuiltinsAssembler::AtomicBinopBuiltinCommon( ...@@ -778,11 +781,11 @@ void SharedArrayBufferBuiltinsAssembler::AtomicBinopBuiltinCommon(
// This shouldn't happen, we've already validated the type. // This shouldn't happen, we've already validated the type.
BIND(&other); BIND(&other);
Unreachable(); Unreachable();
#endif // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64
// || V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_S390X
BIND(&detached); BIND(&detached);
ThrowTypeError(context, MessageTemplate::kDetachedOperation, method_name); ThrowTypeError(context, MessageTemplate::kDetachedOperation, method_name);
#endif // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC64
// || V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_S390X
} }
} // namespace internal } // namespace internal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment