From 4566cb40591f0c5866755be1a667d4871eb112e7 Mon Sep 17 00:00:00 2001 From: Michael Starzinger Date: Wed, 20 Feb 2019 15:18:01 +0100 Subject: [PATCH] [wasm][test] Extend jump-table stress test to all archs. This extends the "test-jump-table-assembler" stress test to supported architectures. Note that on both PPC and S390 the tests flushes out the race during jump table patching pretty reliably. Fixing this issue is outside the scope of this change, this just ensures test coverage exists but keeps the test in question disabled. R=clemensh@chromium.org TEST=cctest/test-jump-table-assembler BUG=v8:8018 Change-Id: Ia299ed2a42f9858019627270a25026b53f3628d3 Reviewed-on: https://chromium-review.googlesource.com/c/1478200 Reviewed-by: Clemens Hammacher Commit-Queue: Michael Starzinger Cr-Commit-Position: refs/heads/master@{#59738} --- test/cctest/cctest.status | 3 +++ test/cctest/wasm/test-jump-table-assembler.cc | 21 ++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/test/cctest/cctest.status b/test/cctest/cctest.status index 22073d5580..e9cd55d1c1 100644 --- a/test/cctest/cctest.status +++ b/test/cctest/cctest.status @@ -425,6 +425,9 @@ # TODO(ppc/s390): implement atomic operations 'test-run-wasm-atomics/*': [SKIP], + # TODO(ppc/s390): support concurrent patching of jump table + 'test-jump-table-assembler/*': [SKIP], + }], # 'arch == ppc or arch == ppc64 or arch == s390 or arch == s390x' ['arch == ppc64', { diff --git a/test/cctest/wasm/test-jump-table-assembler.cc b/test/cctest/wasm/test-jump-table-assembler.cc index d8d9e0412e..cd272e386b 100644 --- a/test/cctest/wasm/test-jump-table-assembler.cc +++ b/test/cctest/wasm/test-jump-table-assembler.cc @@ -24,10 +24,6 @@ namespace wasm { #define __ masm. -// TODO(v8:7424,v8:8018): Extend this test to all architectures. -#if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM || \ - V8_TARGET_ARCH_ARM64 - namespace { static volatile int global_stop_bit = 0; @@ -109,6 +105,20 @@ Address GenerateJumpTableThunk( __ Tbnz(scratch, 0, &exit); __ Mov(scratch, Immediate(jump_target, RelocInfo::NONE)); __ Br(scratch); +#elif V8_TARGET_ARCH_PPC64 + __ mov(scratch, Operand(stop_bit_address, RelocInfo::NONE)); + __ LoadP(scratch, MemOperand(scratch)); + __ cmpi(scratch, Operand::Zero()); + __ bne(&exit); + __ mov(scratch, Operand(jump_target, RelocInfo::NONE)); + __ Jump(scratch); +#elif V8_TARGET_ARCH_S390X + __ mov(scratch, Operand(stop_bit_address, RelocInfo::NONE)); + __ LoadP(scratch, MemOperand(scratch)); + __ CmpP(scratch, Operand(0)); + __ bne(&exit); + __ mov(scratch, Operand(jump_target, RelocInfo::NONE)); + __ Jump(scratch); #else #error Unsupported architecture #endif @@ -236,9 +246,6 @@ TEST(JumpTablePatchingStress) { } } -#endif // V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM || - // V8_TARGET_ARCH_ARM64 - #undef __ #undef TRACE