Skip to content
This repository was archived by the owner on Jan 5, 2019. It is now read-only.

Commit 499e6f0

Browse files
committed
remove references to callDataCopy256 API and replace them with callDataCopy
1 parent 2264295 commit 499e6f0

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

wasm/CALLDATALOAD.wast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
(get_local $writeOffset2)
2424
(get_local $writeOffset3)))
2525

26-
(call $callDataCopy256 (get_global $sp) (get_local $writeOffset))
26+
(call $callDataCopy (get_global $sp) (get_local $writeOffset) (i32.const 32))
2727
;; swap top stack item
2828
(drop (call $bswap_m256 (get_global $sp)))
2929
)

wasm/generateInterface.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ const interfaceManifest = {
88
output: []
99
},
1010
CALLDATALOAD: {
11-
name: 'callDataCopy256',
12-
input: ['pointer'],
13-
output: ['i256'] // TODO: this is wrong
11+
name: 'callDataCopy',
12+
input: ['writeOffset', 'i32', 'length'],
13+
output: []
1414
},
1515
GAS: {
1616
name: 'getGasLeft',

wasm/wast-async.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"imports": "(import \"ethereum\" \"log\" (func $log (param i32 i32 i32 i32 i32 i32 i32) ))"
55
},
66
"CALLDATALOAD": {
7-
"wast": ";; stack:\n;; 0: dataOffset\n(func $CALLDATALOAD\n (local $writeOffset i32)\n (local $writeOffset0 i64)\n (local $writeOffset1 i64)\n (local $writeOffset2 i64)\n (local $writeOffset3 i64)\n\n (set_local $writeOffset0 (i64.load (i32.add (get_global $sp) (i32.const 0))))\n (set_local $writeOffset1 (i64.load (i32.add (get_global $sp) (i32.const 8))))\n (set_local $writeOffset2 (i64.load (i32.add (get_global $sp) (i32.const 16))))\n (set_local $writeOffset3 (i64.load (i32.add (get_global $sp) (i32.const 24))))\n\n (i64.store (i32.add (get_global $sp) (i32.const 0)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const 8)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const 16)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const 24)) (i64.const 0))\n\n (set_local $writeOffset\n (call $check_overflow (get_local $writeOffset0)\n (get_local $writeOffset1)\n (get_local $writeOffset2)\n (get_local $writeOffset3)))\n\n (call $callDataCopy256 (get_global $sp) (get_local $writeOffset))\n ;; swap top stack item\n (drop (call $bswap_m256 (get_global $sp)))\n)\n",
8-
"imports": "(import \"ethereum\" \"callDataCopy256\" (func $callDataCopy256 (param i32 i32) ))"
7+
"wast": ";; stack:\n;; 0: dataOffset\n(func $CALLDATALOAD\n (local $writeOffset i32)\n (local $writeOffset0 i64)\n (local $writeOffset1 i64)\n (local $writeOffset2 i64)\n (local $writeOffset3 i64)\n\n (set_local $writeOffset0 (i64.load (i32.add (get_global $sp) (i32.const 0))))\n (set_local $writeOffset1 (i64.load (i32.add (get_global $sp) (i32.const 8))))\n (set_local $writeOffset2 (i64.load (i32.add (get_global $sp) (i32.const 16))))\n (set_local $writeOffset3 (i64.load (i32.add (get_global $sp) (i32.const 24))))\n\n (i64.store (i32.add (get_global $sp) (i32.const 0)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const 8)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const 16)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const 24)) (i64.const 0))\n\n (set_local $writeOffset\n (call $check_overflow (get_local $writeOffset0)\n (get_local $writeOffset1)\n (get_local $writeOffset2)\n (get_local $writeOffset3)))\n\n (call $callDataCopy (get_global $sp) (get_local $writeOffset) (i32.const 32))\n ;; swap top stack item\n (drop (call $bswap_m256 (get_global $sp)))\n)\n",
8+
"imports": "(import \"ethereum\" \"callDataCopy\" (func $callDataCopy (param i32 i32 i32) ))"
99
},
1010
"GAS": {
1111
"wast": ";; generated by ./wasm/generateInterface.js\n(func $GAS (i64.store (i32.add (get_global $sp) (i32.const 32)) (call $getGasLeft))\n\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const 56)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const 48)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const 40)) (i64.const 0)))",

wasm/wast.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"imports": "(import \"ethereum\" \"log\" (func $log (param i32 i32 i32 i32 i32 i32 i32) ))"
55
},
66
"CALLDATALOAD": {
7-
"wast": ";; stack:\n;; 0: dataOffset\n(func $CALLDATALOAD\n (local $writeOffset i32)\n (local $writeOffset0 i64)\n (local $writeOffset1 i64)\n (local $writeOffset2 i64)\n (local $writeOffset3 i64)\n\n (set_local $writeOffset0 (i64.load (i32.add (get_global $sp) (i32.const 0))))\n (set_local $writeOffset1 (i64.load (i32.add (get_global $sp) (i32.const 8))))\n (set_local $writeOffset2 (i64.load (i32.add (get_global $sp) (i32.const 16))))\n (set_local $writeOffset3 (i64.load (i32.add (get_global $sp) (i32.const 24))))\n\n (i64.store (i32.add (get_global $sp) (i32.const 0)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const 8)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const 16)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const 24)) (i64.const 0))\n\n (set_local $writeOffset\n (call $check_overflow (get_local $writeOffset0)\n (get_local $writeOffset1)\n (get_local $writeOffset2)\n (get_local $writeOffset3)))\n\n (call $callDataCopy256 (get_global $sp) (get_local $writeOffset))\n ;; swap top stack item\n (drop (call $bswap_m256 (get_global $sp)))\n)\n",
8-
"imports": "(import \"ethereum\" \"callDataCopy256\" (func $callDataCopy256 (param i32 i32) ))"
7+
"wast": ";; stack:\n;; 0: dataOffset\n(func $CALLDATALOAD\n (local $writeOffset i32)\n (local $writeOffset0 i64)\n (local $writeOffset1 i64)\n (local $writeOffset2 i64)\n (local $writeOffset3 i64)\n\n (set_local $writeOffset0 (i64.load (i32.add (get_global $sp) (i32.const 0))))\n (set_local $writeOffset1 (i64.load (i32.add (get_global $sp) (i32.const 8))))\n (set_local $writeOffset2 (i64.load (i32.add (get_global $sp) (i32.const 16))))\n (set_local $writeOffset3 (i64.load (i32.add (get_global $sp) (i32.const 24))))\n\n (i64.store (i32.add (get_global $sp) (i32.const 0)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const 8)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const 16)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const 24)) (i64.const 0))\n\n (set_local $writeOffset\n (call $check_overflow (get_local $writeOffset0)\n (get_local $writeOffset1)\n (get_local $writeOffset2)\n (get_local $writeOffset3)))\n\n (call $callDataCopy (get_global $sp) (get_local $writeOffset) (i32.const 32))\n ;; swap top stack item\n (drop (call $bswap_m256 (get_global $sp)))\n)\n",
8+
"imports": "(import \"ethereum\" \"callDataCopy\" (func $callDataCopy (param i32 i32 i32) ))"
99
},
1010
"GAS": {
1111
"wast": ";; generated by ./wasm/generateInterface.js\n(func $GAS (i64.store (i32.add (get_global $sp) (i32.const 32)) (call $getGasLeft))\n\n ;; zero out mem\n (i64.store (i32.add (get_global $sp) (i32.const 56)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const 48)) (i64.const 0))\n (i64.store (i32.add (get_global $sp) (i32.const 40)) (i64.const 0)))",

0 commit comments

Comments
 (0)