diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /js/src/jit-test/tests/wasm/ref-types/externref-global-prebarrier.js | |
parent | Initial commit. (diff) | |
download | firefox-esr-upstream.tar.xz firefox-esr-upstream.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/jit-test/tests/wasm/ref-types/externref-global-prebarrier.js')
-rw-r--r-- | js/src/jit-test/tests/wasm/ref-types/externref-global-prebarrier.js | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/wasm/ref-types/externref-global-prebarrier.js b/js/src/jit-test/tests/wasm/ref-types/externref-global-prebarrier.js new file mode 100644 index 0000000000..139f71e758 --- /dev/null +++ b/js/src/jit-test/tests/wasm/ref-types/externref-global-prebarrier.js @@ -0,0 +1,61 @@ +// Do not run the test if we're jit-compiling JS, since it's the wasm frames +// we're interested in and eager JS compilation can upset the test. + +opts = getJitCompilerOptions(); +if (opts['ion.enable'] || opts['baseline.enable']) + quit(); + +const { startProfiling, endProfiling, assertEqPreciseStacks, isSingleStepProfilingEnabled } = WasmHelpers; + +let e = wasmEvalText(`(module + (global $g (mut externref) (ref.null extern)) + (func (export "set") (param externref) local.get 0 global.set $g) +)`).exports; + +let obj = { field: null }; + +// GCZeal mode 4 implies that prebarriers are being verified at many +// locations in the interpreter, during interrupt checks, etc. It can be ultra +// slow, so disable it with gczeal(0) when it's not strictly needed. +gczeal(4, 1); +e.set(obj); +e.set(null); +gczeal(0); + +if (!isSingleStepProfilingEnabled) { + quit(0); +} + +enableGeckoProfiling(); +startProfiling(); +gczeal(4, 1); +e.set(obj); +gczeal(0); +assertEqPreciseStacks( + endProfiling(), + [ + // Expected output for (simulator+via-Ion/baseline). + ['', '!>', '0,!>', '<,0,!>', 'GC postbarrier,0,!>', + '<,0,!>', '0,!>', '!>', ''], + + // Expected output for other configurations. + ['', '!>', '0,!>', '!>', ''], + ]); + +startProfiling(); +gczeal(4, 1); +e.set(null); +gczeal(0); + +// We're losing stack info in the prebarrier code. +assertEqPreciseStacks( + endProfiling(), + [ + // Expected output for (simulator+via-Ion/baseline). + ['', '!>', '0,!>', '', '0,!>', '<,0,!>', 'GC postbarrier,0,!>', + '<,0,!>', '0,!>', '!>', ''], + + // Expected output for other configurations. + ['', '!>', '0,!>', '', '0,!>', '!>', ''], + ]); + |