From e3c4ecfb8cd17483bbc4c2f417c44d59da7ff35b Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Sun, 29 Jul 2018 18:46:51 +0100 Subject: [PATCH 1/2] Add proper input field for callReturnMemory* instead of workarounds (it is not fully supported yet) --- wasm/generateInterface.js | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/wasm/generateInterface.js b/wasm/generateInterface.js index c88a2ec2..cd4c8d30 100644 --- a/wasm/generateInterface.js +++ b/wasm/generateInterface.js @@ -13,6 +13,8 @@ const wasmTypes = { ipointer: 'i32', opointer: 'i32', gasLimit: 'i64', + callReturnMemoryOffset: 'i32', + callReturnMemorySize: 'i32', // FIXME: these are handled wrongly currently address: 'i32', i128: 'i32', @@ -140,25 +142,25 @@ const interfaceManifest = { CALL: { name: 'call', async: true, - input: ['gasLimit', 'address', 'i128', 'readOffset', 'length'], + input: ['gasLimit', 'address', 'i128', 'readOffset', 'length', 'callReturnMemoryOffset', 'callReturnMemorySize'], output: ['i32'] }, CALLCODE: { name: 'callCode', async: true, - input: ['gasLimit', 'address', 'i128', 'readOffset', 'length'], + input: ['gasLimit', 'address', 'i128', 'readOffset', 'length', 'callReturnMemoryOffset', 'callReturnMemorySize'], output: ['i32'] }, DELEGATECALL: { name: 'callDelegate', async: true, - input: ['gasLimit', 'address', 'i128', 'readOffset', 'length'], + input: ['gasLimit', 'address', 'i128', 'readOffset', 'length', 'callReturnMemoryOffset', 'callReturnMemorySize'], output: ['i32'] }, STATICCALL: { name: 'callStatic', async: true, - input: ['gasLimit', 'address', 'readOffset', 'length'], + input: ['gasLimit', 'address', 'readOffset', 'length', 'callReturnMemoryOffset', 'callReturnMemorySize'], output: ['i32'] }, RETURNDATACOPY: { @@ -262,7 +264,8 @@ function generateManifest (interfaceManifest, opts) { for (let opcode in interfaceManifest) { const op = interfaceManifest[opcode] // Translate input types to native wasm types - let inputs = op.input.map(type => toWasmType(type)) + // callReturnMemoryOffset and callReturnMemorySize are actually output and must be ignored here + let inputs = op.input.filter(type => type !== 'callReturnMemoryOffset' && type !== 'callReturnMemorySize').map(type => toWasmType(type)) // Also add output types which are non-basic because they need to be passed as inputs inputs = inputs.concat(op.output.filter(type => type !== 'i32' && type !== 'i64').map(type => toWasmType(type))) let params = '' @@ -344,7 +347,13 @@ function generateManifest (interfaceManifest, opts) { locals += `(local $offset${numOfLocals} i32)` body += `(set_local $offset${numOfLocals} ${checkOverflowStackItem256(spOffset)})` call += `(get_local $offset${numOfLocals})` - } else if (input === 'length' && (opcode === 'CALL' || opcode === 'CALLCODE' || opcode === 'DELEGATECALL' || opcode === 'STATICCALL')) { + } else if (input === 'callReturnMemoryOffset' || input === 'callReturnMemorySize') { + // FIXME: this should actually insert a wrapper for invoking returndatacopy + // with these arguments in the postprocessing step + + // Remove (ignore) this stack item here + spOffset-- + } else if (input === 'length' && (opcode === 'CALL' || opcode === 'CALLCODE')) { // CALLs in EVM have 7 arguments // but in ewasm CALLs only have 5 arguments // so delete the bottom two stack elements, after processing the 5th argument @@ -358,12 +367,6 @@ function generateManifest (interfaceManifest, opts) { call += `(get_local $length${numOfLocals})` numOfLocals++ - - // delete 6th stack element - spOffset-- - - // delete 7th stack element - spOffset-- } else if (input === 'length' && (opcode !== 'CALL' && opcode !== 'CALLCODE' && opcode !== 'DELEGATECALL' && opcode !== 'STATICCALL')) { locals += `(local $length${numOfLocals} i32)` body += `(set_local $length${numOfLocals} ${checkOverflowStackItem256(spOffset)})` @@ -420,6 +423,9 @@ function generateManifest (interfaceManifest, opts) { if (opcode === 'CALL' || opcode === 'CALLCODE' || opcode === 'DELEGATECALL' || opcode === 'STATICCALL') { // flip CALL result from EEI to EVM convention (0 -> 1, 1,2,.. -> 1) call = `(i64.store ${getStackItem(spOffset)} (i64.extend_u/i32 (i32.eqz ${call})))` + + // FIXME: add callReturnMemory* handling here + } else { call = `(i64.store ${getStackItem(spOffset)} (i64.extend_u/i32 ${call}))` } From cddefc5617da2f39c795125713a4c597d25298d5 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Sun, 29 Jul 2018 18:50:26 +0100 Subject: [PATCH 2/2] Regenerate interface --- include/wast-async.h | 8 ++++---- include/wast.h | 8 ++++---- wasm/wast-async.json | 8 ++++---- wasm/wast.json | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/wast-async.h b/include/wast-async.h index de006948..a64fcbc4 100644 --- a/include/wast-async.h +++ b/include/wast-async.h @@ -120,22 +120,22 @@ namespace evm2wasm } },{ opcodeEnum::CALL, { - .wast = ";; generated by ./wasm/generateInterface.js\n(func $CALL (param $callback i32)(local $offset0 i32)(local $length0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72)))))(set_local $length0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -128)))\n (i64.load (i32.add (get_global $sp) (i32.const -120)))\n (i64.load (i32.add (get_global $sp) (i32.const -112)))\n (i64.load (i32.add (get_global $sp) (i32.const -104)))))\n (call $memusegas (get_local $offset0) (get_local $length0))\n (set_local $offset0 (i32.add (get_global $memstart) (get_local $offset0))) (i64.store (i32.add (get_global $sp) (i32.const -192)) (i64.extend_u/i32 (i32.eqz (call $call(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(i32.add (get_global $sp) (i32.const -64))(get_local $offset0)(get_local $length0)(get_local $callback)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -168)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -176)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -184)) (i64.const 0)))", + .wast = ";; generated by ./wasm/generateInterface.js\n(func $CALL (param $callback i32)(local $offset0 i32)(local $length0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72)))))(set_local $length0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -128)))\n (i64.load (i32.add (get_global $sp) (i32.const -120)))\n (i64.load (i32.add (get_global $sp) (i32.const -112)))\n (i64.load (i32.add (get_global $sp) (i32.const -104)))))\n (call $memusegas (get_local $offset0) (get_local $length0))\n (set_local $offset0 (i32.add (get_global $memstart) (get_local $offset0))) (i64.store (i32.add (get_global $sp) (i32.const -256)) (i64.extend_u/i32 (i32.eqz (call $call(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(i32.add (get_global $sp) (i32.const -64))(get_local $offset0)(get_local $length0)(get_local $callback)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -232)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -240)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -248)) (i64.const 0)))", .imports = "(import \"ethereum\" \"call\" (func $call (param i64 i32 i32 i32 i32 i32) (result i32)))" } },{ opcodeEnum::CALLCODE, { - .wast = ";; generated by ./wasm/generateInterface.js\n(func $CALLCODE (param $callback i32)(local $offset0 i32)(local $length0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72)))))(set_local $length0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -128)))\n (i64.load (i32.add (get_global $sp) (i32.const -120)))\n (i64.load (i32.add (get_global $sp) (i32.const -112)))\n (i64.load (i32.add (get_global $sp) (i32.const -104)))))\n (call $memusegas (get_local $offset0) (get_local $length0))\n (set_local $offset0 (i32.add (get_global $memstart) (get_local $offset0))) (i64.store (i32.add (get_global $sp) (i32.const -192)) (i64.extend_u/i32 (i32.eqz (call $callCode(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(i32.add (get_global $sp) (i32.const -64))(get_local $offset0)(get_local $length0)(get_local $callback)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -168)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -176)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -184)) (i64.const 0)))", + .wast = ";; generated by ./wasm/generateInterface.js\n(func $CALLCODE (param $callback i32)(local $offset0 i32)(local $length0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72)))))(set_local $length0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -128)))\n (i64.load (i32.add (get_global $sp) (i32.const -120)))\n (i64.load (i32.add (get_global $sp) (i32.const -112)))\n (i64.load (i32.add (get_global $sp) (i32.const -104)))))\n (call $memusegas (get_local $offset0) (get_local $length0))\n (set_local $offset0 (i32.add (get_global $memstart) (get_local $offset0))) (i64.store (i32.add (get_global $sp) (i32.const -256)) (i64.extend_u/i32 (i32.eqz (call $callCode(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(i32.add (get_global $sp) (i32.const -64))(get_local $offset0)(get_local $length0)(get_local $callback)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -232)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -240)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -248)) (i64.const 0)))", .imports = "(import \"ethereum\" \"callCode\" (func $callCode (param i64 i32 i32 i32 i32 i32) (result i32)))" } },{ opcodeEnum::DELEGATECALL, { - .wast = ";; generated by ./wasm/generateInterface.js\n(func $DELEGATECALL (param $callback i32)(local $offset0 i32)(local $length0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72)))))(set_local $length0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -128)))\n (i64.load (i32.add (get_global $sp) (i32.const -120)))\n (i64.load (i32.add (get_global $sp) (i32.const -112)))\n (i64.load (i32.add (get_global $sp) (i32.const -104)))))\n (call $memusegas (get_local $offset0) (get_local $length0))\n (set_local $offset0 (i32.add (get_global $memstart) (get_local $offset0))) (i64.store (i32.add (get_global $sp) (i32.const -192)) (i64.extend_u/i32 (i32.eqz (call $callDelegate(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(i32.add (get_global $sp) (i32.const -64))(get_local $offset0)(get_local $length0)(get_local $callback)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -168)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -176)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -184)) (i64.const 0)))", + .wast = ";; generated by ./wasm/generateInterface.js\n(func $DELEGATECALL (param $callback i32)(local $offset0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72))))) (i64.store (i32.add (get_global $sp) (i32.const -256)) (i64.extend_u/i32 (i32.eqz (call $callDelegate(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(i32.add (get_global $sp) (i32.const -64))(get_local $offset0)(get_local $callback)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -232)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -240)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -248)) (i64.const 0)))", .imports = "(import \"ethereum\" \"callDelegate\" (func $callDelegate (param i64 i32 i32 i32 i32 i32) (result i32)))" } },{ opcodeEnum::STATICCALL, { - .wast = ";; generated by ./wasm/generateInterface.js\n(func $STATICCALL (param $callback i32)(local $offset0 i32)(local $length0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -64)))\n (i64.load (i32.add (get_global $sp) (i32.const -56)))\n (i64.load (i32.add (get_global $sp) (i32.const -48)))\n (i64.load (i32.add (get_global $sp) (i32.const -40)))))(set_local $length0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72)))))\n (call $memusegas (get_local $offset0) (get_local $length0))\n (set_local $offset0 (i32.add (get_global $memstart) (get_local $offset0))) (i64.store (i32.add (get_global $sp) (i32.const -160)) (i64.extend_u/i32 (i32.eqz (call $callStatic(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(get_local $offset0)(get_local $length0)(get_local $callback)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -136)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -144)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -152)) (i64.const 0)))", + .wast = ";; generated by ./wasm/generateInterface.js\n(func $STATICCALL (param $callback i32)(local $offset0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -64)))\n (i64.load (i32.add (get_global $sp) (i32.const -56)))\n (i64.load (i32.add (get_global $sp) (i32.const -48)))\n (i64.load (i32.add (get_global $sp) (i32.const -40))))) (i64.store (i32.add (get_global $sp) (i32.const -224)) (i64.extend_u/i32 (i32.eqz (call $callStatic(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(get_local $offset0)(get_local $callback)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -200)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -208)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -216)) (i64.const 0)))", .imports = "(import \"ethereum\" \"callStatic\" (func $callStatic (param i64 i32 i32 i32 i32) (result i32)))" } },{ diff --git a/include/wast.h b/include/wast.h index 3da58279..5c1f47c6 100644 --- a/include/wast.h +++ b/include/wast.h @@ -120,22 +120,22 @@ namespace evm2wasm } },{ opcodeEnum::CALL, { - .wast = ";; generated by ./wasm/generateInterface.js\n(func $CALL (local $offset0 i32)(local $length0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72)))))(set_local $length0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -128)))\n (i64.load (i32.add (get_global $sp) (i32.const -120)))\n (i64.load (i32.add (get_global $sp) (i32.const -112)))\n (i64.load (i32.add (get_global $sp) (i32.const -104)))))\n (call $memusegas (get_local $offset0) (get_local $length0))\n (set_local $offset0 (i32.add (get_global $memstart) (get_local $offset0))) (i64.store (i32.add (get_global $sp) (i32.const -192)) (i64.extend_u/i32 (i32.eqz (call $call(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(i32.add (get_global $sp) (i32.const -64))(get_local $offset0)(get_local $length0)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -168)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -176)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -184)) (i64.const 0)))", + .wast = ";; generated by ./wasm/generateInterface.js\n(func $CALL (local $offset0 i32)(local $length0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72)))))(set_local $length0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -128)))\n (i64.load (i32.add (get_global $sp) (i32.const -120)))\n (i64.load (i32.add (get_global $sp) (i32.const -112)))\n (i64.load (i32.add (get_global $sp) (i32.const -104)))))\n (call $memusegas (get_local $offset0) (get_local $length0))\n (set_local $offset0 (i32.add (get_global $memstart) (get_local $offset0))) (i64.store (i32.add (get_global $sp) (i32.const -256)) (i64.extend_u/i32 (i32.eqz (call $call(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(i32.add (get_global $sp) (i32.const -64))(get_local $offset0)(get_local $length0)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -232)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -240)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -248)) (i64.const 0)))", .imports = "(import \"ethereum\" \"call\" (func $call (param i64 i32 i32 i32 i32) (result i32)))" } },{ opcodeEnum::CALLCODE, { - .wast = ";; generated by ./wasm/generateInterface.js\n(func $CALLCODE (local $offset0 i32)(local $length0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72)))))(set_local $length0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -128)))\n (i64.load (i32.add (get_global $sp) (i32.const -120)))\n (i64.load (i32.add (get_global $sp) (i32.const -112)))\n (i64.load (i32.add (get_global $sp) (i32.const -104)))))\n (call $memusegas (get_local $offset0) (get_local $length0))\n (set_local $offset0 (i32.add (get_global $memstart) (get_local $offset0))) (i64.store (i32.add (get_global $sp) (i32.const -192)) (i64.extend_u/i32 (i32.eqz (call $callCode(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(i32.add (get_global $sp) (i32.const -64))(get_local $offset0)(get_local $length0)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -168)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -176)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -184)) (i64.const 0)))", + .wast = ";; generated by ./wasm/generateInterface.js\n(func $CALLCODE (local $offset0 i32)(local $length0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72)))))(set_local $length0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -128)))\n (i64.load (i32.add (get_global $sp) (i32.const -120)))\n (i64.load (i32.add (get_global $sp) (i32.const -112)))\n (i64.load (i32.add (get_global $sp) (i32.const -104)))))\n (call $memusegas (get_local $offset0) (get_local $length0))\n (set_local $offset0 (i32.add (get_global $memstart) (get_local $offset0))) (i64.store (i32.add (get_global $sp) (i32.const -256)) (i64.extend_u/i32 (i32.eqz (call $callCode(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(i32.add (get_global $sp) (i32.const -64))(get_local $offset0)(get_local $length0)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -232)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -240)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -248)) (i64.const 0)))", .imports = "(import \"ethereum\" \"callCode\" (func $callCode (param i64 i32 i32 i32 i32) (result i32)))" } },{ opcodeEnum::DELEGATECALL, { - .wast = ";; generated by ./wasm/generateInterface.js\n(func $DELEGATECALL (local $offset0 i32)(local $length0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72)))))(set_local $length0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -128)))\n (i64.load (i32.add (get_global $sp) (i32.const -120)))\n (i64.load (i32.add (get_global $sp) (i32.const -112)))\n (i64.load (i32.add (get_global $sp) (i32.const -104)))))\n (call $memusegas (get_local $offset0) (get_local $length0))\n (set_local $offset0 (i32.add (get_global $memstart) (get_local $offset0))) (i64.store (i32.add (get_global $sp) (i32.const -192)) (i64.extend_u/i32 (i32.eqz (call $callDelegate(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(i32.add (get_global $sp) (i32.const -64))(get_local $offset0)(get_local $length0)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -168)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -176)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -184)) (i64.const 0)))", + .wast = ";; generated by ./wasm/generateInterface.js\n(func $DELEGATECALL (local $offset0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72))))) (i64.store (i32.add (get_global $sp) (i32.const -256)) (i64.extend_u/i32 (i32.eqz (call $callDelegate(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(i32.add (get_global $sp) (i32.const -64))(get_local $offset0)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -232)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -240)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -248)) (i64.const 0)))", .imports = "(import \"ethereum\" \"callDelegate\" (func $callDelegate (param i64 i32 i32 i32 i32) (result i32)))" } },{ opcodeEnum::STATICCALL, { - .wast = ";; generated by ./wasm/generateInterface.js\n(func $STATICCALL (local $offset0 i32)(local $length0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -64)))\n (i64.load (i32.add (get_global $sp) (i32.const -56)))\n (i64.load (i32.add (get_global $sp) (i32.const -48)))\n (i64.load (i32.add (get_global $sp) (i32.const -40)))))(set_local $length0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72)))))\n (call $memusegas (get_local $offset0) (get_local $length0))\n (set_local $offset0 (i32.add (get_global $memstart) (get_local $offset0))) (i64.store (i32.add (get_global $sp) (i32.const -160)) (i64.extend_u/i32 (i32.eqz (call $callStatic(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(get_local $offset0)(get_local $length0)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -136)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -144)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -152)) (i64.const 0)))", + .wast = ";; generated by ./wasm/generateInterface.js\n(func $STATICCALL (local $offset0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -64)))\n (i64.load (i32.add (get_global $sp) (i32.const -56)))\n (i64.load (i32.add (get_global $sp) (i32.const -48)))\n (i64.load (i32.add (get_global $sp) (i32.const -40))))) (i64.store (i32.add (get_global $sp) (i32.const -224)) (i64.extend_u/i32 (i32.eqz (call $callStatic(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(get_local $offset0)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -200)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -208)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -216)) (i64.const 0)))", .imports = "(import \"ethereum\" \"callStatic\" (func $callStatic (param i64 i32 i32 i32) (result i32)))" } },{ diff --git a/wasm/wast-async.json b/wasm/wast-async.json index c3656ff7..90c6814c 100644 --- a/wasm/wast-async.json +++ b/wasm/wast-async.json @@ -88,19 +88,19 @@ "imports": "(import \"ethereum\" \"create\" (func $create (param i32 i32 i32 i32 i32) ))" }, "CALL": { - "wast": ";; generated by ./wasm/generateInterface.js\n(func $CALL (param $callback i32)(local $offset0 i32)(local $length0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72)))))(set_local $length0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -128)))\n (i64.load (i32.add (get_global $sp) (i32.const -120)))\n (i64.load (i32.add (get_global $sp) (i32.const -112)))\n (i64.load (i32.add (get_global $sp) (i32.const -104)))))\n (call $memusegas (get_local $offset0) (get_local $length0))\n (set_local $offset0 (i32.add (get_global $memstart) (get_local $offset0))) (i64.store (i32.add (get_global $sp) (i32.const -192)) (i64.extend_u/i32 (i32.eqz (call $call(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(i32.add (get_global $sp) (i32.const -64))(get_local $offset0)(get_local $length0)(get_local $callback)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -168)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -176)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -184)) (i64.const 0)))", + "wast": ";; generated by ./wasm/generateInterface.js\n(func $CALL (param $callback i32)(local $offset0 i32)(local $length0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72)))))(set_local $length0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -128)))\n (i64.load (i32.add (get_global $sp) (i32.const -120)))\n (i64.load (i32.add (get_global $sp) (i32.const -112)))\n (i64.load (i32.add (get_global $sp) (i32.const -104)))))\n (call $memusegas (get_local $offset0) (get_local $length0))\n (set_local $offset0 (i32.add (get_global $memstart) (get_local $offset0))) (i64.store (i32.add (get_global $sp) (i32.const -256)) (i64.extend_u/i32 (i32.eqz (call $call(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(i32.add (get_global $sp) (i32.const -64))(get_local $offset0)(get_local $length0)(get_local $callback)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -232)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -240)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -248)) (i64.const 0)))", "imports": "(import \"ethereum\" \"call\" (func $call (param i64 i32 i32 i32 i32 i32) (result i32)))" }, "CALLCODE": { - "wast": ";; generated by ./wasm/generateInterface.js\n(func $CALLCODE (param $callback i32)(local $offset0 i32)(local $length0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72)))))(set_local $length0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -128)))\n (i64.load (i32.add (get_global $sp) (i32.const -120)))\n (i64.load (i32.add (get_global $sp) (i32.const -112)))\n (i64.load (i32.add (get_global $sp) (i32.const -104)))))\n (call $memusegas (get_local $offset0) (get_local $length0))\n (set_local $offset0 (i32.add (get_global $memstart) (get_local $offset0))) (i64.store (i32.add (get_global $sp) (i32.const -192)) (i64.extend_u/i32 (i32.eqz (call $callCode(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(i32.add (get_global $sp) (i32.const -64))(get_local $offset0)(get_local $length0)(get_local $callback)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -168)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -176)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -184)) (i64.const 0)))", + "wast": ";; generated by ./wasm/generateInterface.js\n(func $CALLCODE (param $callback i32)(local $offset0 i32)(local $length0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72)))))(set_local $length0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -128)))\n (i64.load (i32.add (get_global $sp) (i32.const -120)))\n (i64.load (i32.add (get_global $sp) (i32.const -112)))\n (i64.load (i32.add (get_global $sp) (i32.const -104)))))\n (call $memusegas (get_local $offset0) (get_local $length0))\n (set_local $offset0 (i32.add (get_global $memstart) (get_local $offset0))) (i64.store (i32.add (get_global $sp) (i32.const -256)) (i64.extend_u/i32 (i32.eqz (call $callCode(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(i32.add (get_global $sp) (i32.const -64))(get_local $offset0)(get_local $length0)(get_local $callback)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -232)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -240)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -248)) (i64.const 0)))", "imports": "(import \"ethereum\" \"callCode\" (func $callCode (param i64 i32 i32 i32 i32 i32) (result i32)))" }, "DELEGATECALL": { - "wast": ";; generated by ./wasm/generateInterface.js\n(func $DELEGATECALL (param $callback i32)(local $offset0 i32)(local $length0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72)))))(set_local $length0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -128)))\n (i64.load (i32.add (get_global $sp) (i32.const -120)))\n (i64.load (i32.add (get_global $sp) (i32.const -112)))\n (i64.load (i32.add (get_global $sp) (i32.const -104)))))\n (call $memusegas (get_local $offset0) (get_local $length0))\n (set_local $offset0 (i32.add (get_global $memstart) (get_local $offset0))) (i64.store (i32.add (get_global $sp) (i32.const -192)) (i64.extend_u/i32 (i32.eqz (call $callDelegate(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(i32.add (get_global $sp) (i32.const -64))(get_local $offset0)(get_local $length0)(get_local $callback)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -168)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -176)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -184)) (i64.const 0)))", + "wast": ";; generated by ./wasm/generateInterface.js\n(func $DELEGATECALL (param $callback i32)(local $offset0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72))))) (i64.store (i32.add (get_global $sp) (i32.const -256)) (i64.extend_u/i32 (i32.eqz (call $callDelegate(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(i32.add (get_global $sp) (i32.const -64))(get_local $offset0)(get_local $callback)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -232)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -240)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -248)) (i64.const 0)))", "imports": "(import \"ethereum\" \"callDelegate\" (func $callDelegate (param i64 i32 i32 i32 i32 i32) (result i32)))" }, "STATICCALL": { - "wast": ";; generated by ./wasm/generateInterface.js\n(func $STATICCALL (param $callback i32)(local $offset0 i32)(local $length0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -64)))\n (i64.load (i32.add (get_global $sp) (i32.const -56)))\n (i64.load (i32.add (get_global $sp) (i32.const -48)))\n (i64.load (i32.add (get_global $sp) (i32.const -40)))))(set_local $length0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72)))))\n (call $memusegas (get_local $offset0) (get_local $length0))\n (set_local $offset0 (i32.add (get_global $memstart) (get_local $offset0))) (i64.store (i32.add (get_global $sp) (i32.const -160)) (i64.extend_u/i32 (i32.eqz (call $callStatic(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(get_local $offset0)(get_local $length0)(get_local $callback)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -136)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -144)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -152)) (i64.const 0)))", + "wast": ";; generated by ./wasm/generateInterface.js\n(func $STATICCALL (param $callback i32)(local $offset0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -64)))\n (i64.load (i32.add (get_global $sp) (i32.const -56)))\n (i64.load (i32.add (get_global $sp) (i32.const -48)))\n (i64.load (i32.add (get_global $sp) (i32.const -40))))) (i64.store (i32.add (get_global $sp) (i32.const -224)) (i64.extend_u/i32 (i32.eqz (call $callStatic(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(get_local $offset0)(get_local $callback)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -200)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -208)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -216)) (i64.const 0)))", "imports": "(import \"ethereum\" \"callStatic\" (func $callStatic (param i64 i32 i32 i32 i32) (result i32)))" }, "RETURNDATACOPY": { diff --git a/wasm/wast.json b/wasm/wast.json index e7d07de8..1bf396fd 100644 --- a/wasm/wast.json +++ b/wasm/wast.json @@ -88,19 +88,19 @@ "imports": "(import \"ethereum\" \"create\" (func $create (param i32 i32 i32 i32) ))" }, "CALL": { - "wast": ";; generated by ./wasm/generateInterface.js\n(func $CALL (local $offset0 i32)(local $length0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72)))))(set_local $length0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -128)))\n (i64.load (i32.add (get_global $sp) (i32.const -120)))\n (i64.load (i32.add (get_global $sp) (i32.const -112)))\n (i64.load (i32.add (get_global $sp) (i32.const -104)))))\n (call $memusegas (get_local $offset0) (get_local $length0))\n (set_local $offset0 (i32.add (get_global $memstart) (get_local $offset0))) (i64.store (i32.add (get_global $sp) (i32.const -192)) (i64.extend_u/i32 (i32.eqz (call $call(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(i32.add (get_global $sp) (i32.const -64))(get_local $offset0)(get_local $length0)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -168)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -176)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -184)) (i64.const 0)))", + "wast": ";; generated by ./wasm/generateInterface.js\n(func $CALL (local $offset0 i32)(local $length0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72)))))(set_local $length0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -128)))\n (i64.load (i32.add (get_global $sp) (i32.const -120)))\n (i64.load (i32.add (get_global $sp) (i32.const -112)))\n (i64.load (i32.add (get_global $sp) (i32.const -104)))))\n (call $memusegas (get_local $offset0) (get_local $length0))\n (set_local $offset0 (i32.add (get_global $memstart) (get_local $offset0))) (i64.store (i32.add (get_global $sp) (i32.const -256)) (i64.extend_u/i32 (i32.eqz (call $call(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(i32.add (get_global $sp) (i32.const -64))(get_local $offset0)(get_local $length0)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -232)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -240)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -248)) (i64.const 0)))", "imports": "(import \"ethereum\" \"call\" (func $call (param i64 i32 i32 i32 i32) (result i32)))" }, "CALLCODE": { - "wast": ";; generated by ./wasm/generateInterface.js\n(func $CALLCODE (local $offset0 i32)(local $length0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72)))))(set_local $length0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -128)))\n (i64.load (i32.add (get_global $sp) (i32.const -120)))\n (i64.load (i32.add (get_global $sp) (i32.const -112)))\n (i64.load (i32.add (get_global $sp) (i32.const -104)))))\n (call $memusegas (get_local $offset0) (get_local $length0))\n (set_local $offset0 (i32.add (get_global $memstart) (get_local $offset0))) (i64.store (i32.add (get_global $sp) (i32.const -192)) (i64.extend_u/i32 (i32.eqz (call $callCode(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(i32.add (get_global $sp) (i32.const -64))(get_local $offset0)(get_local $length0)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -168)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -176)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -184)) (i64.const 0)))", + "wast": ";; generated by ./wasm/generateInterface.js\n(func $CALLCODE (local $offset0 i32)(local $length0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72)))))(set_local $length0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -128)))\n (i64.load (i32.add (get_global $sp) (i32.const -120)))\n (i64.load (i32.add (get_global $sp) (i32.const -112)))\n (i64.load (i32.add (get_global $sp) (i32.const -104)))))\n (call $memusegas (get_local $offset0) (get_local $length0))\n (set_local $offset0 (i32.add (get_global $memstart) (get_local $offset0))) (i64.store (i32.add (get_global $sp) (i32.const -256)) (i64.extend_u/i32 (i32.eqz (call $callCode(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(i32.add (get_global $sp) (i32.const -64))(get_local $offset0)(get_local $length0)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -232)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -240)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -248)) (i64.const 0)))", "imports": "(import \"ethereum\" \"callCode\" (func $callCode (param i64 i32 i32 i32 i32) (result i32)))" }, "DELEGATECALL": { - "wast": ";; generated by ./wasm/generateInterface.js\n(func $DELEGATECALL (local $offset0 i32)(local $length0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72)))))(set_local $length0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -128)))\n (i64.load (i32.add (get_global $sp) (i32.const -120)))\n (i64.load (i32.add (get_global $sp) (i32.const -112)))\n (i64.load (i32.add (get_global $sp) (i32.const -104)))))\n (call $memusegas (get_local $offset0) (get_local $length0))\n (set_local $offset0 (i32.add (get_global $memstart) (get_local $offset0))) (i64.store (i32.add (get_global $sp) (i32.const -192)) (i64.extend_u/i32 (i32.eqz (call $callDelegate(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(i32.add (get_global $sp) (i32.const -64))(get_local $offset0)(get_local $length0)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -168)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -176)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -184)) (i64.const 0)))", + "wast": ";; generated by ./wasm/generateInterface.js\n(func $DELEGATECALL (local $offset0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72))))) (i64.store (i32.add (get_global $sp) (i32.const -256)) (i64.extend_u/i32 (i32.eqz (call $callDelegate(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(i32.add (get_global $sp) (i32.const -64))(get_local $offset0)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -232)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -240)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -248)) (i64.const 0)))", "imports": "(import \"ethereum\" \"callDelegate\" (func $callDelegate (param i64 i32 i32 i32 i32) (result i32)))" }, "STATICCALL": { - "wast": ";; generated by ./wasm/generateInterface.js\n(func $STATICCALL (local $offset0 i32)(local $length0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -64)))\n (i64.load (i32.add (get_global $sp) (i32.const -56)))\n (i64.load (i32.add (get_global $sp) (i32.const -48)))\n (i64.load (i32.add (get_global $sp) (i32.const -40)))))(set_local $length0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -96)))\n (i64.load (i32.add (get_global $sp) (i32.const -88)))\n (i64.load (i32.add (get_global $sp) (i32.const -80)))\n (i64.load (i32.add (get_global $sp) (i32.const -72)))))\n (call $memusegas (get_local $offset0) (get_local $length0))\n (set_local $offset0 (i32.add (get_global $memstart) (get_local $offset0))) (i64.store (i32.add (get_global $sp) (i32.const -160)) (i64.extend_u/i32 (i32.eqz (call $callStatic(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(get_local $offset0)(get_local $length0)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -136)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -144)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -152)) (i64.const 0)))", + "wast": ";; generated by ./wasm/generateInterface.js\n(func $STATICCALL (local $offset0 i32) (set_local $offset0 (call $check_overflow\n (i64.load (i32.add (get_global $sp) (i32.const -64)))\n (i64.load (i32.add (get_global $sp) (i32.const -56)))\n (i64.load (i32.add (get_global $sp) (i32.const -48)))\n (i64.load (i32.add (get_global $sp) (i32.const -40))))) (i64.store (i32.add (get_global $sp) (i32.const -224)) (i64.extend_u/i32 (i32.eqz (call $callStatic(call $check_overflow_i64\n (i64.load (get_global $sp))\n (i64.load (i32.add (get_global $sp) (i32.const 8)))\n (i64.load (i32.add (get_global $sp) (i32.const 16)))\n (i64.load (i32.add (get_global $sp) (i32.const 24))))(call $bswap_m160 (i32.add (get_global $sp) (i32.const -32)))(get_local $offset0)))))\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const -200)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -208)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const -216)) (i64.const 0)))", "imports": "(import \"ethereum\" \"callStatic\" (func $callStatic (param i64 i32 i32 i32) (result i32)))" }, "RETURNDATACOPY": {