(wasmExpression, alignment, offset)
| 38 | } |
| 39 | |
| 40 | function 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 | |
| 60 | function GetAtomicCmpExchangeFunction(wasmExpression, alignment, offset) { |
| 61 | let builder = new WasmModuleBuilder(); |
no test coverage detected