Commit 4566cb40 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[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/1478200Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59738}
parent 48d5f1bc
...@@ -425,6 +425,9 @@ ...@@ -425,6 +425,9 @@
# TODO(ppc/s390): implement atomic operations # TODO(ppc/s390): implement atomic operations
'test-run-wasm-atomics/*': [SKIP], '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 == ppc or arch == ppc64 or arch == s390 or arch == s390x'
['arch == ppc64', { ['arch == ppc64', {
......
...@@ -24,10 +24,6 @@ namespace wasm { ...@@ -24,10 +24,6 @@ namespace wasm {
#define __ masm. #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 { namespace {
static volatile int global_stop_bit = 0; static volatile int global_stop_bit = 0;
...@@ -109,6 +105,20 @@ Address GenerateJumpTableThunk( ...@@ -109,6 +105,20 @@ Address GenerateJumpTableThunk(
__ Tbnz(scratch, 0, &exit); __ Tbnz(scratch, 0, &exit);
__ Mov(scratch, Immediate(jump_target, RelocInfo::NONE)); __ Mov(scratch, Immediate(jump_target, RelocInfo::NONE));
__ Br(scratch); __ 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 #else
#error Unsupported architecture #error Unsupported architecture
#endif #endif
...@@ -236,9 +246,6 @@ TEST(JumpTablePatchingStress) { ...@@ -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 __
#undef TRACE #undef TRACE
......
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