MCPcopy Create free account
hub / github.com/nodejs/node / WasmI32AtomicWait

Function WasmI32AtomicWait

deps/v8/test/mjsunit/wasm/atomics-memory64.js:44–63  ·  view source on GitHub ↗
(memory, offset, index, val, timeout)

Source from the content-addressed store, hash-verified

42}
43
44function WasmI32AtomicWait(memory, offset, index, val, timeout) {
45 let builder = new WasmModuleBuilder();
46 let pages = memory.buffer.byteLength / kPageSize;
47 builder.addImportedMemory("m", "memory", pages, pages, "shared", "memory64");
48 builder.addFunction("main",
49 makeSig([kWasmF64, kWasmI32, kWasmF64], [kWasmI32]))
50 .addBody([
51 kExprLocalGet, 0,
52 kExprI64SConvertF64,
53 kExprLocalGet, 1,
54 kExprLocalGet, 2,
55 kExprI64SConvertF64,
56 kAtomicPrefix,
57 kExprI32AtomicWait, /* alignment */ 2, ...wasmSignedLeb64(offset, 10)])
58 .exportAs("main");
59
60 let module = new WebAssembly.Module(builder.toBuffer());
61 let instance = new WebAssembly.Instance(module, {m: {memory}});
62 return instance.exports.main(index, val, timeout);
63}
64
65function WasmI64AtomicWait(memory, offset, index, val_low,
66 val_high, timeout) {

Callers 1

TestAtomicI32WaitFunction · 0.70

Calls 8

addImportedMemoryMethod · 0.95
addFunctionMethod · 0.95
toBufferMethod · 0.95
wasmSignedLeb64Function · 0.85
makeSigFunction · 0.70
exportAsMethod · 0.45
addBodyMethod · 0.45
mainMethod · 0.45

Tested by

no test coverage detected