(wasmExpression, alignment, offset)
| 20 | let memory = new WebAssembly.Memory({initial: 1, maximum: maxSize, shared: true}); |
| 21 | |
| 22 | function GetAtomicBinOpFunction(wasmExpression, alignment, offset) { |
| 23 | let builder = new WasmModuleBuilder(); |
| 24 | builder.addImportedMemory("m", "imported_mem", 0, maxSize, "shared"); |
| 25 | builder.addFunction("main", kSig_i_ii) |
| 26 | .addBody([ |
| 27 | kExprLocalGet, 0, |
| 28 | kExprLocalGet, 1, |
| 29 | kAtomicPrefix, |
| 30 | wasmExpression, alignment, offset]) |
| 31 | .exportAs("main"); |
| 32 | |
| 33 | // Instantiate module, get function exports |
| 34 | let module = new WebAssembly.Module(builder.toBuffer()); |
| 35 | let instance = new WebAssembly.Instance(module, |
| 36 | {m: {imported_mem: memory}}); |
| 37 | return instance.exports.main; |
| 38 | } |
| 39 | |
| 40 | function GetI64AtomicBinOpFunction(wasmExpression, alignment, offset) { |
| 41 | const kSig_l_il = makeSig([kWasmI32, kWasmI64], [kWasmI64]); |
no test coverage detected