Implement function types / indirect calls / trampolines (#39)

This commit is contained in:
Daniel Wirtz
2018-03-12 14:06:39 +01:00
committed by GitHub
parent 5d5f458ab1
commit 423533c6b0
67 changed files with 7499 additions and 5763 deletions

View File

@ -0,0 +1,103 @@
(module
(type $iiii (func (param i32 i32 i32) (result i32)))
(type $iiiii (func (param i32 i32 i32 i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 4) "\10\00\00\00c\00a\00l\00l\00-\00o\00p\00t\00i\00o\00n\00a\00l\00.\00t\00s")
(export "memory" (memory $0))
(start $start)
(func $call-optional/opt (; 1 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(i32.add
(i32.add
(get_local $0)
(get_local $1)
)
(get_local $2)
)
)
(func $call-optional/opt|trampoline (; 2 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(block $N=2
(block $N=1
(block $N=0
(block $N=invalid
(br_table $N=0 $N=1 $N=2 $N=invalid
(get_local $3)
)
)
(unreachable)
)
(set_local $1
(i32.const -1)
)
)
(set_local $2
(i32.const -2)
)
)
(call $call-optional/opt
(get_local $0)
(get_local $1)
(get_local $2)
)
)
(func $start (; 3 ;) (type $v)
(if
(call $call-optional/opt|trampoline
(i32.const 3)
(i32.const 0)
(i32.const 0)
(i32.const 0)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 4)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.ne
(call $call-optional/opt|trampoline
(i32.const 3)
(i32.const 4)
(i32.const 0)
(i32.const 1)
)
(i32.const 5)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 5)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.ne
(call $call-optional/opt
(i32.const 3)
(i32.const 4)
(i32.const 5)
)
(i32.const 12)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 6)
(i32.const 0)
)
(unreachable)
)
)
)
)

View File

@ -0,0 +1,6 @@
function opt(a: i32, b: i32 = -1, c: i32 = -2): i32 {
return a + b + c;
}
assert(opt(3) == 0); // calls the trampoline with N=0
assert(opt(3, 4) == 5); // calls the trampoline with N=1
assert(opt(3, 4, 5) == 12); // calls the function directly

View File

@ -0,0 +1,115 @@
(module
(type $iiii (func (param i32 i32 i32) (result i32)))
(type $iiiii (func (param i32 i32 i32 i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
(global $HEAP_BASE i32 (i32.const 40))
(memory $0 1)
(data (i32.const 4) "\10\00\00\00c\00a\00l\00l\00-\00o\00p\00t\00i\00o\00n\00a\00l\00.\00t\00s\00")
(export "memory" (memory $0))
(start $start)
(func $call-optional/opt (; 1 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(return
(i32.add
(i32.add
(get_local $0)
(get_local $1)
)
(get_local $2)
)
)
)
(func $call-optional/opt|trampoline (; 2 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(block $N=2
(block $N=1
(block $N=0
(block $N=invalid
(br_table $N=0 $N=1 $N=2 $N=invalid
(get_local $3)
)
)
(unreachable)
)
(set_local $1
(i32.const -1)
)
)
(set_local $2
(i32.const -2)
)
)
(call $call-optional/opt
(get_local $0)
(get_local $1)
(get_local $2)
)
)
(func $start (; 3 ;) (type $v)
(if
(i32.eqz
(i32.eq
(call $call-optional/opt|trampoline
(i32.const 3)
(i32.const 0)
(i32.const 0)
(i32.const 0)
)
(i32.const 0)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 4)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(call $call-optional/opt|trampoline
(i32.const 3)
(i32.const 4)
(i32.const 0)
(i32.const 1)
)
(i32.const 5)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 5)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(call $call-optional/opt
(i32.const 3)
(i32.const 4)
(i32.const 5)
)
(i32.const 12)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 6)
(i32.const 0)
)
(unreachable)
)
)
)
)

View File

@ -1,9 +1,9 @@
(module
(type $iii (func (param i32 i32) (result i32)))
(type $fff (func (param f32 f32) (result f32)))
(type $ii (func (param i32) (result i32)))
(type $iiii (func (param i32 i32 i32) (result i32)))
(type $ifff (func (param i32 f32 f32) (result f32)))
(type $ii (func (param i32) (result i32)))
(type $v (func))
(global $class/Animal.ONE (mut i32) (i32.const 1))
(memory $0 1)

View File

@ -2,9 +2,9 @@
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $iii (func (param i32 i32) (result i32)))
(type $fff (func (param f32 f32) (result f32)))
(type $ii (func (param i32) (result i32)))
(type $iiii (func (param i32 i32 i32) (result i32)))
(type $ifff (func (param i32 f32 f32) (result f32)))
(type $ii (func (param i32) (result i32)))
(type $v (func))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
(global $class/Animal.ONE (mut i32) (i32.const 1))

View File

@ -1,28 +1,188 @@
(module
(type $ii (func (param i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func))
(table 3 3 anyfunc)
(elem (i32.const 0) $start~anonymous|0 $start~anonymous|0 $start~someName|2)
(type $i (func (result i32)))
(type $iii (func (param i32 i32) (result i32)))
(type $fff (func (param f32 f32) (result f32)))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
(global $function-expression/f1 (mut i32) (i32.const 0))
(global $function-expression/f2 (mut i32) (i32.const 1))
(global $function-expression/f3 (mut i32) (i32.const 2))
(global $function-expression/i32Adder (mut i32) (i32.const 0))
(global $function-expression/f32Adder (mut i32) (i32.const 0))
(global $function-expression/i8Adder (mut i32) (i32.const 0))
(table 6 6 anyfunc)
(elem (i32.const 0) $start~anonymous|0 $start~anonymous|0 $start~someName|2 $function-expression/makeAdder<i32>~theAdder|3 $function-expression/makeAdder<f32>~theAdder|4 $function-expression/makeAdderArrow<i8>~anonymous|5)
(memory $0 1)
(data (i32.const 4) "\16\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00e\00x\00p\00r\00e\00s\00s\00i\00o\00n\00.\00t\00s")
(export "memory" (memory $0))
(start $start)
(func $start~anonymous|0 (; 0 ;) (type $ii) (param $0 i32) (result i32)
(func $start~anonymous|0 (; 1 ;) (type $ii) (param $0 i32) (result i32)
(get_local $0)
)
(func $start~someName|2 (; 1 ;) (type $v)
(func $start~someName|2 (; 2 ;) (type $v)
(nop)
)
(func $start (; 2 ;) (type $v)
(drop
(call $start~anonymous|0
(func $function-expression/makeAdder<i32>~theAdder|3 (; 3 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.add
(get_local $0)
(get_local $1)
)
)
(func $function-expression/makeAdder<i32> (; 4 ;) (type $i) (result i32)
(i32.const 3)
)
(func $function-expression/makeAdder<f32>~theAdder|4 (; 5 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32)
(f32.add
(get_local $0)
(get_local $1)
)
)
(func $function-expression/makeAdder<f32> (; 6 ;) (type $i) (result i32)
(i32.const 4)
)
(func $function-expression/makeAdderArrow<i8>~anonymous|5 (; 7 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.shr_s
(i32.shl
(i32.add
(get_local $0)
(get_local $1)
)
(i32.const 24)
)
(i32.const 24)
)
)
(func $function-expression/makeAdderArrow<i8> (; 8 ;) (type $i) (result i32)
(i32.const 5)
)
(func $start (; 9 ;) (type $v)
(if
(i32.ne
(call_indirect (type $ii)
(i32.const 1)
(get_global $function-expression/f1)
)
(i32.const 1)
)
)
(drop
(call $start~anonymous|0
(i32.const 2)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 4)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.ne
(call_indirect (type $ii)
(i32.const 2)
(get_global $function-expression/f2)
)
(i32.const 2)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 9)
(i32.const 0)
)
(unreachable)
)
)
(call_indirect (type $v)
(get_global $function-expression/f3)
)
(set_global $function-expression/i32Adder
(call $function-expression/makeAdder<i32>)
)
(if
(i32.ne
(call_indirect (type $iii)
(i32.const 4)
(i32.const 2)
(get_global $function-expression/i32Adder)
)
(i32.const 6)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 22)
(i32.const 0)
)
(unreachable)
)
)
(set_global $function-expression/f32Adder
(call $function-expression/makeAdder<f32>)
)
(if
(f32.ne
(call_indirect (type $fff)
(f32.const 1.5)
(f32.const 2.5)
(get_global $function-expression/f32Adder)
)
(f32.const 4)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 25)
(i32.const 0)
)
(unreachable)
)
)
(set_global $function-expression/i8Adder
(call $function-expression/makeAdderArrow<i8>)
)
(if
(i32.ne
(call_indirect (type $iii)
(i32.const 127)
(i32.const 127)
(get_global $function-expression/i8Adder)
)
(i32.const -2)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 34)
(i32.const 0)
)
(unreachable)
)
)
(set_global $function-expression/f1
(get_global $function-expression/f2)
)
(if
(i32.ne
(call_indirect (type $ii)
(i32.const 4)
(get_global $function-expression/f1)
)
(i32.const 4)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 37)
(i32.const 0)
)
(unreachable)
)
)
(call $start~someName|2)
)
)

View File

@ -1,11 +1,37 @@
var f1 = function(a: i32): i32 {
return a;
};
f1(1);
assert(f1(1) == 1);
var f2 = (a: i32): i32 => {
return a;
};
f2(2);
assert(f2(2) == 2);
var f3 = function someName(): void {
};
f3();
function makeAdder<T>(): (a: T, b: T) => T {
return function theAdder(a: T, b: T): T {
return a + b;
};
}
var i32Adder = makeAdder<i32>();
assert(i32Adder(4, 2) == 6);
var f32Adder = makeAdder<f32>();
assert(f32Adder(1.5, 2.5) == 4.0);
function makeAdderArrow<T>(): (a: T, b: T) => T {
return (a: T, b: T): T => {
return a + b;
};
}
var i8Adder = makeAdderArrow<i8>();
assert(i8Adder(127, 127) == -2);
f1 = f2;
assert(f1(4) == 4);

View File

@ -1,38 +1,219 @@
(module
(type $ii (func (param i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func))
(type $i (func (result i32)))
(type $iii (func (param i32 i32) (result i32)))
(type $fff (func (param f32 f32) (result f32)))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
(global $function-expression/f1 (mut i32) (i32.const 0))
(global $function-expression/f2 (mut i32) (i32.const 1))
(global $function-expression/f3 (mut i32) (i32.const 2))
(global $HEAP_BASE i32 (i32.const 4))
(table 3 3 anyfunc)
(elem (i32.const 0) $start~anonymous|0 $start~anonymous|1 $start~someName|2)
(global $function-expression/i32Adder (mut i32) (i32.const 0))
(global $function-expression/f32Adder (mut i32) (i32.const 0))
(global $function-expression/i8Adder (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 52))
(table 6 6 anyfunc)
(elem (i32.const 0) $start~anonymous|0 $start~anonymous|1 $start~someName|2 $function-expression/makeAdder<i32>~theAdder|3 $function-expression/makeAdder<f32>~theAdder|4 $function-expression/makeAdderArrow<i8>~anonymous|5)
(memory $0 1)
(data (i32.const 4) "\16\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00e\00x\00p\00r\00e\00s\00s\00i\00o\00n\00.\00t\00s\00")
(export "memory" (memory $0))
(start $start)
(func $start~anonymous|0 (; 0 ;) (type $ii) (param $0 i32) (result i32)
(func $start~anonymous|0 (; 1 ;) (type $ii) (param $0 i32) (result i32)
(return
(get_local $0)
)
)
(func $start~anonymous|1 (; 1 ;) (type $ii) (param $0 i32) (result i32)
(func $start~anonymous|1 (; 2 ;) (type $ii) (param $0 i32) (result i32)
(return
(get_local $0)
)
)
(func $start~someName|2 (; 2 ;) (type $v)
(func $start~someName|2 (; 3 ;) (type $v)
)
(func $start (; 3 ;) (type $v)
(drop
(call $start~anonymous|0
(i32.const 1)
(func $function-expression/makeAdder<i32>~theAdder|3 (; 4 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(return
(i32.add
(get_local $0)
(get_local $1)
)
)
(drop
(call $start~anonymous|1
(i32.const 2)
)
(func $function-expression/makeAdder<i32> (; 5 ;) (type $i) (result i32)
(return
(i32.const 3)
)
)
(func $function-expression/makeAdder<f32>~theAdder|4 (; 6 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32)
(return
(f32.add
(get_local $0)
(get_local $1)
)
)
)
(func $function-expression/makeAdder<f32> (; 7 ;) (type $i) (result i32)
(return
(i32.const 4)
)
)
(func $function-expression/makeAdderArrow<i8>~anonymous|5 (; 8 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(return
(i32.shr_s
(i32.shl
(i32.add
(get_local $0)
(get_local $1)
)
(i32.const 24)
)
(i32.const 24)
)
)
)
(func $function-expression/makeAdderArrow<i8> (; 9 ;) (type $i) (result i32)
(return
(i32.const 5)
)
)
(func $start (; 10 ;) (type $v)
(if
(i32.eqz
(i32.eq
(call_indirect (type $ii)
(i32.const 1)
(get_global $function-expression/f1)
)
(i32.const 1)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 4)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(call_indirect (type $ii)
(i32.const 2)
(get_global $function-expression/f2)
)
(i32.const 2)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 9)
(i32.const 0)
)
(unreachable)
)
)
(call_indirect (type $v)
(get_global $function-expression/f3)
)
(set_global $function-expression/i32Adder
(call $function-expression/makeAdder<i32>)
)
(if
(i32.eqz
(i32.eq
(call_indirect (type $iii)
(i32.const 4)
(i32.const 2)
(get_global $function-expression/i32Adder)
)
(i32.const 6)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 22)
(i32.const 0)
)
(unreachable)
)
)
(set_global $function-expression/f32Adder
(call $function-expression/makeAdder<f32>)
)
(if
(i32.eqz
(f32.eq
(call_indirect (type $fff)
(f32.const 1.5)
(f32.const 2.5)
(get_global $function-expression/f32Adder)
)
(f32.const 4)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 25)
(i32.const 0)
)
(unreachable)
)
)
(set_global $function-expression/i8Adder
(call $function-expression/makeAdderArrow<i8>)
)
(if
(i32.eqz
(i32.eq
(call_indirect (type $iii)
(i32.const 127)
(i32.const 127)
(get_global $function-expression/i8Adder)
)
(i32.const -2)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 34)
(i32.const 0)
)
(unreachable)
)
)
(set_global $function-expression/f1
(get_global $function-expression/f2)
)
(if
(i32.eqz
(i32.eq
(call_indirect (type $ii)
(i32.const 4)
(get_global $function-expression/f1)
)
(i32.const 4)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 37)
(i32.const 0)
)
(unreachable)
)
)
(call $start~someName|2)
)
)

View File

@ -1,6 +1,6 @@
(module
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $iiv (func (param i32 i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
(global $retain-i32/si (mut i32) (i32.const 0))

View File

@ -1,6 +1,6 @@
(module
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $iiv (func (param i32 i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
(global $retain-i32/si (mut i32) (i32.const 0))

View File

@ -6,7 +6,7 @@
(type $iv (func (param i32)))
(type $v (func))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
(global "$(lib)/allocator/arena/OFFSET" (mut i32) (i32.const 0))
(global "$(lib)/allocator/arena/offset" (mut i32) (i32.const 0))
(global $std/allocator_arena/ptr1 (mut i32) (i32.const 0))
(global $std/allocator_arena/ptr2 (mut i32) (i32.const 0))
(global $std/allocator_arena/i (mut i32) (i32.const 0))
@ -35,7 +35,7 @@
(i32.add
(i32.add
(tee_local $1
(get_global "$(lib)/allocator/arena/OFFSET")
(get_global "$(lib)/allocator/arena/offset")
)
(get_local $0)
)
@ -92,7 +92,7 @@
)
)
)
(set_global "$(lib)/allocator/arena/OFFSET"
(set_global "$(lib)/allocator/arena/offset"
(get_local $2)
)
(get_local $1)
@ -2360,7 +2360,7 @@
(nop)
)
(func "$(lib)/allocator/arena/reset_memory" (; 7 ;) (type $v)
(set_global "$(lib)/allocator/arena/OFFSET"
(set_global "$(lib)/allocator/arena/offset"
(i32.and
(i32.add
(get_global $HEAP_BASE)
@ -2371,7 +2371,7 @@
)
)
(func $start (; 8 ;) (type $v)
(set_global "$(lib)/allocator/arena/OFFSET"
(set_global "$(lib)/allocator/arena/offset"
(i32.and
(i32.add
(get_global $HEAP_BASE)

View File

@ -7,10 +7,10 @@
(type $iv (func (param i32)))
(type $v (func))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
(global "$(lib)/allocator/arena/AL_BITS" i32 (i32.const 3))
(global "$(lib)/allocator/arena/AL_SIZE" i32 (i32.const 8))
(global "$(lib)/allocator/arena/AL_MASK" i32 (i32.const 7))
(global "$(lib)/allocator/arena/OFFSET" (mut i32) (i32.const 0))
(global "$(lib)/allocator/common/alignment/BITS" i32 (i32.const 3))
(global "$(lib)/allocator/common/alignment/SIZE" i32 (i32.const 8))
(global "$(lib)/allocator/common/alignment/MASK" i32 (i32.const 7))
(global "$(lib)/allocator/arena/offset" (mut i32) (i32.const 0))
(global $std/allocator_arena/size i32 (i32.const 42))
(global $std/allocator_arena/ptr1 (mut i32) (i32.const 0))
(global $std/allocator_arena/ptr2 (mut i32) (i32.const 0))
@ -37,7 +37,7 @@
)
)
(set_local $1
(get_global "$(lib)/allocator/arena/OFFSET")
(get_global "$(lib)/allocator/arena/offset")
)
(set_local $2
(i32.and
@ -117,7 +117,7 @@
)
)
)
(set_global "$(lib)/allocator/arena/OFFSET"
(set_global "$(lib)/allocator/arena/offset"
(get_local $2)
)
(return
@ -777,6 +777,232 @@
)
(br $break|2)
)
(block
(set_local $3
(i32.load
(get_local $1)
)
)
(i32.store8
(block (result i32)
(set_local $5
(get_local $0)
)
(set_local $0
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
(i32.load8_u
(block (result i32)
(set_local $5
(get_local $1)
)
(set_local $1
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
)
)
(i32.store8
(block (result i32)
(set_local $5
(get_local $0)
)
(set_local $0
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
(i32.load8_u
(block (result i32)
(set_local $5
(get_local $1)
)
(set_local $1
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
)
)
(i32.store8
(block (result i32)
(set_local $5
(get_local $0)
)
(set_local $0
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
(i32.load8_u
(block (result i32)
(set_local $5
(get_local $1)
)
(set_local $1
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
)
)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 3)
)
)
(block $break|3
(loop $continue|3
(if
(i32.ge_u
(get_local $2)
(i32.const 17)
)
(block
(block
(set_local $4
(i32.load
(i32.add
(get_local $1)
(i32.const 1)
)
)
)
(i32.store
(get_local $0)
(i32.or
(i32.shr_u
(get_local $3)
(i32.const 24)
)
(i32.shl
(get_local $4)
(i32.const 8)
)
)
)
(set_local $3
(i32.load
(i32.add
(get_local $1)
(i32.const 5)
)
)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 4)
)
(i32.or
(i32.shr_u
(get_local $4)
(i32.const 24)
)
(i32.shl
(get_local $3)
(i32.const 8)
)
)
)
(set_local $4
(i32.load
(i32.add
(get_local $1)
(i32.const 9)
)
)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 8)
)
(i32.or
(i32.shr_u
(get_local $3)
(i32.const 24)
)
(i32.shl
(get_local $4)
(i32.const 8)
)
)
)
(set_local $3
(i32.load
(i32.add
(get_local $1)
(i32.const 13)
)
)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 12)
)
(i32.or
(i32.shr_u
(get_local $4)
(i32.const 24)
)
(i32.shl
(get_local $3)
(i32.const 8)
)
)
)
(set_local $1
(i32.add
(get_local $1)
(i32.const 16)
)
)
(set_local $0
(i32.add
(get_local $0)
(i32.const 16)
)
)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 16)
)
)
)
(br $continue|3)
)
)
)
)
(br $break|2)
)
)
(block
(set_local $3
(i32.load
(get_local $1)
@ -838,46 +1064,18 @@
)
)
)
(i32.store8
(block (result i32)
(set_local $5
(get_local $0)
)
(set_local $0
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
(i32.load8_u
(block (result i32)
(set_local $5
(get_local $1)
)
(set_local $1
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
)
)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 3)
(i32.const 2)
)
)
(block $break|3
(loop $continue|3
(block $break|4
(loop $continue|4
(if
(i32.ge_u
(get_local $2)
(i32.const 17)
(i32.const 18)
)
(block
(block
@ -885,7 +1083,7 @@
(i32.load
(i32.add
(get_local $1)
(i32.const 1)
(i32.const 2)
)
)
)
@ -894,11 +1092,11 @@
(i32.or
(i32.shr_u
(get_local $3)
(i32.const 24)
(i32.const 16)
)
(i32.shl
(get_local $4)
(i32.const 8)
(i32.const 16)
)
)
)
@ -906,7 +1104,7 @@
(i32.load
(i32.add
(get_local $1)
(i32.const 5)
(i32.const 6)
)
)
)
@ -918,11 +1116,11 @@
(i32.or
(i32.shr_u
(get_local $4)
(i32.const 24)
(i32.const 16)
)
(i32.shl
(get_local $3)
(i32.const 8)
(i32.const 16)
)
)
)
@ -930,7 +1128,7 @@
(i32.load
(i32.add
(get_local $1)
(i32.const 9)
(i32.const 10)
)
)
)
@ -942,11 +1140,11 @@
(i32.or
(i32.shr_u
(get_local $3)
(i32.const 24)
(i32.const 16)
)
(i32.shl
(get_local $4)
(i32.const 8)
(i32.const 16)
)
)
)
@ -954,7 +1152,7 @@
(i32.load
(i32.add
(get_local $1)
(i32.const 13)
(i32.const 14)
)
)
)
@ -966,11 +1164,11 @@
(i32.or
(i32.shr_u
(get_local $4)
(i32.const 24)
(i32.const 16)
)
(i32.shl
(get_local $3)
(i32.const 8)
(i32.const 16)
)
)
)
@ -993,13 +1191,15 @@
)
)
)
(br $continue|3)
(br $continue|4)
)
)
)
)
(br $break|2)
)
)
(block
(set_local $3
(i32.load
(get_local $1)
@ -1033,46 +1233,18 @@
)
)
)
(i32.store8
(block (result i32)
(set_local $5
(get_local $0)
)
(set_local $0
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
(i32.load8_u
(block (result i32)
(set_local $5
(get_local $1)
)
(set_local $1
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
)
)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 2)
(i32.const 1)
)
)
(block $break|4
(loop $continue|4
(block $break|5
(loop $continue|5
(if
(i32.ge_u
(get_local $2)
(i32.const 18)
(i32.const 19)
)
(block
(block
@ -1080,7 +1252,7 @@
(i32.load
(i32.add
(get_local $1)
(i32.const 2)
(i32.const 3)
)
)
)
@ -1089,11 +1261,11 @@
(i32.or
(i32.shr_u
(get_local $3)
(i32.const 16)
(i32.const 8)
)
(i32.shl
(get_local $4)
(i32.const 16)
(i32.const 24)
)
)
)
@ -1101,7 +1273,7 @@
(i32.load
(i32.add
(get_local $1)
(i32.const 6)
(i32.const 7)
)
)
)
@ -1113,11 +1285,11 @@
(i32.or
(i32.shr_u
(get_local $4)
(i32.const 16)
(i32.const 8)
)
(i32.shl
(get_local $3)
(i32.const 16)
(i32.const 24)
)
)
)
@ -1125,7 +1297,7 @@
(i32.load
(i32.add
(get_local $1)
(i32.const 10)
(i32.const 11)
)
)
)
@ -1137,11 +1309,11 @@
(i32.or
(i32.shr_u
(get_local $3)
(i32.const 16)
(i32.const 8)
)
(i32.shl
(get_local $4)
(i32.const 16)
(i32.const 24)
)
)
)
@ -1149,7 +1321,7 @@
(i32.load
(i32.add
(get_local $1)
(i32.const 14)
(i32.const 15)
)
)
)
@ -1161,11 +1333,11 @@
(i32.or
(i32.shr_u
(get_local $4)
(i32.const 16)
(i32.const 8)
)
(i32.shl
(get_local $3)
(i32.const 16)
(i32.const 24)
)
)
)
@ -1188,179 +1360,13 @@
)
)
)
(br $continue|4)
(br $continue|5)
)
)
)
)
(br $break|2)
)
(set_local $3
(i32.load
(get_local $1)
)
)
(i32.store8
(block (result i32)
(set_local $5
(get_local $0)
)
(set_local $0
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
(i32.load8_u
(block (result i32)
(set_local $5
(get_local $1)
)
(set_local $1
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
)
)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 1)
)
)
(block $break|5
(loop $continue|5
(if
(i32.ge_u
(get_local $2)
(i32.const 19)
)
(block
(block
(set_local $4
(i32.load
(i32.add
(get_local $1)
(i32.const 3)
)
)
)
(i32.store
(get_local $0)
(i32.or
(i32.shr_u
(get_local $3)
(i32.const 8)
)
(i32.shl
(get_local $4)
(i32.const 24)
)
)
)
(set_local $3
(i32.load
(i32.add
(get_local $1)
(i32.const 7)
)
)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 4)
)
(i32.or
(i32.shr_u
(get_local $4)
(i32.const 8)
)
(i32.shl
(get_local $3)
(i32.const 24)
)
)
)
(set_local $4
(i32.load
(i32.add
(get_local $1)
(i32.const 11)
)
)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 8)
)
(i32.or
(i32.shr_u
(get_local $3)
(i32.const 8)
)
(i32.shl
(get_local $4)
(i32.const 24)
)
)
)
(set_local $3
(i32.load
(i32.add
(get_local $1)
(i32.const 15)
)
)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 12)
)
(i32.or
(i32.shr_u
(get_local $4)
(i32.const 8)
)
(i32.shl
(get_local $3)
(i32.const 24)
)
)
)
(set_local $1
(i32.add
(get_local $1)
(i32.const 16)
)
)
(set_local $0
(i32.add
(get_local $0)
(i32.const 16)
)
)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 16)
)
)
)
(br $continue|5)
)
)
)
)
(br $break|2)
)
)
(if
@ -2662,7 +2668,7 @@
(func "$(lib)/allocator/arena/free_memory" (; 6 ;) (type $iv) (param $0 i32)
)
(func "$(lib)/allocator/arena/reset_memory" (; 7 ;) (type $v)
(set_global "$(lib)/allocator/arena/OFFSET"
(set_global "$(lib)/allocator/arena/offset"
(i32.and
(i32.add
(get_global $HEAP_BASE)
@ -2676,7 +2682,7 @@
)
)
(func $start (; 8 ;) (type $v)
(set_global "$(lib)/allocator/arena/OFFSET"
(set_global "$(lib)/allocator/arena/offset"
(i32.and
(i32.add
(get_global $HEAP_BASE)

View File

@ -1,14 +1,15 @@
(module
(type $ii (func (param i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $iii (func (param i32 i32) (result i32)))
(type $iiv (func (param i32 i32)))
(type $iiiv (func (param i32 i32 i32)))
(type $iv (func (param i32)))
(type $iiv (func (param i32 i32)))
(type $iii (func (param i32 i32) (result i32)))
(type $iiii (func (param i32 i32 i32) (result i32)))
(type $iiiii (func (param i32 i32 i32 i32) (result i32)))
(type $v (func))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
(global "$(lib)/allocator/arena/OFFSET" (mut i32) (i32.const 0))
(global "$(lib)/allocator/arena/offset" (mut i32) (i32.const 0))
(global $std/array/arr (mut i32) (i32.const 0))
(global $std/array/i (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 64))
@ -37,7 +38,7 @@
(i32.add
(i32.add
(tee_local $1
(get_global "$(lib)/allocator/arena/OFFSET")
(get_global "$(lib)/allocator/arena/offset")
)
(get_local $0)
)
@ -94,7 +95,7 @@
)
)
)
(set_global "$(lib)/allocator/arena/OFFSET"
(set_global "$(lib)/allocator/arena/offset"
(get_local $2)
)
(get_local $1)
@ -2803,7 +2804,27 @@
)
(i32.const -1)
)
(func "$(lib)/array/Array#splice" (; 15 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(func "$(lib)/array/Array#indexOf|trampoline" (; 15 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(block $N=1
(block $N=0
(block $N=invalid
(br_table $N=0 $N=1 $N=invalid
(get_local $3)
)
)
(unreachable)
)
(set_local $2
(i32.const 0)
)
)
(call "$(lib)/array/Array#indexOf"
(get_local $0)
(get_local $1)
(get_local $2)
)
)
(func "$(lib)/array/Array#splice" (; 16 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(if
(i32.lt_s
(get_local $2)
@ -2904,8 +2925,8 @@
)
)
)
(func $start (; 16 ;) (type $v)
(set_global "$(lib)/allocator/arena/OFFSET"
(func $start (; 17 ;) (type $v)
(set_global "$(lib)/allocator/arena/offset"
(i32.and
(i32.add
(get_global $HEAP_BASE)
@ -3854,10 +3875,11 @@
)
)
(set_global $std/array/i
(call "$(lib)/array/Array#indexOf"
(call "$(lib)/array/Array#indexOf|trampoline"
(get_global $std/array/arr)
(i32.const 44)
(i32.const 0)
(i32.const 0)
)
)
(if
@ -3873,10 +3895,11 @@
)
)
(set_global $std/array/i
(call "$(lib)/array/Array#indexOf"
(call "$(lib)/array/Array#indexOf|trampoline"
(get_global $std/array/arr)
(i32.const 42)
(i32.const 0)
(i32.const 0)
)
)
(if
@ -3895,10 +3918,11 @@
)
)
(set_global $std/array/i
(call "$(lib)/array/Array#indexOf"
(call "$(lib)/array/Array#indexOf|trampoline"
(get_global $std/array/arr)
(i32.const 45)
(i32.const 0)
(i32.const 0)
)
)
(if

View File

@ -2,17 +2,18 @@
(type $i (func (result i32)))
(type $ii (func (param i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $iii (func (param i32 i32) (result i32)))
(type $iiv (func (param i32 i32)))
(type $iiiv (func (param i32 i32 i32)))
(type $iv (func (param i32)))
(type $iiv (func (param i32 i32)))
(type $iii (func (param i32 i32) (result i32)))
(type $iiii (func (param i32 i32 i32) (result i32)))
(type $iiiii (func (param i32 i32 i32 i32) (result i32)))
(type $v (func))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
(global "$(lib)/allocator/arena/AL_BITS" i32 (i32.const 3))
(global "$(lib)/allocator/arena/AL_SIZE" i32 (i32.const 8))
(global "$(lib)/allocator/arena/AL_MASK" i32 (i32.const 7))
(global "$(lib)/allocator/arena/OFFSET" (mut i32) (i32.const 0))
(global "$(lib)/allocator/common/alignment/BITS" i32 (i32.const 3))
(global "$(lib)/allocator/common/alignment/SIZE" i32 (i32.const 8))
(global "$(lib)/allocator/common/alignment/MASK" i32 (i32.const 7))
(global "$(lib)/allocator/arena/offset" (mut i32) (i32.const 0))
(global $std/array/arr (mut i32) (i32.const 0))
(global $std/array/i (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 64))
@ -38,7 +39,7 @@
)
)
(set_local $1
(get_global "$(lib)/allocator/arena/OFFSET")
(get_global "$(lib)/allocator/arena/offset")
)
(set_local $2
(i32.and
@ -118,7 +119,7 @@
)
)
)
(set_global "$(lib)/allocator/arena/OFFSET"
(set_global "$(lib)/allocator/arena/offset"
(get_local $2)
)
(return
@ -436,6 +437,232 @@
)
(br $break|2)
)
(block
(set_local $3
(i32.load
(get_local $1)
)
)
(i32.store8
(block (result i32)
(set_local $5
(get_local $0)
)
(set_local $0
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
(i32.load8_u
(block (result i32)
(set_local $5
(get_local $1)
)
(set_local $1
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
)
)
(i32.store8
(block (result i32)
(set_local $5
(get_local $0)
)
(set_local $0
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
(i32.load8_u
(block (result i32)
(set_local $5
(get_local $1)
)
(set_local $1
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
)
)
(i32.store8
(block (result i32)
(set_local $5
(get_local $0)
)
(set_local $0
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
(i32.load8_u
(block (result i32)
(set_local $5
(get_local $1)
)
(set_local $1
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
)
)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 3)
)
)
(block $break|3
(loop $continue|3
(if
(i32.ge_u
(get_local $2)
(i32.const 17)
)
(block
(block
(set_local $4
(i32.load
(i32.add
(get_local $1)
(i32.const 1)
)
)
)
(i32.store
(get_local $0)
(i32.or
(i32.shr_u
(get_local $3)
(i32.const 24)
)
(i32.shl
(get_local $4)
(i32.const 8)
)
)
)
(set_local $3
(i32.load
(i32.add
(get_local $1)
(i32.const 5)
)
)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 4)
)
(i32.or
(i32.shr_u
(get_local $4)
(i32.const 24)
)
(i32.shl
(get_local $3)
(i32.const 8)
)
)
)
(set_local $4
(i32.load
(i32.add
(get_local $1)
(i32.const 9)
)
)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 8)
)
(i32.or
(i32.shr_u
(get_local $3)
(i32.const 24)
)
(i32.shl
(get_local $4)
(i32.const 8)
)
)
)
(set_local $3
(i32.load
(i32.add
(get_local $1)
(i32.const 13)
)
)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 12)
)
(i32.or
(i32.shr_u
(get_local $4)
(i32.const 24)
)
(i32.shl
(get_local $3)
(i32.const 8)
)
)
)
(set_local $1
(i32.add
(get_local $1)
(i32.const 16)
)
)
(set_local $0
(i32.add
(get_local $0)
(i32.const 16)
)
)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 16)
)
)
)
(br $continue|3)
)
)
)
)
(br $break|2)
)
)
(block
(set_local $3
(i32.load
(get_local $1)
@ -497,46 +724,18 @@
)
)
)
(i32.store8
(block (result i32)
(set_local $5
(get_local $0)
)
(set_local $0
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
(i32.load8_u
(block (result i32)
(set_local $5
(get_local $1)
)
(set_local $1
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
)
)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 3)
(i32.const 2)
)
)
(block $break|3
(loop $continue|3
(block $break|4
(loop $continue|4
(if
(i32.ge_u
(get_local $2)
(i32.const 17)
(i32.const 18)
)
(block
(block
@ -544,7 +743,7 @@
(i32.load
(i32.add
(get_local $1)
(i32.const 1)
(i32.const 2)
)
)
)
@ -553,11 +752,11 @@
(i32.or
(i32.shr_u
(get_local $3)
(i32.const 24)
(i32.const 16)
)
(i32.shl
(get_local $4)
(i32.const 8)
(i32.const 16)
)
)
)
@ -565,7 +764,7 @@
(i32.load
(i32.add
(get_local $1)
(i32.const 5)
(i32.const 6)
)
)
)
@ -577,11 +776,11 @@
(i32.or
(i32.shr_u
(get_local $4)
(i32.const 24)
(i32.const 16)
)
(i32.shl
(get_local $3)
(i32.const 8)
(i32.const 16)
)
)
)
@ -589,7 +788,7 @@
(i32.load
(i32.add
(get_local $1)
(i32.const 9)
(i32.const 10)
)
)
)
@ -601,11 +800,11 @@
(i32.or
(i32.shr_u
(get_local $3)
(i32.const 24)
(i32.const 16)
)
(i32.shl
(get_local $4)
(i32.const 8)
(i32.const 16)
)
)
)
@ -613,7 +812,7 @@
(i32.load
(i32.add
(get_local $1)
(i32.const 13)
(i32.const 14)
)
)
)
@ -625,11 +824,11 @@
(i32.or
(i32.shr_u
(get_local $4)
(i32.const 24)
(i32.const 16)
)
(i32.shl
(get_local $3)
(i32.const 8)
(i32.const 16)
)
)
)
@ -652,13 +851,15 @@
)
)
)
(br $continue|3)
(br $continue|4)
)
)
)
)
(br $break|2)
)
)
(block
(set_local $3
(i32.load
(get_local $1)
@ -692,46 +893,18 @@
)
)
)
(i32.store8
(block (result i32)
(set_local $5
(get_local $0)
)
(set_local $0
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
(i32.load8_u
(block (result i32)
(set_local $5
(get_local $1)
)
(set_local $1
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
)
)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 2)
(i32.const 1)
)
)
(block $break|4
(loop $continue|4
(block $break|5
(loop $continue|5
(if
(i32.ge_u
(get_local $2)
(i32.const 18)
(i32.const 19)
)
(block
(block
@ -739,7 +912,7 @@
(i32.load
(i32.add
(get_local $1)
(i32.const 2)
(i32.const 3)
)
)
)
@ -748,11 +921,11 @@
(i32.or
(i32.shr_u
(get_local $3)
(i32.const 16)
(i32.const 8)
)
(i32.shl
(get_local $4)
(i32.const 16)
(i32.const 24)
)
)
)
@ -760,7 +933,7 @@
(i32.load
(i32.add
(get_local $1)
(i32.const 6)
(i32.const 7)
)
)
)
@ -772,11 +945,11 @@
(i32.or
(i32.shr_u
(get_local $4)
(i32.const 16)
(i32.const 8)
)
(i32.shl
(get_local $3)
(i32.const 16)
(i32.const 24)
)
)
)
@ -784,7 +957,7 @@
(i32.load
(i32.add
(get_local $1)
(i32.const 10)
(i32.const 11)
)
)
)
@ -796,11 +969,11 @@
(i32.or
(i32.shr_u
(get_local $3)
(i32.const 16)
(i32.const 8)
)
(i32.shl
(get_local $4)
(i32.const 16)
(i32.const 24)
)
)
)
@ -808,7 +981,7 @@
(i32.load
(i32.add
(get_local $1)
(i32.const 14)
(i32.const 15)
)
)
)
@ -820,11 +993,11 @@
(i32.or
(i32.shr_u
(get_local $4)
(i32.const 16)
(i32.const 8)
)
(i32.shl
(get_local $3)
(i32.const 16)
(i32.const 24)
)
)
)
@ -847,179 +1020,13 @@
)
)
)
(br $continue|4)
(br $continue|5)
)
)
)
)
(br $break|2)
)
(set_local $3
(i32.load
(get_local $1)
)
)
(i32.store8
(block (result i32)
(set_local $5
(get_local $0)
)
(set_local $0
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
(i32.load8_u
(block (result i32)
(set_local $5
(get_local $1)
)
(set_local $1
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
)
)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 1)
)
)
(block $break|5
(loop $continue|5
(if
(i32.ge_u
(get_local $2)
(i32.const 19)
)
(block
(block
(set_local $4
(i32.load
(i32.add
(get_local $1)
(i32.const 3)
)
)
)
(i32.store
(get_local $0)
(i32.or
(i32.shr_u
(get_local $3)
(i32.const 8)
)
(i32.shl
(get_local $4)
(i32.const 24)
)
)
)
(set_local $3
(i32.load
(i32.add
(get_local $1)
(i32.const 7)
)
)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 4)
)
(i32.or
(i32.shr_u
(get_local $4)
(i32.const 8)
)
(i32.shl
(get_local $3)
(i32.const 24)
)
)
)
(set_local $4
(i32.load
(i32.add
(get_local $1)
(i32.const 11)
)
)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 8)
)
(i32.or
(i32.shr_u
(get_local $3)
(i32.const 8)
)
(i32.shl
(get_local $4)
(i32.const 24)
)
)
)
(set_local $3
(i32.load
(i32.add
(get_local $1)
(i32.const 15)
)
)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 12)
)
(i32.or
(i32.shr_u
(get_local $4)
(i32.const 8)
)
(i32.shl
(get_local $3)
(i32.const 24)
)
)
)
(set_local $1
(i32.add
(get_local $1)
(i32.const 16)
)
)
(set_local $0
(i32.add
(get_local $0)
(i32.const 16)
)
)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 16)
)
)
)
(br $continue|5)
)
)
)
)
(br $break|2)
)
)
(if
@ -3143,7 +3150,27 @@
(i32.const -1)
)
)
(func "$(lib)/array/Array#splice" (; 15 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(func "$(lib)/array/Array#indexOf|trampoline" (; 15 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(block $N=1
(block $N=0
(block $N=invalid
(br_table $N=0 $N=1 $N=invalid
(get_local $3)
)
)
(unreachable)
)
(set_local $2
(i32.const 0)
)
)
(call "$(lib)/array/Array#indexOf"
(get_local $0)
(get_local $1)
(get_local $2)
)
)
(func "$(lib)/array/Array#splice" (; 16 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(local $4 i32)
(if
@ -3252,8 +3279,8 @@
)
)
)
(func $start (; 16 ;) (type $v)
(set_global "$(lib)/allocator/arena/OFFSET"
(func $start (; 17 ;) (type $v)
(set_global "$(lib)/allocator/arena/offset"
(i32.and
(i32.add
(get_global $HEAP_BASE)
@ -4322,10 +4349,11 @@
)
)
(set_global $std/array/i
(call "$(lib)/array/Array#indexOf"
(call "$(lib)/array/Array#indexOf|trampoline"
(get_global $std/array/arr)
(i32.const 44)
(i32.const 0)
(i32.const 0)
)
)
(if
@ -4346,10 +4374,11 @@
)
)
(set_global $std/array/i
(call "$(lib)/array/Array#indexOf"
(call "$(lib)/array/Array#indexOf|trampoline"
(get_global $std/array/arr)
(i32.const 42)
(i32.const 0)
(i32.const 0)
)
)
(if
@ -4370,10 +4399,11 @@
)
)
(set_global $std/array/i
(call "$(lib)/array/Array#indexOf"
(call "$(lib)/array/Array#indexOf|trampoline"
(get_global $std/array/arr)
(i32.const 45)
(i32.const 0)
(i32.const 0)
)
)
(if

View File

@ -49,6 +49,7 @@
)
(func $start (; 3 ;) (type $v)
(local $0 i32)
(local $1 i32)
(set_global $std/carray/arr
(get_global $HEAP_BASE)
)
@ -199,14 +200,19 @@
(if
(block (result i32)
(call "$(lib)/array/CArray#__set"
(get_global $std/carray/arr)
(i32.const 3)
(tee_local $0
(i32.const 9000)
(get_global $std/carray/arr)
)
(tee_local $1
(i32.const 3)
)
(i32.const 9000)
)
(i32.ne
(get_local $0)
(call "$(lib)/array/CArray#__get"
(get_local $0)
(get_local $1)
)
(i32.const 9000)
)
)

View File

@ -51,6 +51,7 @@
)
(func $start (; 3 ;) (type $v)
(local $0 i32)
(local $1 i32)
(set_global $std/carray/arr
(get_global $HEAP_BASE)
)
@ -231,13 +232,18 @@
(i32.eq
(block (result i32)
(call "$(lib)/array/CArray#__set"
(get_global $std/carray/arr)
(i32.const 3)
(tee_local $0
(i32.const 9000)
(get_global $std/carray/arr)
)
(tee_local $1
(i32.const 3)
)
(i32.const 9000)
)
(call "$(lib)/array/CArray#__get"
(get_local $0)
(get_local $1)
)
(get_local $0)
)
(i32.const 9000)
)

View File

@ -2,7 +2,7 @@
(type $ii (func (param i32) (result i32)))
(type $ifv (func (param i32 f32)))
(type $v (func))
(global "$(lib)/allocator/arena/OFFSET" (mut i32) (i32.const 0))
(global "$(lib)/allocator/arena/offset" (mut i32) (i32.const 0))
(global $std/new/aClass (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
@ -28,7 +28,7 @@
(i32.add
(i32.add
(tee_local $1
(get_global "$(lib)/allocator/arena/OFFSET")
(get_global "$(lib)/allocator/arena/offset")
)
(get_local $0)
)
@ -85,7 +85,7 @@
)
)
)
(set_global "$(lib)/allocator/arena/OFFSET"
(set_global "$(lib)/allocator/arena/offset"
(get_local $2)
)
(get_local $1)
@ -107,7 +107,7 @@
)
(func $start (; 2 ;) (type $v)
(local $0 i32)
(set_global "$(lib)/allocator/arena/OFFSET"
(set_global "$(lib)/allocator/arena/offset"
(i32.and
(i32.add
(get_global $HEAP_BASE)

View File

@ -3,10 +3,10 @@
(type $ii (func (param i32) (result i32)))
(type $ifv (func (param i32 f32)))
(type $v (func))
(global "$(lib)/allocator/arena/AL_BITS" i32 (i32.const 3))
(global "$(lib)/allocator/arena/AL_SIZE" i32 (i32.const 8))
(global "$(lib)/allocator/arena/AL_MASK" i32 (i32.const 7))
(global "$(lib)/allocator/arena/OFFSET" (mut i32) (i32.const 0))
(global "$(lib)/allocator/common/alignment/BITS" i32 (i32.const 3))
(global "$(lib)/allocator/common/alignment/SIZE" i32 (i32.const 8))
(global "$(lib)/allocator/common/alignment/MASK" i32 (i32.const 7))
(global "$(lib)/allocator/arena/offset" (mut i32) (i32.const 0))
(global $std/new/aClass (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
@ -29,7 +29,7 @@
)
)
(set_local $1
(get_global "$(lib)/allocator/arena/OFFSET")
(get_global "$(lib)/allocator/arena/offset")
)
(set_local $2
(i32.and
@ -109,7 +109,7 @@
)
)
)
(set_global "$(lib)/allocator/arena/OFFSET"
(set_global "$(lib)/allocator/arena/offset"
(get_local $2)
)
(return
@ -133,7 +133,7 @@
)
(func $start (; 2 ;) (type $v)
(local $0 i32)
(set_global "$(lib)/allocator/arena/OFFSET"
(set_global "$(lib)/allocator/arena/offset"
(i32.and
(i32.add
(get_global $HEAP_BASE)

View File

@ -1,6 +1,6 @@
(module
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $ii (func (param i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $II (func (param i64) (result i64)))
(type $v (func))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))

View File

@ -1,6 +1,6 @@
(module
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $ii (func (param i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $II (func (param i64) (result i64)))
(type $v (func))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))

View File

@ -1,12 +1,12 @@
(module
(type $ii (func (param i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $iii (func (param i32 i32) (result i32)))
(type $iiiv (func (param i32 i32 i32)))
(type $iv (func (param i32)))
(type $iii (func (param i32 i32) (result i32)))
(type $v (func))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
(global "$(lib)/allocator/arena/OFFSET" (mut i32) (i32.const 0))
(global "$(lib)/allocator/arena/offset" (mut i32) (i32.const 0))
(global $std/set/set (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 56))
(memory $0 1)
@ -34,7 +34,7 @@
(i32.add
(i32.add
(tee_local $1
(get_global "$(lib)/allocator/arena/OFFSET")
(get_global "$(lib)/allocator/arena/offset")
)
(get_local $0)
)
@ -91,7 +91,7 @@
)
)
)
(set_global "$(lib)/allocator/arena/OFFSET"
(set_global "$(lib)/allocator/arena/offset"
(get_local $2)
)
(get_local $1)
@ -2273,7 +2273,7 @@
)
)
(func $start (; 10 ;) (type $v)
(set_global "$(lib)/allocator/arena/OFFSET"
(set_global "$(lib)/allocator/arena/offset"
(i32.and
(i32.add
(get_global $HEAP_BASE)

View File

@ -2,15 +2,15 @@
(type $i (func (result i32)))
(type $ii (func (param i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $iii (func (param i32 i32) (result i32)))
(type $iiiv (func (param i32 i32 i32)))
(type $iv (func (param i32)))
(type $iii (func (param i32 i32) (result i32)))
(type $v (func))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
(global "$(lib)/allocator/arena/AL_BITS" i32 (i32.const 3))
(global "$(lib)/allocator/arena/AL_SIZE" i32 (i32.const 8))
(global "$(lib)/allocator/arena/AL_MASK" i32 (i32.const 7))
(global "$(lib)/allocator/arena/OFFSET" (mut i32) (i32.const 0))
(global "$(lib)/allocator/common/alignment/BITS" i32 (i32.const 3))
(global "$(lib)/allocator/common/alignment/SIZE" i32 (i32.const 8))
(global "$(lib)/allocator/common/alignment/MASK" i32 (i32.const 7))
(global "$(lib)/allocator/arena/offset" (mut i32) (i32.const 0))
(global $std/set/set (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 56))
(memory $0 1)
@ -35,7 +35,7 @@
)
)
(set_local $1
(get_global "$(lib)/allocator/arena/OFFSET")
(get_global "$(lib)/allocator/arena/offset")
)
(set_local $2
(i32.and
@ -115,7 +115,7 @@
)
)
)
(set_global "$(lib)/allocator/arena/OFFSET"
(set_global "$(lib)/allocator/arena/offset"
(get_local $2)
)
(return
@ -433,6 +433,232 @@
)
(br $break|2)
)
(block
(set_local $3
(i32.load
(get_local $1)
)
)
(i32.store8
(block (result i32)
(set_local $5
(get_local $0)
)
(set_local $0
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
(i32.load8_u
(block (result i32)
(set_local $5
(get_local $1)
)
(set_local $1
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
)
)
(i32.store8
(block (result i32)
(set_local $5
(get_local $0)
)
(set_local $0
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
(i32.load8_u
(block (result i32)
(set_local $5
(get_local $1)
)
(set_local $1
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
)
)
(i32.store8
(block (result i32)
(set_local $5
(get_local $0)
)
(set_local $0
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
(i32.load8_u
(block (result i32)
(set_local $5
(get_local $1)
)
(set_local $1
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
)
)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 3)
)
)
(block $break|3
(loop $continue|3
(if
(i32.ge_u
(get_local $2)
(i32.const 17)
)
(block
(block
(set_local $4
(i32.load
(i32.add
(get_local $1)
(i32.const 1)
)
)
)
(i32.store
(get_local $0)
(i32.or
(i32.shr_u
(get_local $3)
(i32.const 24)
)
(i32.shl
(get_local $4)
(i32.const 8)
)
)
)
(set_local $3
(i32.load
(i32.add
(get_local $1)
(i32.const 5)
)
)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 4)
)
(i32.or
(i32.shr_u
(get_local $4)
(i32.const 24)
)
(i32.shl
(get_local $3)
(i32.const 8)
)
)
)
(set_local $4
(i32.load
(i32.add
(get_local $1)
(i32.const 9)
)
)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 8)
)
(i32.or
(i32.shr_u
(get_local $3)
(i32.const 24)
)
(i32.shl
(get_local $4)
(i32.const 8)
)
)
)
(set_local $3
(i32.load
(i32.add
(get_local $1)
(i32.const 13)
)
)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 12)
)
(i32.or
(i32.shr_u
(get_local $4)
(i32.const 24)
)
(i32.shl
(get_local $3)
(i32.const 8)
)
)
)
(set_local $1
(i32.add
(get_local $1)
(i32.const 16)
)
)
(set_local $0
(i32.add
(get_local $0)
(i32.const 16)
)
)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 16)
)
)
)
(br $continue|3)
)
)
)
)
(br $break|2)
)
)
(block
(set_local $3
(i32.load
(get_local $1)
@ -494,46 +720,18 @@
)
)
)
(i32.store8
(block (result i32)
(set_local $5
(get_local $0)
)
(set_local $0
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
(i32.load8_u
(block (result i32)
(set_local $5
(get_local $1)
)
(set_local $1
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
)
)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 3)
(i32.const 2)
)
)
(block $break|3
(loop $continue|3
(block $break|4
(loop $continue|4
(if
(i32.ge_u
(get_local $2)
(i32.const 17)
(i32.const 18)
)
(block
(block
@ -541,7 +739,7 @@
(i32.load
(i32.add
(get_local $1)
(i32.const 1)
(i32.const 2)
)
)
)
@ -550,11 +748,11 @@
(i32.or
(i32.shr_u
(get_local $3)
(i32.const 24)
(i32.const 16)
)
(i32.shl
(get_local $4)
(i32.const 8)
(i32.const 16)
)
)
)
@ -562,7 +760,7 @@
(i32.load
(i32.add
(get_local $1)
(i32.const 5)
(i32.const 6)
)
)
)
@ -574,11 +772,11 @@
(i32.or
(i32.shr_u
(get_local $4)
(i32.const 24)
(i32.const 16)
)
(i32.shl
(get_local $3)
(i32.const 8)
(i32.const 16)
)
)
)
@ -586,7 +784,7 @@
(i32.load
(i32.add
(get_local $1)
(i32.const 9)
(i32.const 10)
)
)
)
@ -598,11 +796,11 @@
(i32.or
(i32.shr_u
(get_local $3)
(i32.const 24)
(i32.const 16)
)
(i32.shl
(get_local $4)
(i32.const 8)
(i32.const 16)
)
)
)
@ -610,7 +808,7 @@
(i32.load
(i32.add
(get_local $1)
(i32.const 13)
(i32.const 14)
)
)
)
@ -622,11 +820,11 @@
(i32.or
(i32.shr_u
(get_local $4)
(i32.const 24)
(i32.const 16)
)
(i32.shl
(get_local $3)
(i32.const 8)
(i32.const 16)
)
)
)
@ -649,13 +847,15 @@
)
)
)
(br $continue|3)
(br $continue|4)
)
)
)
)
(br $break|2)
)
)
(block
(set_local $3
(i32.load
(get_local $1)
@ -689,46 +889,18 @@
)
)
)
(i32.store8
(block (result i32)
(set_local $5
(get_local $0)
)
(set_local $0
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
(i32.load8_u
(block (result i32)
(set_local $5
(get_local $1)
)
(set_local $1
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
)
)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 2)
(i32.const 1)
)
)
(block $break|4
(loop $continue|4
(block $break|5
(loop $continue|5
(if
(i32.ge_u
(get_local $2)
(i32.const 18)
(i32.const 19)
)
(block
(block
@ -736,7 +908,7 @@
(i32.load
(i32.add
(get_local $1)
(i32.const 2)
(i32.const 3)
)
)
)
@ -745,11 +917,11 @@
(i32.or
(i32.shr_u
(get_local $3)
(i32.const 16)
(i32.const 8)
)
(i32.shl
(get_local $4)
(i32.const 16)
(i32.const 24)
)
)
)
@ -757,7 +929,7 @@
(i32.load
(i32.add
(get_local $1)
(i32.const 6)
(i32.const 7)
)
)
)
@ -769,11 +941,11 @@
(i32.or
(i32.shr_u
(get_local $4)
(i32.const 16)
(i32.const 8)
)
(i32.shl
(get_local $3)
(i32.const 16)
(i32.const 24)
)
)
)
@ -781,7 +953,7 @@
(i32.load
(i32.add
(get_local $1)
(i32.const 10)
(i32.const 11)
)
)
)
@ -793,11 +965,11 @@
(i32.or
(i32.shr_u
(get_local $3)
(i32.const 16)
(i32.const 8)
)
(i32.shl
(get_local $4)
(i32.const 16)
(i32.const 24)
)
)
)
@ -805,7 +977,7 @@
(i32.load
(i32.add
(get_local $1)
(i32.const 14)
(i32.const 15)
)
)
)
@ -817,11 +989,11 @@
(i32.or
(i32.shr_u
(get_local $4)
(i32.const 16)
(i32.const 8)
)
(i32.shl
(get_local $3)
(i32.const 16)
(i32.const 24)
)
)
)
@ -844,179 +1016,13 @@
)
)
)
(br $continue|4)
(br $continue|5)
)
)
)
)
(br $break|2)
)
(set_local $3
(i32.load
(get_local $1)
)
)
(i32.store8
(block (result i32)
(set_local $5
(get_local $0)
)
(set_local $0
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
(i32.load8_u
(block (result i32)
(set_local $5
(get_local $1)
)
(set_local $1
(i32.add
(get_local $5)
(i32.const 1)
)
)
(get_local $5)
)
)
)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 1)
)
)
(block $break|5
(loop $continue|5
(if
(i32.ge_u
(get_local $2)
(i32.const 19)
)
(block
(block
(set_local $4
(i32.load
(i32.add
(get_local $1)
(i32.const 3)
)
)
)
(i32.store
(get_local $0)
(i32.or
(i32.shr_u
(get_local $3)
(i32.const 8)
)
(i32.shl
(get_local $4)
(i32.const 24)
)
)
)
(set_local $3
(i32.load
(i32.add
(get_local $1)
(i32.const 7)
)
)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 4)
)
(i32.or
(i32.shr_u
(get_local $4)
(i32.const 8)
)
(i32.shl
(get_local $3)
(i32.const 24)
)
)
)
(set_local $4
(i32.load
(i32.add
(get_local $1)
(i32.const 11)
)
)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 8)
)
(i32.or
(i32.shr_u
(get_local $3)
(i32.const 8)
)
(i32.shl
(get_local $4)
(i32.const 24)
)
)
)
(set_local $3
(i32.load
(i32.add
(get_local $1)
(i32.const 15)
)
)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 12)
)
(i32.or
(i32.shr_u
(get_local $4)
(i32.const 8)
)
(i32.shl
(get_local $3)
(i32.const 24)
)
)
)
(set_local $1
(i32.add
(get_local $1)
(i32.const 16)
)
)
(set_local $0
(i32.add
(get_local $0)
(i32.const 16)
)
)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 16)
)
)
)
(br $continue|5)
)
)
)
)
(br $break|2)
)
)
(if
@ -2593,7 +2599,7 @@
)
)
(func $start (; 10 ;) (type $v)
(set_global "$(lib)/allocator/arena/OFFSET"
(set_global "$(lib)/allocator/arena/offset"
(i32.and
(i32.add
(get_global $HEAP_BASE)

View File

@ -1,9 +1,11 @@
(module
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $i (func (result i32)))
(type $iii (func (param i32 i32) (result i32)))
(type $i (func (result i32)))
(type $iiii (func (param i32 i32 i32) (result i32)))
(type $iiiii (func (param i32 i32 i32 i32) (result i32)))
(type $iiF (func (param i32 i32) (result f64)))
(type $iiiF (func (param i32 i32 i32) (result f64)))
(type $iF (func (param i32) (result f64)))
(type $v (func))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
@ -217,7 +219,27 @@
)
)
)
(func "$(lib)/string/String#endsWith" (; 4 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func "$(lib)/string/String#startsWith|trampoline" (; 4 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(block $N=1
(block $N=0
(block $N=invalid
(br_table $N=0 $N=1 $N=invalid
(get_local $3)
)
)
(unreachable)
)
(set_local $2
(i32.const 0)
)
)
(call "$(lib)/string/String#startsWith"
(get_local $0)
(get_local $1)
(get_local $2)
)
)
(func "$(lib)/string/String#endsWith" (; 5 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(if
(i32.eqz
@ -302,7 +324,27 @@
)
)
)
(func "$(lib)/string/String#indexOf" (; 5 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func "$(lib)/string/String#endsWith|trampoline" (; 6 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(block $N=1
(block $N=0
(block $N=invalid
(br_table $N=0 $N=1 $N=invalid
(get_local $3)
)
)
(unreachable)
)
(set_local $2
(i32.const 2147483647)
)
)
(call "$(lib)/string/String#endsWith"
(get_local $0)
(get_local $1)
(get_local $2)
)
)
(func "$(lib)/string/String#indexOf" (; 7 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@ -407,7 +449,7 @@
)
(i32.const -1)
)
(func "$(lib)/string/String#includes" (; 6 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func "$(lib)/string/String#includes" (; 8 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(i32.ne
(call "$(lib)/string/String#indexOf"
(get_local $0)
@ -417,10 +459,50 @@
(i32.const -1)
)
)
(func $std/string/getString (; 7 ;) (type $i) (result i32)
(func "$(lib)/string/String#includes|trampoline" (; 9 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(block $N=1
(block $N=0
(block $N=invalid
(br_table $N=0 $N=1 $N=invalid
(get_local $3)
)
)
(unreachable)
)
(set_local $2
(i32.const 0)
)
)
(call "$(lib)/string/String#includes"
(get_local $0)
(get_local $1)
(get_local $2)
)
)
(func "$(lib)/string/String#indexOf|trampoline" (; 10 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(block $N=1
(block $N=0
(block $N=invalid
(br_table $N=0 $N=1 $N=invalid
(get_local $3)
)
)
(unreachable)
)
(set_local $2
(i32.const 0)
)
)
(call "$(lib)/string/String#indexOf"
(get_local $0)
(get_local $1)
(get_local $2)
)
)
(func $std/string/getString (; 11 ;) (type $i) (result i32)
(get_global $std/string/str)
)
(func "$(lib)/string/parse<f64>" (; 8 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64)
(func "$(lib)/string/parse<f64>" (; 12 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -785,13 +867,32 @@
(get_local $5)
)
)
(func "$(lib)/string/parseInt" (; 9 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64)
(func "$(lib)/string/parseInt" (; 13 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64)
(call "$(lib)/string/parse<f64>"
(get_local $0)
(get_local $1)
)
)
(func "$(lib)/string/parseFloat" (; 10 ;) (type $iF) (param $0 i32) (result f64)
(func "$(lib)/string/parseInt|trampoline" (; 14 ;) (type $iiiF) (param $0 i32) (param $1 i32) (param $2 i32) (result f64)
(block $N=1
(block $N=0
(block $N=invalid
(br_table $N=0 $N=1 $N=invalid
(get_local $2)
)
)
(unreachable)
)
(set_local $1
(i32.const 0)
)
)
(call "$(lib)/string/parseInt"
(get_local $0)
(get_local $1)
)
)
(func "$(lib)/string/parseFloat" (; 15 ;) (type $iF) (param $0 i32) (result f64)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@ -1043,7 +1144,7 @@
(get_local $4)
)
)
(func $start (; 11 ;) (type $v)
(func $start (; 16 ;) (type $v)
(if
(i32.ne
(get_global $std/string/str)
@ -1096,10 +1197,11 @@
)
(if
(i32.eqz
(call "$(lib)/string/String#startsWith"
(call "$(lib)/string/String#startsWith|trampoline"
(get_global $std/string/str)
(i32.const 108)
(i32.const 0)
(i32.const 0)
)
)
(block
@ -1114,10 +1216,11 @@
)
(if
(i32.eqz
(call "$(lib)/string/String#endsWith"
(call "$(lib)/string/String#endsWith|trampoline"
(get_global $std/string/str)
(i32.const 128)
(i32.const 2147483647)
(i32.const 0)
(i32.const 0)
)
)
(block
@ -1132,10 +1235,11 @@
)
(if
(i32.eqz
(call "$(lib)/string/String#includes"
(call "$(lib)/string/String#includes|trampoline"
(get_global $std/string/str)
(i32.const 144)
(i32.const 0)
(i32.const 0)
)
)
(block
@ -1150,10 +1254,11 @@
)
(if
(i32.ne
(call "$(lib)/string/String#indexOf"
(call "$(lib)/string/String#indexOf|trampoline"
(get_global $std/string/str)
(i32.const 156)
(i32.const 0)
(i32.const 0)
)
(i32.const 2)
)
@ -1169,10 +1274,11 @@
)
(if
(i32.ne
(call "$(lib)/string/String#indexOf"
(call "$(lib)/string/String#indexOf|trampoline"
(get_global $std/string/str)
(i32.const 164)
(i32.const 0)
(i32.const 0)
)
(i32.const -1)
)
@ -1188,9 +1294,10 @@
)
(if
(f64.ne
(call "$(lib)/string/parseInt"
(call "$(lib)/string/parseInt|trampoline"
(i32.const 172)
(i32.const 0)
(i32.const 0)
)
(f64.const 0)
)
@ -1206,9 +1313,10 @@
)
(if
(f64.ne
(call "$(lib)/string/parseInt"
(call "$(lib)/string/parseInt|trampoline"
(i32.const 180)
(i32.const 0)
(i32.const 0)
)
(f64.const 1)
)
@ -1224,9 +1332,10 @@
)
(if
(f64.ne
(call "$(lib)/string/parseInt"
(call "$(lib)/string/parseInt|trampoline"
(i32.const 188)
(i32.const 0)
(i32.const 0)
)
(f64.const 5)
)
@ -1242,9 +1351,10 @@
)
(if
(f64.ne
(call "$(lib)/string/parseInt"
(call "$(lib)/string/parseInt|trampoline"
(i32.const 204)
(i32.const 0)
(i32.const 0)
)
(f64.const 455)
)
@ -1260,9 +1370,10 @@
)
(if
(f64.ne
(call "$(lib)/string/parseInt"
(call "$(lib)/string/parseInt|trampoline"
(i32.const 220)
(i32.const 0)
(i32.const 0)
)
(f64.const 3855)
)
@ -1278,9 +1389,10 @@
)
(if
(f64.ne
(call "$(lib)/string/parseInt"
(call "$(lib)/string/parseInt|trampoline"
(i32.const 236)
(i32.const 0)
(i32.const 0)
)
(f64.const 3855)
)
@ -1296,9 +1408,10 @@
)
(if
(f64.ne
(call "$(lib)/string/parseInt"
(call "$(lib)/string/parseInt|trampoline"
(i32.const 252)
(i32.const 0)
(i32.const 0)
)
(f64.const 11)
)
@ -1314,9 +1427,10 @@
)
(if
(f64.ne
(call "$(lib)/string/parseInt"
(call "$(lib)/string/parseInt|trampoline"
(i32.const 264)
(i32.const 0)
(i32.const 0)
)
(f64.const 1)
)

View File

@ -1,9 +1,11 @@
(module
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $i (func (result i32)))
(type $iii (func (param i32 i32) (result i32)))
(type $i (func (result i32)))
(type $iiii (func (param i32 i32 i32) (result i32)))
(type $iiiii (func (param i32 i32 i32 i32) (result i32)))
(type $iiF (func (param i32 i32) (result f64)))
(type $iiiF (func (param i32 i32 i32) (result f64)))
(type $iF (func (param i32) (result f64)))
(type $v (func))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
@ -274,7 +276,27 @@
)
)
)
(func "$(lib)/string/String#endsWith" (; 4 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func "$(lib)/string/String#startsWith|trampoline" (; 4 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(block $N=1
(block $N=0
(block $N=invalid
(br_table $N=0 $N=1 $N=invalid
(get_local $3)
)
)
(unreachable)
)
(set_local $2
(i32.const 0)
)
)
(call "$(lib)/string/String#startsWith"
(get_local $0)
(get_local $1)
(get_local $2)
)
)
(func "$(lib)/string/String#endsWith" (; 5 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@ -378,7 +400,27 @@
)
)
)
(func "$(lib)/string/String#indexOf" (; 5 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func "$(lib)/string/String#endsWith|trampoline" (; 6 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(block $N=1
(block $N=0
(block $N=invalid
(br_table $N=0 $N=1 $N=invalid
(get_local $3)
)
)
(unreachable)
)
(set_local $2
(i32.const 2147483647)
)
)
(call "$(lib)/string/String#endsWith"
(get_local $0)
(get_local $1)
(get_local $2)
)
)
(func "$(lib)/string/String#indexOf" (; 7 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@ -508,7 +550,7 @@
(i32.const -1)
)
)
(func "$(lib)/string/String#includes" (; 6 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func "$(lib)/string/String#includes" (; 8 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(return
(i32.ne
(call "$(lib)/string/String#indexOf"
@ -520,12 +562,52 @@
)
)
)
(func $std/string/getString (; 7 ;) (type $i) (result i32)
(func "$(lib)/string/String#includes|trampoline" (; 9 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(block $N=1
(block $N=0
(block $N=invalid
(br_table $N=0 $N=1 $N=invalid
(get_local $3)
)
)
(unreachable)
)
(set_local $2
(i32.const 0)
)
)
(call "$(lib)/string/String#includes"
(get_local $0)
(get_local $1)
(get_local $2)
)
)
(func "$(lib)/string/String#indexOf|trampoline" (; 10 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(block $N=1
(block $N=0
(block $N=invalid
(br_table $N=0 $N=1 $N=invalid
(get_local $3)
)
)
(unreachable)
)
(set_local $2
(i32.const 0)
)
)
(call "$(lib)/string/String#indexOf"
(get_local $0)
(get_local $1)
(get_local $2)
)
)
(func $std/string/getString (; 11 ;) (type $i) (result i32)
(return
(get_global $std/string/str)
)
)
(func "$(lib)/string/parse<f64>" (; 8 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64)
(func "$(lib)/string/parse<f64>" (; 12 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -701,61 +783,69 @@
(br $case6|0)
)
)
(set_local $3
(i32.add
(get_local $3)
(i32.const 4)
(block
(set_local $3
(i32.add
(get_local $3)
(i32.const 4)
)
)
)
(set_local $2
(i32.sub
(get_local $2)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 2)
)
)
(set_local $1
(i32.const 2)
)
(br $break|0)
)
(set_local $1
)
)
(block
(set_local $3
(i32.add
(get_local $3)
(i32.const 4)
)
)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 2)
)
(br $break|0)
)
)
(set_local $3
(i32.add
(get_local $3)
(i32.const 4)
(set_local $1
(i32.const 8)
)
(br $break|0)
)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 2)
)
)
(set_local $1
(i32.const 8)
)
(br $break|0)
)
)
(set_local $3
(i32.add
(get_local $3)
(i32.const 4)
(block
(set_local $3
(i32.add
(get_local $3)
(i32.const 4)
)
)
)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 2)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 2)
)
)
(set_local $1
(i32.const 16)
)
(br $break|0)
)
(set_local $1
(i32.const 16)
)
(br $break|0)
)
(set_local $1
(i32.const 10)
(block
(set_local $1
(i32.const 10)
)
)
)
(set_local $1
@ -927,7 +1017,7 @@
)
)
)
(func "$(lib)/string/parseInt" (; 9 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64)
(func "$(lib)/string/parseInt" (; 13 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64)
(return
(call "$(lib)/string/parse<f64>"
(get_local $0)
@ -935,7 +1025,26 @@
)
)
)
(func "$(lib)/string/parseFloat" (; 10 ;) (type $iF) (param $0 i32) (result f64)
(func "$(lib)/string/parseInt|trampoline" (; 14 ;) (type $iiiF) (param $0 i32) (param $1 i32) (param $2 i32) (result f64)
(block $N=1
(block $N=0
(block $N=invalid
(br_table $N=0 $N=1 $N=invalid
(get_local $2)
)
)
(unreachable)
)
(set_local $1
(i32.const 0)
)
)
(call "$(lib)/string/parseInt"
(get_local $0)
(get_local $1)
)
)
(func "$(lib)/string/parseFloat" (; 15 ;) (type $iF) (param $0 i32) (result f64)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@ -1218,7 +1327,7 @@
)
)
)
(func $start (; 11 ;) (type $v)
(func $start (; 16 ;) (type $v)
(if
(i32.eqz
(i32.eq
@ -1277,10 +1386,11 @@
)
(if
(i32.eqz
(call "$(lib)/string/String#startsWith"
(call "$(lib)/string/String#startsWith|trampoline"
(get_global $std/string/str)
(i32.const 108)
(i32.const 0)
(i32.const 0)
)
)
(block
@ -1295,10 +1405,11 @@
)
(if
(i32.eqz
(call "$(lib)/string/String#endsWith"
(call "$(lib)/string/String#endsWith|trampoline"
(get_global $std/string/str)
(i32.const 128)
(i32.const 2147483647)
(i32.const 0)
(i32.const 0)
)
)
(block
@ -1313,10 +1424,11 @@
)
(if
(i32.eqz
(call "$(lib)/string/String#includes"
(call "$(lib)/string/String#includes|trampoline"
(get_global $std/string/str)
(i32.const 144)
(i32.const 0)
(i32.const 0)
)
)
(block
@ -1332,10 +1444,11 @@
(if
(i32.eqz
(i32.eq
(call "$(lib)/string/String#indexOf"
(call "$(lib)/string/String#indexOf|trampoline"
(get_global $std/string/str)
(i32.const 156)
(i32.const 0)
(i32.const 0)
)
(i32.const 2)
)
@ -1353,10 +1466,11 @@
(if
(i32.eqz
(i32.eq
(call "$(lib)/string/String#indexOf"
(call "$(lib)/string/String#indexOf|trampoline"
(get_global $std/string/str)
(i32.const 164)
(i32.const 0)
(i32.const 0)
)
(i32.const -1)
)
@ -1374,9 +1488,10 @@
(if
(i32.eqz
(f64.eq
(call "$(lib)/string/parseInt"
(call "$(lib)/string/parseInt|trampoline"
(i32.const 172)
(i32.const 0)
(i32.const 0)
)
(f64.const 0)
)
@ -1394,9 +1509,10 @@
(if
(i32.eqz
(f64.eq
(call "$(lib)/string/parseInt"
(call "$(lib)/string/parseInt|trampoline"
(i32.const 180)
(i32.const 0)
(i32.const 0)
)
(f64.const 1)
)
@ -1414,9 +1530,10 @@
(if
(i32.eqz
(f64.eq
(call "$(lib)/string/parseInt"
(call "$(lib)/string/parseInt|trampoline"
(i32.const 188)
(i32.const 0)
(i32.const 0)
)
(f64.const 5)
)
@ -1434,9 +1551,10 @@
(if
(i32.eqz
(f64.eq
(call "$(lib)/string/parseInt"
(call "$(lib)/string/parseInt|trampoline"
(i32.const 204)
(i32.const 0)
(i32.const 0)
)
(f64.const 455)
)
@ -1454,9 +1572,10 @@
(if
(i32.eqz
(f64.eq
(call "$(lib)/string/parseInt"
(call "$(lib)/string/parseInt|trampoline"
(i32.const 220)
(i32.const 0)
(i32.const 0)
)
(f64.const 3855)
)
@ -1474,9 +1593,10 @@
(if
(i32.eqz
(f64.eq
(call "$(lib)/string/parseInt"
(call "$(lib)/string/parseInt|trampoline"
(i32.const 236)
(i32.const 0)
(i32.const 0)
)
(f64.const 3855)
)
@ -1494,9 +1614,10 @@
(if
(i32.eqz
(f64.eq
(call "$(lib)/string/parseInt"
(call "$(lib)/string/parseInt|trampoline"
(i32.const 252)
(i32.const 0)
(i32.const 0)
)
(f64.const 11)
)
@ -1514,9 +1635,10 @@
(if
(i32.eqz
(f64.eq
(call "$(lib)/string/parseInt"
(call "$(lib)/string/parseInt|trampoline"
(i32.const 264)
(i32.const 0)
(i32.const 0)
)
(f64.const 1)
)