From c084bd93a5763e85fef791510e5c9b64d79c4997 Mon Sep 17 00:00:00 2001 From: Shu-yu Guo Date: Fri, 14 Aug 2020 12:06:01 -0700 Subject: [PATCH] [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/+/2357169 Reviewed-by: Milad Farazmand Reviewed-by: Ben Smith Commit-Queue: Shu-yu Guo Cr-Commit-Position: refs/heads/master@{#69406} --- src/builtins/builtins-sharedarraybuffer-gen.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/builtins/builtins-sharedarraybuffer-gen.cc b/src/builtins/builtins-sharedarraybuffer-gen.cc index 716ced31f9..26cf4fe159 100644 --- a/src/builtins/builtins-sharedarraybuffer-gen.cc +++ b/src/builtins/builtins-sharedarraybuffer-gen.cc @@ -380,6 +380,7 @@ TF_BUILTIN(AtomicsExchange, SharedArrayBufferBuiltinsAssembler) { TNode index_word = ValidateAtomicAccess(array, index, context); #if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 + USE(array_buffer); TNode index_number = ChangeUintPtrToTagged(index_word); Return(CallRuntime(Runtime::kAtomicsExchange, context, array, index_number, value)); @@ -480,13 +481,13 @@ TF_BUILTIN(AtomicsExchange, SharedArrayBufferBuiltinsAssembler) { // This shouldn't happen, we've already validated the type. BIND(&other); Unreachable(); +#endif // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 BIND(&detached); { ThrowTypeError(context, MessageTemplate::kDetachedOperation, "Atomics.exchange"); } -#endif // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 } // https://tc39.es/ecma262/#sec-atomics.compareexchange @@ -510,6 +511,7 @@ TF_BUILTIN(AtomicsCompareExchange, SharedArrayBufferBuiltinsAssembler) { #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 + USE(array_buffer); TNode index_number = ChangeUintPtrToTagged(index_word); Return(CallRuntime(Runtime::kAtomicsCompareExchange, context, array, index_number, old_value, new_value)); @@ -628,14 +630,14 @@ TF_BUILTIN(AtomicsCompareExchange, SharedArrayBufferBuiltinsAssembler) { // This shouldn't happen, we've already validated the type. BIND(&other); 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); { ThrowTypeError(context, MessageTemplate::kDetachedOperation, "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) \ @@ -678,6 +680,7 @@ void SharedArrayBufferBuiltinsAssembler::AtomicBinopBuiltinCommon( #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 + USE(array_buffer); TNode index_number = ChangeUintPtrToTagged(index_word); Return(CallRuntime(runtime_function, context, array, index_number, value)); #else @@ -778,11 +781,11 @@ void SharedArrayBufferBuiltinsAssembler::AtomicBinopBuiltinCommon( // This shouldn't happen, we've already validated the type. BIND(&other); 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); 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