| 1 |
(module |
| 2 |
(type $f1 (;0;) (func)) |
| 3 |
(type $k1 (;1;) (cont $f1)) |
| 4 |
(type (;2;) (func (param (ref $k1)))) |
| 5 |
(tag $exn (;0;) (type $f1)) |
| 6 |
(tag $e1 (;1;) (type $f1)) |
| 7 |
(tag $e2 (;2;) (type $f1)) |
| 8 |
(export "unhandled-1" (func $f1)) |
| 9 |
(export "unhandled-2" (func 1)) |
| 10 |
(export "unhandled-3" (func 2)) |
| 11 |
(export "handled" (func 3)) |
| 12 |
(export "uncaught-1" (func 5)) |
| 13 |
(export "uncaught-2" (func 6)) |
| 14 |
(export "non-linear-1" (func 13)) |
| 15 |
(export "non-linear-2" (func 14)) |
| 16 |
(export "non-linear-3" (func 15)) |
| 17 |
(export "non-linear-4" (func 16)) |
| 18 |
(elem (;0;) declare func $f2) |
| 19 |
(elem (;1;) declare func $r0 $r1) |
| 20 |
(func $f1 (;0;) (type $f1) |
| 21 |
suspend $e1 |
| 22 |
) |
| 23 |
(func (;1;) (type $f1) |
| 24 |
ref.func $f1 |
| 25 |
cont.new $k1 |
| 26 |
resume $k1 |
| 27 |
) |
| 28 |
(func (;2;) (type $f1) |
| 29 |
block $h (result (ref $k1)) |
| 30 |
ref.func $f1 |
| 31 |
cont.new $k1 |
| 32 |
resume $k1 (on $e2 $h) |
| 33 |
unreachable |
| 34 |
end |
| 35 |
drop |
| 36 |
) |
| 37 |
(func (;3;) (type $f1) |
| 38 |
block $h (result (ref $k1)) |
| 39 |
ref.func $f1 |
| 40 |
cont.new $k1 |
| 41 |
resume $k1 (on $e1 $h) |
| 42 |
unreachable |
| 43 |
end |
| 44 |
drop |
| 45 |
) |
| 46 |
(func $f2 (;4;) (type $f1) |
| 47 |
throw $exn |
| 48 |
) |
| 49 |
(func (;5;) (type $f1) |
| 50 |
block $h (result (ref $k1)) |
| 51 |
ref.func $f2 |
| 52 |
cont.new $k1 |
| 53 |
resume $k1 (on $e1 $h) |
| 54 |
unreachable |
| 55 |
end |
| 56 |
drop |
| 57 |
) |
| 58 |
(func (;6;) (type $f1) |
| 59 |
block $h (result (ref $k1)) |
| 60 |
ref.func $f1 |
| 61 |
cont.new $k1 |
| 62 |
resume $k1 (on $e1 $h) |
| 63 |
unreachable |
| 64 |
end |
| 65 |
resume_throw $k1 $exn |
| 66 |
) |
| 67 |
(func $r0 (;7;) (type $f1)) |
| 68 |
(func $r1 (;8;) (type $f1) |
| 69 |
suspend $e1 |
| 70 |
suspend $e1 |
| 71 |
) |
| 72 |
(func $nl1 (;9;) (type 2) (param $k (ref $k1)) |
| 73 |
local.get $k |
| 74 |
resume $k1 |
| 75 |
local.get $k |
| 76 |
resume $k1 |
| 77 |
) |
| 78 |
(func $nl2 (;10;) (type 2) (param $k (ref $k1)) |
| 79 |
block $h (result (ref $k1)) |
| 80 |
local.get $k |
| 81 |
resume $k1 (on $e1 $h) |
| 82 |
unreachable |
| 83 |
end |
| 84 |
local.get $k |
| 85 |
resume $k1 |
| 86 |
unreachable |
| 87 |
) |
| 88 |
(func $nl3 (;11;) (type 2) (param $k (ref $k1)) |
| 89 |
(local $k' (ref null $k1)) |
| 90 |
block $h1 (result (ref $k1)) |
| 91 |
local.get $k |
| 92 |
resume $k1 (on $e1 $h1) |
| 93 |
unreachable |
| 94 |
end |
| 95 |
local.set $k' |
| 96 |
block $h2 (result (ref $k1)) |
| 97 |
local.get $k' |
| 98 |
resume $k1 (on $e1 $h2) |
| 99 |
unreachable |
| 100 |
end |
| 101 |
local.get $k' |
| 102 |
resume $k1 |
| 103 |
unreachable |
| 104 |
) |
| 105 |
(func $nl4 (;12;) (type 2) (param $k (ref $k1)) |
| 106 |
local.get $k |
| 107 |
cont.bind $k1 $k1 |
| 108 |
drop |
| 109 |
local.get $k |
| 110 |
resume $k1 |
| 111 |
) |
| 112 |
(func (;13;) (type $f1) |
| 113 |
ref.func $r0 |
| 114 |
cont.new $k1 |
| 115 |
call $nl1 |
| 116 |
) |
| 117 |
(func (;14;) (type $f1) |
| 118 |
ref.func $r1 |
| 119 |
cont.new $k1 |
| 120 |
call $nl2 |
| 121 |
) |
| 122 |
(func (;15;) (type $f1) |
| 123 |
ref.func $r1 |
| 124 |
cont.new $k1 |
| 125 |
call $nl3 |
| 126 |
) |
| 127 |
(func (;16;) (type $f1) |
| 128 |
ref.func $r1 |
| 129 |
cont.new $k1 |
| 130 |
call $nl4 |
| 131 |
) |
| 132 |
) |