Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions benchmarks/wasm/wasmfx/fun-pipes-strip.wast
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@
(type (;7;) (func (result i32 (ref 2))))
(type (;8;) (func (param (ref 2) (ref 3))))
(type (;9;) (func))
(import "spectest" "print_i32" (func (;0;) (type 4)))
;; (import "spectest" "print_i32" (func (;0;) (type 4)))

(tag (;0;) (type 4) (param i32))
(tag (;1;) (type 0) (result i32))
(export "pipe" (func 3))
(export "run" (func 6))
(start 7)
(export "main" (func 7))
(elem (;0;) declare func 4 5)
(func (type 4) (param i32)
)

(func (;1;) (type 5) (param i32 (ref 2) (ref 3))
block (result (ref 3)) ;; label = @1
local.get 0
Expand Down Expand Up @@ -68,7 +73,7 @@
)
(func (;5;) (type 1) (param i32) (result i32)
(local i32 i32)
i32.const 10
i32.const 3
local.set 1
i32.const 0
local.set 2
Expand Down Expand Up @@ -105,7 +110,7 @@
call 3
)
(func (;7;) (type 9)
i32.const 0
i32.const 1
call 6
)
)
388 changes: 388 additions & 0 deletions benchmarks/wasm/wasmfx/fun-pipes.trace

Large diffs are not rendered by default.

151 changes: 151 additions & 0 deletions benchmarks/wasm/wasmfx/fun-pipes.trace1

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions benchmarks/wasm/wasmfx/fun-state-strip.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
(module
(type (;0;) (func (param i32) (result i32)))
(type (;1;) (func (result i32)))
(type (;2;) (cont 0))
(type (;3;) (cont 1))
(type (;4;) (func (param i32)))
(type (;5;) (func (param (ref 2) i32) (result i32)))
(type (;6;) (func (result i32 (ref 3))))
(type (;7;) (func (param i32 (ref 3)) (result i32)))
(tag (;0;) (type 1) (result i32))
(tag (;1;) (type 4) (param i32))
(export "main" (func 3))
(start 3)
(elem (;0;) declare func 2)
(func (;0;) (type 5) (param (ref 2) i32) (result i32)
block (result (ref 2)) ;; label = @1
block (type 6) (result i32 (ref 3)) ;; label = @2
local.get 1
local.get 0
resume 2 (on 0 1 (;@1;)) (on 1 0 (;@2;))
return
end
return_call 1
end
local.get 1
return_call 0
)
(func (;1;) (type 7) (param i32 (ref 3)) (result i32)
block (result (ref 2)) ;; label = @1
block (type 6) (result i32 (ref 3)) ;; label = @2
local.get 1
resume 3 (on 0 1 (;@1;)) (on 1 0 (;@2;))
return
end
return_call 1
end
local.get 0
return_call 0
)
(func (;2;) (type 1) (result i32)
i32.const 7
suspend 1
suspend 0
i32.const 2
i32.const 3
suspend 1
i32.const 3
suspend 0
i32.add
i32.mul
i32.add
)
(func (;3;) (type 1) (result i32)
i32.const 0
ref.func 2
cont.new 3
call 1
)
)
18 changes: 18 additions & 0 deletions benchmarks/wasm/wasmfx/fun-state.bin.wast
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
(module definition $state binary
"\00\61\73\6d\01\00\00\00\01\a6\80\80\80\00\08\60"
"\01\7f\01\7f\60\00\01\7f\5d\00\5d\01\60\01\7f\00"
"\60\02\64\02\7f\01\7f\60\00\02\7f\64\03\60\02\7f"
"\64\03\01\7f\03\85\80\80\80\00\04\05\07\01\01\0d"
"\85\80\80\80\00\02\00\01\00\04\07\87\80\80\80\00"
"\01\03\72\75\6e\00\03\09\85\80\80\80\00\01\03\00"
"\01\02\0a\ec\80\80\80\00\04\9d\80\80\80\00\00\02"
"\64\02\02\06\20\01\20\00\e3\02\02\00\00\01\00\01"
"\00\0f\0b\12\01\0b\20\01\12\00\0b\9b\80\80\80\00"
"\00\02\64\02\02\06\20\01\e3\03\02\00\00\01\00\01"
"\00\0f\0b\12\01\0b\20\00\12\00\0b\95\80\80\80\00"
"\00\41\07\e2\01\e2\00\41\02\41\03\e2\01\41\03\e2"
"\00\6a\6c\6a\0b\8a\80\80\80\00\00\41\00\d2\02\e0"
"\03\10\01\0b"
)
(module instance $state $state)
(assert_return (invoke "run") (i32.const 0x13))
59 changes: 0 additions & 59 deletions benchmarks/wasm/wasmfx/fun-state.strip.wat

This file was deleted.

2 changes: 1 addition & 1 deletion benchmarks/wasm/wasmfx/fun-state.wast
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@
)
)

;; (assert_return (invoke "run") (i32.const 19))
(assert_return (invoke "run") (i32.const 19))
8 changes: 6 additions & 2 deletions src/main/scala/wasm/AST.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,13 @@ case object Drop extends Instr
case object Alloc extends Instr
case object Free extends Instr
case class Select(ty: Option[List[ValueType]]) extends Instr
case class Block(ty: BlockType, instrs: List[Instr]) extends Instr
case class Block(ty: BlockType, instrs: List[Instr]) extends Instr {
override def toString: String = s"Block(...)"
}
case class IdBlock(id: Int, ty: BlockType, instrs: List[Instr]) extends Instr
case class Loop(ty: BlockType, instrs: List[Instr]) extends Instr
case class Loop(ty: BlockType, instrs: List[Instr]) extends Instr {
override def toString: String = s"Loop(...)"
}
case class IdLoop(id: Int, ty: BlockType, instrs: List[Instr]) extends Instr
case class If(ty: BlockType, thenInstrs: List[Instr], elseInstrs: List[Instr]) extends Instr
case class IdIf(ty: BlockType, thenInstrs: IdBlock, elseInstrs: IdBlock) extends Instr
Expand Down
Loading