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

Function WasmAtomicNotify

deps/v8/test/mjsunit/wasm/wasm-interpreter-memory64.js:39–54  ·  view source on GitHub ↗
(memory, offset, index, num)

Source from the content-addressed store, hash-verified

37 }
38
39 function WasmAtomicNotify(memory, offset, index, num) {
40 let builder = new WasmModuleBuilder();
41 let pages = memory.buffer.byteLength / kPageSize;
42 builder.addImportedMemory("m", "memory", pages, pages, "shared", "memory64");
43 builder.addFunction("main", makeSig([kWasmF64, kWasmI32], [kWasmI32]))
44 .addBody([
45 kExprLocalGet, 0,
46 kExprI64SConvertF64,
47 kExprLocalGet, 1,
48 kAtomicPrefix, kExprAtomicNotify, /* alignment */ 2, ...wasmSignedLeb64(offset, 10)])
49 .exportAs("main");
50
51 let module = new WebAssembly.Module(builder.toBuffer());
52 let instance = new WebAssembly.Instance(module, { m: { memory } });
53 return instance.exports.main(index, num);
54 }
55
56 function WasmI32AtomicWait(memory, offset, index, val, timeout) {
57 let builder = new WasmModuleBuilder();

Callers 2

TestAtomicI32WaitFunction · 0.70
TestAtomicI64WaitFunction · 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