Commit Graph

155 Commits

Author SHA1 Message Date
Brian Carroll
513a346fe1
wasm_interp: end all function blocks on RETURN op 2022-12-06 08:59:08 +00:00
Brian Carroll
ad2973cd8d
wasm_interp: fix call_indirect immediates order 2022-12-06 08:59:08 +00:00
Brian Carroll
6d43763ab7
wasm_interp: dump a stack trace on error 2022-12-06 08:59:08 +00:00
Brian Carroll
5bdd1b5628
wasm_interp: use Result instead of panic. Focus debug info on *Wasm app*, not interp. 2022-12-06 08:59:08 +00:00
Brian Carroll
284dc6fa51
wasm_interp: support WASI argc/argv, and writing to stdout/stderr 2022-12-05 22:16:27 +00:00
Brian Carroll
736630b53f
wasm_interp: don't require -- before app arguments 2022-12-05 22:16:27 +00:00
Brian Carroll
735085b8df
wasm_interp: add a description to Cargo.toml 2022-12-05 22:16:27 +00:00
Brian Carroll
c6e446da8d
wasm_interp: don't expose internal types 2022-12-02 08:02:27 +00:00
Brian Carroll
4714b4599a
wasm_interp: move test_utils into tests/mod.rs 2022-12-02 08:02:23 +00:00
Brian Carroll
ffd35f5884
wasm_interp: move tests inside the crate 2022-12-02 07:54:13 +00:00
Brian Carroll
42a15d07b3
wasm_interp: Just don't support non-function imports! I've never seen them anyway. 2022-12-02 07:47:49 +00:00
Brian Carroll
c38164ce8a
wasm_interp: cache import indices instead of signatures 2022-12-02 07:47:49 +00:00
Brian Carroll
0cf2f4f9e4
clippy 2022-12-01 21:56:59 +00:00
Brian Carroll
c0f840542a
wasm_interp: test import calls 2022-12-01 21:31:46 +00:00
Brian Carroll
c866ce6b09
wasm_interp: Handle calls to imports 2022-12-01 20:41:38 +00:00
Brian Carroll
b10ac827f1
wasm_interp: simplified ImportDispatcher
We don't really need a trait for the 'import module' concept.
2022-12-01 08:47:32 +00:00
Brian Carroll
ec8950816a
wasm_interp: expose both call_export_from_cli and call_export (for library usage) 2022-11-30 23:20:58 +00:00
Brian Carroll
7ddff49691
wasm_interp: possible design for imports, using enum dispatch 2022-11-30 07:25:38 +00:00
Brian Carroll
378cad7748
clippy 2022-11-29 11:28:30 +00:00
Brian Carroll
d29ea7fedf
wasm_interp: last few instructions! 2022-11-29 08:59:37 +00:00
Brian Carroll
17810d5134
wasm_interp: float rounding ops 2022-11-29 08:43:56 +00:00
Brian Carroll
714586fac1
wasm_interp: f32 convert instructions 2022-11-29 08:06:18 +00:00
Brian Carroll
029f0d00c1
wasm_interp: truncate instructions 2022-11-29 08:06:18 +00:00
Brian Carroll
6ac46a150f
wasm_interp: fix tests for promote and demote ops 2022-11-29 08:05:46 +00:00
Brian Carroll
afa57a027b
wasm_interp: implement some number conversion ops 2022-11-28 23:28:08 +00:00
Brian Carroll
94ca352ed7
wasm_interp: 'reinterpret' instructions 2022-11-28 23:28:08 +00:00
Brian Carroll
46737b4a41
wasm_interp: rename test_opcodes -> test_basics, and split out test_convert 2022-11-28 23:28:08 +00:00
Brian Carroll
f798f47edd
wasm_interp: move load and store tests to test_mem 2022-11-28 23:28:08 +00:00
Brian Carroll
a97aba7cec
wasm_interp: delete older duplicate test 2022-11-28 23:28:08 +00:00
Brian Carroll
1e114d6eef
wasm_interp: implement float neg and abs 2022-11-28 23:28:08 +00:00
Brian Carroll
284eeb5537
wasm_interp: Implement float ops that have int equivalents 2022-11-28 23:28:08 +00:00
Brian Carroll
fc10c520b1
wasm_interp: fix return type for i64 comparison ops 2022-11-28 23:28:08 +00:00
Brian Carroll
c2bf7d68fc
wasm_interp: rename ExecutionState -> Instance to match standard Wasm terminology 2022-11-28 23:28:08 +00:00
Brian Carroll
9ea2176db8
wasm_module, wasm_interp: fix SLEB-128 encoding for i64 2022-11-28 17:39:13 +00:00
Brian Carroll
0dc3441301
wasm_interp: even more copy-and-pasting 2022-11-28 17:35:51 +00:00
Brian Carroll
ea9b53aff3
wasm_interp: more copy-and-pasting of i64 from i32 2022-11-28 17:17:25 +00:00
Brian Carroll
31a4ad62a7
wasm_interp: implement modulo for rotr and rotl 2022-11-28 17:15:56 +00:00
Brian Carroll
3881296fb4
wasm_interp: Implement lots of i64 ops by copy-pasting from i32 2022-11-28 17:10:28 +00:00
Brian Carroll
56ddd1f29b
wasm_interp: Add a comment and tests for modulo in shift ops 2022-11-28 17:04:45 +00:00
Brian Carroll
b707f6fdff
wasm_interp: tests for i32 bitwise rotate ops 2022-11-28 09:01:25 +00:00
Brian Carroll
77f5635d89
wasm_interp: tests for shift right ops 2022-11-28 08:58:45 +00:00
Brian Carroll
2e0dd18b82
wasm_interp: make test_op_example generate a valid wasm file and dump it 2022-11-28 08:58:09 +00:00
Brian Carroll
5fc874057c
wasm_interp: tests for i32 ops 2022-11-27 23:00:22 +00:00
Brian Carroll
eeca876421
wasm_interp: create a test_utils module 2022-11-27 22:10:12 +00:00
Brian Carroll
e3df393a22
wasm_interp: use wrapping arithmetic 2022-11-27 22:07:31 +00:00
Brian Carroll
8e15d49720
wasm_interp: use Value::from in more places 2022-11-27 21:00:52 +00:00
Brian Carroll
78fbc75249
wasm_interp: neater creation of Value from unsigned integers 2022-11-27 20:53:12 +00:00
Brian Carroll
f7dcd8f421
wasm_interp: implement remaining i32 ops 2022-11-27 20:47:21 +00:00
Brian Carroll
ae2e561945
wasm_interp: implement select instruction 2022-11-27 20:39:28 +00:00
Brian Carroll
9e7a92574d
wasm_interp: don't give Signature the Clone trait just for a test! 2022-11-27 20:34:03 +00:00
Brian Carroll
8ff843261a
clippy 2022-11-27 19:40:09 +00:00
Brian Carroll
c2fb626c17
wasm_interp: implement indirect_call 2022-11-27 18:56:09 +00:00
Brian Carroll
acb871abeb
wasm_interp: fix implicit return for calls inside blocks 2022-11-26 16:23:48 +00:00
Brian Carroll
df972a4567
wasm_interp: remove unnecessary and confusing ELSE check 2022-11-26 12:01:37 +00:00
Brian Carroll
0009e65d93
clippy 2022-11-26 11:01:12 +00:00
Brian Carroll
3346ef9c9c
wasm_interp: Don't need to store block depth in CallStack any more 2022-11-26 10:58:16 +00:00
Brian Carroll
0bd1bced68
wasm_interp: implement loop 2022-11-26 10:47:16 +00:00
Brian Carroll
c55cedd279
wasm_interp: implement i32.lt_s 2022-11-26 10:12:47 +00:00
Brian Carroll
82e8c89045
wasm_interp: test for if/else 2022-11-26 09:36:49 +00:00
Brian Carroll
a09fd95fd7
wasm_interp: pass arguments from CLI 2022-11-26 09:10:35 +00:00
Brian Carroll
fa1e0a8614
wasm_interp: implement if/else statements 2022-11-26 07:33:17 +00:00
Brian Carroll
131a9925d0
wasm_interp: test br_table 2022-11-26 00:56:51 +00:00
Brian Carroll
578b74ee77
wasm_interp: test for br_if 2022-11-26 00:43:49 +00:00
Brian Carroll
5035ad0a2b
wasm_interp: test br 2022-11-26 00:39:46 +00:00
Brian Carroll
b69be0e12d
wasm_interp: implement br_if and br_table 2022-11-25 21:41:35 +00:00
Brian Carroll
b96f1ffc33
wasm_interp: implement block and br 2022-11-25 19:42:10 +00:00
Brian Carroll
a593d19b2d
wasm_interp: use copy_from_slice instead of write_all 2022-11-25 19:41:19 +00:00
Brian Carroll
5f5a535aaf
clippy 2022-11-25 16:56:25 +00:00
Brian Carroll
2bd67a3292
wasm_interp: tests for memory allocation instructions 2022-11-25 16:51:36 +00:00
Brian Carroll
06f3726e35
wasm_interp: tests for store instructions 2022-11-25 16:29:37 +00:00
Brian Carroll
65fc079393
clippy 2022-11-25 15:46:02 +00:00
Brian Carroll
e8f78a9618
wasm_interp: disable some debug code 2022-11-25 15:44:00 +00:00
Brian Carroll
e08b09538e
wasm_interp: implement memory size instructions 2022-11-25 15:41:11 +00:00
Brian Carroll
598e62275d
wasm_interp: implement store instructions 2022-11-25 15:41:11 +00:00
Brian Carroll
d9a8c6f64c
wasm_interp: Fix parse error hex formatting 2022-11-25 14:51:40 +00:00
Brian Carroll
73ede61cb1
wasm_interp: tests for load instructions 2022-11-25 14:50:55 +00:00
Brian Carroll
c6bf34dd78
wasm_interp: Imeplement load instructions 2022-11-25 10:13:13 +00:00
Brian Carroll
85d5f3d109
wasm_interp: add a --hex CLI flag 2022-11-25 10:12:39 +00:00
Brian Carroll
96bff3e304
wasm_module: Create DataSection::load_into 2022-11-25 09:19:35 +00:00
Brian Carroll
a0fe01dd5f
wasm_interp: Use an Option instead of separate bool and String 2022-11-25 01:28:31 +00:00
Brian Carroll
77ebaba4ff
wasm_interp: include immediates in --debug output 2022-11-25 01:13:32 +00:00
Brian Carroll
dd93e2e46f
wasm_interp: Print out return value(s), if any 2022-11-25 00:14:44 +00:00
Brian Carroll
9d77c474d9
wasm_interp: Add --debug flag 2022-11-25 00:14:44 +00:00
Brian Carroll
3d756a8fff
wasm_interp: Fixes to get CLI mode working 2022-11-25 00:14:44 +00:00
Brian Carroll
9d437fe3fd
wasm_interp: report todo! panics with file offset of the missing instruction 2022-11-25 00:14:44 +00:00
Brian Carroll
60a671362f
wasm_interp: Create a CLI to run .wasm files 2022-11-25 00:14:44 +00:00
Brian Carroll
6d84c85078
wasm_interp: Fix PR feedback 2022-11-25 00:14:43 +00:00
Brian Carroll
4c6f868e24
wasm_interp: refactor a test for readability 2022-11-24 16:55:22 +00:00
Brian Carroll
f10262a41d
clippy 2022-11-24 16:43:43 +00:00
Brian Carroll
6523b38847
wasm_interp: implement calls with arguments 2022-11-24 16:43:31 +00:00
Brian Carroll
3aeab0dbd7
wasm_interp: initial version of ExecutionState::for_module 2022-11-24 16:43:31 +00:00
Brian Carroll
235c238e36
Move Value from wasm_interp to wasm_module & create GlobalSection::initial_values 2022-11-24 16:43:31 +00:00
Brian Carroll
0a2f2739b2
wasm_interp: implement function call (no arguments yet!) 2022-11-24 16:43:31 +00:00
Brian Carroll
972d9dbb19
wasm_interp: implement call and return instructions 2022-11-24 16:43:31 +00:00
Brian Carroll
57aa3aafd8
wasm_interp: test helper for default ExecutionState 2022-11-24 16:43:31 +00:00
Brian Carroll
335497c99f
wasm_interp: implement globals 2022-11-24 16:43:31 +00:00
Brian Carroll
ff63831fd1
wasm_interp: implement local.get, local.set, and local.tee 2022-11-24 16:43:31 +00:00
Brian Carroll
92039547b6
wasm_interp: remove unsafe code 2022-11-22 00:09:38 +00:00
Brian Carroll
ce10199bb4
clippy + comments 2022-11-21 23:04:22 +00:00
Brian Carroll
3d7fb380a5
wasm_interp: Tests for ExecutionState 2022-11-21 19:54:48 +00:00