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

Function GetAtomicLoadFunction

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

Source from the content-addressed store, hash-verified

77}
78
79function GetAtomicLoadFunction(wasmExpression, alignment, offset) {
80 let builder = new WasmModuleBuilder();
81 builder.addImportedMemory("m", "imported_mem", 0, maxSize, "shared");
82 builder.addFunction("main", kSig_i_i)
83 .addBody([
84 kExprLocalGet, 0,
85 kAtomicPrefix,
86 wasmExpression, alignment, offset])
87 .exportAs("main");
88
89 // Instantiate module, get function exports
90 let module = new WebAssembly.Module(builder.toBuffer());
91 let instance = new WebAssembly.Instance(module,
92 {m: {imported_mem: memory}});
93 return instance.exports.main;
94}
95
96function GetAtomicStoreFunction(wasmExpression, alignment, offset) {
97 let builder = new WasmModuleBuilder();

Callers 1

atomics.jsFile · 0.85

Calls 5

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

Tested by

no test coverage detected