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

Function WasmAtomicNotify

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

Source from the content-addressed store, hash-verified

24}
25
26function WasmAtomicNotify(memory, offset, index, num) {
27 let builder = new WasmModuleBuilder();
28 let pages = memory.buffer.byteLength / kPageSize;
29 builder.addImportedMemory("m", "memory", pages, pages, "shared", "memory64");
30 builder.addFunction("main", makeSig([kWasmF64, kWasmI32], [kWasmI32]))
31 .addBody([
32 kExprLocalGet, 0,
33 kExprI64SConvertF64,
34 kExprLocalGet, 1,
35 kAtomicPrefix,
36 kExprAtomicNotify, /* alignment */ 2, ...wasmSignedLeb64(offset, 10)])
37 .exportAs("main");
38
39 let module = new WebAssembly.Module(builder.toBuffer());
40 let instance = new WebAssembly.Instance(module, {m: {memory}});
41 return instance.exports.main(index, num);
42}
43
44function WasmI32AtomicWait(memory, offset, index, val, timeout) {
45 let builder = new WasmModuleBuilder();

Callers 1

wasmWakeCheckFunction · 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