Commit 9c001573 authored by Stephan Herhut's avatar Stephan Herhut Committed by Commit Bot

[wasm] Add stress test for I64 atomics

This test is modelled after the atomics-stress test but supports 64 bit
operands.

Bug: v8:6532
Change-Id: I313b1ade74a58201b3fa097ba5b1515754a685db
Reviewed-on: https://chromium-review.googlesource.com/c/1234414
Commit-Queue: Stephan Herhut <herhut@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56812}
parent 1bf6e735
......@@ -178,6 +178,7 @@
'wasm/grow-memory': [PASS, SLOW],
'wasm/unreachable-validation': [PASS, SLOW],
'wasm/atomics-stress': [PASS, SLOW, ['(arch == arm or arch == arm64) and simulator_run', SKIP]],
'wasm/atomics64-stress': [PASS, SLOW, ['(arch == arm or arch == arm64) and simulator_run', SKIP]],
# case-insensitive unicode regexp relies on case mapping provided by ICU.
'es6/unicode-regexp-ignore-case': [PASS, ['no_i18n == True', FAIL]],
......@@ -811,7 +812,9 @@
# These tests already stress d8 by using many workers. No need for extra stress.
'wasm/compare-exchange-stress': [SKIP],
'wasm/compare-exchange64-stress': [SKIP],
'wasm/atomics-stress': [SKIP],
'wasm/atomics64-stress': [SKIP],
# Too slow for verify-csa builds.
'big-object-literal': [PASS, ['verify_csa == True', SKIP]],
......
......@@ -80,8 +80,10 @@ class Operation {
constructor(opcode, input, offset) {
this.opcode = opcode != undefined ? opcode : Operation.nextOpcode();
this.size = Operation.opcodeToSize(this.opcode);
this.input = input != undefined ? input : Operation.inputForSize(this.size);
this.offset = offset != undefined ? offset : Operation.offsetForSize(this.size);
this.input = input != undefined ? input : Operation.inputForSize(
this.size);
this.offset = offset != undefined ? offset : Operation.offsetForSize(
this.size);
}
static nextOpcode() {
......@@ -280,20 +282,22 @@ function generateFunctionBodyForSequence(sequence) {
// an int32* we use to count down spinning workers.
let body = [];
// Initially, we spin until all workers start running.
body.push(
// Decrement the wait count.
kExprGetLocal, 2,
kExprI32Const, 1,
kAtomicPrefix, kExprI32AtomicSub, 2, 0,
// Spin until zero.
kExprLoop, kWasmStmt,
kExprGetLocal, 2,
kAtomicPrefix, kExprI32AtomicLoad, 2, 0,
kExprI32Const, 0,
kExprI32GtU,
kExprBrIf, 0,
kExprEnd
);
if (!kDebug) {
body.push(
// Decrement the wait count.
kExprGetLocal, 2,
kExprI32Const, 1,
kAtomicPrefix, kExprI32AtomicSub, 2, 0,
// Spin until zero.
kExprLoop, kWasmStmt,
kExprGetLocal, 2,
kAtomicPrefix, kExprI32AtomicLoad, 2, 0,
kExprI32Const, 0,
kExprI32GtU,
kExprBrIf, 0,
kExprEnd
);
}
for (let operation of sequence) {
body.push(
// Pre-load address of results sequence pointer for later.
......@@ -451,8 +455,9 @@ function loadSequencesFromStrings(inputs) {
let parts = input.split(",");
let sequence = [];
for (let part of parts) {
let parsed = parseRE.exec(part);
sequence.push(new Operation(reverseOpcodes[parsed[1]], parsed[3], parsed[2]|0));
let parsed = parseRE.exec(part);
sequence.push(new Operation(reverseOpcodes[parsed[1]], parsed[3],
parsed[2] | 0));
}
sequences.push(sequence);
}
......@@ -466,7 +471,7 @@ function loadResultsFromStrings(inputs) {
let parts = input.split(",");
let result = [];
for (let number of parts) {
result.push(number|0);
result.push(number | 0);
}
results.push(result);
}
......
This diff is collapsed.
......@@ -108,6 +108,7 @@ let kSig_l_l = makeSig([kWasmI64], [kWasmI64]);
let kSig_i_l = makeSig([kWasmI64], [kWasmI32]);
let kSig_i_ii = makeSig([kWasmI32, kWasmI32], [kWasmI32]);
let kSig_i_iii = makeSig([kWasmI32, kWasmI32, kWasmI32], [kWasmI32]);
let kSig_v_iiii = makeSig([kWasmI32, kWasmI32, kWasmI32, kWasmI32], []);
let kSig_d_dd = makeSig([kWasmF64, kWasmF64], [kWasmF64]);
let kSig_l_ll = makeSig([kWasmI64, kWasmI64], [kWasmI64]);
let kSig_i_dd = makeSig([kWasmF64, kWasmF64], [kWasmI32]);
......@@ -370,9 +371,9 @@ let kExprI32AtomicXor16U = 0x3d;
let kExprI32AtomicExchange = 0x41;
let kExprI32AtomicExchange8U = 0x43;
let kExprI32AtomicExchange16U = 0x44;
let kExprI32AtomicCompareExchange = 0x48
let kExprI32AtomicCompareExchange8U = 0x4a
let kExprI32AtomicCompareExchange16U = 0x4b
let kExprI32AtomicCompareExchange = 0x48;
let kExprI32AtomicCompareExchange8U = 0x4a;
let kExprI32AtomicCompareExchange16U = 0x4b;
let kExprI64AtomicLoad = 0x11;
let kExprI64AtomicLoad8U = 0x14;
......
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