Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement non-trapping grow_memory semantics (#308)
Addresses #307. Clean up some of the memory error condition handling on the way.
- Loading branch information
Showing
13 changed files
with
1,128 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,51 @@ | |||
--- host/encode.ml | |||
+++ host/encode.ml | |||
@@ -105,31 +105,30 @@ | |||
let rec expr e = | |||
match e.it with | |||
| Nop -> op 0x00 | |||
- | Block es -> op 0x01; list expr es; op 0x17 | |||
- | Loop es -> op 0x02; list expr es; op 0x17 | |||
+ | Block es -> op 0x01; list expr es; op 0x0f | |||
+ | Loop es -> op 0x02; list expr es; op 0x0f | |||
| If (e, es1, es2) -> | |||
expr e; op 0x03; list expr es1; | |||
- if es2 <> [] then op 0x04; list expr es2; op 0x17 | |||
+ if es2 <> [] then op 0x04; list expr es2; op 0x0f | |||
| Select (e1, e2, e3) -> expr e1; expr e2; expr e3; op 0x05 | |||
| Br (x, eo) -> opt expr eo; op 0x06; arity1 eo; var x | |||
| Br_if (x, eo, e) -> opt expr eo; expr e; op 0x07; arity1 eo; var x | |||
| Br_table (xs, x, eo, e) -> | |||
opt expr eo; expr e; op 0x08; arity1 eo; vec var32 xs; var32 x | |||
- | |||
- | Ast.I32_const c -> op 0x0a; vs32 c.it | |||
- | Ast.I64_const c -> op 0x0b; vs64 c.it | |||
- | Ast.F32_const c -> op 0x0c; f32 c.it | |||
- | Ast.F64_const c -> op 0x0d; f64 c.it | |||
- | |||
- | Ast.Get_local x -> op 0x0e; var x | |||
- | Ast.Set_local (x, e) -> unary e 0x0f; var x | |||
- | Ast.Tee_local (x, e) -> unary e 0x10; var x | |||
- | |||
- | Ast.Call (x, es) -> nary es 0x12; var x | |||
- | Ast.Call_import (x, es) -> nary es 0x1f; var x | |||
- | Ast.Call_indirect (x, e, es) -> expr e; nary es 0x13; var x | |||
- | Ast.Return eo -> nary1 eo 0x14 | |||
- | Ast.Unreachable -> op 0x15 | |||
+ | Ast.Return eo -> nary1 eo 0x09 | |||
+ | Ast.Unreachable -> op 0x0a | |||
+ | |||
+ | Ast.I32_const c -> op 0x10; vs32 c.it | |||
+ | Ast.I64_const c -> op 0x11; vs64 c.it | |||
+ | Ast.F32_const c -> op 0x12; f32 c.it | |||
+ | Ast.F64_const c -> op 0x13; f64 c.it | |||
+ | |||
+ | Ast.Get_local x -> op 0x14; var x | |||
+ | Ast.Set_local (x, e) -> unary e 0x15; var x | |||
+ | |||
+ | Ast.Call (x, es) -> nary es 0x16; var x | |||
+ | Ast.Call_indirect (x, e, es) -> expr e; nary es 0x17; var x | |||
+ | Ast.Call_import (x, es) -> nary es 0x18; var x | |||
|
|||
| I32_load8_s (o, a, e) -> unary e 0x20; memop o a | |||
| I32_load8_u (o, a, e) -> unary e 0x21; memop o a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.