Skip to content

Instantly share code, notes, and snippets.

@taegyunkim
Created February 24, 2020 21:41
Show Gist options
  • Save taegyunkim/8d45175554cf81729c63032cd3258dca to your computer and use it in GitHub Desktop.
Save taegyunkim/8d45175554cf81729c63032cd3258dca to your computer and use it in GitHub Desktop.
An example run for use-local.wat
$> cargo run --release -- ./examples/use-local.wat
   Compiling rocinante v0.1.0 (/mnt/c/Users/ktaeg/Workspace/rocinante)
    Finished release [optimized] target(s) in 5.27s
     Running `target/release/rocinante ./examples/use-local.wat`
(module
  (type (;0;) (func (param i32) (result i32)))
  (func $use-local (type 0) (param i32) (result i32)
    (local i32)
    local.get 0
    i32.const 2
    i32.mul
    local.set 1
    local.get 0
    local.get 1
    i32.add)
  (export "use-local" (func $use-local)))
(module
  (type (;0;) (func (param i32) (result i32)))
  (func (;0;) (type 0) (param i32) (result i32)
    (local i32)
    i32.const 3
    local.get 0
    nop
    nop
    i32.const 0
    i32.shl
    i32.mul)
  (export "candidate" (func 0)))
Verified.
(module
  (type (;0;) (func (param i32) (result i32)))
  (func (;0;) (type 0) (param i32) (result i32)
    (local i32)
    nop
    nop
    nop
    nop
    i32.const 3
    local.get 0
    i32.mul)
  (export "candidate" (func 0)))
Verified.
cargo run --release -- ./examples/use-local.wat  54.19s user 13.28s system 124% cpu 54.124 total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment