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

Function GetI64AtomicBinOpFunction

deps/v8/test/mjsunit/wasm/atomics.js:40–58  ·  view source on GitHub ↗
(wasmExpression, alignment, offset)

Source from the content-addressed store, hash-verified

38}
39
40function GetI64AtomicBinOpFunction(wasmExpression, alignment, offset) {
41 const kSig_l_il = makeSig([kWasmI32, kWasmI64], [kWasmI64]);
42 let builder = new WasmModuleBuilder();
43 builder.addImportedMemory("m", "imported_mem", 0, maxSize, "shared");
44 builder.addFunction("main", kSig_l_il)
45 .addBody([
46 kExprLocalGet, 0,
47 kExprLocalGet, 1,
48 kAtomicPrefix,
49 wasmExpression, alignment, offset
50 ])
51 .exportAs("main");
52
53 // Instantiate module, get function exports
54 let module = new WebAssembly.Module(builder.toBuffer());
55 let instance = new WebAssembly.Instance(module,
56 {m: {imported_mem: memory}});
57 return instance.exports.main;
58}
59
60function GetAtomicCmpExchangeFunction(wasmExpression, alignment, offset) {
61 let builder = new WasmModuleBuilder();

Callers 1

atomics.jsFile · 0.85

Calls 6

addImportedMemoryMethod · 0.95
addFunctionMethod · 0.95
toBufferMethod · 0.95
makeSigFunction · 0.70
exportAsMethod · 0.45
addBodyMethod · 0.45

Tested by

no test coverage detected