-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0b300ec
commit aef0bd6
Showing
9 changed files
with
73 additions
and
20 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
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 | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ OPTIONS | |
debug mode | ||
|
||
-o FILE, --output=FILE | ||
wat | ||
Write output to a file. | ||
|
||
--optimize | ||
optimize mode | ||
|
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
$ owi opt fbinop.wat -o bar.wat | ||
$ owi fmt bar.wat | ||
(module | ||
|
||
(type (sub final (func))) | ||
(func $start | ||
|
||
) | ||
(start 0) | ||
) |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
$ owi wasm2wat done.wasm -o bar.wat | ||
$ owi fmt bar.wat | ||
(module | ||
|
||
(type (sub final (func (param i32) (param i32) (result i32)))) | ||
|
||
(type (sub final (func))) | ||
(func (param i32) (param i32) (result i32) | ||
local.get 0 | ||
local.get 1 | ||
i32.add | ||
) | ||
(func | ||
i32.const 22 | ||
i32.const 20 | ||
call 0 | ||
drop | ||
) | ||
(start 1) | ||
) |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
$ owi wat2wasm func.wat -o bar.wasm | ||
$ owi run bar.wasm --debug | ||
typechecking ... | ||
linking ... | ||
interpreting ... | ||
stack : [ ] | ||
running instr: call 1 | ||
calling func : func anonymous | ||
stack : [ ] | ||
running instr: f32.const 40.400_001_525_878_906 | ||
stack : [ f32.const 40.400_001_525_878_906 ] | ||
running instr: call 0 | ||
calling func : func anonymous | ||
stack : [ ] | ||
running instr: f32.const 2.019_999_980_926_513_7 | ||
stack : [ f32.const 2.019_999_980_926_513_7 ] | ||
running instr: local.tee 1 | ||
stack : [ f32.const 2.019_999_980_926_513_7 ] | ||
running instr: local.get 0 | ||
stack : [ f32.const 40.400_001_525_878_906 ; f32.const 2.019_999_980_926_513_7 ] | ||
running instr: f32.add | ||
stack : [ f32.const 42.420_001_983_642_578 ] | ||
stack : [ f32.const 42.420_001_983_642_578 ] | ||
running instr: drop | ||
stack : [ ] | ||
stack : [ ] |