Control flow evaluator; Support for block-level let/const variables

This commit is contained in:
dcodeIO
2018-01-18 23:34:12 +01:00
parent 1c4b0ddc57
commit 7be4f9fabb
54 changed files with 3285 additions and 13138 deletions

View File

@ -34,20 +34,6 @@
)
)
)
(drop
(select
(tee_local $2
(i32.const 1)
)
(tee_local $3
(i32.const 2)
)
(i32.lt_s
(get_local $2)
(get_local $3)
)
)
)
(set_global $builtins/i
(i32.const 31)
)
@ -90,9 +76,7 @@
(tee_local $2
(i32.const 1)
)
(tee_local $3
(i32.const 2)
)
(i32.const 2)
(i32.gt_s
(get_local $2)
(get_local $3)
@ -108,12 +92,8 @@
)
(set_global $builtins/i
(select
(tee_local $2
(i32.const 1)
)
(tee_local $3
(i32.const 2)
)
(i32.const 1)
(i32.const 2)
(i32.lt_s
(get_local $2)
(get_local $3)
@ -187,12 +167,8 @@
)
(set_global $builtins/I
(select
(tee_local $4
(i64.const 1)
)
(tee_local $5
(i64.const 2)
)
(i64.const 1)
(i64.const 2)
(i64.lt_s
(get_local $4)
(get_local $5)
@ -251,9 +227,7 @@
(select
(f32.ne
(f32.abs
(tee_local $0
(f32.const 1.25)
)
(f32.const 1.25)
)
(f32.const inf)
)
@ -309,9 +283,7 @@
(select
(f64.ne
(f64.abs
(tee_local $1
(f64.const 1.25)
)
(f64.const 1.25)
)
(f64.const inf)
)

View File

@ -1,141 +0,0 @@
(module
(type $iii (func (param i32 i32) (result i32)))
(type $fff (func (param f32 f32) (result f32)))
(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)
(export "test" (func $class/test))
(export "memory" (memory $0))
(start $start)
(func $class/test (; 0 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 f32)
(local $6 f32)
(drop
(block (result i32)
(block $__inlined_func$class/Animal#instanceAdd (result i32)
(set_local $1
(get_local $0)
)
(set_local $2
(i32.const 1)
)
(set_local $3
(i32.const 2)
)
(i32.add
(i32.add
(get_local $2)
(get_local $3)
)
(get_global $class/Animal.ONE)
)
)
)
)
(drop
(block (result f32)
(block $__inlined_func$class/Animal#instanceSub<f32> (result f32)
(set_local $4
(get_local $0)
)
(set_local $5
(f32.const 1)
)
(set_local $6
(f32.const 2)
)
(f32.add
(f32.sub
(get_local $5)
(get_local $6)
)
(f32.convert_s/i32
(get_global $class/Animal.ONE)
)
)
)
)
)
(drop
(i32.load
(get_local $0)
)
)
(drop
(i32.load16_s offset=4
(get_local $0)
)
)
(drop
(i32.load8_s offset=6
(get_local $0)
)
)
(i32.store
(get_local $0)
(i32.const 1)
)
(i32.store16 offset=4
(get_local $0)
(i32.const 2)
)
(i32.store8 offset=6
(get_local $0)
(i32.const 3)
)
(get_local $0)
)
(func $start (; 1 ;) (type $v)
(local $0 i32)
(local $1 i32)
(local $2 f32)
(local $3 f32)
(drop
(block (result i32)
(block $__inlined_func$class/Animal.add (result i32)
(set_local $0
(i32.const 1)
)
(set_local $1
(i32.const 2)
)
(i32.add
(i32.add
(get_local $0)
(get_local $1)
)
(get_global $class/Animal.ONE)
)
)
)
)
(drop
(block (result f32)
(block $__inlined_func$class/Animal.sub<f32> (result f32)
(set_local $2
(f32.const 1)
)
(set_local $3
(f32.const 2)
)
(f32.add
(f32.sub
(get_local $2)
(get_local $3)
)
(f32.convert_s/i32
(get_global $class/Animal.ONE)
)
)
)
)
)
)
)

View File

@ -1,70 +1,11 @@
(module
(type $iii (func (param i32 i32) (result i32)))
(type $fff (func (param f32 f32) (result f32)))
(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)
(export "test" (func $class/test))
(export "memory" (memory $0))
(start $start)
(func $class/Animal.add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.add
(i32.add
(get_local $0)
(get_local $1)
)
(get_global $class/Animal.ONE)
)
)
(func $class/Animal.sub<f32> (; 1 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32)
(f32.add
(f32.sub
(get_local $0)
(get_local $1)
)
(f32.convert_s/i32
(get_global $class/Animal.ONE)
)
)
)
(func $class/Animal#instanceAdd (; 2 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(i32.add
(i32.add
(get_local $1)
(get_local $2)
)
(get_global $class/Animal.ONE)
)
)
(func $class/Animal#instanceSub<f32> (; 3 ;) (type $ifff) (param $0 i32) (param $1 f32) (param $2 f32) (result f32)
(f32.add
(f32.sub
(get_local $1)
(get_local $2)
)
(f32.convert_s/i32
(get_global $class/Animal.ONE)
)
)
)
(func $class/test (; 4 ;) (type $ii) (param $0 i32) (result i32)
(drop
(call $class/Animal#instanceAdd
(get_local $0)
(i32.const 1)
(i32.const 2)
)
)
(drop
(call $class/Animal#instanceSub<f32>
(get_local $0)
(f32.const 1)
(f32.const 2)
)
)
(func $class/test (; 0 ;) (type $ii) (param $0 i32) (result i32)
(drop
(i32.load
(get_local $0)
@ -94,18 +35,7 @@
)
(get_local $0)
)
(func $start (; 5 ;) (type $v)
(drop
(call $class/Animal.add
(i32.const 1)
(i32.const 2)
)
)
(drop
(call $class/Animal.sub<f32>
(f32.const 1)
(f32.const 2)
)
)
(func $start (; 1 ;) (type $v)
(nop)
)
)

View File

@ -127,15 +127,11 @@
(i32.const 24)
)
)
(block
(set_local $1
(get_local $0)
)
(set_local $1
(get_local $0)
)
(block
(set_local $2
(get_local $1)
)
(set_local $2
(get_local $1)
)
(return
(get_local $2)

View File

@ -147,10 +147,8 @@
(unreachable)
)
(block $break|0
(block
(set_local $1
(i32.const 0)
)
(set_local $1
(i32.const 0)
)
(loop $continue|0
(if

View File

@ -1,48 +0,0 @@
(module
(type $i (func (result i32)))
(type $v (func))
(global $enum/Implicit.ZERO i32 (i32.const 0))
(global $enum/Implicit.ONE i32 (i32.const 1))
(global $enum/Implicit.TWO i32 (i32.const 2))
(global $enum/Implicit.THREE i32 (i32.const 3))
(global $enum/Explicit.ZERO i32 (i32.const 0))
(global $enum/Explicit.ONE i32 (i32.const 1))
(global $enum/Explicit.TWO i32 (i32.const 2))
(global $enum/Explicit.THREE i32 (i32.const 3))
(global $enum/Mixed.ZERO i32 (i32.const 0))
(global $enum/Mixed.ONE i32 (i32.const 1))
(global $enum/Mixed.THREE i32 (i32.const 3))
(global $enum/Mixed.FOUR i32 (i32.const 4))
(global $enum/NonConstant.ZERO (mut i32) (i32.const 0))
(global $enum/NonConstant.ONE (mut i32) (i32.const 0))
(memory $0 1)
(export "enum/Implicit.ZERO" (global $enum/Implicit.ZERO))
(export "enum/Implicit.ONE" (global $enum/Implicit.ONE))
(export "enum/Implicit.TWO" (global $enum/Implicit.TWO))
(export "enum/Implicit.THREE" (global $enum/Implicit.THREE))
(export "enum/Explicit.ZERO" (global $enum/Explicit.ZERO))
(export "enum/Explicit.ONE" (global $enum/Explicit.ONE))
(export "enum/Explicit.TWO" (global $enum/Explicit.TWO))
(export "enum/Explicit.THREE" (global $enum/Explicit.THREE))
(export "enum/Mixed.ZERO" (global $enum/Mixed.ZERO))
(export "enum/Mixed.ONE" (global $enum/Mixed.ONE))
(export "enum/Mixed.THREE" (global $enum/Mixed.THREE))
(export "enum/Mixed.FOUR" (global $enum/Mixed.FOUR))
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)
(set_global $enum/NonConstant.ZERO
(block (result i32)
(block $__inlined_func$enum/getZero (result i32)
(i32.const 0)
)
)
)
(set_global $enum/NonConstant.ONE
(i32.add
(get_global $enum/NonConstant.ZERO)
(i32.const 1)
)
)
)
)

View File

@ -1,5 +1,4 @@
(module
(type $i (func (result i32)))
(type $v (func))
(global $enum/Implicit.ZERO i32 (i32.const 0))
(global $enum/Implicit.ONE i32 (i32.const 1))
@ -30,12 +29,9 @@
(export "enum/Mixed.FOUR" (global $enum/Mixed.FOUR))
(export "memory" (memory $0))
(start $start)
(func $enum/getZero (; 0 ;) (type $i) (result i32)
(i32.const 0)
)
(func $start (; 1 ;) (type $v)
(func $start (; 0 ;) (type $v)
(set_global $enum/NonConstant.ZERO
(call $enum/getZero)
(i32.const 0)
)
(set_global $enum/NonConstant.ONE
(i32.add

File diff suppressed because it is too large Load Diff

View File

@ -19,53 +19,43 @@
(local $7 f64)
(local $8 i32)
(local $9 i64)
(block
(set_local $2
(i64.reinterpret/f64
(get_local $0)
)
(set_local $2
(i64.reinterpret/f64
(get_local $0)
)
)
(block
(set_local $3
(i64.reinterpret/f64
(get_local $1)
)
(set_local $3
(i64.reinterpret/f64
(get_local $1)
)
)
(block
(set_local $4
(i32.wrap/i64
(i64.and
(i64.shr_u
(get_local $2)
(i64.const 52)
)
(i64.const 2047)
)
)
)
)
(block
(set_local $5
(i32.wrap/i64
(i64.and
(i64.shr_u
(get_local $3)
(i64.const 52)
)
(i64.const 2047)
)
)
)
)
(block
(set_local $6
(i32.wrap/i64
(set_local $4
(i32.wrap/i64
(i64.and
(i64.shr_u
(get_local $2)
(i64.const 63)
(i64.const 52)
)
(i64.const 2047)
)
)
)
(set_local $5
(i32.wrap/i64
(i64.and
(i64.shr_u
(get_local $3)
(i64.const 52)
)
(i64.const 2047)
)
)
)
(set_local $6
(i32.wrap/i64
(i64.shr_u
(get_local $2)
(i64.const 63)
)
)
)
@ -163,12 +153,10 @@
)
(block
(block $break|0
(block
(set_local $9
(i64.shl
(get_local $2)
(i64.const 12)
)
(set_local $9
(i64.shl
(get_local $2)
(i64.const 12)
)
)
(loop $continue|0
@ -497,48 +485,38 @@
(local $7 f32)
(local $8 i32)
(local $9 i32)
(block
(set_local $2
(i32.reinterpret/f32
(get_local $0)
)
(set_local $2
(i32.reinterpret/f32
(get_local $0)
)
)
(block
(set_local $3
(i32.reinterpret/f32
(get_local $1)
)
(set_local $3
(i32.reinterpret/f32
(get_local $1)
)
)
(block
(set_local $4
(i32.and
(i32.shr_u
(get_local $2)
(i32.const 23)
)
(i32.const 255)
)
)
)
(block
(set_local $5
(i32.and
(i32.shr_u
(get_local $3)
(i32.const 23)
)
(i32.const 255)
)
)
)
(block
(set_local $6
(i32.and
(set_local $4
(i32.and
(i32.shr_u
(get_local $2)
(i32.const -2147483648)
(i32.const 23)
)
(i32.const 255)
)
)
(set_local $5
(i32.and
(i32.shr_u
(get_local $3)
(i32.const 23)
)
(i32.const 255)
)
)
(set_local $6
(i32.and
(get_local $2)
(i32.const -2147483648)
)
)
(if
@ -635,12 +613,10 @@
)
(block
(block $break|0
(block
(set_local $9
(i32.shl
(get_local $2)
(i32.const 9)
)
(set_local $9
(i32.shl
(get_local $2)
(i32.const 9)
)
)
(loop $continue|0

View File

@ -33,9 +33,6 @@
)
(unreachable)
)
(set_local $0
(i32.const 0)
)
(loop $continue|1
(if
(i32.lt_s

View File

@ -18,7 +18,9 @@
(i32.const 10)
)
(block
(nop)
(block
(nop)
)
(set_global $for/i
(i32.add
(get_global $for/i)
@ -40,10 +42,8 @@
(unreachable)
)
(block $break|1
(block
(set_local $0
(i32.const 0)
)
(set_local $0
(i32.const 0)
)
(loop $continue|1
(if
@ -52,7 +52,9 @@
(i32.const 10)
)
(block
(nop)
(block
(nop)
)
(set_local $0
(i32.add
(get_local $0)

View File

@ -1,195 +0,0 @@
(module
(type $v (func))
(type $i (func (result i32)))
(type $I (func (result i64)))
(type $f (func (result f32)))
(type $F (func (result f64)))
(type $iv (func (param i32)))
(type $ii (func (param i32) (result i32)))
(type $II (func (param i64) (result i64)))
(type $ff (func (param f32) (result f32)))
(type $FF (func (param f64) (result f64)))
(type $iiv (func (param i32 i32)))
(type $iii (func (param i32 i32) (result i32)))
(type $IiI (func (param i64 i32) (result i64)))
(type $fff (func (param f32 f32) (result f32)))
(type $FFF (func (param f64 f64) (result f64)))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)
(local $0 i32)
(local $1 i32)
(local $2 i64)
(local $3 f32)
(local $4 f64)
(local $5 i32)
(local $6 i32)
(local $7 i32)
(local $8 i32)
(local $9 i64)
(local $10 i32)
(local $11 f32)
(local $12 f32)
(local $13 f64)
(local $14 f64)
(block
(block $__inlined_func$function/v
(nop)
)
)
(drop
(block (result i32)
(block $__inlined_func$function/i (result i32)
(i32.const 0)
)
)
)
(drop
(block (result i64)
(block $__inlined_func$function/I (result i64)
(i64.const 0)
)
)
)
(drop
(block (result f32)
(block $__inlined_func$function/f (result f32)
(f32.const 0)
)
)
)
(drop
(block (result f64)
(block $__inlined_func$function/F (result f64)
(f64.const 0)
)
)
)
(block
(block $__inlined_func$function/iv
(set_local $0
(i32.const 0)
)
(nop)
)
)
(drop
(block (result i32)
(block $__inlined_func$function/ii (result i32)
(set_local $1
(i32.const 0)
)
(get_local $1)
)
)
)
(drop
(block (result i64)
(block $__inlined_func$function/II (result i64)
(set_local $2
(i64.const 0)
)
(get_local $2)
)
)
)
(drop
(block (result f32)
(block $__inlined_func$function/ff (result f32)
(set_local $3
(f32.const 0)
)
(get_local $3)
)
)
)
(drop
(block (result f64)
(block $__inlined_func$function/FF (result f64)
(set_local $4
(f64.const 0)
)
(get_local $4)
)
)
)
(block
(block $__inlined_func$function/iiv
(set_local $5
(i32.const 1)
)
(set_local $6
(i32.const 2)
)
(nop)
)
)
(drop
(block (result i32)
(block $__inlined_func$function/iii (result i32)
(set_local $7
(i32.const 1)
)
(set_local $8
(i32.const 2)
)
(i32.add
(get_local $7)
(get_local $8)
)
)
)
)
(drop
(block (result i64)
(block $__inlined_func$function/III (result i64)
(set_local $9
(i64.const 1)
)
(set_local $10
(i32.const 2)
)
(i64.add
(get_local $9)
(i64.extend_s/i32
(get_local $10)
)
)
)
)
)
(drop
(block (result f32)
(block $__inlined_func$function/fff (result f32)
(set_local $11
(f32.const 1)
)
(set_local $12
(f32.const 2)
)
(f32.add
(get_local $11)
(get_local $12)
)
)
)
)
(drop
(block (result f64)
(block $__inlined_func$function/FFF (result f64)
(set_local $13
(f64.const 1)
)
(set_local $14
(f64.const 2)
)
(f64.add
(get_local $13)
(get_local $14)
)
)
)
)
)
)

View File

@ -1,145 +1,9 @@
(module
(type $v (func))
(type $i (func (result i32)))
(type $I (func (result i64)))
(type $f (func (result f32)))
(type $F (func (result f64)))
(type $iv (func (param i32)))
(type $ii (func (param i32) (result i32)))
(type $II (func (param i64) (result i64)))
(type $ff (func (param f32) (result f32)))
(type $FF (func (param f64) (result f64)))
(type $iiv (func (param i32 i32)))
(type $iii (func (param i32 i32) (result i32)))
(type $IiI (func (param i64 i32) (result i64)))
(type $fff (func (param f32 f32) (result f32)))
(type $FFF (func (param f64 f64) (result f64)))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
(func $function/v (; 0 ;) (type $v)
(func $start (; 0 ;) (type $v)
(nop)
)
(func $function/i (; 1 ;) (type $i) (result i32)
(i32.const 0)
)
(func $function/I (; 2 ;) (type $I) (result i64)
(i64.const 0)
)
(func $function/f (; 3 ;) (type $f) (result f32)
(f32.const 0)
)
(func $function/F (; 4 ;) (type $F) (result f64)
(f64.const 0)
)
(func $function/iv (; 5 ;) (type $iv) (param $0 i32)
(nop)
)
(func $function/ii (; 6 ;) (type $ii) (param $0 i32) (result i32)
(get_local $0)
)
(func $function/II (; 7 ;) (type $II) (param $0 i64) (result i64)
(get_local $0)
)
(func $function/ff (; 8 ;) (type $ff) (param $0 f32) (result f32)
(get_local $0)
)
(func $function/FF (; 9 ;) (type $FF) (param $0 f64) (result f64)
(get_local $0)
)
(func $function/iiv (; 10 ;) (type $iiv) (param $0 i32) (param $1 i32)
(nop)
)
(func $function/iii (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.add
(get_local $0)
(get_local $1)
)
)
(func $function/III (; 12 ;) (type $IiI) (param $0 i64) (param $1 i32) (result i64)
(i64.add
(get_local $0)
(i64.extend_s/i32
(get_local $1)
)
)
)
(func $function/fff (; 13 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32)
(f32.add
(get_local $0)
(get_local $1)
)
)
(func $function/FFF (; 14 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64)
(f64.add
(get_local $0)
(get_local $1)
)
)
(func $start (; 15 ;) (type $v)
(call $function/v)
(drop
(call $function/i)
)
(drop
(call $function/I)
)
(drop
(call $function/f)
)
(drop
(call $function/F)
)
(call $function/iv
(i32.const 0)
)
(drop
(call $function/ii
(i32.const 0)
)
)
(drop
(call $function/II
(i64.const 0)
)
)
(drop
(call $function/ff
(f32.const 0)
)
)
(drop
(call $function/FF
(f64.const 0)
)
)
(call $function/iiv
(i32.const 1)
(i32.const 2)
)
(drop
(call $function/iii
(i32.const 1)
(i32.const 2)
)
)
(drop
(call $function/III
(i64.const 1)
(i32.const 2)
)
)
(drop
(call $function/fff
(f32.const 1)
(f32.const 2)
)
)
(drop
(call $function/FFF
(f64.const 1)
(f64.const 2)
)
)
)
)

View File

@ -43,9 +43,6 @@
(i32.const 1)
)
)
(set_local $0
(i32.const 0)
)
(loop $continue|0
(if
(i32.lt_u
@ -210,11 +207,7 @@
)
(if
(i32.and
(if (result i32)
(i32.lt_u
(get_local $2)
(i32.const 2)
)
(select
(i32.lt_u
(get_local $2)
(i32.const 2)
@ -223,6 +216,10 @@
(get_local $2)
(i32.const 3)
)
(i32.lt_u
(get_local $2)
(i32.const 2)
)
)
(i32.const 1)
)

View File

@ -48,10 +48,8 @@
)
)
(block $break|0
(block
(set_local $2
(i32.const 0)
)
(set_local $2
(i32.const 0)
)
(loop $continue|0
(if
@ -90,10 +88,8 @@
)
)
(block $break|1
(block
(set_local $5
(i32.const 0)
)
(set_local $5
(i32.const 0)
)
(loop $continue|1
(if
@ -131,33 +127,22 @@
)
)
)
(block
(set_local $8
(i32.and
(set_local $8
(i32.and
(i32.add
(i32.add
(i32.add
(i32.add
(i32.add
(i32.add
(i32.add
(i32.add
(i32.load8_u
(i32.add
(i32.mul
(get_local $3)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
)
(get_local $6)
)
)
(i32.load8_u
(i32.add
(i32.mul
(get_local $3)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
)
(get_local $5)
(i32.load8_u
(i32.add
(i32.mul
(get_local $3)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
)
(get_local $6)
)
)
(i32.load8_u
@ -166,17 +151,17 @@
(get_local $3)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
)
(get_local $7)
(get_local $5)
)
)
)
(i32.load8_u
(i32.add
(i32.mul
(get_local $2)
(get_local $3)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
)
(get_local $6)
(get_local $7)
)
)
)
@ -186,17 +171,17 @@
(get_local $2)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
)
(get_local $7)
(get_local $6)
)
)
)
(i32.load8_u
(i32.add
(i32.mul
(get_local $4)
(get_local $2)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
)
(get_local $6)
(get_local $7)
)
)
)
@ -206,7 +191,7 @@
(get_local $4)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
)
(get_local $5)
(get_local $6)
)
)
)
@ -216,12 +201,21 @@
(get_local $4)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
)
(get_local $7)
(get_local $5)
)
)
)
(i32.const 255)
(i32.load8_u
(i32.add
(i32.mul
(get_local $4)
(get_global $../../examples/game-of-life/assembly/game-of-life/w)
)
(get_local $7)
)
)
)
(i32.const 255)
)
)
(if

File diff suppressed because it is too large Load Diff

View File

@ -8,10 +8,10 @@
(export "memory" (memory $0))
(start $start)
(func $if/ifThenElse (; 0 ;) (type $ii) (param $0 i32) (result i32)
(if (result i32)
(get_local $0)
(select
(i32.const 1)
(i32.const 0)
(get_local $0)
)
)
(func $if/ifThen (; 1 ;) (type $ii) (param $0 i32) (result i32)

View File

@ -1,68 +0,0 @@
(module
(type $iii (func (param i32 i32) (result i32)))
(type $v (func))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)
(local $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(drop
(i32.add
(i32.add
(block (result i32)
(block $__inlined_func$export/add (result i32)
(set_local $0
(i32.const 1)
)
(set_local $1
(i32.const 2)
)
(i32.add
(get_local $0)
(get_local $1)
)
)
)
(block (result i32)
(block $__inlined_func$export/sub (result i32)
(set_local $2
(i32.const 2)
)
(set_local $3
(i32.const 3)
)
(i32.sub
(get_local $2)
(get_local $3)
)
)
)
)
(block (result i32)
(block $__inlined_func$export/mul (result i32)
(set_local $4
(i32.const 3)
)
(set_local $5
(i32.const 1)
)
(i32.mul
(get_local $4)
(get_local $5)
)
)
)
)
)
(block
(block $__inlined_func$export/ns.two
(nop)
)
)
)
)

View File

@ -1,49 +1,9 @@
(module
(type $iii (func (param i32 i32) (result i32)))
(type $v (func))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
(func $export/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.add
(get_local $0)
(get_local $1)
)
)
(func $export/sub (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.sub
(get_local $0)
(get_local $1)
)
)
(func $export/mul (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.mul
(get_local $0)
(get_local $1)
)
)
(func $export/ns.two (; 3 ;) (type $v)
(func $start (; 0 ;) (type $v)
(nop)
)
(func $start (; 4 ;) (type $v)
(drop
(i32.add
(i32.add
(call $export/add
(i32.const 1)
(i32.const 2)
)
(call $export/sub
(i32.const 2)
(i32.const 3)
)
)
(call $export/mul
(i32.const 3)
(i32.const 1)
)
)
)
(call $export/ns.two)
)
)

View File

@ -1,74 +0,0 @@
(module
(type $v (func))
(type $i (func (result i32)))
(type $I (func (result i64)))
(type $f (func (result f32)))
(type $F (func (result f64)))
(global $infer-type/ri (mut i32) (i32.const 0))
(global $infer-type/rI (mut i64) (i64.const 0))
(global $infer-type/rf (mut f32) (f32.const 0))
(global $infer-type/rF (mut f64) (f64.const 0))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)
(local $0 i32)
(local $1 i32)
(block
(block $__inlined_func$infer-type/locals
(nop)
)
)
(set_global $infer-type/ri
(block (result i32)
(block $__inlined_func$infer-type/reti (result i32)
(i32.const 0)
)
)
)
(set_global $infer-type/rI
(block (result i64)
(block $__inlined_func$infer-type/retI (result i64)
(i64.const 0)
)
)
)
(set_global $infer-type/rf
(block (result f32)
(block $__inlined_func$infer-type/retf (result f32)
(f32.const 0)
)
)
)
(set_global $infer-type/rF
(block (result f64)
(block $__inlined_func$infer-type/refF (result f64)
(f64.const 0)
)
)
)
(set_local $0
(i32.const 0)
)
(set_local $1
(i32.const 10)
)
(loop $continue|0
(if
(i32.lt_u
(get_local $0)
(get_local $1)
)
(block
(set_local $0
(i32.add
(get_local $0)
(i32.const 1)
)
)
(br $continue|0)
)
)
)
)
)

View File

@ -1,9 +1,5 @@
(module
(type $v (func))
(type $i (func (result i32)))
(type $I (func (result i64)))
(type $f (func (result f32)))
(type $F (func (result f64)))
(global $infer-type/ri (mut i32) (i32.const 0))
(global $infer-type/rI (mut i64) (i64.const 0))
(global $infer-type/rf (mut f32) (f32.const 0))
@ -11,48 +7,25 @@
(memory $0 1)
(export "memory" (memory $0))
(start $start)
(func $infer-type/locals (; 0 ;) (type $v)
(nop)
)
(func $infer-type/reti (; 1 ;) (type $i) (result i32)
(i32.const 0)
)
(func $infer-type/retI (; 2 ;) (type $I) (result i64)
(i64.const 0)
)
(func $infer-type/retf (; 3 ;) (type $f) (result f32)
(f32.const 0)
)
(func $infer-type/refF (; 4 ;) (type $F) (result f64)
(f64.const 0)
)
(func $start (; 5 ;) (type $v)
(func $start (; 0 ;) (type $v)
(local $0 i32)
(local $1 i32)
(call $infer-type/locals)
(set_global $infer-type/ri
(call $infer-type/reti)
)
(set_global $infer-type/rI
(call $infer-type/retI)
)
(set_global $infer-type/rf
(call $infer-type/retf)
)
(set_global $infer-type/rF
(call $infer-type/refF)
)
(set_local $0
(i32.const 0)
)
(set_local $1
(i32.const 10)
(set_global $infer-type/rI
(i64.const 0)
)
(set_global $infer-type/rf
(f32.const 0)
)
(set_global $infer-type/rF
(f64.const 0)
)
(loop $continue|0
(if
(i32.lt_u
(get_local $0)
(get_local $1)
(i32.const 10)
)
(block
(set_local $0

View File

@ -22,35 +22,23 @@
(local $3 i32)
(local $4 i64)
(local $5 f64)
(block
(set_local $0
(i32.const 10)
)
(set_local $0
(i32.const 10)
)
(block
(set_local $1
(i64.const 4294967296)
)
(set_local $1
(i64.const 4294967296)
)
(block
(set_local $2
(f64.const 1.5)
)
(set_local $2
(f64.const 1.5)
)
(block
(set_local $3
(i32.const 10)
)
(set_local $3
(i32.const 10)
)
(block
(set_local $4
(i64.const 4294967296)
)
(set_local $4
(i64.const 4294967296)
)
(block
(set_local $5
(f64.const 1.5)
)
(set_local $5
(f64.const 1.5)
)
)
(func $infer-type/reti (; 1 ;) (type $i) (result i32)
@ -126,7 +114,9 @@
(get_local $1)
)
(block
(nop)
(block
(nop)
)
(set_local $0
(i32.add
(get_local $0)

File diff suppressed because it is too large Load Diff

View File

@ -13,10 +13,8 @@
(local $4 i32)
(local $5 i32)
(local $6 i32)
(block
(set_local $3
(get_local $0)
)
(set_local $3
(get_local $0)
)
(nop)
(block $break|0

View File

@ -10,10 +10,8 @@
(func $memmove/memmove (; 0 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(block
(set_local $3
(get_local $0)
)
(set_local $3
(get_local $0)
)
(if
(i32.eq
@ -283,20 +281,22 @@
(if
(get_local $2)
(block
(i32.store8
(i32.add
(get_local $0)
(tee_local $2
(i32.sub
(get_local $2)
(i32.const 1)
(block
(i32.store8
(i32.add
(get_local $0)
(tee_local $2
(i32.sub
(get_local $2)
(i32.const 1)
)
)
)
)
(i32.load8_u
(i32.add
(get_local $1)
(get_local $2)
(i32.load8_u
(i32.add
(get_local $1)
(get_local $2)
)
)
)
)

View File

@ -10,349 +10,336 @@
(local $3 i32)
(local $4 i64)
(local $5 i32)
(set_local $3
(get_local $0)
)
(if
(i32.eqz
(get_local $2)
)
(return
(get_local $3)
)
)
(i32.store8
(get_local $0)
(get_local $1)
)
(i32.store8
(i32.sub
(i32.add
(get_local $0)
(get_local $2)
)
(i32.const 1)
)
(get_local $1)
)
(if
(i32.le_u
(get_local $2)
(i32.const 2)
)
(return
(get_local $3)
)
)
(i32.store8
(i32.add
(block $folding-inner0
(set_local $3
(get_local $0)
(i32.const 1)
)
(get_local $1)
)
(i32.store8
(i32.add
(br_if $folding-inner0
(i32.eqz
(get_local $2)
)
)
(i32.store8
(get_local $0)
(i32.const 2)
(get_local $1)
)
(get_local $1)
)
(i32.store8
(i32.sub
(i32.store8
(i32.sub
(i32.add
(get_local $0)
(get_local $2)
)
(i32.const 1)
)
(get_local $1)
)
(br_if $folding-inner0
(i32.le_u
(get_local $2)
(i32.const 2)
)
)
(i32.store8
(i32.add
(get_local $0)
(get_local $2)
(i32.const 1)
)
(i32.const 2)
(get_local $1)
)
(get_local $1)
)
(i32.store8
(i32.sub
(i32.store8
(i32.add
(get_local $0)
(get_local $2)
(i32.const 2)
)
(i32.const 3)
(get_local $1)
)
(get_local $1)
)
(if
(i32.le_u
(get_local $2)
(i32.const 6)
(i32.store8
(i32.sub
(i32.add
(get_local $0)
(get_local $2)
)
(i32.const 2)
)
(get_local $1)
)
(return
(get_local $3)
(i32.store8
(i32.sub
(i32.add
(get_local $0)
(get_local $2)
)
(i32.const 3)
)
(get_local $1)
)
)
(i32.store8
(i32.add
(get_local $0)
(i32.const 3)
(br_if $folding-inner0
(i32.le_u
(get_local $2)
(i32.const 6)
)
)
(get_local $1)
)
(i32.store8
(i32.sub
(i32.store8
(i32.add
(get_local $0)
(get_local $2)
(i32.const 3)
)
(i32.const 4)
(get_local $1)
)
(get_local $1)
)
(if
(i32.le_u
(get_local $2)
(i32.const 8)
(i32.store8
(i32.sub
(i32.add
(get_local $0)
(get_local $2)
)
(i32.const 4)
)
(get_local $1)
)
(return
(get_local $3)
(br_if $folding-inner0
(i32.le_u
(get_local $2)
(i32.const 8)
)
)
)
(i32.store
(tee_local $0
(i32.store
(tee_local $0
(i32.add
(get_local $0)
(tee_local $5
(i32.and
(i32.sub
(i32.const 0)
(get_local $0)
)
(i32.const 3)
)
)
)
)
(tee_local $1
(i32.mul
(get_local $1)
(i32.const 16843009)
)
)
)
(i32.store
(i32.sub
(i32.add
(get_local $0)
(tee_local $2
(i32.and
(i32.sub
(get_local $2)
(get_local $5)
)
(i32.const -4)
)
)
)
(i32.const 4)
)
(get_local $1)
)
(br_if $folding-inner0
(i32.le_u
(get_local $2)
(i32.const 8)
)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 4)
)
(get_local $1)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 8)
)
(get_local $1)
)
(i32.store
(i32.sub
(i32.add
(get_local $0)
(get_local $2)
)
(i32.const 12)
)
(get_local $1)
)
(i32.store
(i32.sub
(i32.add
(get_local $0)
(get_local $2)
)
(i32.const 8)
)
(get_local $1)
)
(br_if $folding-inner0
(i32.le_u
(get_local $2)
(i32.const 24)
)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 12)
)
(get_local $1)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 16)
)
(get_local $1)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 20)
)
(get_local $1)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 24)
)
(get_local $1)
)
(i32.store
(i32.sub
(i32.add
(get_local $0)
(get_local $2)
)
(i32.const 28)
)
(get_local $1)
)
(i32.store
(i32.sub
(i32.add
(get_local $0)
(get_local $2)
)
(i32.const 24)
)
(get_local $1)
)
(i32.store
(i32.sub
(i32.add
(get_local $0)
(get_local $2)
)
(i32.const 20)
)
(get_local $1)
)
(i32.store
(i32.sub
(i32.add
(get_local $0)
(get_local $2)
)
(i32.const 16)
)
(get_local $1)
)
(set_local $0
(i32.add
(get_local $0)
(tee_local $5
(i32.and
(i32.sub
(i32.const 0)
(i32.add
(i32.and
(get_local $0)
(i32.const 4)
)
(i32.const 3)
(i32.const 24)
)
)
)
)
(tee_local $1
(i32.mul
(get_local $1)
(i32.const 16843009)
)
)
)
(i32.store
(i32.sub
(i32.add
(get_local $0)
(tee_local $2
(i32.and
(i32.sub
(get_local $2)
(get_local $5)
)
(i32.const -4)
)
)
)
(i32.const 4)
)
(get_local $1)
)
(if
(i32.le_u
(get_local $2)
(i32.const 8)
)
(return
(get_local $3)
)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 4)
)
(get_local $1)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 8)
)
(get_local $1)
)
(i32.store
(i32.sub
(i32.add
(get_local $0)
(set_local $2
(i32.sub
(get_local $2)
)
(i32.const 12)
)
(get_local $1)
)
(i32.store
(i32.sub
(i32.add
(get_local $0)
(get_local $2)
)
(i32.const 8)
)
(get_local $1)
)
(if
(i32.le_u
(get_local $2)
(i32.const 24)
)
(return
(get_local $3)
)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 12)
)
(get_local $1)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 16)
)
(get_local $1)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 20)
)
(get_local $1)
)
(i32.store
(i32.add
(get_local $0)
(i32.const 24)
)
(get_local $1)
)
(i32.store
(i32.sub
(i32.add
(get_local $0)
(get_local $2)
)
(i32.const 28)
)
(get_local $1)
)
(i32.store
(i32.sub
(i32.add
(get_local $0)
(get_local $2)
)
(i32.const 24)
)
(get_local $1)
)
(i32.store
(i32.sub
(i32.add
(get_local $0)
(get_local $2)
)
(i32.const 20)
)
(get_local $1)
)
(i32.store
(i32.sub
(i32.add
(get_local $0)
(get_local $2)
)
(i32.const 16)
)
(get_local $1)
)
(set_local $0
(i32.add
(get_local $0)
(tee_local $5
(i32.add
(i32.and
(get_local $0)
(i32.const 4)
)
(i32.const 24)
)
(get_local $5)
)
)
)
(set_local $2
(i32.sub
(get_local $2)
(get_local $5)
)
)
(set_local $4
(i64.or
(i64.extend_u/i32
(get_local $1)
)
(i64.shl
(set_local $4
(i64.or
(i64.extend_u/i32
(get_local $1)
)
(i64.const 32)
(i64.shl
(i64.extend_u/i32
(get_local $1)
)
(i64.const 32)
)
)
)
)
(loop $continue|0
(if
(i32.ge_u
(get_local $2)
(i32.const 32)
)
(block
(i64.store
(get_local $0)
(get_local $4)
)
(i64.store
(i32.add
(get_local $0)
(i32.const 8)
)
(get_local $4)
)
(i64.store
(i32.add
(get_local $0)
(i32.const 16)
)
(get_local $4)
)
(i64.store
(i32.add
(get_local $0)
(i32.const 24)
)
(get_local $4)
)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 32)
)
)
(set_local $0
(i32.add
(get_local $0)
(i32.const 32)
)
)
(br $continue|0)
(loop $continue|0
(if
(i32.ge_u
(get_local $2)
(i32.const 32)
)
(block
(i64.store
(get_local $0)
(get_local $4)
)
(i64.store
(i32.add
(get_local $0)
(i32.const 8)
)
(get_local $4)
)
(i64.store
(i32.add
(get_local $0)
(i32.const 16)
)
(get_local $4)
)
(i64.store
(i32.add
(get_local $0)
(i32.const 24)
)
(get_local $4)
)
(set_local $2
(i32.sub
(get_local $2)
(i32.const 32)
)
)
(set_local $0
(i32.add
(get_local $0)
(i32.const 32)
)
)
(br $continue|0)
)
)
)
(return
(get_local $3)
)
)
(get_local $3)
)

View File

@ -11,10 +11,8 @@
(local $4 i32)
(local $5 i32)
(local $6 i64)
(block
(set_local $3
(get_local $0)
)
(set_local $3
(get_local $0)
)
(if
(i32.eqz
@ -116,15 +114,13 @@
(get_local $3)
)
)
(block
(set_local $4
(i32.and
(i32.sub
(i32.const 0)
(get_local $0)
)
(i32.const 3)
(set_local $4
(i32.and
(i32.sub
(i32.const 0)
(get_local $0)
)
(i32.const 3)
)
)
(set_local $0
@ -148,18 +144,16 @@
)
)
)
(block
(set_local $5
(i32.mul
(i32.div_u
(i32.sub
(i32.const 0)
(i32.const 1)
)
(i32.const 255)
(set_local $5
(i32.mul
(i32.div_u
(i32.sub
(i32.const 0)
(i32.const 1)
)
(get_local $1)
(i32.const 255)
)
(get_local $1)
)
)
(i32.store
@ -317,18 +311,16 @@
(get_local $4)
)
)
(block
(set_local $6
(i64.or
(set_local $6
(i64.or
(i64.extend_u/i32
(get_local $5)
)
(i64.shl
(i64.extend_u/i32
(get_local $5)
)
(i64.shl
(i64.extend_u/i32
(get_local $5)
)
(i64.const 32)
)
(i64.const 32)
)
)
)

View File

@ -1,24 +0,0 @@
(module
(type $i (func (result i32)))
(type $v (func))
(global $namespace/Outer.Inner.aVar (mut i32) (i32.const 0))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)
(drop
(block (result i32)
(block $__inlined_func$namespace/Outer.Inner.aFunc (result i32)
(get_global $namespace/Outer.Inner.aVar)
)
)
)
(drop
(block (result i32)
(block $__inlined_func$namespace/Joined.anotherFunc (result i32)
(i32.const 3)
)
)
)
)
)

View File

@ -1,22 +1,9 @@
(module
(type $i (func (result i32)))
(type $v (func))
(global $namespace/Outer.Inner.aVar (mut i32) (i32.const 0))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
(func $namespace/Outer.Inner.aFunc (; 0 ;) (type $i) (result i32)
(get_global $namespace/Outer.Inner.aVar)
)
(func $namespace/Joined.anotherFunc (; 1 ;) (type $i) (result i32)
(i32.const 3)
)
(func $start (; 2 ;) (type $v)
(drop
(call $namespace/Outer.Inner.aFunc)
)
(drop
(call $namespace/Joined.anotherFunc)
)
(func $start (; 0 ;) (type $v)
(nop)
)
)

View File

@ -593,10 +593,8 @@
(i32.const 255)
)
(block $break|0
(block
(set_local $0
(i32.const -128)
)
(set_local $0
(i32.const -128)
)
(loop $continue|0
(if

View File

@ -0,0 +1,46 @@
(module
(type $v (func))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)
(local $0 i32)
(loop $continue|0
(if
(i32.lt_s
(get_local $0)
(i32.const 1)
)
(block
(set_local $0
(i32.add
(get_local $0)
(i32.const 1)
)
)
(br $continue|0)
)
)
)
(set_local $0
(i32.const 0)
)
(loop $continue|1
(if
(i32.lt_s
(get_local $0)
(i32.const 1)
)
(block
(set_local $0
(i32.add
(get_local $0)
(i32.const 1)
)
)
(br $continue|1)
)
)
)
)
)

14
tests/compiler/scoped.ts Normal file
View File

@ -0,0 +1,14 @@
var aGlobal: i32 = 1;
const aConstant: i32 = 3;
let aStartFunctionLocal: i32 = 2;
for (var anotherStartFunctionLocal: i32 = 0; anotherStartFunctionLocal < 1; ++anotherStartFunctionLocal);
for (let aGlobal /* that shadows */: i32 = 0; aGlobal < 1; ++aGlobal)
aGlobal;
{
let /* actually not */ aConstant: i64 = 5;
{
let /* still not */ aConstant: f32 = 10;
}
}

124
tests/compiler/scoped.wast Normal file
View File

@ -0,0 +1,124 @@
(module
(type $v (func))
(global $scoped/aGlobal (mut i32) (i32.const 1))
(global $scoped/aConstant i32 (i32.const 3))
(global $scoped/aStartFunctionLocal (mut i32) (i32.const 2))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)
(local $0 i32)
(local $1 i32)
(local $2 i64)
(local $3 f32)
(block $break|0
(set_local $0
(i32.const 0)
)
(loop $continue|0
(if
(i32.lt_s
(get_local $0)
(i32.const 1)
)
(block
(nop)
(set_local $0
(i32.add
(get_local $0)
(i32.const 1)
)
)
(br $continue|0)
)
)
)
)
(block $break|1
(set_local $1
(i32.const 0)
)
(loop $continue|1
(if
(i32.lt_s
(get_local $1)
(i32.const 1)
)
(block
(drop
(get_local $1)
)
(set_local $1
(i32.add
(get_local $1)
(i32.const 1)
)
)
(br $continue|1)
)
)
)
)
(block
(set_local $2
(i64.const 5)
)
(block
(set_local $3
(f32.const 10)
)
)
)
)
)
(;
[program.elements]
GLOBAL: NaN
GLOBAL: Infinity
FUNCTION_PROTOTYPE: isNaN
FUNCTION_PROTOTYPE: isFinite
FUNCTION_PROTOTYPE: clz
FUNCTION_PROTOTYPE: ctz
FUNCTION_PROTOTYPE: popcnt
FUNCTION_PROTOTYPE: rotl
FUNCTION_PROTOTYPE: rotr
FUNCTION_PROTOTYPE: abs
FUNCTION_PROTOTYPE: max
FUNCTION_PROTOTYPE: min
FUNCTION_PROTOTYPE: ceil
FUNCTION_PROTOTYPE: floor
FUNCTION_PROTOTYPE: copysign
FUNCTION_PROTOTYPE: nearest
FUNCTION_PROTOTYPE: reinterpret
FUNCTION_PROTOTYPE: sqrt
FUNCTION_PROTOTYPE: trunc
FUNCTION_PROTOTYPE: load
FUNCTION_PROTOTYPE: store
FUNCTION_PROTOTYPE: sizeof
FUNCTION_PROTOTYPE: select
FUNCTION_PROTOTYPE: unreachable
FUNCTION_PROTOTYPE: current_memory
FUNCTION_PROTOTYPE: grow_memory
FUNCTION_PROTOTYPE: changetype
FUNCTION_PROTOTYPE: assert
FUNCTION_PROTOTYPE: i8
FUNCTION_PROTOTYPE: i16
FUNCTION_PROTOTYPE: i32
FUNCTION_PROTOTYPE: i64
FUNCTION_PROTOTYPE: u8
FUNCTION_PROTOTYPE: u16
FUNCTION_PROTOTYPE: u32
FUNCTION_PROTOTYPE: u64
FUNCTION_PROTOTYPE: bool
FUNCTION_PROTOTYPE: f32
FUNCTION_PROTOTYPE: f64
FUNCTION_PROTOTYPE: isize
FUNCTION_PROTOTYPE: usize
GLOBAL: HEAP_BASE
GLOBAL: scoped/aGlobal
GLOBAL: scoped/aConstant
GLOBAL: scoped/aStartFunctionLocal
[program.exports]
;)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -121,10 +121,8 @@
(local $4 i32)
(local $5 i32)
(local $6 i32)
(block
(set_local $3
(get_local $0)
)
(set_local $3
(get_local $0)
)
(nop)
(block $break|0
@ -1936,53 +1934,43 @@
(local $7 f64)
(local $8 i32)
(local $9 i64)
(block
(set_local $2
(i64.reinterpret/f64
(get_local $0)
)
(set_local $2
(i64.reinterpret/f64
(get_local $0)
)
)
(block
(set_local $3
(i64.reinterpret/f64
(get_local $1)
)
(set_local $3
(i64.reinterpret/f64
(get_local $1)
)
)
(block
(set_local $4
(i32.wrap/i64
(i64.and
(i64.shr_u
(get_local $2)
(i64.const 52)
)
(i64.const 2047)
)
)
)
)
(block
(set_local $5
(i32.wrap/i64
(i64.and
(i64.shr_u
(get_local $3)
(i64.const 52)
)
(i64.const 2047)
)
)
)
)
(block
(set_local $6
(i32.wrap/i64
(set_local $4
(i32.wrap/i64
(i64.and
(i64.shr_u
(get_local $2)
(i64.const 63)
(i64.const 52)
)
(i64.const 2047)
)
)
)
(set_local $5
(i32.wrap/i64
(i64.and
(i64.shr_u
(get_local $3)
(i64.const 52)
)
(i64.const 2047)
)
)
)
(set_local $6
(i32.wrap/i64
(i64.shr_u
(get_local $2)
(i64.const 63)
)
)
)
@ -2080,12 +2068,10 @@
)
(block
(block $break|0
(block
(set_local $9
(i64.shl
(get_local $2)
(i64.const 12)
)
(set_local $9
(i64.shl
(get_local $2)
(i64.const 12)
)
)
(loop $continue|0
@ -2414,48 +2400,38 @@
(local $7 f32)
(local $8 i32)
(local $9 i32)
(block
(set_local $2
(i32.reinterpret/f32
(get_local $0)
)
(set_local $2
(i32.reinterpret/f32
(get_local $0)
)
)
(block
(set_local $3
(i32.reinterpret/f32
(get_local $1)
)
(set_local $3
(i32.reinterpret/f32
(get_local $1)
)
)
(block
(set_local $4
(i32.and
(i32.shr_u
(get_local $2)
(i32.const 23)
)
(i32.const 255)
)
)
)
(block
(set_local $5
(i32.and
(i32.shr_u
(get_local $3)
(i32.const 23)
)
(i32.const 255)
)
)
)
(block
(set_local $6
(i32.and
(set_local $4
(i32.and
(i32.shr_u
(get_local $2)
(i32.const -2147483648)
(i32.const 23)
)
(i32.const 255)
)
)
(set_local $5
(i32.and
(i32.shr_u
(get_local $3)
(i32.const 23)
)
(i32.const 255)
)
)
(set_local $6
(i32.and
(get_local $2)
(i32.const -2147483648)
)
)
(if
@ -2552,12 +2528,10 @@
)
(block
(block $break|0
(block
(set_local $9
(i32.shl
(get_local $2)
(i32.const 9)
)
(set_local $9
(i32.shl
(get_local $2)
(i32.const 9)
)
)
(loop $continue|0

View File

@ -2159,13 +2159,13 @@
(if
(i32.le_s
(tee_local $3
(if (result i32)
(get_local $2)
(select
(i32.shl
(get_local $2)
(i32.const 1)
)
(i32.const 1)
(get_local $2)
)
)
(i32.load offset=4
@ -2655,9 +2655,6 @@
(local $1 i32)
(local $2 i32)
(local $3 i32)
(set_local $1
(i32.const 0)
)
(set_local $2
(i32.sub
(i32.load offset=8

View File

@ -30,10 +30,8 @@
(i32.const 0)
)
)
(block
(set_local $1
(current_memory)
)
(set_local $1
(current_memory)
)
(if
(i32.gt_u
@ -82,10 +80,8 @@
(unreachable)
)
)
(block
(set_local $4
(get_global $std:heap/HEAP_OFFSET)
)
(set_local $4
(get_global $std:heap/HEAP_OFFSET)
)
(if
(i32.and
@ -2220,20 +2216,22 @@
(if
(get_local $2)
(block
(i32.store8
(i32.add
(get_local $0)
(tee_local $2
(i32.sub
(get_local $2)
(i32.const 1)
(block
(i32.store8
(i32.add
(get_local $0)
(tee_local $2
(i32.sub
(get_local $2)
(i32.const 1)
)
)
)
)
(i32.load8_u
(i32.add
(get_local $1)
(get_local $2)
(i32.load8_u
(i32.add
(get_local $1)
(get_local $2)
)
)
)
)
@ -2260,13 +2258,11 @@
)
(unreachable)
)
(block
(set_local $2
(call $std:heap/allocate_memory
(i32.mul
(get_local $1)
(i32.const 4)
)
(set_local $2
(call $std:heap/allocate_memory
(i32.mul
(get_local $1)
(i32.const 4)
)
)
)
@ -2430,11 +2426,9 @@
(local $3 i32)
(local $4 i32)
(local $5 i32)
(block
(set_local $2
(i32.load offset=4
(get_local $0)
)
(set_local $2
(i32.load offset=4
(get_local $0)
)
)
(if
@ -2445,16 +2439,14 @@
(get_local $2)
)
(block
(block
(set_local $3
(if (result i32)
(set_local $3
(if (result i32)
(get_local $2)
(i32.shl
(get_local $2)
(i32.shl
(get_local $2)
(i32.const 1)
)
(i32.const 1)
)
(i32.const 1)
)
)
(if
@ -2468,13 +2460,11 @@
)
(unreachable)
)
(block
(set_local $4
(call $std:heap/allocate_memory
(i32.mul
(get_local $3)
(i32.const 4)
)
(set_local $4
(call $std:heap/allocate_memory
(i32.mul
(get_local $3)
(i32.const 4)
)
)
)
@ -2648,15 +2638,13 @@
)
(return)
)
(block
(set_local $3
(i32.and
(i32.sub
(i32.const 0)
(get_local $0)
)
(i32.const 3)
(set_local $3
(i32.and
(i32.sub
(i32.const 0)
(get_local $0)
)
(i32.const 3)
)
)
(set_local $0
@ -2680,18 +2668,16 @@
)
)
)
(block
(set_local $4
(i32.mul
(i32.div_u
(i32.sub
(i32.const 0)
(i32.const 1)
)
(i32.const 255)
(set_local $4
(i32.mul
(i32.div_u
(i32.sub
(i32.const 0)
(i32.const 1)
)
(get_local $1)
(i32.const 255)
)
(get_local $1)
)
)
(i32.store
@ -2845,18 +2831,16 @@
(get_local $3)
)
)
(block
(set_local $5
(i64.or
(set_local $5
(i64.or
(i64.extend_u/i32
(get_local $4)
)
(i64.shl
(i64.extend_u/i32
(get_local $4)
)
(i64.shl
(i64.extend_u/i32
(get_local $4)
)
(i64.const 32)
)
(i64.const 32)
)
)
)
@ -2924,12 +2908,10 @@
)
(unreachable)
)
(block
(set_local $1
(set_local $1
(i32.load
(i32.load
(i32.load
(get_local $0)
)
(get_local $0)
)
)
)
@ -3010,17 +2992,15 @@
)
(block
(block
(block
(set_local $3
(i32.load
(i32.add
(i32.load
(get_local $0)
)
(i32.mul
(get_local $1)
(i32.const 4)
)
(set_local $3
(i32.load
(i32.add
(i32.load
(get_local $0)
)
(i32.mul
(get_local $1)
(i32.const 4)
)
)
)

View File

@ -30,10 +30,8 @@
(i32.const 0)
)
)
(block
(set_local $1
(current_memory)
)
(set_local $1
(current_memory)
)
(if
(i32.gt_u
@ -82,10 +80,8 @@
(unreachable)
)
)
(block
(set_local $4
(get_global $std:heap/HEAP_OFFSET)
)
(set_local $4
(get_global $std:heap/HEAP_OFFSET)
)
(if
(i32.and
@ -210,15 +206,13 @@
)
(return)
)
(block
(set_local $3
(i32.and
(i32.sub
(i32.const 0)
(get_local $0)
)
(i32.const 3)
(set_local $3
(i32.and
(i32.sub
(i32.const 0)
(get_local $0)
)
(i32.const 3)
)
)
(set_local $0
@ -242,18 +236,16 @@
)
)
)
(block
(set_local $4
(i32.mul
(i32.div_u
(i32.sub
(i32.const 0)
(i32.const 1)
)
(i32.const 255)
(set_local $4
(i32.mul
(i32.div_u
(i32.sub
(i32.const 0)
(i32.const 1)
)
(get_local $1)
(i32.const 255)
)
(get_local $1)
)
)
(i32.store
@ -407,18 +399,16 @@
(get_local $3)
)
)
(block
(set_local $5
(i64.or
(set_local $5
(i64.or
(i64.extend_u/i32
(get_local $4)
)
(i64.shl
(i64.extend_u/i32
(get_local $4)
)
(i64.shl
(i64.extend_u/i32
(get_local $4)
)
(i64.const 32)
)
(i64.const 32)
)
)
)
@ -2574,20 +2564,22 @@
(if
(get_local $2)
(block
(i32.store8
(i32.add
(get_local $0)
(tee_local $2
(i32.sub
(get_local $2)
(i32.const 1)
(block
(i32.store8
(i32.add
(get_local $0)
(tee_local $2
(i32.sub
(get_local $2)
(i32.const 1)
)
)
)
)
(i32.load8_u
(i32.add
(get_local $1)
(get_local $2)
(i32.load8_u
(i32.add
(get_local $1)
(get_local $2)
)
)
)
)

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,6 @@
(module
(type $ii (func (param 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))
(global $std:heap/HEAP_OFFSET (mut i32) (i32.const 0))
@ -1970,10 +1969,7 @@
)
)
)
(func $std:heap/free_memory (; 4 ;) (type $iv) (param $0 i32)
(nop)
)
(func $std:set/Set#add (; 5 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $std:set/Set#add (; 4 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(if
@ -1999,12 +1995,10 @@
(i32.const 1)
)
)
(tee_local $3
(i32.const 8)
)
(i32.const 8)
(i32.gt_u
(get_local $2)
(get_local $3)
(i32.const 8)
)
)
)
@ -2029,7 +2023,7 @@
(i32.const 4)
)
)
(call $std:heap/free_memory
(drop
(i32.load
(get_local $0)
)
@ -2071,12 +2065,9 @@
)
(get_local $0)
)
(func $std:set/Set#has (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $std:set/Set#has (; 5 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(set_local $2
(i32.const 0)
)
(set_local $3
(i32.load offset=8
(get_local $0)
@ -2120,12 +2111,9 @@
)
(i32.const 0)
)
(func $std:set/Set#delete (; 7 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $std:set/Set#delete (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(set_local $2
(i32.const 0)
)
(set_local $3
(i32.load offset=8
(get_local $0)
@ -2223,13 +2211,7 @@
)
(i32.const 0)
)
(func $std:set/Set#clear (; 8 ;) (type $iv) (param $0 i32)
(i32.store offset=8
(get_local $0)
(i32.const 0)
)
)
(func $start (; 9 ;) (type $v)
(func $start (; 7 ;) (type $v)
(set_global $std:heap/HEAP_OFFSET
(get_global $HEAP_BASE)
)
@ -2345,8 +2327,9 @@
)
(unreachable)
)
(call $std:set/Set#clear
(i32.store offset=8
(get_global $std/set/set)
(i32.const 0)
)
(if
(call $std:set/Set#get:size

View File

@ -27,10 +27,8 @@
(i32.const 0)
)
)
(block
(set_local $1
(current_memory)
)
(set_local $1
(current_memory)
)
(if
(i32.gt_u
@ -79,10 +77,8 @@
(unreachable)
)
)
(block
(set_local $4
(get_global $std:heap/HEAP_OFFSET)
)
(set_local $4
(get_global $std:heap/HEAP_OFFSET)
)
(if
(i32.and
@ -2217,20 +2213,22 @@
(if
(get_local $2)
(block
(i32.store8
(i32.add
(get_local $0)
(tee_local $2
(i32.sub
(get_local $2)
(i32.const 1)
(block
(i32.store8
(i32.add
(get_local $0)
(tee_local $2
(i32.sub
(get_local $2)
(i32.const 1)
)
)
)
)
(i32.load8_u
(i32.add
(get_local $1)
(get_local $2)
(i32.load8_u
(i32.add
(get_local $1)
(get_local $2)
)
)
)
)
@ -2259,34 +2257,30 @@
)
)
(block
(block
(set_local $4
(select
(tee_local $2
(i32.shl
(i32.load offset=4
(get_local $0)
)
(i32.const 1)
(set_local $4
(select
(tee_local $2
(i32.shl
(i32.load offset=4
(get_local $0)
)
(i32.const 1)
)
(tee_local $3
(i32.const 8)
)
(i32.gt_u
(get_local $2)
(get_local $3)
)
)
(tee_local $3
(i32.const 8)
)
(i32.gt_u
(get_local $2)
(get_local $3)
)
)
)
(block
(set_local $5
(call $std:heap/allocate_memory
(i32.mul
(get_local $4)
(i32.const 4)
)
(set_local $5
(call $std:heap/allocate_memory
(i32.mul
(get_local $4)
(i32.const 4)
)
)
)

View File

@ -6,15 +6,36 @@
(export "doSwitchDefaultOmitted" (func $switch/doSwitchDefaultOmitted))
(export "memory" (memory $0))
(func $switch/doSwitch (; 0 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(block $case4|0
(block $case2|0
(block $case0|0
(block $tablify|0
(br_table $case2|0 $case0|0 $case4|0 $case4|0 $tablify|0
(if
(i32.ne
(tee_local $1
(get_local $0)
)
(i32.const 1)
)
(block
(br_if $case2|0
(i32.eqz
(get_local $1)
)
)
(br_if $case4|0
(i32.or
(i32.eq
(get_local $1)
(i32.const 2)
)
(i32.eq
(get_local $1)
(i32.const 3)
)
)
)
(br $case2|0)
)
(br $case2|0)
)
(return
(i32.const 1)
@ -27,18 +48,31 @@
(i32.const 23)
)
(func $switch/doSwitchDefaultFirst (; 1 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(block $case3|0
(block $case1|0
(block $tablify|0
(br_table $case1|0 $case3|0 $case3|0 $tablify|0
(i32.sub
(get_local $0)
(i32.const 1)
(if
(i32.ne
(tee_local $1
(get_local $0)
)
(i32.const 1)
)
(block
(br_if $case3|0
(i32.or
(i32.eq
(get_local $1)
(i32.const 2)
)
(i32.eq
(get_local $1)
(i32.const 3)
)
)
)
)
(return
(i32.const 0)
(return
(i32.const 0)
)
)
)
(return
@ -48,18 +82,31 @@
(i32.const 23)
)
(func $switch/doSwitchDefaultOmitted (; 2 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(block $break|0
(block $case2|0
(block $case0|0
(block $tablify|0
(br_table $case0|0 $case2|0 $case2|0 $tablify|0
(i32.sub
(get_local $0)
(i32.const 1)
(if
(i32.ne
(tee_local $1
(get_local $0)
)
(i32.const 1)
)
(block
(br_if $case2|0
(i32.or
(i32.eq
(get_local $1)
(i32.const 2)
)
(i32.eq
(get_local $1)
(i32.const 3)
)
)
)
(br $break|0)
)
(br $break|0)
)
(return
(i32.const 1)

View File

@ -1,277 +0,0 @@
(module
(type $ii (func (param i32) (result i32)))
(type $iiv (func (param i32 i32)))
(type $iiiv (func (param i32 i32 i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $iv (func (param i32)))
(type $v (func))
(memory $0 1)
(export "control$construct" (func $tlsf/control$construct))
(export "memory" (memory $0))
(start $start)
(func $tlsf/fls (; 0 ;) (type $ii) (param $0 i32) (result i32)
(if (result i32)
(get_local $0)
(i32.sub
(i32.const 31)
(i32.clz
(get_local $0)
)
)
(i32.const -1)
)
)
(func $tlsf/ffs (; 1 ;) (type $ii) (param $0 i32) (result i32)
(if (result i32)
(get_local $0)
(i32.ctz
(get_local $0)
)
(i32.const -1)
)
)
(func $tlsf/control$set_block (; 2 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32)
(if
(i32.ge_u
(get_local $1)
(i32.const 23)
)
(unreachable)
)
(if
(i32.ge_u
(get_local $2)
(i32.const 32)
)
(unreachable)
)
(i32.store
(i32.add
(i32.add
(get_local $0)
(i32.const 112)
)
(i32.mul
(i32.add
(i32.mul
(get_local $1)
(i32.const 32)
)
(get_local $2)
)
(i32.const 4)
)
)
(get_local $3)
)
)
(func $tlsf/control$construct (; 3 ;) (type $iv) (param $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
(local $8 i32)
(local $9 i32)
(local $10 i32)
(local $11 i32)
(block
(block $__inlined_func$tlsf/block$set_next_free
(set_local $3
(get_local $0)
)
(set_local $4
(get_local $0)
)
(i32.store
(i32.add
(get_local $3)
(i32.const 8)
)
(get_local $4)
)
)
)
(block
(block $__inlined_func$tlsf/block$set_prev_free
(set_local $5
(get_local $0)
)
(set_local $6
(get_local $0)
)
(i32.store
(i32.add
(get_local $5)
(i32.const 12)
)
(get_local $6)
)
)
)
(block
(block $__inlined_func$tlsf/control$set_fl_bitmap
(set_local $7
(get_local $0)
)
(set_local $8
(i32.const 0)
)
(i32.store
(i32.add
(get_local $7)
(i32.const 16)
)
(get_local $8)
)
)
)
(set_local $1
(i32.const 0)
)
(loop $continue|0
(if
(i32.lt_u
(get_local $1)
(i32.const 23)
)
(block
(block
(block $__inlined_func$tlsf/control$set_sl_bitmap
(set_local $9
(get_local $0)
)
(set_local $10
(get_local $1)
)
(set_local $11
(i32.const 0)
)
(block
(if
(i32.ge_u
(get_local $10)
(i32.const 23)
)
(unreachable)
)
(i32.store
(i32.add
(i32.add
(get_local $9)
(i32.const 20)
)
(i32.mul
(get_local $10)
(i32.const 4)
)
)
(get_local $11)
)
)
)
)
(set_local $2
(i32.const 0)
)
(loop $continue|1
(if
(i32.lt_u
(get_local $2)
(i32.const 32)
)
(block
(call $tlsf/control$set_block
(get_local $0)
(get_local $1)
(get_local $2)
(get_local $0)
)
(set_local $2
(i32.add
(get_local $2)
(i32.const 1)
)
)
(br $continue|1)
)
)
)
(set_local $1
(i32.add
(get_local $1)
(i32.const 1)
)
)
(br $continue|0)
)
)
)
)
(func $start (; 4 ;) (type $v)
(if
(i32.ne
(call $tlsf/fls
(i32.const 0)
)
(i32.const -1)
)
(unreachable)
)
(if
(call $tlsf/fls
(i32.const 1)
)
(unreachable)
)
(if
(i32.ne
(call $tlsf/fls
(i32.const -2147483640)
)
(i32.const 31)
)
(unreachable)
)
(if
(i32.ne
(call $tlsf/fls
(i32.const 2147483647)
)
(i32.const 30)
)
(unreachable)
)
(if
(i32.ne
(call $tlsf/ffs
(i32.const 0)
)
(i32.const -1)
)
(unreachable)
)
(if
(call $tlsf/ffs
(i32.const 1)
)
(unreachable)
)
(if
(i32.ne
(call $tlsf/ffs
(i32.const -2147483648)
)
(i32.const 31)
)
(unreachable)
)
(call $tlsf/control$construct
(i32.load
(i32.const 4)
)
)
)
)

View File

@ -1,7 +1,5 @@
(module
(type $ii (func (param i32) (result i32)))
(type $iiv (func (param i32 i32)))
(type $iiiv (func (param i32 i32 i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $iv (func (param i32)))
(type $v (func))
@ -10,8 +8,7 @@
(export "memory" (memory $0))
(start $start)
(func $tlsf/fls (; 0 ;) (type $ii) (param $0 i32) (result i32)
(if (result i32)
(get_local $0)
(select
(i32.sub
(i32.const 31)
(i32.clz
@ -19,67 +16,19 @@
)
)
(i32.const -1)
(get_local $0)
)
)
(func $tlsf/ffs (; 1 ;) (type $ii) (param $0 i32) (result i32)
(if (result i32)
(get_local $0)
(select
(i32.ctz
(get_local $0)
)
(i32.const -1)
(get_local $0)
)
)
(func $tlsf/block$set_next_free (; 2 ;) (type $iiv) (param $0 i32) (param $1 i32)
(i32.store
(i32.add
(get_local $0)
(i32.const 8)
)
(get_local $1)
)
)
(func $tlsf/block$set_prev_free (; 3 ;) (type $iiv) (param $0 i32) (param $1 i32)
(i32.store
(i32.add
(get_local $0)
(i32.const 12)
)
(get_local $1)
)
)
(func $tlsf/control$set_fl_bitmap (; 4 ;) (type $iiv) (param $0 i32) (param $1 i32)
(i32.store
(i32.add
(get_local $0)
(i32.const 16)
)
(get_local $1)
)
)
(func $tlsf/control$set_sl_bitmap (; 5 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(if
(i32.ge_u
(get_local $1)
(i32.const 23)
)
(unreachable)
)
(i32.store
(i32.add
(i32.add
(get_local $0)
(i32.const 20)
)
(i32.mul
(get_local $1)
(i32.const 4)
)
)
(get_local $2)
)
)
(func $tlsf/control$set_block (; 6 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32)
(func $tlsf/control$set_block (; 2 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32)
(if
(i32.ge_u
(get_local $1)
@ -114,55 +63,92 @@
(get_local $3)
)
)
(func $tlsf/control$construct (; 7 ;) (type $iv) (param $0 i32)
(func $tlsf/control$construct (; 3 ;) (type $iv) (param $0 i32)
(local $1 i32)
(local $2 i32)
(call $tlsf/block$set_next_free
(get_local $0)
(get_local $0)
(local $3 i32)
(i32.store
(i32.add
(tee_local $3
(get_local $0)
)
(i32.const 8)
)
(tee_local $1
(get_local $0)
)
)
(call $tlsf/block$set_prev_free
(get_local $0)
(get_local $0)
(i32.store
(i32.add
(tee_local $3
(get_local $0)
)
(i32.const 12)
)
(tee_local $1
(get_local $0)
)
)
(call $tlsf/control$set_fl_bitmap
(get_local $0)
(i32.const 0)
)
(set_local $1
(i32.store
(i32.add
(tee_local $1
(get_local $0)
)
(i32.const 16)
)
(i32.const 0)
)
(loop $continue|0
(if
(i32.lt_u
(get_local $1)
(get_local $2)
(i32.const 23)
)
(block
(call $tlsf/control$set_sl_bitmap
(set_local $3
(get_local $0)
(get_local $1)
)
(if
(i32.ge_u
(tee_local $1
(get_local $2)
)
(i32.const 23)
)
(unreachable)
)
(i32.store
(i32.add
(i32.add
(get_local $3)
(i32.const 20)
)
(i32.mul
(get_local $1)
(i32.const 4)
)
)
(i32.const 0)
)
(set_local $2
(set_local $1
(i32.const 0)
)
(loop $continue|1
(if
(i32.lt_u
(get_local $2)
(get_local $1)
(i32.const 32)
)
(block
(call $tlsf/control$set_block
(get_local $0)
(get_local $1)
(get_local $2)
(get_local $1)
(get_local $0)
)
(set_local $2
(set_local $1
(i32.add
(get_local $2)
(get_local $1)
(i32.const 1)
)
)
@ -170,9 +156,9 @@
)
)
)
(set_local $1
(set_local $2
(i32.add
(get_local $1)
(get_local $2)
(i32.const 1)
)
)
@ -181,7 +167,7 @@
)
)
)
(func $start (; 8 ;) (type $v)
(func $start (; 4 ;) (type $v)
(if
(i32.ne
(call $tlsf/fls

View File

@ -175,10 +175,8 @@
(i32.const 0)
)
(block $break|0
(block
(set_local $1
(i32.const 0)
)
(set_local $1
(i32.const 0)
)
(loop $continue|0
(if
@ -194,10 +192,8 @@
(i32.const 0)
)
(block $break|1
(block
(set_local $2
(i32.const 0)
)
(set_local $2
(i32.const 0)
)
(loop $continue|1
(if

View File

@ -132,9 +132,7 @@
(i32.const 1)
)
)
(tee_local $0
(get_local $0)
)
(get_local $0)
)
(block (result i32)
(set_global $while/m