Use stack IR when emitting text format (#312)

This commit is contained in:
Daniel Wirtz
2018-11-08 08:04:24 +01:00
committed by GitHub
parent 7135af36bd
commit 2bdc2a72f1
194 changed files with 239934 additions and 340697 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -3,15 +3,15 @@
(type $FF (func (param f64) (result f64))) (type $FF (func (param f64) (result f64)))
(type $v (func)) (type $v (func))
(import "env" "memory" (memory $0 0)) (import "env" "memory" (memory $0 0))
(table 1 anyfunc)
(elem (i32.const 0) $null)
(import "Math" "LN2" (global $~lib/bindings/Math/LN2 f64)) (import "Math" "LN2" (global $~lib/bindings/Math/LN2 f64))
(import "Math" "sqrt" (func $~lib/bindings/Math/sqrt (param f64) (result f64))) (import "Math" "sqrt" (func $~lib/bindings/Math/sqrt (param f64) (result f64)))
(import "Math" "log" (func $~lib/bindings/Math/log (param f64) (result f64))) (import "Math" "log" (func $~lib/bindings/Math/log (param f64) (result f64)))
(table $0 1 anyfunc)
(elem (i32.const 0) $null)
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(export "computeLine" (func $assembly/index/computeLine)) (export "computeLine" (func $assembly/index/computeLine))
(func $assembly/index/computeLine (; 2 ;) (; has Stack IR ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (func $assembly/index/computeLine (; 2 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32)
(local $4 f64) (local $4 f64)
(local $5 f64) (local $5 f64)
(local $6 f64) (local $6 f64)
@ -21,342 +21,191 @@
(local $10 f64) (local $10 f64)
(local $11 f64) (local $11 f64)
(local $12 f64) (local $12 f64)
;;@ assembly/index.ts:8:2 get_local $1
(set_local $11 f64.convert_u/i32
;;@ assembly/index.ts:8:19 tee_local $6
(f64.div f64.const 1.6
(tee_local $6 f64.div
(f64.convert_u/i32 set_local $11
(get_local $1) get_local $0
) f64.convert_u/i32
) get_local $2
;;@ assembly/index.ts:8:27 f64.convert_u/i32
(f64.const 1.6) tee_local $4
) f64.const 2
) f64.div
;;@ assembly/index.ts:11:2 tee_local $7
(set_local $9 f64.sub
;;@ assembly/index.ts:11:18 f64.const 10
(f64.mul f64.const 3
(f64.sub get_local $6
(f64.convert_u/i32 f64.mul
(get_local $0) f64.const 4
) get_local $4
;;@ assembly/index.ts:9:2 f64.mul
(tee_local $7 f64.min
;;@ assembly/index.ts:9:19 f64.div
(f64.div tee_local $12
(tee_local $4 f64.mul
(f64.convert_u/i32 set_local $9
(get_local $2) block $break|0
) loop $repeat|0
) get_local $8
;;@ assembly/index.ts:9:28 get_local $1
(f64.const 2) i32.ge_u
) br_if $break|0
) get_local $8
) f64.convert_u/i32
;;@ assembly/index.ts:10:2 get_local $11
(tee_local $12 f64.sub
;;@ assembly/index.ts:10:14 get_local $12
(f64.div f64.mul
(f64.const 10) set_local $10
;;@ assembly/index.ts:10:21 f64.const 0
(f64.min set_local $4
;;@ assembly/index.ts:10:25 f64.const 0
(f64.mul set_local $5
(f64.const 3) i32.const 0
(get_local $6) set_local $2
) block $break|1
;;@ assembly/index.ts:10:36 loop $continue|1
(f64.mul get_local $4
(f64.const 4) get_local $4
(get_local $4) f64.mul
) tee_local $6
) get_local $5
) get_local $5
) f64.mul
) tee_local $7
) f64.add
;;@ assembly/index.ts:12:2 f64.const 4
(block $break|0 f64.le
(loop $repeat|0 if
(br_if $break|0 f64.const 2
;;@ assembly/index.ts:12:23 get_local $4
(i32.ge_u f64.mul
(get_local $8) get_local $5
(get_local $1) f64.mul
) get_local $9
) f64.add
;;@ assembly/index.ts:13:4 set_local $5
(set_local $10 get_local $6
;;@ assembly/index.ts:13:15 get_local $7
(f64.mul f64.sub
(f64.sub get_local $10
(f64.convert_u/i32 f64.add
(get_local $8) set_local $4
) get_local $2
(get_local $11) get_local $3
) i32.ge_u
(get_local $12) br_if $break|1
) get_local $2
) i32.const 1
(set_local $4 i32.add
;;@ assembly/index.ts:16:13 set_local $2
(f64.const 0) br $continue|1
) end
(set_local $5 end
;;@ assembly/index.ts:16:23 end
(f64.const 0) block $break|2
) f64.const 8
;;@ assembly/index.ts:17:4 get_local $3
(set_local $2 f64.convert_u/i32
;;@ assembly/index.ts:17:25 f64.min
(i32.const 0) set_local $6
) loop $repeat|2
;;@ assembly/index.ts:18:4 get_local $2
(block $break|1 f64.convert_u/i32
(loop $continue|1 get_local $6
(if f64.lt
;;@ assembly/index.ts:18:11 i32.eqz
(f64.le br_if $break|2
(f64.add get_local $4
(tee_local $6 get_local $4
;;@ assembly/index.ts:18:19 f64.mul
(f64.mul get_local $5
(get_local $4) get_local $5
(get_local $4) f64.mul
) f64.sub
) get_local $10
;;@ assembly/index.ts:18:30 f64.add
(tee_local $7 set_local $7
;;@ assembly/index.ts:18:38 f64.const 2
(f64.mul get_local $4
(get_local $5) f64.mul
(get_local $5) get_local $5
) f64.mul
) get_local $9
) f64.add
;;@ assembly/index.ts:18:50 set_local $5
(f64.const 4) get_local $7
) set_local $4
(block get_local $2
;;@ assembly/index.ts:20:6 i32.const 1
(set_local $5 i32.add
;;@ assembly/index.ts:20:11 set_local $2
(f64.add br $repeat|2
(f64.mul unreachable
(f64.mul end
(f64.const 2) unreachable
(get_local $4) end
) get_local $0
(get_local $5) get_local $1
) i32.mul
(get_local $9) get_local $8
) i32.add
) i32.const 1
;;@ assembly/index.ts:21:6 i32.shl
(set_local $4 get_local $4
;;@ assembly/index.ts:19:18 get_local $4
(f64.add f64.mul
(f64.sub get_local $5
(get_local $6) get_local $5
(get_local $7) f64.mul
) f64.add
(get_local $10) call $~lib/bindings/Math/sqrt
) call $~lib/bindings/Math/log
) call $~lib/bindings/Math/log
;;@ assembly/index.ts:22:30 get_global $~lib/bindings/Math/LN2
(br_if $break|1 f64.div
;;@ assembly/index.ts:22:10 tee_local $6
(i32.ge_u get_local $6
(get_local $2) f64.sub
(get_local $3) f64.const 0
) f64.eq
) if (result i32)
;;@ assembly/index.ts:23:6 f64.const 2047
(set_local $2 get_local $2
(i32.add i32.const 1
(get_local $2) i32.add
(i32.const 1) f64.convert_u/i32
) get_local $6
) f64.sub
(br $continue|1) get_local $3
) f64.convert_u/i32
) f64.div
) f64.const 0
) f64.max
;;@ assembly/index.ts:27:4 f64.const 1
(block $break|2 f64.min
;;@ assembly/index.ts:27:9 f64.mul
(set_local $6 i32.trunc_u/f64
;;@ assembly/index.ts:27:29 else
(f64.min i32.const 2047
;;@ assembly/index.ts:27:33 end
(f64.const 8) tee_local $2
;;@ assembly/index.ts:27:36 i32.store16
(f64.convert_u/i32 get_local $8
(get_local $3) i32.const 1
) i32.add
) set_local $8
) br $repeat|0
(loop $repeat|2 unreachable
(br_if $break|2 end
(i32.eqz unreachable
;;@ assembly/index.ts:27:44 end
(f64.lt
(f64.convert_u/i32
(get_local $2)
)
(get_local $6)
)
)
)
;;@ assembly/index.ts:28:6
(set_local $7
;;@ assembly/index.ts:28:18
(f64.add
(f64.sub
(f64.mul
(get_local $4)
(get_local $4)
)
;;@ assembly/index.ts:28:28
(f64.mul
(get_local $5)
(get_local $5)
)
)
(get_local $10)
)
)
;;@ assembly/index.ts:29:6
(set_local $5
;;@ assembly/index.ts:29:11
(f64.add
(f64.mul
(f64.mul
(f64.const 2)
(get_local $4)
)
(get_local $5)
)
(get_local $9)
)
)
;;@ assembly/index.ts:30:6
(set_local $4
(get_local $7)
)
;;@ assembly/index.ts:27:71
(set_local $2
(i32.add
(get_local $2)
(i32.const 1)
)
)
(br $repeat|2)
)
)
;;@ assembly/index.ts:40:4
(i32.store16
;;@ assembly/index.ts:40:15
(i32.shl
(i32.add
;;@ assembly/index.ts:40:16
(i32.mul
(get_local $0)
(get_local $1)
)
(get_local $8)
)
;;@ assembly/index.ts:40:34
(i32.const 1)
)
(tee_local $2
;;@ assembly/index.ts:37:15
(if (result i32)
(f64.eq
(f64.sub
;;@ assembly/index.ts:36:4
(tee_local $6
;;@ assembly/index.ts:36:15
(f64.div
;;@ assembly/index.ts:36:20
(call $~lib/bindings/Math/log
;;@ assembly/index.ts:36:29
(call $~lib/bindings/Math/log
;;@ assembly/index.ts:36:38
(call $~lib/bindings/Math/sqrt
;;@ assembly/index.ts:36:43
(f64.add
(f64.mul
(get_local $4)
(get_local $4)
)
;;@ assembly/index.ts:36:53
(f64.mul
(get_local $5)
(get_local $5)
)
)
)
)
)
;;@ assembly/index.ts:36:66
(get_global $~lib/bindings/Math/LN2)
)
)
(get_local $6)
)
(f64.const 0)
)
;;@ assembly/index.ts:38:8
(i32.trunc_u/f64
;;@ assembly/index.ts:38:14
(f64.mul
(f64.const 2047)
(f64.min
(f64.max
;;@ assembly/index.ts:38:39
(f64.div
(f64.sub
(f64.convert_u/i32
;;@ assembly/index.ts:38:40
(i32.add
(get_local $2)
;;@ assembly/index.ts:38:52
(i32.const 1)
)
)
(get_local $6)
)
(f64.convert_u/i32
(get_local $3)
)
)
(f64.const 0)
)
(f64.const 1)
)
)
)
(i32.const 2047)
)
)
)
;;@ assembly/index.ts:12:34
(set_local $8
(i32.add
(get_local $8)
(i32.const 1)
)
)
(br $repeat|0)
)
)
) )
(func $null (; 3 ;) (; has Stack IR ;) (type $v) (func $null (; 3 ;) (type $v)
(nop) nop
) )
) )

View File

@ -5,42 +5,29 @@
(type $FFFF (func (param f64 f64 f64) (result f64))) (type $FFFF (func (param f64 f64 f64) (result f64)))
(type $v (func)) (type $v (func))
(import "env" "memory" (memory $0 0)) (import "env" "memory" (memory $0 0))
(table 1 anyfunc)
(elem (i32.const 0) $null)
(import "Math" "LN2" (global $~lib/bindings/Math/LN2 f64)) (import "Math" "LN2" (global $~lib/bindings/Math/LN2 f64))
(import "Math" "sqrt" (func $~lib/bindings/Math/sqrt (param f64) (result f64))) (import "Math" "sqrt" (func $~lib/bindings/Math/sqrt (param f64) (result f64)))
(import "Math" "log" (func $~lib/bindings/Math/log (param f64) (result f64))) (import "Math" "log" (func $~lib/bindings/Math/log (param f64) (result f64)))
(table $0 1 anyfunc)
(elem (i32.const 0) $null)
(global $assembly/index/NUM_COLORS i32 (i32.const 2048)) (global $assembly/index/NUM_COLORS i32 (i32.const 2048))
(global $HEAP_BASE i32 (i32.const 8)) (global $HEAP_BASE i32 (i32.const 8))
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(export "computeLine" (func $assembly/index/computeLine)) (export "computeLine" (func $assembly/index/computeLine))
(func $~lib/builtins/isFinite<f64> (; 2 ;) (type $Fi) (param $0 f64) (result i32) (func $~lib/builtins/isFinite<f64> (; 2 ;) (type $Fi) (param $0 f64) (result i32)
;;@ ~lib/builtins.ts:16:78 get_local $0
(f64.eq get_local $0
;;@ ~lib/builtins.ts:16:61 f64.sub
(f64.sub f64.const 0
(get_local $0) f64.eq
;;@ ~lib/builtins.ts:16:69
(get_local $0)
)
;;@ ~lib/builtins.ts:16:78
(f64.const 0)
)
) )
(func $assembly/index/clamp<f64> (; 3 ;) (type $FFFF) (param $0 f64) (param $1 f64) (param $2 f64) (result f64) (func $assembly/index/clamp<f64> (; 3 ;) (type $FFFF) (param $0 f64) (param $1 f64) (param $2 f64) (result f64)
;;@ assembly/index.ts:47:43 get_local $0
(f64.min get_local $1
;;@ assembly/index.ts:47:13 f64.max
(f64.max get_local $2
;;@ assembly/index.ts:47:17 f64.min
(get_local $0)
;;@ assembly/index.ts:47:24
(get_local $1)
)
;;@ assembly/index.ts:47:35
(get_local $2)
)
) )
(func $assembly/index/computeLine (; 4 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (func $assembly/index/computeLine (; 4 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32)
(local $4 f64) (local $4 f64)
@ -57,413 +44,207 @@
(local $15 f64) (local $15 f64)
(local $16 f64) (local $16 f64)
(local $17 i32) (local $17 i32)
;;@ assembly/index.ts:8:2 get_local $1
(set_local $4 f64.convert_u/i32
;;@ assembly/index.ts:8:19 f64.const 1.6
(f64.div f64.div
(f64.convert_u/i32 set_local $4
(get_local $1) get_local $2
) f64.convert_u/i32
;;@ assembly/index.ts:8:27 f64.const 2
(f64.const 1.6) f64.div
) set_local $5
) f64.const 10
;;@ assembly/index.ts:9:2 f64.const 3
(set_local $5 get_local $1
;;@ assembly/index.ts:9:19 f64.convert_u/i32
(f64.div f64.mul
(f64.convert_u/i32 f64.const 4
(get_local $2) get_local $2
) f64.convert_u/i32
;;@ assembly/index.ts:9:28 f64.mul
(f64.const 2) f64.min
) f64.div
) set_local $6
;;@ assembly/index.ts:10:2 get_local $0
(set_local $6 f64.convert_u/i32
;;@ assembly/index.ts:10:14 get_local $5
(f64.div f64.sub
(f64.const 10) get_local $6
;;@ assembly/index.ts:10:21 f64.mul
(f64.min set_local $7
;;@ assembly/index.ts:10:25 block $break|0
(f64.mul i32.const 0
(f64.const 3) set_local $8
(f64.convert_u/i32 loop $repeat|0
;;@ assembly/index.ts:10:29 get_local $8
(get_local $1) get_local $1
) i32.lt_u
) i32.eqz
;;@ assembly/index.ts:10:36 br_if $break|0
(f64.mul block
(f64.const 4) get_local $8
(f64.convert_u/i32 f64.convert_u/i32
;;@ assembly/index.ts:10:40 get_local $4
(get_local $2) f64.sub
) get_local $6
) f64.mul
) set_local $9
) f64.const 0
) set_local $10
;;@ assembly/index.ts:11:2 f64.const 0
(set_local $7 set_local $11
;;@ assembly/index.ts:11:18 i32.const 0
(f64.mul set_local $14
(f64.sub block $break|1
(f64.convert_u/i32 loop $continue|1
;;@ assembly/index.ts:11:19 get_local $10
(get_local $0) get_local $10
) f64.mul
;;@ assembly/index.ts:11:23 tee_local $12
(get_local $5) get_local $11
) get_local $11
;;@ assembly/index.ts:11:37 f64.mul
(get_local $6) tee_local $13
) f64.add
) f64.const 4
;;@ assembly/index.ts:12:2 f64.le
(block $break|0 if
;;@ assembly/index.ts:12:7 block
(set_local $8 get_local $12
;;@ assembly/index.ts:12:20 get_local $13
(i32.const 0) f64.sub
) get_local $9
(loop $repeat|0 f64.add
(br_if $break|0 set_local $15
(i32.eqz f64.const 2
;;@ assembly/index.ts:12:23 get_local $10
(i32.lt_u f64.mul
(get_local $8) get_local $11
;;@ assembly/index.ts:12:27 f64.mul
(get_local $1) get_local $7
) f64.add
) set_local $11
) get_local $15
;;@ assembly/index.ts:12:39 set_local $10
(block get_local $14
;;@ assembly/index.ts:13:4 get_local $3
(set_local $9 i32.ge_u
;;@ assembly/index.ts:13:15 if
(f64.mul br $break|1
(f64.sub end
(f64.convert_u/i32 get_local $14
;;@ assembly/index.ts:13:16 i32.const 1
(get_local $8) i32.add
) set_local $14
;;@ assembly/index.ts:13:20 end
(get_local $4) br $continue|1
) end
;;@ assembly/index.ts:13:34 end
(get_local $6) end
) block $break|2
) f64.const 8
(set_local $10 get_local $3
;;@ assembly/index.ts:16:13 f64.convert_u/i32
(f64.const 0) f64.min
) set_local $15
(set_local $11 loop $repeat|2
;;@ assembly/index.ts:16:23 get_local $14
(f64.const 0) f64.convert_u/i32
) get_local $15
;;@ assembly/index.ts:17:4 f64.lt
(set_local $14 i32.eqz
;;@ assembly/index.ts:17:25 br_if $break|2
(i32.const 0) block
) get_local $10
;;@ assembly/index.ts:18:4 get_local $10
(block $break|1 f64.mul
(loop $continue|1 get_local $11
(if get_local $11
;;@ assembly/index.ts:18:11 f64.mul
(f64.le f64.sub
(f64.add get_local $9
(tee_local $12 f64.add
;;@ assembly/index.ts:18:19 set_local $16
(f64.mul f64.const 2
(get_local $10) get_local $10
;;@ assembly/index.ts:18:24 f64.mul
(get_local $10) get_local $11
) f64.mul
) get_local $7
;;@ assembly/index.ts:18:30 f64.add
(tee_local $13 set_local $11
;;@ assembly/index.ts:18:38 get_local $16
(f64.mul set_local $10
(get_local $11) end
;;@ assembly/index.ts:18:43 get_local $14
(get_local $11) i32.const 1
) i32.add
) set_local $14
) br $repeat|2
;;@ assembly/index.ts:18:50 unreachable
(f64.const 4) end
) unreachable
(block end
;;@ assembly/index.ts:18:55 get_local $10
(block get_local $10
;;@ assembly/index.ts:19:6 f64.mul
(set_local $15 get_local $11
;;@ assembly/index.ts:19:18 get_local $11
(f64.add f64.mul
(f64.sub f64.add
(get_local $12) call $~lib/bindings/Math/sqrt
;;@ assembly/index.ts:19:25 call $~lib/bindings/Math/log
(get_local $13) call $~lib/bindings/Math/log
) get_global $~lib/bindings/Math/LN2
;;@ assembly/index.ts:19:32 f64.div
(get_local $9) set_local $15
) get_local $15
) call $~lib/builtins/isFinite<f64>
;;@ assembly/index.ts:20:6 if (result i32)
(set_local $11 get_global $assembly/index/NUM_COLORS
;;@ assembly/index.ts:20:11 i32.const 1
(f64.add i32.sub
(f64.mul f64.convert_s/i32
(f64.mul get_local $14
(f64.const 2) i32.const 1
;;@ assembly/index.ts:20:17 i32.add
(get_local $10) f64.convert_u/i32
) get_local $15
;;@ assembly/index.ts:20:22 f64.sub
(get_local $11) get_local $3
) f64.convert_u/i32
;;@ assembly/index.ts:20:27 f64.div
(get_local $7) f64.const 0
) f64.const 1
) call $assembly/index/clamp<f64>
;;@ assembly/index.ts:21:6 f64.mul
(set_local $10 i32.trunc_u/f64
;;@ assembly/index.ts:21:11 else
(get_local $15) get_global $assembly/index/NUM_COLORS
) i32.const 1
;;@ assembly/index.ts:22:6 i32.sub
(if end
;;@ assembly/index.ts:22:10 set_local $17
(i32.ge_u get_local $0
(get_local $14) get_local $1
;;@ assembly/index.ts:22:23 i32.mul
(get_local $3) get_local $8
) i32.add
;;@ assembly/index.ts:22:30 i32.const 1
(br $break|1) i32.shl
) get_local $17
;;@ assembly/index.ts:23:6 i32.store16
(set_local $14 end
(i32.add get_local $8
;;@ assembly/index.ts:23:8 i32.const 1
(get_local $14) i32.add
(i32.const 1) set_local $8
) br $repeat|0
) unreachable
) end
(br $continue|1) unreachable
) end
)
)
)
;;@ assembly/index.ts:27:4
(block $break|2
;;@ assembly/index.ts:27:9
(set_local $15
;;@ assembly/index.ts:27:29
(f64.min
;;@ assembly/index.ts:27:33
(f64.const 8)
;;@ assembly/index.ts:27:36
(f64.convert_u/i32
(get_local $3)
)
)
)
(loop $repeat|2
(br_if $break|2
(i32.eqz
;;@ assembly/index.ts:27:44
(f64.lt
(f64.convert_u/i32
(get_local $14)
)
;;@ assembly/index.ts:27:56
(get_local $15)
)
)
)
;;@ assembly/index.ts:27:84
(block
;;@ assembly/index.ts:28:6
(set_local $16
;;@ assembly/index.ts:28:18
(f64.add
(f64.sub
(f64.mul
(get_local $10)
;;@ assembly/index.ts:28:23
(get_local $10)
)
;;@ assembly/index.ts:28:28
(f64.mul
(get_local $11)
;;@ assembly/index.ts:28:33
(get_local $11)
)
)
;;@ assembly/index.ts:28:38
(get_local $9)
)
)
;;@ assembly/index.ts:29:6
(set_local $11
;;@ assembly/index.ts:29:11
(f64.add
(f64.mul
(f64.mul
(f64.const 2)
;;@ assembly/index.ts:29:17
(get_local $10)
)
;;@ assembly/index.ts:29:22
(get_local $11)
)
;;@ assembly/index.ts:29:27
(get_local $7)
)
)
;;@ assembly/index.ts:30:6
(set_local $10
;;@ assembly/index.ts:30:11
(get_local $16)
)
)
;;@ assembly/index.ts:27:71
(set_local $14
(i32.add
;;@ assembly/index.ts:27:73
(get_local $14)
(i32.const 1)
)
)
(br $repeat|2)
)
)
;;@ assembly/index.ts:36:4
(set_local $15
;;@ assembly/index.ts:36:15
(f64.div
;;@ assembly/index.ts:36:20
(call $~lib/bindings/Math/log
;;@ assembly/index.ts:36:29
(call $~lib/bindings/Math/log
;;@ assembly/index.ts:36:38
(call $~lib/bindings/Math/sqrt
;;@ assembly/index.ts:36:43
(f64.add
(f64.mul
(get_local $10)
;;@ assembly/index.ts:36:48
(get_local $10)
)
;;@ assembly/index.ts:36:53
(f64.mul
(get_local $11)
;;@ assembly/index.ts:36:58
(get_local $11)
)
)
)
)
)
;;@ assembly/index.ts:36:66
(get_global $~lib/bindings/Math/LN2)
)
)
;;@ assembly/index.ts:37:4
(set_local $17
;;@ assembly/index.ts:37:15
(if (result i32)
(call $~lib/builtins/isFinite<f64>
;;@ assembly/index.ts:37:24
(get_local $15)
)
;;@ assembly/index.ts:38:8
(i32.trunc_u/f64
;;@ assembly/index.ts:38:14
(f64.mul
(f64.convert_s/i32
(i32.sub
;;@ assembly/index.ts:38:15
(get_global $assembly/index/NUM_COLORS)
;;@ assembly/index.ts:38:28
(i32.const 1)
)
)
;;@ assembly/index.ts:38:33
(call $assembly/index/clamp<f64>
;;@ assembly/index.ts:38:39
(f64.div
(f64.sub
(f64.convert_u/i32
;;@ assembly/index.ts:38:40
(i32.add
(get_local $14)
;;@ assembly/index.ts:38:52
(i32.const 1)
)
)
;;@ assembly/index.ts:38:56
(get_local $15)
)
(f64.convert_u/i32
;;@ assembly/index.ts:38:64
(get_local $3)
)
)
;;@ assembly/index.ts:38:71
(f64.const 0)
;;@ assembly/index.ts:38:76
(f64.const 1)
)
)
)
;;@ assembly/index.ts:39:8
(i32.sub
(get_global $assembly/index/NUM_COLORS)
;;@ assembly/index.ts:39:21
(i32.const 1)
)
)
)
;;@ assembly/index.ts:40:4
(i32.store16
;;@ assembly/index.ts:40:15
(i32.shl
(i32.add
;;@ assembly/index.ts:40:16
(i32.mul
(get_local $0)
;;@ assembly/index.ts:40:20
(get_local $1)
)
;;@ assembly/index.ts:40:28
(get_local $8)
)
;;@ assembly/index.ts:40:34
(i32.const 1)
)
;;@ assembly/index.ts:40:37
(get_local $17)
)
)
;;@ assembly/index.ts:12:34
(set_local $8
(i32.add
;;@ assembly/index.ts:12:36
(get_local $8)
(i32.const 1)
)
)
(br $repeat|0)
)
)
) )
(func $null (; 5 ;) (type $v) (func $null (; 5 ;) (type $v)
) )

View File

@ -447,7 +447,7 @@ function asmFunc(global, env, buffer) {
pagesToAdd = pagesToAdd | 0; pagesToAdd = pagesToAdd | 0;
var oldPages = __wasm_current_memory() | 0; var oldPages = __wasm_current_memory() | 0;
var newPages = oldPages + pagesToAdd | 0; var newPages = oldPages + pagesToAdd | 0;
if ((oldPages < newPages) && (newPages < 65535)) { if ((oldPages < newPages) && (newPages < 65536)) {
var newBuffer = new ArrayBuffer(Math_imul(newPages, 65536)); var newBuffer = new ArrayBuffer(Math_imul(newPages, 65536));
var newHEAP8 = new global.Int8Array(newBuffer); var newHEAP8 = new global.Int8Array(newBuffer);
newHEAP8.set(HEAP8); newHEAP8.set(HEAP8);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -6,9 +6,6 @@
(type $Fv (func (param f64))) (type $Fv (func (param f64)))
(type $i (func (result i32))) (type $i (func (result i32)))
(type $I (func (result i64))) (type $I (func (result i64)))
(memory $0 0)
(table 1 anyfunc)
(elem (i32.const 0) $null)
(import "pson" "onNull" (func $assembly/pson/onNull)) (import "pson" "onNull" (func $assembly/pson/onNull))
(import "pson" "onTrue" (func $assembly/pson/onTrue)) (import "pson" "onTrue" (func $assembly/pson/onTrue))
(import "pson" "onFalse" (func $assembly/pson/onFalse)) (import "pson" "onFalse" (func $assembly/pson/onFalse))
@ -23,6 +20,9 @@
(import "pson" "onDouble" (func $assembly/pson/onDouble (param f64))) (import "pson" "onDouble" (func $assembly/pson/onDouble (param f64)))
(import "pson" "onString" (func $assembly/pson/onString (param i32 i32))) (import "pson" "onString" (func $assembly/pson/onString (param i32 i32)))
(import "pson" "onBinary" (func $assembly/pson/onBinary (param i32 i32))) (import "pson" "onBinary" (func $assembly/pson/onBinary (param i32 i32)))
(memory $0 0)
(table $0 1 anyfunc)
(elem (i32.const 0) $null)
(global $assembly/pson/offset (mut i32) (i32.const 0)) (global $assembly/pson/offset (mut i32) (i32.const 0))
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
@ -41,537 +41,304 @@
(export "onString" (func $assembly/pson/onString)) (export "onString" (func $assembly/pson/onString))
(export "onBinary" (func $assembly/pson/onBinary)) (export "onBinary" (func $assembly/pson/onBinary))
(export "decode" (func $assembly/pson/decode)) (export "decode" (func $assembly/pson/decode))
(func $assembly/pson/readVarint32 (; 14 ;) (; has Stack IR ;) (type $i) (result i32) (func $assembly/pson/readVarint32 (; 14 ;) (type $i) (result i32)
(local $0 i32) (local $0 i32)
(local $1 i32) (local $1 i32)
(local $2 i32) (local $2 i32)
(loop $continue|0 loop $continue|0
;;@ assembly/pson.ts:138:4 get_local $0
(set_local $0 block (result i32)
(i32.or get_global $assembly/pson/offset
(get_local $0) tee_local $0
;;@ assembly/pson.ts:137:17 i32.const 1
(block (result i32) i32.add
(set_global $assembly/pson/offset set_global $assembly/pson/offset
(i32.add get_local $0
(tee_local $0 i32.load8_u
(get_global $assembly/pson/offset) tee_local $2
) i32.const 127
(i32.const 1) i32.and
) block (result i32)
) get_local $1
;;@ assembly/pson.ts:138:13 tee_local $0
(i32.shl i32.const 1
(i32.and i32.add
;;@ assembly/pson.ts:137:4 set_local $1
(tee_local $2 get_local $0
;;@ assembly/pson.ts:137:8 i32.const 7
(i32.load8_u i32.mul
(get_local $0) end
) i32.shl
) end
;;@ assembly/pson.ts:138:23 i32.or
(i32.const 127) set_local $0
) get_local $2
;;@ assembly/pson.ts:138:37 i32.const 128
(block (result i32) i32.and
(set_local $1 br_if $continue|0
(i32.add end
(tee_local $0 get_local $0
(get_local $1)
)
(i32.const 1)
)
)
;;@ assembly/pson.ts:138:32
(i32.mul
(get_local $0)
;;@ assembly/pson.ts:138:33
(i32.const 7)
)
)
)
)
)
)
(br_if $continue|0
;;@ assembly/pson.ts:139:11
(i32.and
(get_local $2)
;;@ assembly/pson.ts:139:15
(i32.const 128)
)
)
)
;;@ assembly/pson.ts:140:9
(get_local $0)
) )
(func $assembly/pson/readVarint64 (; 15 ;) (; has Stack IR ;) (type $I) (result i64) (func $assembly/pson/readVarint64 (; 15 ;) (type $I) (result i64)
(local $0 i64) (local $0 i64)
(local $1 i32) (local $1 i32)
(local $2 i64) (local $2 i64)
(loop $continue|0 loop $continue|0
;;@ assembly/pson.ts:149:4 get_local $0
(set_local $0 block (result i64)
(i64.or get_global $assembly/pson/offset
(get_local $0) tee_local $1
;;@ assembly/pson.ts:148:17 i32.const 1
(block (result i64) i32.add
(set_global $assembly/pson/offset set_global $assembly/pson/offset
(i32.add get_local $2
(tee_local $1 tee_local $0
(get_global $assembly/pson/offset) i64.const 1
) i64.add
(i32.const 1) set_local $2
) get_local $1
) i32.load8_u
(set_local $2 tee_local $1
(i64.add i32.const 127
(tee_local $0 i32.and
;;@ assembly/pson.ts:149:37 i64.extend_u/i32
(get_local $2) get_local $0
) i64.const 7
(i64.const 1) i64.mul
) i64.shl
) end
;;@ assembly/pson.ts:149:13 i64.or
(i64.shl set_local $0
(i64.extend_u/i32 get_local $1
;;@ assembly/pson.ts:149:19 i32.const 128
(i32.and i32.and
;;@ assembly/pson.ts:148:4 br_if $continue|0
(tee_local $1 end
;;@ assembly/pson.ts:148:8 get_local $0
(i32.load8_u
(get_local $1)
)
)
;;@ assembly/pson.ts:149:23
(i32.const 127)
)
)
;;@ assembly/pson.ts:149:32
(i64.mul
(get_local $0)
;;@ assembly/pson.ts:149:33
(i64.const 7)
)
)
)
)
)
(br_if $continue|0
;;@ assembly/pson.ts:150:11
(i32.and
(get_local $1)
;;@ assembly/pson.ts:150:15
(i32.const 128)
)
)
)
;;@ assembly/pson.ts:151:9
(get_local $0)
) )
(func $assembly/pson/decodeValue (; 16 ;) (; has Stack IR ;) (type $v) (func $assembly/pson/decodeValue (; 16 ;) (type $v)
(local $0 i32) (local $0 i32)
(local $1 i32) (local $1 i32)
(local $2 i64) (local $2 i64)
;;@ assembly/pson.ts:49:2 block $break|0
(block $break|0 block $case16|0
(block $case16|0 block $case15|0
(block $case15|0 block $case14|0
(block $case14|0 block $case12|0
(block $case12|0 block $case11|0
(block $case11|0 block $case10|0
(block $case10|0 block $case9|0
(block $case9|0 block $case8|0
(block $case8|0 block $case7|0
(block $case7|0 block $case6|0
(block $case6|0 block $case5|0
(block $case5|0 block $case4|0
(block $case4|0 block $case3|0
(block $case3|0 block $case2|0
(block $case2|0 block $case1|0
(block $case1|0 block (result i32)
(if get_global $assembly/pson/offset
;;@ assembly/pson.ts:46:28 tee_local $1
(block (result i32) i32.const 1
(set_global $assembly/pson/offset i32.add
(i32.add set_global $assembly/pson/offset
(tee_local $1 get_local $1
(get_global $assembly/pson/offset) i32.load8_u
) tee_local $0
(i32.const 1) tee_local $1
) i32.const 240
) i32.ne
(i32.ne end
(tee_local $1 if
;;@ assembly/pson.ts:46:2 block $tablify|0
(tee_local $0 get_local $1
;;@ assembly/pson.ts:46:19 i32.const 241
(i32.load8_u i32.sub
(get_local $1) br_table $case1|0 $case2|0 $case3|0 $case4|0 $case5|0 $case6|0 $case7|0 $case8|0 $case9|0 $case10|0 $case11|0 $case12|0 $tablify|0
) end
) get_local $1
) i32.const 253
(i32.const 240) i32.eq
) get_local $1
) i32.const 254
(block i32.eq
(block $tablify|0 i32.or
(br_table $case1|0 $case2|0 $case3|0 $case4|0 $case5|0 $case6|0 $case7|0 $case8|0 $case9|0 $case10|0 $case11|0 $case12|0 $tablify|0 br_if $case14|0
(i32.sub get_local $1
(get_local $1) i32.const 255
(i32.const 241) i32.eq
) br_if $case15|0
) br $case16|0
) end
(br_if $case14|0 call $assembly/pson/onNull
(i32.or br $break|0
(i32.eq end
(get_local $1) call $assembly/pson/onTrue
(i32.const 253) br $break|0
) end
(i32.eq call $assembly/pson/onFalse
(get_local $1) br $break|0
(i32.const 254) end
) call $assembly/pson/onEObject
) br $break|0
) end
(br_if $case15|0 call $assembly/pson/onEArray
(i32.eq br $break|0
(get_local $1) end
(i32.const 255) call $assembly/pson/onEString
) br $break|0
) end
(br $case16|0) call $assembly/pson/readVarint32
) tee_local $0
) call $assembly/pson/onObject
;;@ assembly/pson.ts:51:6 loop $continue|1
(call $assembly/pson/onNull) block (result i32)
;;@ assembly/pson.ts:52:6 get_local $0
(br $break|0) tee_local $1
) i32.const 1
;;@ assembly/pson.ts:55:6 i32.sub
(call $assembly/pson/onTrue) set_local $0
;;@ assembly/pson.ts:56:6 get_local $1
(br $break|0) end
) if
;;@ assembly/pson.ts:59:6 call $assembly/pson/decodeValue
(call $assembly/pson/onFalse) call $assembly/pson/decodeValue
;;@ assembly/pson.ts:60:6 br $continue|1
(br $break|0) end
) end
;;@ assembly/pson.ts:63:6 br $break|0
(call $assembly/pson/onEObject) end
;;@ assembly/pson.ts:64:6 call $assembly/pson/readVarint32
(br $break|0) tee_local $0
) call $assembly/pson/onArray
;;@ assembly/pson.ts:67:6 loop $continue|2
(call $assembly/pson/onEArray) block (result i32)
;;@ assembly/pson.ts:68:6 get_local $0
(br $break|0) tee_local $1
) i32.const 1
;;@ assembly/pson.ts:71:6 i32.sub
(call $assembly/pson/onEString) set_local $0
;;@ assembly/pson.ts:72:6 get_local $1
(br $break|0) end
) if
;;@ assembly/pson.ts:75:6 call $assembly/pson/decodeValue
(call $assembly/pson/onObject br $continue|2
;;@ assembly/pson.ts:75:15 end
(tee_local $0 end
;;@ assembly/pson.ts:75:22 br $break|0
(call $assembly/pson/readVarint32) end
) call $assembly/pson/readVarint32
) tee_local $0
(loop $continue|1 i32.const 1
(if i32.shr_u
;;@ assembly/pson.ts:76:13 i32.const 0
(block (result i32) get_local $0
(set_local $0 i32.const 1
(i32.sub i32.and
(tee_local $1 i32.sub
(get_local $0) i32.xor
) call $assembly/pson/onInteger
(i32.const 1) br $break|0
) end
) call $assembly/pson/readVarint64
(get_local $1) tee_local $2
) i64.const 1
(block i64.shr_u
;;@ assembly/pson.ts:77:8 i64.const 0
(call $assembly/pson/decodeValue) get_local $2
;;@ assembly/pson.ts:78:8 i64.const 1
(call $assembly/pson/decodeValue) i64.and
(br $continue|1) i64.sub
) i64.xor
) tee_local $2
) i32.wrap/i64
;;@ assembly/pson.ts:80:6 get_local $2
(br $break|0) i64.const 32
) i64.shr_u
;;@ assembly/pson.ts:83:6 i32.wrap/i64
(call $assembly/pson/onArray call $assembly/pson/onLong
;;@ assembly/pson.ts:83:14 br $break|0
(tee_local $0 end
;;@ assembly/pson.ts:83:21 get_global $assembly/pson/offset
(call $assembly/pson/readVarint32) f32.load
) call $assembly/pson/onFloat
) get_global $assembly/pson/offset
(loop $continue|2 i32.const 4
(if i32.add
;;@ assembly/pson.ts:84:13 set_global $assembly/pson/offset
(block (result i32) br $break|0
(set_local $0 end
(i32.sub get_global $assembly/pson/offset
(tee_local $1 f64.load
(get_local $0) call $assembly/pson/onDouble
) get_global $assembly/pson/offset
(i32.const 1) i32.const 8
) i32.add
) set_global $assembly/pson/offset
(get_local $1) br $break|0
) end
(block call $assembly/pson/readVarint32
;;@ assembly/pson.ts:84:21 set_local $0
(call $assembly/pson/decodeValue) get_global $assembly/pson/offset
(br $continue|2) get_local $0
) call $assembly/pson/onString
) get_global $assembly/pson/offset
) get_local $0
;;@ assembly/pson.ts:85:6 i32.add
(br $break|0) set_global $assembly/pson/offset
) br $break|0
;;@ assembly/pson.ts:88:6 end
(call $assembly/pson/onInteger unreachable
;;@ assembly/pson.ts:88:16 end
(i32.xor call $assembly/pson/readVarint32
(i32.shr_u set_local $0
;;@ assembly/pson.ts:88:17 get_global $assembly/pson/offset
(tee_local $0 get_local $0
;;@ assembly/pson.ts:88:25 call $assembly/pson/onBinary
(call $assembly/pson/readVarint32) get_global $assembly/pson/offset
) get_local $0
;;@ assembly/pson.ts:88:44 i32.add
(i32.const 1) set_global $assembly/pson/offset
) br $break|0
;;@ assembly/pson.ts:88:49 end
(i32.sub get_local $0
(i32.const 0) i32.const 239
;;@ assembly/pson.ts:88:50 i32.gt_u
(i32.and if
;;@ assembly/pson.ts:88:51 unreachable
(get_local $0) end
;;@ assembly/pson.ts:88:58 get_local $0
(i32.const 1) i32.const 1
) i32.shr_u
) i32.const 0
) get_local $0
) i32.const 1
;;@ assembly/pson.ts:89:6 i32.and
(br $break|0) i32.sub
) i32.xor
;;@ assembly/pson.ts:93:6 call $assembly/pson/onInteger
(call $assembly/pson/onLong end
;;@ assembly/pson.ts:93:13
(i32.wrap/i64
;;@ assembly/pson.ts:92:6
(tee_local $2
;;@ assembly/pson.ts:92:13
(i64.xor
(i64.shr_u
;;@ assembly/pson.ts:92:14
(tee_local $2
;;@ assembly/pson.ts:92:22
(call $assembly/pson/readVarint64)
)
;;@ assembly/pson.ts:92:41
(i64.const 1)
)
;;@ assembly/pson.ts:92:46
(i64.sub
(i64.const 0)
;;@ assembly/pson.ts:92:47
(i64.and
;;@ assembly/pson.ts:92:48
(get_local $2)
;;@ assembly/pson.ts:92:55
(i64.const 1)
)
)
)
)
)
;;@ assembly/pson.ts:93:24
(i32.wrap/i64
;;@ assembly/pson.ts:93:30
(i64.shr_u
(get_local $2)
;;@ assembly/pson.ts:93:39
(i64.const 32)
)
)
)
;;@ assembly/pson.ts:94:6
(br $break|0)
)
;;@ assembly/pson.ts:97:6
(call $assembly/pson/onFloat
;;@ assembly/pson.ts:97:14
(f32.load
;;@ assembly/pson.ts:97:24
(get_global $assembly/pson/offset)
)
)
;;@ assembly/pson.ts:98:6
(set_global $assembly/pson/offset
(i32.add
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:98:16
(i32.const 4)
)
)
;;@ assembly/pson.ts:99:6
(br $break|0)
)
;;@ assembly/pson.ts:102:6
(call $assembly/pson/onDouble
;;@ assembly/pson.ts:102:15
(f64.load
;;@ assembly/pson.ts:102:25
(get_global $assembly/pson/offset)
)
)
;;@ assembly/pson.ts:103:6
(set_global $assembly/pson/offset
(i32.add
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:103:16
(i32.const 8)
)
)
;;@ assembly/pson.ts:104:6
(br $break|0)
)
;;@ assembly/pson.ts:107:6
(set_local $0
;;@ assembly/pson.ts:107:13
(call $assembly/pson/readVarint32)
)
;;@ assembly/pson.ts:108:6
(call $assembly/pson/onString
;;@ assembly/pson.ts:108:15
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:108:23
(get_local $0)
)
;;@ assembly/pson.ts:109:6
(set_global $assembly/pson/offset
(i32.add
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:109:16
(get_local $0)
)
)
;;@ assembly/pson.ts:110:6
(br $break|0)
)
;;@ assembly/pson.ts:115:6
(unreachable)
)
;;@ assembly/pson.ts:119:6
(set_local $0
;;@ assembly/pson.ts:119:13
(call $assembly/pson/readVarint32)
)
;;@ assembly/pson.ts:120:6
(call $assembly/pson/onBinary
;;@ assembly/pson.ts:120:15
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:120:23
(get_local $0)
)
;;@ assembly/pson.ts:121:6
(set_global $assembly/pson/offset
(i32.add
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:121:16
(get_local $0)
)
)
;;@ assembly/pson.ts:122:6
(br $break|0)
)
;;@ assembly/pson.ts:125:6
(if
;;@ assembly/pson.ts:125:10
(i32.gt_u
(get_local $0)
(i32.const 239)
)
;;@ assembly/pson.ts:125:34
(unreachable)
)
;;@ assembly/pson.ts:126:6
(call $assembly/pson/onInteger
;;@ assembly/pson.ts:126:16
(i32.xor
(i32.shr_u
;;@ assembly/pson.ts:126:17
(get_local $0)
;;@ assembly/pson.ts:126:26
(i32.const 1)
)
;;@ assembly/pson.ts:126:31
(i32.sub
(i32.const 0)
;;@ assembly/pson.ts:126:32
(i32.and
;;@ assembly/pson.ts:126:33
(get_local $0)
;;@ assembly/pson.ts:126:41
(i32.const 1)
)
)
)
)
)
) )
(func $assembly/pson/decode (; 17 ;) (; has Stack IR ;) (type $iv) (param $0 i32) (func $assembly/pson/decode (; 17 ;) (type $iv) (param $0 i32)
;;@ assembly/pson.ts:40:2 i32.const 0
(set_global $assembly/pson/offset set_global $assembly/pson/offset
;;@ assembly/pson.ts:40:11 loop $continue|0
(i32.const 0) get_global $assembly/pson/offset
) get_local $0
(loop $continue|0 i32.lt_u
(if if
;;@ assembly/pson.ts:41:9 call $assembly/pson/decodeValue
(i32.lt_u br $continue|0
(get_global $assembly/pson/offset) end
;;@ assembly/pson.ts:41:18 end
(get_local $0) get_global $assembly/pson/offset
) get_local $0
(block i32.ne
;;@ assembly/pson.ts:41:26 if
(call $assembly/pson/decodeValue) unreachable
(br $continue|0) end
)
)
)
;;@ assembly/pson.ts:42:2
(if
;;@ assembly/pson.ts:42:6
(i32.ne
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:42:16
(get_local $0)
)
;;@ assembly/pson.ts:42:24
(unreachable)
)
) )
(func $null (; 18 ;) (; has Stack IR ;) (type $v) (func $null (; 18 ;) (type $v)
(nop) nop
) )
) )

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1092
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,7 @@
}, },
"dependencies": { "dependencies": {
"@protobufjs/utf8": "^1.1.0", "@protobufjs/utf8": "^1.1.0",
"binaryen": "51.0.0-nightly.20181010", "binaryen": "52.0.0-nightly.20181104",
"glob": "^7.1.3", "glob": "^7.1.3",
"long": "^4.0.0" "long": "^4.0.0"
}, },

View File

@ -397,9 +397,7 @@ export class Compiler extends DiagnosticEmitter {
: 0; : 0;
module.setMemory( module.setMemory(
numPages, numPages,
this.options.isWasm64 Module.UNLIMITED_MEMORY,
? Module.MAX_MEMORY_WASM64
: Module.MAX_MEMORY_WASM32,
this.memorySegments, this.memorySegments,
options.target, options.target,
"memory" "memory"

View File

@ -5,7 +5,9 @@
declare namespace binaryen { declare namespace binaryen {
class Module { class Module {
constructor(ref: number); constructor(ref: number);
runPasses(passes: string[]): void;
emitText(): string; emitText(): string;
emitStackIR(optimize?: boolean): string;
emitAsmjs(): string; emitAsmjs(): string;
} }
} }

View File

@ -14,7 +14,7 @@ import "./i64";
import { Module } from "../../module"; import { Module } from "../../module";
Module.prototype.toText = function(this: Module) { Module.prototype.toText = function(this: Module) {
return new binaryen.Module(this.ref).emitText(); return new binaryen.Module(this.ref).emitStackIR();
}; };
Module.prototype.toAsmjs = function(this: Module) { Module.prototype.toAsmjs = function(this: Module) {

View File

@ -239,12 +239,6 @@ export class Module {
private cachedByValue: usize; private cachedByValue: usize;
/** Maximum number of pages when targeting WASM32. */
static readonly MAX_MEMORY_WASM32: Index = 0xffff;
/** Maximum number of pages when targeting WASM64. */
static readonly MAX_MEMORY_WASM64: Index = 0xffff; // TODO
static create(): Module { static create(): Module {
var module = new Module(); var module = new Module();
module.ref = _BinaryenModuleCreate(); module.ref = _BinaryenModuleCreate();
@ -824,6 +818,9 @@ export class Module {
} }
} }
/** Unlimited memory constant. */
static readonly UNLIMITED_MEMORY: Index = <Index>-1;
setMemory( setMemory(
initial: Index, initial: Index,
maximum: Index, maximum: Index,

View File

@ -2,11 +2,11 @@
(type $i (func (result i32))) (type $i (func (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func)) (type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\06\00\00\00a\00b\00i\00.\00t\00s") (data (i32.const 8) "\06\00\00\00a\00b\00i\00.\00t\00s")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $abi/condition (mut i32) (i32.const 0)) (global $abi/condition (mut i32) (i32.const 0))
(global $abi/y (mut i32) (i32.const 0)) (global $abi/y (mut i32) (i32.const 0))
(export "memory" (memory $0)) (export "memory" (memory $0))
@ -15,48 +15,40 @@
(export "exportedExported" (func $abi/exportedExported)) (export "exportedExported" (func $abi/exportedExported))
(export "exportedInternal" (func $abi/exportedInternal)) (export "exportedInternal" (func $abi/exportedInternal))
(start $start) (start $start)
(func $abi/exported (; 1 ;) (; has Stack IR ;) (type $i) (result i32) (func $abi/exported (; 1 ;) (type $i) (result i32)
(i32.const -128) i32.const -128
) )
(func $abi/exportedExported (; 2 ;) (; has Stack IR ;) (type $i) (result i32) (func $abi/exportedExported (; 2 ;) (type $i) (result i32)
(call $abi/exported) call $abi/exported
) )
(func $abi/internal (; 3 ;) (; has Stack IR ;) (type $i) (result i32) (func $abi/internal (; 3 ;) (type $i) (result i32)
(i32.const 128) i32.const 128
) )
(func $abi/exportedInternal (; 4 ;) (; has Stack IR ;) (type $i) (result i32) (func $abi/exportedInternal (; 4 ;) (type $i) (result i32)
(i32.shr_s call $abi/internal
(i32.shl i32.const 24
(call $abi/internal) i32.shl
(i32.const 24) i32.const 24
) i32.shr_s
(i32.const 24)
)
) )
(func $start (; 5 ;) (; has Stack IR ;) (type $v) (func $start (; 5 ;) (type $v)
(drop call $abi/internal
(call $abi/internal) drop
) i32.const 1
(set_global $abi/condition set_global $abi/condition
(i32.const 1) i32.const 0
) set_global $abi/y
(set_global $abi/y get_global $abi/y
(i32.const 0) if
) i32.const 0
(if i32.const 8
(get_global $abi/y) i32.const 65
(block i32.const 2
(call $~lib/env/abort call $~lib/env/abort
(i32.const 0) unreachable
(i32.const 8) end
(i32.const 65)
(i32.const 2)
)
(unreachable)
)
)
) )
(func $null (; 6 ;) (; has Stack IR ;) (type $v) (func $null (; 6 ;) (type $v)
(nop) nop
) )
) )

View File

@ -2,11 +2,11 @@
(type $i (func (result i32))) (type $i (func (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func)) (type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\06\00\00\00a\00b\00i\00.\00t\00s\00") (data (i32.const 8) "\06\00\00\00a\00b\00i\00.\00t\00s\00")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $abi/condition (mut i32) (i32.const 0)) (global $abi/condition (mut i32) (i32.const 0))
(global $abi/y (mut i32) (i32.const 0)) (global $abi/y (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 24)) (global $HEAP_BASE i32 (i32.const 24))
@ -17,274 +17,199 @@
(export "exportedInternal" (func $abi/exportedInternal)) (export "exportedInternal" (func $abi/exportedInternal))
(start $start) (start $start)
(func $abi/exported (; 1 ;) (type $i) (result i32) (func $abi/exported (; 1 ;) (type $i) (result i32)
(i32.shr_s i32.const 128
(i32.shl i32.const 24
(i32.const 128) i32.shl
(i32.const 24) i32.const 24
) i32.shr_s
(i32.const 24)
)
) )
(func $abi/exportedExported (; 2 ;) (type $i) (result i32) (func $abi/exportedExported (; 2 ;) (type $i) (result i32)
(call $abi/exported) call $abi/exported
) )
(func $abi/internal (; 3 ;) (type $i) (result i32) (func $abi/internal (; 3 ;) (type $i) (result i32)
(i32.const 128) i32.const 128
) )
(func $abi/exportedInternal (; 4 ;) (type $i) (result i32) (func $abi/exportedInternal (; 4 ;) (type $i) (result i32)
(i32.shr_s call $abi/internal
(i32.shl i32.const 24
(call $abi/internal) i32.shl
(i32.const 24) i32.const 24
) i32.shr_s
(i32.const 24)
)
) )
(func $start (; 5 ;) (type $v) (func $start (; 5 ;) (type $v)
(local $0 i32) (local $0 i32)
(local $1 i32) (local $1 i32)
(drop call $abi/internal
(call $abi/internal) drop
) i32.const 0
(set_global $abi/condition i32.eqz
(i32.eqz set_global $abi/condition
(i32.const 0) block
) i32.const 256
) set_local $0
(block get_local $0
(set_local $0 i32.const 24
(i32.const 256) i32.shl
) i32.const 24
(if i32.shr_s
(i32.eqz i32.eqz
(i32.eqz i32.eqz
(i32.shr_s if
(i32.shl i32.const 0
(get_local $0) i32.const 8
(i32.const 24) i32.const 32
) i32.const 2
(i32.const 24) call $~lib/env/abort
) unreachable
) end
) end
(block block
(call $~lib/env/abort i32.const 256
(i32.const 0) set_local $0
(i32.const 8) get_global $abi/condition
(i32.const 32) if
(i32.const 2) get_local $0
) i32.const 24
(unreachable) i32.shl
) i32.const 24
) i32.shr_s
) i32.const 2
(block i32.div_s
(set_local $0 set_local $0
(i32.const 256) else
) get_local $0
(if i32.const 24
(get_global $abi/condition) i32.shl
(set_local $0 i32.const 24
(i32.div_s i32.shr_s
(i32.shr_s i32.const 2
(i32.shl i32.div_s
(get_local $0) set_local $0
(i32.const 24) end
) get_local $0
(i32.const 24) i32.const 24
) i32.shl
(i32.const 2) i32.const 24
) i32.shr_s
) i32.eqz
(set_local $0 i32.eqz
(i32.div_s if
(i32.shr_s i32.const 0
(i32.shl i32.const 8
(get_local $0) i32.const 45
(i32.const 24) i32.const 2
) call $~lib/env/abort
(i32.const 24) unreachable
) end
(i32.const 2) end
) block
) i32.const 256
) set_local $0
(if get_global $abi/condition
(i32.eqz if
(i32.eqz get_local $0
(i32.shr_s i32.const 24
(i32.shl i32.shl
(get_local $0) i32.const 24
(i32.const 24) i32.shr_s
) i32.const 24
(i32.const 24) i32.shr_s
) set_local $0
) else
) get_local $0
(block i32.const 127
(call $~lib/env/abort i32.and
(i32.const 0) set_local $0
(i32.const 8) end
(i32.const 45) get_local $0
(i32.const 2) i32.eqz
) i32.eqz
(unreachable) if
) i32.const 0
) i32.const 8
) i32.const 58
(block i32.const 2
(set_local $0 call $~lib/env/abort
(i32.const 256) unreachable
) end
(if end
(get_global $abi/condition) block
(set_local $0 i32.const 256
(i32.shr_s i32.const 24
(i32.shr_s i32.shl
(i32.shl i32.const 24
(get_local $0) i32.shr_s
(i32.const 24) set_global $abi/y
) get_global $abi/y
(i32.const 24) i32.eqz
) i32.eqz
(i32.const 24) if
) i32.const 0
) i32.const 8
(set_local $0 i32.const 65
(i32.and i32.const 2
(get_local $0) call $~lib/env/abort
(i32.const 127) unreachable
) end
) end
) block
(if i32.const 2
(i32.eqz i32.ctz
(i32.eqz set_local $0
(get_local $0) get_local $0
) i32.const 1
) i32.and
(block i32.eqz
(call $~lib/env/abort if
(i32.const 0) i32.const 0
(i32.const 8) i32.const 8
(i32.const 58) i32.const 72
(i32.const 2) i32.const 2
) call $~lib/env/abort
(unreachable) unreachable
) end
) i32.const 1
) i32.clz
(block set_local $0
(set_global $abi/y get_local $0
(i32.shr_s i32.const 1
(i32.shl i32.and
(i32.const 256) i32.eqz
(i32.const 24) if
) i32.const 0
(i32.const 24) i32.const 8
) i32.const 74
) i32.const 2
(if call $~lib/env/abort
(i32.eqz unreachable
(i32.eqz end
(get_global $abi/y) i32.const 2
) i32.ctz
) set_local $1
(block get_local $1
(call $~lib/env/abort i32.eqz
(i32.const 0) if
(i32.const 8) i32.const 0
(i32.const 65) i32.const 8
(i32.const 2) i32.const 77
) i32.const 2
(unreachable) call $~lib/env/abort
) unreachable
) end
) i32.const 1
(block i32.clz
(set_local $0 set_local $1
(i32.ctz get_local $1
(i32.const 2) i32.eqz
) if
) i32.const 0
(if i32.const 8
(i32.eqz i32.const 79
(i32.and i32.const 2
(get_local $0) call $~lib/env/abort
(i32.const 1) unreachable
) end
) end
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 72)
(i32.const 2)
)
(unreachable)
)
)
(set_local $0
(i32.clz
(i32.const 1)
)
)
(if
(i32.eqz
(i32.and
(get_local $0)
(i32.const 1)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 74)
(i32.const 2)
)
(unreachable)
)
)
(set_local $1
(i32.ctz
(i32.const 2)
)
)
(if
(i32.eqz
(get_local $1)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 77)
(i32.const 2)
)
(unreachable)
)
)
(set_local $1
(i32.clz
(i32.const 1)
)
)
(if
(i32.eqz
(get_local $1)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 79)
(i32.const 2)
)
(unreachable)
)
)
)
) )
(func $null (; 6 ;) (type $v) (func $null (; 6 ;) (type $v)
) )

View File

@ -1,11 +1,11 @@
(module (module
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $start) (elem (i32.const 0) $start)
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(func $start (; 0 ;) (; has Stack IR ;) (type $v) (func $start (; 0 ;) (type $v)
(nop) nop
) )
) )

View File

@ -1,7 +1,7 @@
(module (module
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(global $ASC_TARGET i32 (i32.const 0)) (global $ASC_TARGET i32 (i32.const 0))
(global $ASC_NO_TREESHAKING i32 (i32.const 0)) (global $ASC_NO_TREESHAKING i32 (i32.const 0))
@ -16,30 +16,22 @@
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $start (; 0 ;) (type $v) (func $start (; 0 ;) (type $v)
(drop i32.const 1
(i32.const 1) drop
) i32.const 0
(drop drop
(i32.const 0) i32.const 0
) drop
(drop i32.const 0
(i32.const 0) drop
) i32.const 0
(drop drop
(i32.const 0) i32.const 0
) drop
(drop i32.const 0
(i32.const 0) drop
) i32.const 0
(drop drop
(i32.const 0)
)
(drop
(i32.const 0)
)
(drop
(i32.const 0)
)
) )
(func $null (; 1 ;) (type $v) (func $null (; 1 ;) (type $v)
) )

View File

@ -3,11 +3,11 @@
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\t\00\00\00a\00s\00s\00e\00r\00t\00.\00t\00s") (data (i32.const 8) "\t\00\00\00a\00s\00s\00e\00r\00t\00.\00t\00s")
(data (i32.const 32) "\0c\00\00\00m\00u\00s\00t\00 \00b\00e\00 \00t\00r\00u\00e") (data (i32.const 32) "\0c\00\00\00m\00u\00s\00t\00 \00b\00e\00 \00t\00r\00u\00e")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $start) (elem (i32.const 0) $start)
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(func $start (; 0 ;) (; has Stack IR ;) (type $v) (func $start (; 0 ;) (type $v)
(nop) nop
) )
) )

View File

@ -1,146 +1,111 @@
(module (module
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func)) (type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\t\00\00\00a\00s\00s\00e\00r\00t\00.\00t\00s\00") (data (i32.const 8) "\t\00\00\00a\00s\00s\00e\00r\00t\00.\00t\00s\00")
(data (i32.const 32) "\0c\00\00\00m\00u\00s\00t\00 \00b\00e\00 \00t\00r\00u\00e\00") (data (i32.const 32) "\0c\00\00\00m\00u\00s\00t\00 \00b\00e\00 \00t\00r\00u\00e\00")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $HEAP_BASE i32 (i32.const 60)) (global $HEAP_BASE i32 (i32.const 60))
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $start (; 1 ;) (type $v) (func $start (; 1 ;) (type $v)
(local $0 i32) (local $0 i32)
(if i32.const 1
(i32.eqz i32.eqz
(i32.const 1) if
) i32.const 0
(block i32.const 8
(call $~lib/env/abort i32.const 1
(i32.const 0) i32.const 0
(i32.const 8) call $~lib/env/abort
(i32.const 1) unreachable
(i32.const 0) end
) i32.const 1
(unreachable) i32.eqz
) if
) i32.const 0
(if i32.const 8
(i32.eqz i32.const 2
(i32.const 1) i32.const 0
) call $~lib/env/abort
(block unreachable
(call $~lib/env/abort end
(i32.const 0) i32.const 1
(i32.const 8) i32.const 0
(i32.const 2) i32.gt_u
(i32.const 0) i32.eqz
) if
(unreachable) i32.const 0
) i32.const 8
) i32.const 3
(if i32.const 0
(i32.eqz call $~lib/env/abort
(i32.gt_u unreachable
(i32.const 1) end
(i32.const 0) f64.const 0.5
) f64.const 0
) f64.eq
(block if
(call $~lib/env/abort i32.const 0
(i32.const 0) i32.const 8
(i32.const 8) i32.const 4
(i32.const 3) i32.const 0
(i32.const 0) call $~lib/env/abort
) unreachable
(unreachable) end
) f64.const 0.5
) f64.const 0.4
(if f64.gt
(f64.eq i32.eqz
(f64.const 0.5) if
(f64.const 0) i32.const 0
) i32.const 8
(block i32.const 5
(call $~lib/env/abort i32.const 0
(i32.const 0) call $~lib/env/abort
(i32.const 8) unreachable
(i32.const 4) end
(i32.const 0) i64.const 4294967296
) i64.eqz
(unreachable) if
) i32.const 0
) i32.const 8
(if i32.const 6
(i32.eqz i32.const 0
(f64.gt call $~lib/env/abort
(f64.const 0.5) unreachable
(f64.const 0.4) end
) i64.const 4294967296
) i64.const 1
(block i64.gt_s
(call $~lib/env/abort i32.eqz
(i32.const 0) if
(i32.const 8) i32.const 0
(i32.const 5) i32.const 8
(i32.const 0) i32.const 7
) i32.const 0
(unreachable) call $~lib/env/abort
) unreachable
) end
(if i32.const 1
(i64.eqz tee_local $0
(i64.const 4294967296) if (result i32)
) get_local $0
(block else
(call $~lib/env/abort i32.const 32
(i32.const 0) i32.const 8
(i32.const 8) i32.const 10
(i32.const 6) i32.const 5
(i32.const 0) call $~lib/env/abort
) unreachable
(unreachable) end
) i32.eqz
) if
(if unreachable
(i32.eqz end
(i64.gt_s
(i64.const 4294967296)
(i64.const 1)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 7)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(if (result i32)
(tee_local $0
(i32.const 1)
)
(get_local $0)
(block
(call $~lib/env/abort
(i32.const 32)
(i32.const 8)
(i32.const 10)
(i32.const 5)
)
(unreachable)
)
)
)
(unreachable)
)
) )
(func $null (; 2 ;) (type $v) (func $null (; 2 ;) (type $v)
) )

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -4,86 +4,70 @@
(type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$d (func (result f64))) (type $FUNCSIG$d (func (result f64)))
(type $FUNCSIG$f (func (result f32))) (type $FUNCSIG$f (func (result f32)))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\10\00\00\00c\00a\00l\00l\00-\00i\00n\00f\00e\00r\00r\00e\00d\00.\00t\00s") (data (i32.const 8) "\10\00\00\00c\00a\00l\00l\00-\00i\00n\00f\00e\00r\00r\00e\00d\00.\00t\00s")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $call-inferred/foo<i32> (; 1 ;) (; has Stack IR ;) (type $FUNCSIG$i) (result i32) (func $call-inferred/foo<i32> (; 1 ;) (type $FUNCSIG$i) (result i32)
(i32.const 42) i32.const 42
) )
(func $call-inferred/foo<f64> (; 2 ;) (; has Stack IR ;) (type $FUNCSIG$d) (result f64) (func $call-inferred/foo<f64> (; 2 ;) (type $FUNCSIG$d) (result f64)
(f64.const 42) f64.const 42
) )
(func $call-inferred/foo<f32> (; 3 ;) (; has Stack IR ;) (type $FUNCSIG$f) (result f32) (func $call-inferred/foo<f32> (; 3 ;) (type $FUNCSIG$f) (result f32)
(f32.const 42) f32.const 42
) )
(func $start (; 4 ;) (; has Stack IR ;) (type $v) (func $start (; 4 ;) (type $v)
(if call $call-inferred/foo<i32>
(i32.ne i32.const 42
(call $call-inferred/foo<i32>) i32.ne
(i32.const 42) if
) i32.const 0
(block i32.const 8
(call $~lib/env/abort i32.const 5
(i32.const 0) i32.const 0
(i32.const 8) call $~lib/env/abort
(i32.const 5) unreachable
(i32.const 0) end
) call $call-inferred/foo<f64>
(unreachable) f64.const 42
) f64.ne
) if
(if i32.const 0
(f64.ne i32.const 8
(call $call-inferred/foo<f64>) i32.const 6
(f64.const 42) i32.const 0
) call $~lib/env/abort
(block unreachable
(call $~lib/env/abort end
(i32.const 0) call $call-inferred/foo<f32>
(i32.const 8) f32.const 42
(i32.const 6) f32.ne
(i32.const 0) if
) i32.const 0
(unreachable) i32.const 8
) i32.const 7
) i32.const 0
(if call $~lib/env/abort
(f32.ne unreachable
(call $call-inferred/foo<f32>) end
(f32.const 42) call $call-inferred/foo<f32>
) f32.const 42
(block f32.ne
(call $~lib/env/abort if
(i32.const 0) i32.const 0
(i32.const 8) i32.const 8
(i32.const 7) i32.const 13
(i32.const 0) i32.const 0
) call $~lib/env/abort
(unreachable) unreachable
) end
)
(if
(f32.ne
(call $call-inferred/foo<f32>)
(f32.const 42)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 13)
(i32.const 0)
)
(unreachable)
)
)
) )
(func $null (; 5 ;) (; has Stack IR ;) (type $v) (func $null (; 5 ;) (type $v)
(nop) nop
) )
) )

View File

@ -4,104 +4,80 @@
(type $FF (func (param f64) (result f64))) (type $FF (func (param f64) (result f64)))
(type $ff (func (param f32) (result f32))) (type $ff (func (param f32) (result f32)))
(type $v (func)) (type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\10\00\00\00c\00a\00l\00l\00-\00i\00n\00f\00e\00r\00r\00e\00d\00.\00t\00s\00") (data (i32.const 8) "\10\00\00\00c\00a\00l\00l\00-\00i\00n\00f\00e\00r\00r\00e\00d\00.\00t\00s\00")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $HEAP_BASE i32 (i32.const 44)) (global $HEAP_BASE i32 (i32.const 44))
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $call-inferred/foo<i32> (; 1 ;) (type $ii) (param $0 i32) (result i32) (func $call-inferred/foo<i32> (; 1 ;) (type $ii) (param $0 i32) (result i32)
(get_local $0) get_local $0
) )
(func $call-inferred/foo<f64> (; 2 ;) (type $FF) (param $0 f64) (result f64) (func $call-inferred/foo<f64> (; 2 ;) (type $FF) (param $0 f64) (result f64)
(get_local $0) get_local $0
) )
(func $call-inferred/foo<f32> (; 3 ;) (type $ff) (param $0 f32) (result f32) (func $call-inferred/foo<f32> (; 3 ;) (type $ff) (param $0 f32) (result f32)
(get_local $0) get_local $0
) )
(func $call-inferred/bar<f32> (; 4 ;) (type $ff) (param $0 f32) (result f32) (func $call-inferred/bar<f32> (; 4 ;) (type $ff) (param $0 f32) (result f32)
(get_local $0) get_local $0
) )
(func $start (; 5 ;) (type $v) (func $start (; 5 ;) (type $v)
(if i32.const 42
(i32.eqz call $call-inferred/foo<i32>
(i32.eq i32.const 42
(call $call-inferred/foo<i32> i32.eq
(i32.const 42) i32.eqz
) if
(i32.const 42) i32.const 0
) i32.const 8
) i32.const 5
(block i32.const 0
(call $~lib/env/abort call $~lib/env/abort
(i32.const 0) unreachable
(i32.const 8) end
(i32.const 5) f64.const 42
(i32.const 0) call $call-inferred/foo<f64>
) f64.const 42
(unreachable) f64.eq
) i32.eqz
) if
(if i32.const 0
(i32.eqz i32.const 8
(f64.eq i32.const 6
(call $call-inferred/foo<f64> i32.const 0
(f64.const 42) call $~lib/env/abort
) unreachable
(f64.const 42) end
) f32.const 42
) call $call-inferred/foo<f32>
(block f32.const 42
(call $~lib/env/abort f32.eq
(i32.const 0) i32.eqz
(i32.const 8) if
(i32.const 6) i32.const 0
(i32.const 0) i32.const 8
) i32.const 7
(unreachable) i32.const 0
) call $~lib/env/abort
) unreachable
(if end
(i32.eqz f32.const 42
(f32.eq call $call-inferred/bar<f32>
(call $call-inferred/foo<f32> f32.const 42
(f32.const 42) f32.eq
) i32.eqz
(f32.const 42) if
) i32.const 0
) i32.const 8
(block i32.const 13
(call $~lib/env/abort i32.const 0
(i32.const 0) call $~lib/env/abort
(i32.const 8) unreachable
(i32.const 7) end
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(f32.eq
(call $call-inferred/bar<f32>
(f32.const 42)
)
(f32.const 42)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 13)
(i32.const 0)
)
(unreachable)
)
)
) )
(func $null (; 6 ;) (type $v) (func $null (; 6 ;) (type $v)
) )

View File

@ -2,182 +2,142 @@
(type $iiii (func (param i32 i32 i32) (result i32))) (type $iiii (func (param i32 i32 i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func)) (type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\10\00\00\00c\00a\00l\00l\00-\00o\00p\00t\00i\00o\00n\00a\00l\00.\00t\00s") (data (i32.const 8) "\10\00\00\00c\00a\00l\00l\00-\00o\00p\00t\00i\00o\00n\00a\00l\00.\00t\00s")
(table 2 anyfunc) (table $0 2 anyfunc)
(elem (i32.const 0) $null $call-optional/opt|trampoline) (elem (i32.const 0) $null $call-optional/opt|trampoline)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $~argc (mut i32) (i32.const 0)) (global $~argc (mut i32) (i32.const 0))
(global $call-optional/optIndirect (mut i32) (i32.const 1)) (global $call-optional/optIndirect (mut i32) (i32.const 1))
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $call-optional/opt (; 1 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (func $call-optional/opt (; 1 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(i32.add get_local $0
(i32.add get_local $1
(get_local $0) i32.add
(get_local $1) get_local $2
) i32.add
(get_local $2)
)
) )
(func $call-optional/opt|trampoline (; 2 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (func $call-optional/opt|trampoline (; 2 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(block $2of2 block $2of2
(block $1of2 block $1of2
(block $0of2 block $0of2
(block $outOfRange block $outOfRange
(br_table $0of2 $1of2 $2of2 $outOfRange get_global $~argc
(i32.sub i32.const 1
(get_global $~argc) i32.sub
(i32.const 1) br_table $0of2 $1of2 $2of2 $outOfRange
) end
) unreachable
) end
(unreachable) i32.const -1
) set_local $1
(set_local $1 end
(i32.const -1) i32.const -2
) set_local $2
) end
(set_local $2 get_local $0
(i32.const -2) get_local $1
) get_local $2
) call $call-optional/opt
(call $call-optional/opt
(get_local $0)
(get_local $1)
(get_local $2)
)
) )
(func $start (; 3 ;) (; has Stack IR ;) (type $v) (func $start (; 3 ;) (type $v)
(set_global $~argc i32.const 1
(i32.const 1) set_global $~argc
) i32.const 3
(if i32.const 0
(call $call-optional/opt|trampoline i32.const 0
(i32.const 3) call $call-optional/opt|trampoline
(i32.const 0) if
(i32.const 0) i32.const 0
) i32.const 8
(block i32.const 4
(call $~lib/env/abort i32.const 0
(i32.const 0) call $~lib/env/abort
(i32.const 8) unreachable
(i32.const 4) end
(i32.const 0) i32.const 2
) set_global $~argc
(unreachable) i32.const 3
) i32.const 4
) i32.const 0
(set_global $~argc call $call-optional/opt|trampoline
(i32.const 2) i32.const 5
) i32.ne
(if if
(i32.ne i32.const 0
(call $call-optional/opt|trampoline i32.const 8
(i32.const 3) i32.const 5
(i32.const 4) i32.const 0
(i32.const 0) call $~lib/env/abort
) unreachable
(i32.const 5) end
) i32.const 3
(block i32.const 4
(call $~lib/env/abort i32.const 5
(i32.const 0) call $call-optional/opt
(i32.const 8) i32.const 12
(i32.const 5) i32.ne
(i32.const 0) if
) i32.const 0
(unreachable) i32.const 8
) i32.const 6
) i32.const 0
(if call $~lib/env/abort
(i32.ne unreachable
(call $call-optional/opt end
(i32.const 3) i32.const 1
(i32.const 4) set_global $~argc
(i32.const 5) i32.const 3
) i32.const 0
(i32.const 12) i32.const 0
) get_global $call-optional/optIndirect
(block call_indirect (type $iiii)
(call $~lib/env/abort if
(i32.const 0) i32.const 0
(i32.const 8) i32.const 8
(i32.const 6) i32.const 9
(i32.const 0) i32.const 0
) call $~lib/env/abort
(unreachable) unreachable
) end
) i32.const 2
(set_global $~argc set_global $~argc
(i32.const 1) i32.const 3
) i32.const 4
(if i32.const 0
(call_indirect (type $iiii) get_global $call-optional/optIndirect
(i32.const 3) call_indirect (type $iiii)
(i32.const 0) i32.const 5
(i32.const 0) i32.ne
(get_global $call-optional/optIndirect) if
) i32.const 0
(block i32.const 8
(call $~lib/env/abort i32.const 10
(i32.const 0) i32.const 0
(i32.const 8) call $~lib/env/abort
(i32.const 9) unreachable
(i32.const 0) end
) i32.const 3
(unreachable) set_global $~argc
) i32.const 3
) i32.const 4
(set_global $~argc i32.const 5
(i32.const 2) get_global $call-optional/optIndirect
) call_indirect (type $iiii)
(if i32.const 12
(i32.ne i32.ne
(call_indirect (type $iiii) if
(i32.const 3) i32.const 0
(i32.const 4) i32.const 8
(i32.const 0) i32.const 11
(get_global $call-optional/optIndirect) i32.const 0
) call $~lib/env/abort
(i32.const 5) unreachable
) end
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 10)
(i32.const 0)
)
(unreachable)
)
)
(set_global $~argc
(i32.const 3)
)
(if
(i32.ne
(call_indirect (type $iiii)
(i32.const 3)
(i32.const 4)
(i32.const 5)
(get_global $call-optional/optIndirect)
)
(i32.const 12)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 11)
(i32.const 0)
)
(unreachable)
)
)
) )
(func $null (; 4 ;) (; has Stack IR ;) (type $v) (func $null (; 4 ;) (type $v)
(nop) nop
) )
) )

View File

@ -2,11 +2,11 @@
(type $iiii (func (param i32 i32 i32) (result i32))) (type $iiii (func (param i32 i32 i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func)) (type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\10\00\00\00c\00a\00l\00l\00-\00o\00p\00t\00i\00o\00n\00a\00l\00.\00t\00s\00") (data (i32.const 8) "\10\00\00\00c\00a\00l\00l\00-\00o\00p\00t\00i\00o\00n\00a\00l\00.\00t\00s\00")
(table 2 anyfunc) (table $0 2 anyfunc)
(elem (i32.const 0) $null $call-optional/opt|trampoline) (elem (i32.const 0) $null $call-optional/opt|trampoline)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $~argc (mut i32) (i32.const 0)) (global $~argc (mut i32) (i32.const 0))
(global $call-optional/optIndirect (mut i32) (i32.const 1)) (global $call-optional/optIndirect (mut i32) (i32.const 1))
(global $HEAP_BASE i32 (i32.const 44)) (global $HEAP_BASE i32 (i32.const 44))
@ -14,197 +14,149 @@
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $call-optional/opt (; 1 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (func $call-optional/opt (; 1 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(i32.add get_local $0
(i32.add get_local $1
(get_local $0) i32.add
(get_local $1) get_local $2
) i32.add
(get_local $2)
)
) )
(func $call-optional/opt|trampoline (; 2 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (func $call-optional/opt|trampoline (; 2 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(block $2of2 block $2of2
(block $1of2 block $1of2
(block $0of2 block $0of2
(block $outOfRange block $outOfRange
(br_table $0of2 $1of2 $2of2 $outOfRange get_global $~argc
(i32.sub i32.const 1
(get_global $~argc) i32.sub
(i32.const 1) br_table $0of2 $1of2 $2of2 $outOfRange
) end
) unreachable
) end
(unreachable) i32.const -1
) set_local $1
(set_local $1 end
(i32.const -1) i32.const -2
) set_local $2
) end
(set_local $2 get_local $0
(i32.const -2) get_local $1
) get_local $2
) call $call-optional/opt
(call $call-optional/opt
(get_local $0)
(get_local $1)
(get_local $2)
)
) )
(func $start (; 3 ;) (type $v) (func $start (; 3 ;) (type $v)
(if block (result i32)
(i32.eqz i32.const 1
(i32.eq set_global $~argc
(block (result i32) i32.const 3
(set_global $~argc i32.const 0
(i32.const 1) i32.const 0
) call $call-optional/opt|trampoline
(call $call-optional/opt|trampoline end
(i32.const 3) i32.const 0
(i32.const 0) i32.eq
(i32.const 0) i32.eqz
) if
) i32.const 0
(i32.const 0) i32.const 8
) i32.const 4
) i32.const 0
(block call $~lib/env/abort
(call $~lib/env/abort unreachable
(i32.const 0) end
(i32.const 8) block (result i32)
(i32.const 4) i32.const 2
(i32.const 0) set_global $~argc
) i32.const 3
(unreachable) i32.const 4
) i32.const 0
) call $call-optional/opt|trampoline
(if end
(i32.eqz i32.const 5
(i32.eq i32.eq
(block (result i32) i32.eqz
(set_global $~argc if
(i32.const 2) i32.const 0
) i32.const 8
(call $call-optional/opt|trampoline i32.const 5
(i32.const 3) i32.const 0
(i32.const 4) call $~lib/env/abort
(i32.const 0) unreachable
) end
) i32.const 3
(i32.const 5) i32.const 4
) i32.const 5
) call $call-optional/opt
(block i32.const 12
(call $~lib/env/abort i32.eq
(i32.const 0) i32.eqz
(i32.const 8) if
(i32.const 5) i32.const 0
(i32.const 0) i32.const 8
) i32.const 6
(unreachable) i32.const 0
) call $~lib/env/abort
) unreachable
(if end
(i32.eqz block (result i32)
(i32.eq i32.const 1
(call $call-optional/opt set_global $~argc
(i32.const 3) i32.const 3
(i32.const 4) i32.const 0
(i32.const 5) i32.const 0
) get_global $call-optional/optIndirect
(i32.const 12) call_indirect (type $iiii)
) end
) i32.const 0
(block i32.eq
(call $~lib/env/abort i32.eqz
(i32.const 0) if
(i32.const 8) i32.const 0
(i32.const 6) i32.const 8
(i32.const 0) i32.const 9
) i32.const 0
(unreachable) call $~lib/env/abort
) unreachable
) end
(if block (result i32)
(i32.eqz i32.const 2
(i32.eq set_global $~argc
(block (result i32) i32.const 3
(set_global $~argc i32.const 4
(i32.const 1) i32.const 0
) get_global $call-optional/optIndirect
(call_indirect (type $iiii) call_indirect (type $iiii)
(i32.const 3) end
(i32.const 0) i32.const 5
(i32.const 0) i32.eq
(get_global $call-optional/optIndirect) i32.eqz
) if
) i32.const 0
(i32.const 0) i32.const 8
) i32.const 10
) i32.const 0
(block call $~lib/env/abort
(call $~lib/env/abort unreachable
(i32.const 0) end
(i32.const 8) block (result i32)
(i32.const 9) i32.const 3
(i32.const 0) set_global $~argc
) i32.const 3
(unreachable) i32.const 4
) i32.const 5
) get_global $call-optional/optIndirect
(if call_indirect (type $iiii)
(i32.eqz end
(i32.eq i32.const 12
(block (result i32) i32.eq
(set_global $~argc i32.eqz
(i32.const 2) if
) i32.const 0
(call_indirect (type $iiii) i32.const 8
(i32.const 3) i32.const 11
(i32.const 4) i32.const 0
(i32.const 0) call $~lib/env/abort
(get_global $call-optional/optIndirect) unreachable
) end
)
(i32.const 5)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 10)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(block (result i32)
(set_global $~argc
(i32.const 3)
)
(call_indirect (type $iiii)
(i32.const 3)
(i32.const 4)
(i32.const 5)
(get_global $call-optional/optIndirect)
)
)
(i32.const 12)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 11)
(i32.const 0)
)
(unreachable)
)
)
) )
(func $null (; 4 ;) (type $v) (func $null (; 4 ;) (type $v)
) )

View File

@ -2,32 +2,26 @@
(type $iv (func (param i32))) (type $iv (func (param i32)))
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(export "test" (func $class-extends/test)) (export "test" (func $class-extends/test))
(func $class-extends/test (; 0 ;) (; has Stack IR ;) (type $iv) (param $0 i32) (func $class-extends/test (; 0 ;) (type $iv) (param $0 i32)
(drop get_local $0
(i32.load i32.load
(get_local $0) drop
) get_local $0
) i32.load16_s offset=4
(drop drop
(i32.load16_s offset=4 get_local $0
(get_local $0) i32.const 2
) i32.store
) get_local $0
(i32.store i32.const 3
(get_local $0) i32.store16 offset=4
(i32.const 2)
)
(i32.store16 offset=4
(get_local $0)
(i32.const 3)
)
) )
(func $null (; 1 ;) (; has Stack IR ;) (type $v) (func $null (; 1 ;) (type $v)
(nop) nop
) )
) )

View File

@ -2,31 +2,25 @@
(type $iv (func (param i32))) (type $iv (func (param i32)))
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(global $HEAP_BASE i32 (i32.const 8)) (global $HEAP_BASE i32 (i32.const 8))
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(export "test" (func $class-extends/test)) (export "test" (func $class-extends/test))
(func $class-extends/test (; 0 ;) (type $iv) (param $0 i32) (func $class-extends/test (; 0 ;) (type $iv) (param $0 i32)
(drop get_local $0
(i32.load i32.load
(get_local $0) drop
) get_local $0
) i32.load16_s offset=4
(drop drop
(i32.load16_s offset=4 get_local $0
(get_local $0) i32.const 2
) i32.store
) get_local $0
(i32.store i32.const 3
(get_local $0) i32.store16 offset=4
(i32.const 2)
)
(i32.store16 offset=4
(get_local $0)
(i32.const 3)
)
) )
(func $null (; 1 ;) (type $v) (func $null (; 1 ;) (type $v)
) )

View File

@ -3,24 +3,23 @@
(type $v (func)) (type $v (func))
(type $FUNCSIG$v (func)) (type $FUNCSIG$v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(export "test" (func $class-overloading/test)) (export "test" (func $class-overloading/test))
(start $start) (start $start)
(func $class-overloading/Foo#baz (; 0 ;) (; has Stack IR ;) (type $FUNCSIG$v) (func $class-overloading/Foo#baz (; 0 ;) (type $FUNCSIG$v)
(nop) nop
) )
(func $class-overloading/test (; 1 ;) (; has Stack IR ;) (type $iv) (param $0 i32) (func $class-overloading/test (; 1 ;) (type $iv) (param $0 i32)
(call $class-overloading/Foo#baz) call $class-overloading/Foo#baz
) )
(func $start (; 2 ;) (; has Stack IR ;) (type $v) (func $start (; 2 ;) (type $v)
(call $class-overloading/test i32.const 0
(i32.const 0) call $class-overloading/test
)
) )
(func $null (; 3 ;) (; has Stack IR ;) (type $v) (func $null (; 3 ;) (type $v)
(nop) nop
) )
) )

View File

@ -2,7 +2,7 @@
(type $iv (func (param i32))) (type $iv (func (param i32)))
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(global $HEAP_BASE i32 (i32.const 8)) (global $HEAP_BASE i32 (i32.const 8))
(export "memory" (memory $0)) (export "memory" (memory $0))
@ -10,17 +10,15 @@
(export "test" (func $class-overloading/test)) (export "test" (func $class-overloading/test))
(start $start) (start $start)
(func $class-overloading/Foo#baz (; 0 ;) (type $iv) (param $0 i32) (func $class-overloading/Foo#baz (; 0 ;) (type $iv) (param $0 i32)
(nop) nop
) )
(func $class-overloading/test (; 1 ;) (type $iv) (param $0 i32) (func $class-overloading/test (; 1 ;) (type $iv) (param $0 i32)
(call $class-overloading/Foo#baz get_local $0
(get_local $0) call $class-overloading/Foo#baz
)
) )
(func $start (; 2 ;) (type $v) (func $start (; 2 ;) (type $v)
(call $class-overloading/test i32.const 0
(i32.const 0) call $class-overloading/test
)
) )
(func $null (; 3 ;) (type $v) (func $null (; 3 ;) (type $v)
) )

View File

@ -2,21 +2,19 @@
(type $i (func (result i32))) (type $i (func (result i32)))
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(export "test" (func $class-with-boolean-field/test)) (export "test" (func $class-with-boolean-field/test))
(func $class-with-boolean-field/test (; 0 ;) (; has Stack IR ;) (type $i) (result i32) (func $class-with-boolean-field/test (; 0 ;) (type $i) (result i32)
(i32.store8 i32.const 0
(i32.const 0) i32.const 1
(i32.const 1) i32.store8
) i32.const 0
(i32.load8_u i32.load8_u
(i32.const 0)
)
) )
(func $null (; 1 ;) (; has Stack IR ;) (type $v) (func $null (; 1 ;) (type $v)
(nop) nop
) )
) )

View File

@ -2,7 +2,7 @@
(type $i (func (result i32))) (type $i (func (result i32)))
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(global $HEAP_BASE i32 (i32.const 8)) (global $HEAP_BASE i32 (i32.const 8))
(export "memory" (memory $0)) (export "memory" (memory $0))
@ -10,13 +10,11 @@
(export "test" (func $class-with-boolean-field/test)) (export "test" (func $class-with-boolean-field/test))
(func $class-with-boolean-field/test (; 0 ;) (type $i) (result i32) (func $class-with-boolean-field/test (; 0 ;) (type $i) (result i32)
(local $0 i32) (local $0 i32)
(i32.store8 get_local $0
(get_local $0) i32.const 1
(i32.const 1) i32.store8
) get_local $0
(i32.load8_u i32.load8_u
(get_local $0)
)
) )
(func $null (; 1 ;) (type $v) (func $null (; 1 ;) (type $v)
) )

View File

@ -5,72 +5,56 @@
(type $FUNCSIG$f (func (result f32))) (type $FUNCSIG$f (func (result f32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\08\00\00\00c\00l\00a\00s\00s\00.\00t\00s") (data (i32.const 8) "\08\00\00\00c\00l\00a\00s\00s\00.\00t\00s")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(global $class/Animal.ONE (mut i32) (i32.const 1)) (global $class/Animal.ONE (mut i32) (i32.const 1))
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(export "test" (func $class/test)) (export "test" (func $class/test))
(start $start) (start $start)
(func $class/Animal.add (; 0 ;) (; has Stack IR ;) (type $FUNCSIG$i) (result i32) (func $class/Animal.add (; 0 ;) (type $FUNCSIG$i) (result i32)
(i32.add get_global $class/Animal.ONE
(get_global $class/Animal.ONE) i32.const 3
(i32.const 3) i32.add
)
) )
(func $class/Animal.sub<f32> (; 1 ;) (; has Stack IR ;) (type $FUNCSIG$f) (result f32) (func $class/Animal.sub<f32> (; 1 ;) (type $FUNCSIG$f) (result f32)
(f32.add f32.const -1
(f32.const -1) get_global $class/Animal.ONE
(f32.convert_s/i32 f32.convert_s/i32
(get_global $class/Animal.ONE) f32.add
)
)
) )
(func $class/test (; 2 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (func $class/test (; 2 ;) (type $ii) (param $0 i32) (result i32)
(drop call $class/Animal.add
(call $class/Animal.add) drop
) call $class/Animal.sub<f32>
(drop drop
(call $class/Animal.sub<f32>) get_local $0
) i32.load
(drop drop
(i32.load get_local $0
(get_local $0) i32.load16_s offset=4
) drop
) get_local $0
(drop i32.load8_s offset=6
(i32.load16_s offset=4 drop
(get_local $0) get_local $0
) i32.const 1
) i32.store
(drop get_local $0
(i32.load8_s offset=6 i32.const 2
(get_local $0) i32.store16 offset=4
) get_local $0
) i32.const 3
(i32.store i32.store8 offset=6
(get_local $0) 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 (; 3 ;) (; has Stack IR ;) (type $v) (func $start (; 3 ;) (type $v)
(drop call $class/Animal.add
(call $class/Animal.add) drop
) call $class/Animal.sub<f32>
(drop drop
(call $class/Animal.sub<f32>)
)
) )
(func $null (; 4 ;) (; has Stack IR ;) (type $v) (func $null (; 4 ;) (type $v)
(nop) nop
) )
) )

View File

@ -6,11 +6,11 @@
(type $iiii (func (param i32 i32 i32) (result i32))) (type $iiii (func (param i32 i32 i32) (result i32)))
(type $ifff (func (param i32 f32 f32) (result f32))) (type $ifff (func (param i32 f32 f32) (result f32)))
(type $v (func)) (type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\08\00\00\00c\00l\00a\00s\00s\00.\00t\00s\00") (data (i32.const 8) "\08\00\00\00c\00l\00a\00s\00s\00.\00t\00s\00")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $class/Animal.ONE (mut i32) (i32.const 1)) (global $class/Animal.ONE (mut i32) (i32.const 1))
(global $HEAP_BASE i32 (i32.const 28)) (global $HEAP_BASE i32 (i32.const 28))
(export "memory" (memory $0)) (export "memory" (memory $0))
@ -18,142 +18,103 @@
(export "test" (func $class/test)) (export "test" (func $class/test))
(start $start) (start $start)
(func $class/Animal.add (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $class/Animal.add (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.add get_local $0
(i32.add get_local $1
(get_local $0) i32.add
(get_local $1) get_global $class/Animal.ONE
) i32.add
(get_global $class/Animal.ONE)
)
) )
(func $class/Animal.sub<f32> (; 2 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) (func $class/Animal.sub<f32> (; 2 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32)
(f32.add get_local $0
(f32.sub get_local $1
(get_local $0) f32.sub
(get_local $1) get_global $class/Animal.ONE
) f32.convert_s/i32
(f32.convert_s/i32 f32.add
(get_global $class/Animal.ONE)
)
)
) )
(func $class/Animal<f64>#instanceAdd (; 3 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (func $class/Animal<f64>#instanceAdd (; 3 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(i32.add get_local $1
(i32.add get_local $2
(get_local $1) i32.add
(get_local $2) get_global $class/Animal.ONE
) i32.add
(get_global $class/Animal.ONE)
)
) )
(func $class/Animal<f64>#instanceSub<f32> (; 4 ;) (type $ifff) (param $0 i32) (param $1 f32) (param $2 f32) (result f32) (func $class/Animal<f64>#instanceSub<f32> (; 4 ;) (type $ifff) (param $0 i32) (param $1 f32) (param $2 f32) (result f32)
(f32.add get_local $1
(f32.sub get_local $2
(get_local $1) f32.sub
(get_local $2) get_global $class/Animal.ONE
) f32.convert_s/i32
(f32.convert_s/i32 f32.add
(get_global $class/Animal.ONE)
)
)
) )
(func $class/test (; 5 ;) (type $ii) (param $0 i32) (result i32) (func $class/test (; 5 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32) (local $1 i32)
(local $2 i32) (local $2 i32)
(drop get_local $0
(call $class/Animal<f64>#instanceAdd i32.const 1
(get_local $0) i32.const 2
(i32.const 1) call $class/Animal<f64>#instanceAdd
(i32.const 2) drop
) get_local $0
) f32.const 1
(drop f32.const 2
(call $class/Animal<f64>#instanceSub<f32> call $class/Animal<f64>#instanceSub<f32>
(get_local $0) drop
(f32.const 1) get_local $0
(f32.const 2) i32.load
) drop
) get_local $0
(drop i32.load16_s offset=4
(i32.load drop
(get_local $0) get_local $0
) i32.load8_s offset=6
) drop
(drop get_local $0
(i32.load16_s offset=4 i32.const 0
(get_local $0) i32.const 1
) i32.add
) i32.store
(drop get_local $0
(i32.load8_s offset=6 i32.const 1
(get_local $0) i32.const 1
) i32.add
) i32.store16 offset=4
(i32.store get_local $0
(get_local $0) i32.const 1
(i32.add i32.const 1
(i32.const 0) i32.add
(i32.const 1) i32.const 1
) i32.add
) i32.store8 offset=6
(i32.store16 offset=4 get_local $0
(get_local $0) set_local $1
(i32.add get_local $1
(i32.const 1) set_local $2
(i32.const 1) get_local $2
)
)
(i32.store8 offset=6
(get_local $0)
(i32.add
(i32.add
(i32.const 1)
(i32.const 1)
)
(i32.const 1)
)
)
(set_local $1
(get_local $0)
)
(set_local $2
(get_local $1)
)
(get_local $2)
) )
(func $start (; 6 ;) (type $v) (func $start (; 6 ;) (type $v)
(if i32.const 4
(i32.eqz i32.const 4
(i32.eq i32.eq
(i32.const 4) i32.eqz
(i32.const 4) if
) i32.const 0
) i32.const 8
(block i32.const 13
(call $~lib/env/abort i32.const 0
(i32.const 0) call $~lib/env/abort
(i32.const 8) unreachable
(i32.const 13) end
(i32.const 0) get_global $class/Animal.ONE
) drop
(unreachable) i32.const 1
) i32.const 2
) call $class/Animal.add
(drop drop
(get_global $class/Animal.ONE) f32.const 1
) f32.const 2
(drop call $class/Animal.sub<f32>
(call $class/Animal.add drop
(i32.const 1)
(i32.const 2)
)
)
(drop
(call $class/Animal.sub<f32>
(f32.const 1)
(f32.const 2)
)
)
) )
(func $null (; 7 ;) (type $v) (func $null (; 7 ;) (type $v)
) )

View File

@ -1,11 +1,11 @@
(module (module
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(func $null (; 0 ;) (; has Stack IR ;) (type $v) (func $null (; 0 ;) (type $v)
(nop) nop
) )
) )

View File

@ -1,7 +1,7 @@
(module (module
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(global $HEAP_BASE i32 (i32.const 8)) (global $HEAP_BASE i32 (i32.const 8))
(export "memory" (memory $0)) (export "memory" (memory $0))

View File

@ -1,225 +1,169 @@
(module (module
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func)) (type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\08\00\00\00c\00o\00m\00m\00a\00.\00t\00s") (data (i32.const 8) "\08\00\00\00c\00o\00m\00m\00a\00.\00t\00s")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $comma/a (mut i32) (i32.const 0)) (global $comma/a (mut i32) (i32.const 0))
(global $comma/b (mut i32) (i32.const 0)) (global $comma/b (mut i32) (i32.const 0))
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $start (; 1 ;) (; has Stack IR ;) (type $v) (func $start (; 1 ;) (type $v)
(local $0 i32) (local $0 i32)
(set_global $comma/a get_global $comma/a
(i32.add tee_local $0
(tee_local $0 i32.const 1
(get_global $comma/a) i32.add
) set_global $comma/a
(i32.const 1) get_local $0
) set_global $comma/b
) get_global $comma/a
(set_global $comma/b i32.const 1
(get_local $0) i32.ne
) if
(if i32.const 0
(i32.ne i32.const 8
(get_global $comma/a) i32.const 4
(i32.const 1) i32.const 0
) call $~lib/env/abort
(block unreachable
(call $~lib/env/abort end
(i32.const 0) get_global $comma/b
(i32.const 8) if
(i32.const 4) i32.const 0
(i32.const 0) i32.const 8
) i32.const 5
(unreachable) i32.const 0
) call $~lib/env/abort
) unreachable
(if end
(get_global $comma/b) get_global $comma/a
(block i32.const 1
(call $~lib/env/abort i32.add
(i32.const 0) set_global $comma/a
(i32.const 8) get_global $comma/a
(i32.const 5) set_global $comma/b
(i32.const 0) get_global $comma/a
) i32.const 2
(unreachable) i32.ne
) if
) i32.const 0
(set_global $comma/a i32.const 8
(i32.add i32.const 8
(get_global $comma/a) i32.const 0
(i32.const 1) call $~lib/env/abort
) unreachable
) end
(set_global $comma/b get_global $comma/b
(get_global $comma/a) i32.const 2
) i32.ne
(if if
(i32.ne i32.const 0
(get_global $comma/a) i32.const 8
(i32.const 2) i32.const 9
) i32.const 0
(block call $~lib/env/abort
(call $~lib/env/abort unreachable
(i32.const 0) end
(i32.const 8) i32.const 0
(i32.const 8) set_global $comma/b
(i32.const 0) get_global $comma/b
) set_global $comma/a
(unreachable) get_global $comma/a
) i32.const 1
) i32.add
(if set_global $comma/a
(i32.ne get_global $comma/a
(get_global $comma/b) set_global $comma/b
(i32.const 2) get_global $comma/a
) i32.const 1
(block i32.ne
(call $~lib/env/abort if
(i32.const 0) i32.const 0
(i32.const 8) i32.const 8
(i32.const 9) i32.const 14
(i32.const 0) i32.const 0
) call $~lib/env/abort
(unreachable) unreachable
) end
) get_global $comma/b
(set_global $comma/b i32.const 1
(i32.const 0) i32.ne
) if
(set_global $comma/a i32.const 0
(get_global $comma/b) i32.const 8
) i32.const 15
(set_global $comma/a i32.const 0
(i32.add call $~lib/env/abort
(get_global $comma/a) unreachable
(i32.const 1) end
) get_global $comma/a
) i32.const 1
(set_global $comma/b i32.add
(get_global $comma/a) set_global $comma/a
) get_global $comma/a
(if set_global $comma/b
(i32.ne get_global $comma/b
(get_global $comma/a) set_global $comma/a
(i32.const 1) get_global $comma/a
) i32.const 2
(block i32.ne
(call $~lib/env/abort if
(i32.const 0) i32.const 0
(i32.const 8) i32.const 8
(i32.const 14) i32.const 18
(i32.const 0) i32.const 0
) call $~lib/env/abort
(unreachable) unreachable
) end
) get_global $comma/b
(if i32.const 2
(i32.ne i32.ne
(get_global $comma/b) if
(i32.const 1) i32.const 0
) i32.const 8
(block i32.const 19
(call $~lib/env/abort i32.const 0
(i32.const 0) call $~lib/env/abort
(i32.const 8) unreachable
(i32.const 15) end
(i32.const 0) block $break|0
) i32.const 0
(unreachable) set_local $0
) loop $repeat|0
) get_local $0
(set_global $comma/a get_global $comma/a
(i32.add i32.ge_s
(get_global $comma/a) br_if $break|0
(i32.const 1) get_global $comma/a
) i32.const 1
) i32.sub
(set_global $comma/b set_global $comma/a
(get_global $comma/a) get_local $0
) i32.const 1
(set_global $comma/a i32.add
(get_global $comma/b) set_local $0
) br $repeat|0
(if unreachable
(i32.ne end
(get_global $comma/a) unreachable
(i32.const 2) end
) get_local $0
(block i32.const 1
(call $~lib/env/abort i32.ne
(i32.const 0) if
(i32.const 8) i32.const 0
(i32.const 18) i32.const 8
(i32.const 0) i32.const 22
) i32.const 0
(unreachable) call $~lib/env/abort
) unreachable
) end
(if
(i32.ne
(get_global $comma/b)
(i32.const 2)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 19)
(i32.const 0)
)
(unreachable)
)
)
(block $break|0
(set_local $0
(i32.const 0)
)
(loop $repeat|0
(br_if $break|0
(i32.ge_s
(get_local $0)
(get_global $comma/a)
)
)
(set_global $comma/a
(i32.sub
(get_global $comma/a)
(i32.const 1)
)
)
(set_local $0
(i32.add
(get_local $0)
(i32.const 1)
)
)
(br $repeat|0)
)
)
(if
(i32.ne
(get_local $0)
(i32.const 1)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 22)
(i32.const 0)
)
(unreachable)
)
)
) )
(func $null (; 2 ;) (; has Stack IR ;) (type $v) (func $null (; 2 ;) (type $v)
(nop) nop
) )
) )

View File

@ -1,11 +1,11 @@
(module (module
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func)) (type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\08\00\00\00c\00o\00m\00m\00a\00.\00t\00s\00") (data (i32.const 8) "\08\00\00\00c\00o\00m\00m\00a\00.\00t\00s\00")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $comma/a (mut i32) (i32.const 0)) (global $comma/a (mut i32) (i32.const 0))
(global $comma/b (mut i32) (i32.const 0)) (global $comma/b (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 28)) (global $HEAP_BASE i32 (i32.const 28))
@ -15,265 +15,194 @@
(func $start (; 1 ;) (type $v) (func $start (; 1 ;) (type $v)
(local $0 i32) (local $0 i32)
(local $1 i32) (local $1 i32)
(block block
(set_global $comma/b block (result i32)
(block (result i32) get_global $comma/a
(set_global $comma/a tee_local $0
(i32.add i32.const 1
(tee_local $0 i32.add
(get_global $comma/a) set_global $comma/a
) get_local $0
(i32.const 1) end
) set_global $comma/b
) get_global $comma/a
(get_local $0) drop
) end
) get_global $comma/a
(drop i32.const 1
(get_global $comma/a) i32.eq
) i32.eqz
) if
(if i32.const 0
(i32.eqz i32.const 8
(i32.eq i32.const 4
(get_global $comma/a) i32.const 0
(i32.const 1) call $~lib/env/abort
) unreachable
) end
(block get_global $comma/b
(call $~lib/env/abort i32.const 0
(i32.const 0) i32.eq
(i32.const 8) i32.eqz
(i32.const 4) if
(i32.const 0) i32.const 0
) i32.const 8
(unreachable) i32.const 5
) i32.const 0
) call $~lib/env/abort
(if unreachable
(i32.eqz end
(i32.eq block
(get_global $comma/b) get_global $comma/a
(i32.const 0) i32.const 1
) i32.add
) set_global $comma/a
(block get_global $comma/a
(call $~lib/env/abort set_global $comma/b
(i32.const 0) end
(i32.const 8) get_global $comma/a
(i32.const 5) i32.const 2
(i32.const 0) i32.eq
) i32.eqz
(unreachable) if
) i32.const 0
) i32.const 8
(block i32.const 8
(set_global $comma/a i32.const 0
(i32.add call $~lib/env/abort
(get_global $comma/a) unreachable
(i32.const 1) end
) get_global $comma/b
) i32.const 2
(set_global $comma/b i32.eq
(get_global $comma/a) i32.eqz
) if
) i32.const 0
(if i32.const 8
(i32.eqz i32.const 9
(i32.eq i32.const 0
(get_global $comma/a) call $~lib/env/abort
(i32.const 2) unreachable
) end
) block (result i32)
(block i32.const 0
(call $~lib/env/abort set_global $comma/b
(i32.const 0) get_global $comma/b
(i32.const 8) end
(i32.const 8) set_global $comma/a
(i32.const 0) block (result i32)
) get_global $comma/a
(unreachable) i32.const 1
) i32.add
) set_global $comma/a
(if get_global $comma/a
(i32.eqz end
(i32.eq set_global $comma/b
(get_global $comma/b) get_global $comma/a
(i32.const 2) i32.const 1
) i32.eq
) i32.eqz
(block if
(call $~lib/env/abort i32.const 0
(i32.const 0) i32.const 8
(i32.const 8) i32.const 14
(i32.const 9) i32.const 0
(i32.const 0) call $~lib/env/abort
) unreachable
(unreachable) end
) get_global $comma/b
) i32.const 1
(set_global $comma/a i32.eq
(block (result i32) i32.eqz
(set_global $comma/b if
(i32.const 0) i32.const 0
) i32.const 8
(get_global $comma/b) i32.const 15
) i32.const 0
) call $~lib/env/abort
(set_global $comma/b unreachable
(block (result i32) end
(set_global $comma/a block (result i32)
(i32.add get_global $comma/a
(get_global $comma/a) i32.const 1
(i32.const 1) i32.add
) set_global $comma/a
) block (result i32)
(get_global $comma/a) get_global $comma/a
) set_global $comma/b
) get_global $comma/b
(if end
(i32.eqz end
(i32.eq set_global $comma/a
(get_global $comma/a) get_global $comma/a
(i32.const 1) i32.const 2
) i32.eq
) i32.eqz
(block if
(call $~lib/env/abort i32.const 0
(i32.const 0) i32.const 8
(i32.const 8) i32.const 18
(i32.const 14) i32.const 0
(i32.const 0) call $~lib/env/abort
) unreachable
(unreachable) end
) get_global $comma/b
) i32.const 2
(if i32.eq
(i32.eqz i32.eqz
(i32.eq if
(get_global $comma/b) i32.const 0
(i32.const 1) i32.const 8
) i32.const 19
) i32.const 0
(block call $~lib/env/abort
(call $~lib/env/abort unreachable
(i32.const 0) end
(i32.const 8) block $break|0
(i32.const 15) i32.const 0
(i32.const 0) set_local $1
) loop $repeat|0
(unreachable) get_local $1
) get_global $comma/a
) i32.lt_s
(set_global $comma/a i32.eqz
(block (result i32) br_if $break|0
(set_global $comma/a nop
(i32.add block
(get_global $comma/a) get_global $comma/a
(i32.const 1) i32.const 1
) i32.sub
) set_global $comma/a
(block (result i32) get_local $1
(set_global $comma/b i32.const 1
(get_global $comma/a) i32.add
) set_local $1
(get_global $comma/b) end
) br $repeat|0
) unreachable
) end
(if unreachable
(i32.eqz end
(i32.eq get_local $1
(get_global $comma/a) i32.const 1
(i32.const 2) i32.eq
) i32.eqz
) if
(block i32.const 0
(call $~lib/env/abort i32.const 8
(i32.const 0) i32.const 22
(i32.const 8) i32.const 0
(i32.const 18) call $~lib/env/abort
(i32.const 0) unreachable
) end
(unreachable) block
) i32.const 1
) drop
(if i32.const 2
(i32.eqz drop
(i32.eq i32.const 3
(get_global $comma/b) drop
(i32.const 2) end
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 19)
(i32.const 0)
)
(unreachable)
)
)
(block $break|0
(set_local $1
(i32.const 0)
)
(loop $repeat|0
(br_if $break|0
(i32.eqz
(i32.lt_s
(get_local $1)
(get_global $comma/a)
)
)
)
(nop)
(block
(set_global $comma/a
(i32.sub
(get_global $comma/a)
(i32.const 1)
)
)
(set_local $1
(i32.add
(get_local $1)
(i32.const 1)
)
)
)
(br $repeat|0)
)
)
(if
(i32.eqz
(i32.eq
(get_local $1)
(i32.const 1)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 22)
(i32.const 0)
)
(unreachable)
)
)
(block
(drop
(i32.const 1)
)
(drop
(i32.const 2)
)
(drop
(i32.const 3)
)
)
) )
(func $null (; 2 ;) (type $v) (func $null (; 2 ;) (type $v)
) )

View File

@ -1,53 +1,45 @@
(module (module
(type $v (func)) (type $v (func))
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\n\00\00\00d\00e\00c\00l\00a\00r\00e\00.\00t\00s")
(table 1 anyfunc)
(elem (i32.const 0) $null)
(import "declare" "externalConstant" (global $declare/externalConstant i32)) (import "declare" "externalConstant" (global $declare/externalConstant i32))
(import "declare" "my.externalConstant" (global $declare/my.externalConstant i32)) (import "declare" "my.externalConstant" (global $declare/my.externalConstant i32))
(import "declare" "externalFunction" (func $declare/externalFunction)) (import "declare" "externalFunction" (func $declare/externalFunction))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "declare" "my.externalFunction" (func $declare/my.externalFunction)) (import "declare" "my.externalFunction" (func $declare/my.externalFunction))
(memory $0 1)
(data (i32.const 8) "\n\00\00\00d\00e\00c\00l\00a\00r\00e\00.\00t\00s")
(table $0 1 anyfunc)
(elem (i32.const 0) $null)
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $start (; 3 ;) (; has Stack IR ;) (type $v) (func $start (; 3 ;) (type $v)
(call $declare/externalFunction) call $declare/externalFunction
(if get_global $declare/externalConstant
(i32.ne i32.const 1
(get_global $declare/externalConstant) i32.ne
(i32.const 1) if
) i32.const 0
(block i32.const 8
(call $~lib/env/abort i32.const 5
(i32.const 0) i32.const 0
(i32.const 8) call $~lib/env/abort
(i32.const 5) unreachable
(i32.const 0) end
) call $declare/my.externalFunction
(unreachable) get_global $declare/my.externalConstant
) i32.const 2
) i32.ne
(call $declare/my.externalFunction) if
(if i32.const 0
(i32.ne i32.const 8
(get_global $declare/my.externalConstant) i32.const 13
(i32.const 2) i32.const 0
) call $~lib/env/abort
(block unreachable
(call $~lib/env/abort end
(i32.const 0)
(i32.const 8)
(i32.const 13)
(i32.const 0)
)
(unreachable)
)
)
) )
(func $null (; 4 ;) (; has Stack IR ;) (type $v) (func $null (; 4 ;) (type $v)
(nop) nop
) )
) )

View File

@ -1,56 +1,46 @@
(module (module
(type $v (func)) (type $v (func))
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\n\00\00\00d\00e\00c\00l\00a\00r\00e\00.\00t\00s\00")
(table 1 anyfunc)
(elem (i32.const 0) $null)
(import "declare" "externalConstant" (global $declare/externalConstant i32)) (import "declare" "externalConstant" (global $declare/externalConstant i32))
(import "declare" "my.externalConstant" (global $declare/my.externalConstant i32)) (import "declare" "my.externalConstant" (global $declare/my.externalConstant i32))
(import "declare" "externalFunction" (func $declare/externalFunction)) (import "declare" "externalFunction" (func $declare/externalFunction))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "declare" "my.externalFunction" (func $declare/my.externalFunction)) (import "declare" "my.externalFunction" (func $declare/my.externalFunction))
(memory $0 1)
(data (i32.const 8) "\n\00\00\00d\00e\00c\00l\00a\00r\00e\00.\00t\00s\00")
(table $0 1 anyfunc)
(elem (i32.const 0) $null)
(global $HEAP_BASE i32 (i32.const 32)) (global $HEAP_BASE i32 (i32.const 32))
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $start (; 3 ;) (type $v) (func $start (; 3 ;) (type $v)
(call $declare/externalFunction) call $declare/externalFunction
(if get_global $declare/externalConstant
(i32.eqz i32.const 1
(i32.eq i32.eq
(get_global $declare/externalConstant) i32.eqz
(i32.const 1) if
) i32.const 0
) i32.const 8
(block i32.const 5
(call $~lib/env/abort i32.const 0
(i32.const 0) call $~lib/env/abort
(i32.const 8) unreachable
(i32.const 5) end
(i32.const 0) call $declare/my.externalFunction
) get_global $declare/my.externalConstant
(unreachable) i32.const 2
) i32.eq
) i32.eqz
(call $declare/my.externalFunction) if
(if i32.const 0
(i32.eqz i32.const 8
(i32.eq i32.const 13
(get_global $declare/my.externalConstant) i32.const 0
(i32.const 2) call $~lib/env/abort
) unreachable
) end
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 13)
(i32.const 0)
)
(unreachable)
)
)
) )
(func $null (; 4 ;) (type $v) (func $null (; 4 ;) (type $v)
) )

View File

@ -1,205 +1,154 @@
(module (module
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func)) (type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\05\00\00\00d\00o\00.\00t\00s") (data (i32.const 8) "\05\00\00\00d\00o\00.\00t\00s")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $do/n (mut i32) (i32.const 10)) (global $do/n (mut i32) (i32.const 10))
(global $do/m (mut i32) (i32.const 0)) (global $do/m (mut i32) (i32.const 0))
(global $do/o (mut i32) (i32.const 0)) (global $do/o (mut i32) (i32.const 0))
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $start (; 1 ;) (; has Stack IR ;) (type $v) (func $start (; 1 ;) (type $v)
(local $0 i32) (local $0 i32)
(loop $continue|0 loop $continue|0
(set_global $do/n get_global $do/n
(i32.sub i32.const 1
(get_global $do/n) i32.sub
(i32.const 1) set_global $do/n
) get_global $do/m
) i32.const 1
(set_global $do/m i32.add
(i32.add set_global $do/m
(get_global $do/m) get_global $do/n
(i32.const 1) br_if $continue|0
) end
) get_global $do/n
(br_if $continue|0 if
(get_global $do/n) i32.const 0
) i32.const 8
) i32.const 7
(if i32.const 0
(get_global $do/n) call $~lib/env/abort
(block unreachable
(call $~lib/env/abort end
(i32.const 0) get_global $do/m
(i32.const 8) i32.const 10
(i32.const 7) i32.ne
(i32.const 0) if
) i32.const 0
(unreachable) i32.const 8
) i32.const 8
) i32.const 0
(if call $~lib/env/abort
(i32.ne unreachable
(get_global $do/m) end
(i32.const 10) i32.const 10
) set_global $do/n
(block loop $continue|1
(call $~lib/env/abort get_global $do/n
(i32.const 0) tee_local $0
(i32.const 8) i32.const 1
(i32.const 8) i32.sub
(i32.const 0) set_global $do/n
) get_local $0
(unreachable) br_if $continue|1
) end
) get_global $do/n
(set_global $do/n i32.const -1
(i32.const 10) i32.ne
) if
(loop $continue|1 i32.const 0
(set_global $do/n i32.const 8
(i32.sub i32.const 12
(tee_local $0 i32.const 0
(get_global $do/n) call $~lib/env/abort
) unreachable
(i32.const 1) end
) i32.const 10
) set_global $do/n
(br_if $continue|1 i32.const 0
(get_local $0) set_global $do/m
) loop $continue|2
) get_global $do/n
(if i32.const 1
(i32.ne i32.sub
(get_global $do/n) set_global $do/n
(i32.const -1) get_global $do/m
) i32.const 1
(block i32.add
(call $~lib/env/abort set_global $do/m
(i32.const 0) loop $continue|3
(i32.const 8) get_global $do/n
(i32.const 12) i32.const 1
(i32.const 0) i32.sub
) set_global $do/n
(unreachable) get_global $do/o
) i32.const 1
) i32.add
(set_global $do/n set_global $do/o
(i32.const 10) get_global $do/n
) br_if $continue|3
(set_global $do/m end
(i32.const 0) get_global $do/n
) if
(loop $continue|2 i32.const 0
(set_global $do/n i32.const 8
(i32.sub i32.const 24
(get_global $do/n) i32.const 2
(i32.const 1) call $~lib/env/abort
) unreachable
) end
(set_global $do/m get_global $do/o
(i32.add i32.const 9
(get_global $do/m) i32.ne
(i32.const 1) if
) i32.const 0
) i32.const 8
(loop $continue|3 i32.const 25
(set_global $do/n i32.const 2
(i32.sub call $~lib/env/abort
(get_global $do/n) unreachable
(i32.const 1) end
) get_global $do/n
) br_if $continue|2
(set_global $do/o end
(i32.add get_global $do/n
(get_global $do/o) if
(i32.const 1) i32.const 0
) i32.const 8
) i32.const 27
(br_if $continue|3 i32.const 0
(get_global $do/n) call $~lib/env/abort
) unreachable
) end
(if get_global $do/m
(get_global $do/n) i32.const 1
(block i32.ne
(call $~lib/env/abort if
(i32.const 0) i32.const 0
(i32.const 8) i32.const 8
(i32.const 24) i32.const 28
(i32.const 2) i32.const 0
) call $~lib/env/abort
(unreachable) unreachable
) end
) get_global $do/o
(if i32.const 9
(i32.ne i32.ne
(get_global $do/o) if
(i32.const 9) i32.const 0
) i32.const 8
(block i32.const 29
(call $~lib/env/abort i32.const 0
(i32.const 0) call $~lib/env/abort
(i32.const 8) unreachable
(i32.const 25) end
(i32.const 2)
)
(unreachable)
)
)
(br_if $continue|2
(get_global $do/n)
)
)
(if
(get_global $do/n)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 27)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.ne
(get_global $do/m)
(i32.const 1)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 28)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.ne
(get_global $do/o)
(i32.const 9)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 29)
(i32.const 0)
)
(unreachable)
)
)
) )
(func $null (; 2 ;) (; has Stack IR ;) (type $v) (func $null (; 2 ;) (type $v)
(nop) nop
) )
) )

View File

@ -1,11 +1,11 @@
(module (module
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func)) (type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\05\00\00\00d\00o\00.\00t\00s\00") (data (i32.const 8) "\05\00\00\00d\00o\00.\00t\00s\00")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $do/n (mut i32) (i32.const 10)) (global $do/n (mut i32) (i32.const 10))
(global $do/m (mut i32) (i32.const 0)) (global $do/m (mut i32) (i32.const 0))
(global $do/o (mut i32) (i32.const 0)) (global $do/o (mut i32) (i32.const 0))
@ -15,232 +15,170 @@
(start $start) (start $start)
(func $start (; 1 ;) (type $v) (func $start (; 1 ;) (type $v)
(local $0 i32) (local $0 i32)
(block $break|0 block $break|0
(loop $continue|0 loop $continue|0
(block block
(set_global $do/n get_global $do/n
(i32.sub i32.const 1
(get_global $do/n) i32.sub
(i32.const 1) set_global $do/n
) get_global $do/m
) i32.const 1
(set_global $do/m i32.add
(i32.add set_global $do/m
(get_global $do/m) end
(i32.const 1) get_global $do/n
) br_if $continue|0
) end
) end
(br_if $continue|0 get_global $do/n
(get_global $do/n) i32.const 0
) i32.eq
) i32.eqz
) if
(if i32.const 0
(i32.eqz i32.const 8
(i32.eq i32.const 7
(get_global $do/n) i32.const 0
(i32.const 0) call $~lib/env/abort
) unreachable
) end
(block get_global $do/m
(call $~lib/env/abort i32.const 10
(i32.const 0) i32.eq
(i32.const 8) i32.eqz
(i32.const 7) if
(i32.const 0) i32.const 0
) i32.const 8
(unreachable) i32.const 8
) i32.const 0
) call $~lib/env/abort
(if unreachable
(i32.eqz end
(i32.eq i32.const 10
(get_global $do/m) set_global $do/n
(i32.const 10) block $break|1
) loop $continue|1
) nop
(block block (result i32)
(call $~lib/env/abort get_global $do/n
(i32.const 0) tee_local $0
(i32.const 8) i32.const 1
(i32.const 8) i32.sub
(i32.const 0) set_global $do/n
) get_local $0
(unreachable) end
) br_if $continue|1
) end
(set_global $do/n end
(i32.const 10) get_global $do/n
) i32.const -1
(block $break|1 i32.eq
(loop $continue|1 i32.eqz
(nop) if
(br_if $continue|1 i32.const 0
(block (result i32) i32.const 8
(set_global $do/n i32.const 12
(i32.sub i32.const 0
(tee_local $0 call $~lib/env/abort
(get_global $do/n) unreachable
) end
(i32.const 1) i32.const 10
) set_global $do/n
) i32.const 0
(get_local $0) set_global $do/m
) block $break|2
) loop $continue|2
) block
) get_global $do/n
(if i32.const 1
(i32.eqz i32.sub
(i32.eq set_global $do/n
(get_global $do/n) get_global $do/m
(i32.const -1) i32.const 1
) i32.add
) set_global $do/m
(block block $break|3
(call $~lib/env/abort loop $continue|3
(i32.const 0) block
(i32.const 8) get_global $do/n
(i32.const 12) i32.const 1
(i32.const 0) i32.sub
) set_global $do/n
(unreachable) get_global $do/o
) i32.const 1
) i32.add
(set_global $do/n set_global $do/o
(i32.const 10) end
) get_global $do/n
(set_global $do/m br_if $continue|3
(i32.const 0) end
) end
(block $break|2 get_global $do/n
(loop $continue|2 i32.const 0
(block i32.eq
(set_global $do/n i32.eqz
(i32.sub if
(get_global $do/n) i32.const 0
(i32.const 1) i32.const 8
) i32.const 24
) i32.const 2
(set_global $do/m call $~lib/env/abort
(i32.add unreachable
(get_global $do/m) end
(i32.const 1) get_global $do/o
) i32.const 9
) i32.eq
(block $break|3 i32.eqz
(loop $continue|3 if
(block i32.const 0
(set_global $do/n i32.const 8
(i32.sub i32.const 25
(get_global $do/n) i32.const 2
(i32.const 1) call $~lib/env/abort
) unreachable
) end
(set_global $do/o end
(i32.add get_global $do/n
(get_global $do/o) br_if $continue|2
(i32.const 1) end
) end
) get_global $do/n
) i32.const 0
(br_if $continue|3 i32.eq
(get_global $do/n) i32.eqz
) if
) i32.const 0
) i32.const 8
(if i32.const 27
(i32.eqz i32.const 0
(i32.eq call $~lib/env/abort
(get_global $do/n) unreachable
(i32.const 0) end
) get_global $do/m
) i32.const 1
(block i32.eq
(call $~lib/env/abort i32.eqz
(i32.const 0) if
(i32.const 8) i32.const 0
(i32.const 24) i32.const 8
(i32.const 2) i32.const 28
) i32.const 0
(unreachable) call $~lib/env/abort
) unreachable
) end
(if get_global $do/o
(i32.eqz i32.const 9
(i32.eq i32.eq
(get_global $do/o) i32.eqz
(i32.const 9) if
) i32.const 0
) i32.const 8
(block i32.const 29
(call $~lib/env/abort i32.const 0
(i32.const 0) call $~lib/env/abort
(i32.const 8) unreachable
(i32.const 25) end
(i32.const 2)
)
(unreachable)
)
)
)
(br_if $continue|2
(get_global $do/n)
)
)
)
(if
(i32.eqz
(i32.eq
(get_global $do/n)
(i32.const 0)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 27)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(get_global $do/m)
(i32.const 1)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 28)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(get_global $do/o)
(i32.const 9)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 29)
(i32.const 0)
)
(unreachable)
)
)
) )
(func $null (; 2 ;) (type $v) (func $null (; 2 ;) (type $v)
) )

View File

@ -1,11 +1,11 @@
(module (module
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(func $null (; 0 ;) (; has Stack IR ;) (type $v) (func $null (; 0 ;) (type $v)
(nop) nop
) )
) )

View File

@ -1,7 +1,7 @@
(module (module
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(global $HEAP_BASE i32 (i32.const 8)) (global $HEAP_BASE i32 (i32.const 8))
(export "memory" (memory $0)) (export "memory" (memory $0))

View File

@ -2,7 +2,7 @@
(type $i (func (result i32))) (type $i (func (result i32)))
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(global $enum/Implicit.ZERO i32 (i32.const 0)) (global $enum/Implicit.ZERO i32 (i32.const 0))
(global $enum/Implicit.ONE i32 (i32.const 1)) (global $enum/Implicit.ONE i32 (i32.const 1))
@ -37,21 +37,18 @@
(export "SelfReference.ZERO" (global $enum/SelfReference.ZERO)) (export "SelfReference.ZERO" (global $enum/SelfReference.ZERO))
(export "SelfReference.ONE" (global $enum/SelfReference.ONE)) (export "SelfReference.ONE" (global $enum/SelfReference.ONE))
(start $start) (start $start)
(func $enum/getZero (; 0 ;) (; has Stack IR ;) (type $i) (result i32) (func $enum/getZero (; 0 ;) (type $i) (result i32)
(i32.const 0) i32.const 0
) )
(func $start (; 1 ;) (; has Stack IR ;) (type $v) (func $start (; 1 ;) (type $v)
(set_global $enum/NonConstant.ZERO call $enum/getZero
(call $enum/getZero) set_global $enum/NonConstant.ZERO
) call $enum/getZero
(set_global $enum/NonConstant.ONE i32.const 1
(i32.add i32.add
(call $enum/getZero) set_global $enum/NonConstant.ONE
(i32.const 1)
)
)
) )
(func $null (; 2 ;) (; has Stack IR ;) (type $v) (func $null (; 2 ;) (type $v)
(nop) nop
) )
) )

View File

@ -2,7 +2,7 @@
(type $i (func (result i32))) (type $i (func (result i32)))
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(global $enum/Implicit.ZERO i32 (i32.const 0)) (global $enum/Implicit.ZERO i32 (i32.const 0))
(global $enum/Implicit.ONE i32 (i32.const 1)) (global $enum/Implicit.ONE i32 (i32.const 1))
@ -40,24 +40,19 @@
(export "SelfReference.ONE" (global $enum/SelfReference.ONE)) (export "SelfReference.ONE" (global $enum/SelfReference.ONE))
(start $start) (start $start)
(func $enum/getZero (; 0 ;) (type $i) (result i32) (func $enum/getZero (; 0 ;) (type $i) (result i32)
(i32.const 0) i32.const 0
) )
(func $start (; 1 ;) (type $v) (func $start (; 1 ;) (type $v)
(set_global $enum/NonConstant.ZERO call $enum/getZero
(call $enum/getZero) set_global $enum/NonConstant.ZERO
) call $enum/getZero
(set_global $enum/NonConstant.ONE i32.const 1
(i32.add i32.add
(call $enum/getZero) set_global $enum/NonConstant.ONE
(i32.const 1) get_global $enum/NonConstant.ZERO
) drop
) get_global $enum/NonConstant.ONE
(drop drop
(get_global $enum/NonConstant.ZERO)
)
(drop
(get_global $enum/NonConstant.ONE)
)
) )
(func $null (; 2 ;) (type $v) (func $null (; 2 ;) (type $v)
) )

View File

@ -2,7 +2,7 @@
(type $iii (func (param i32 i32) (result i32))) (type $iii (func (param i32 i32) (result i32)))
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $export/ns.two) (elem (i32.const 0) $export/ns.two)
(global $export/a i32 (i32.const 1)) (global $export/a i32 (i32.const 1))
(global $export/b i32 (i32.const 2)) (global $export/b i32 (i32.const 2))
@ -16,25 +16,22 @@
(export "b" (global $export/b)) (export "b" (global $export/b))
(export "renamed_c" (global $export/c)) (export "renamed_c" (global $export/c))
(export "ns.two" (func $export/ns.two)) (export "ns.two" (func $export/ns.two))
(func $export/add (; 0 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $export/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.add get_local $0
(get_local $0) get_local $1
(get_local $1) i32.add
)
) )
(func $export/sub (; 1 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $export/sub (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.sub get_local $0
(get_local $0) get_local $1
(get_local $1) i32.sub
)
) )
(func $export/mul (; 2 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $export/mul (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.mul get_local $0
(get_local $0) get_local $1
(get_local $1) i32.mul
)
) )
(func $export/ns.two (; 3 ;) (; has Stack IR ;) (type $v) (func $export/ns.two (; 3 ;) (type $v)
(nop) nop
) )
) )

View File

@ -2,7 +2,7 @@
(type $iii (func (param i32 i32) (result i32))) (type $iii (func (param i32 i32) (result i32)))
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(global $export/a i32 (i32.const 1)) (global $export/a i32 (i32.const 1))
(global $export/b i32 (i32.const 2)) (global $export/b i32 (i32.const 2))
@ -18,25 +18,22 @@
(export "renamed_c" (global $export/c)) (export "renamed_c" (global $export/c))
(export "ns.two" (func $export/ns.two)) (export "ns.two" (func $export/ns.two))
(func $export/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $export/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.add get_local $0
(get_local $0) get_local $1
(get_local $1) i32.add
)
) )
(func $export/sub (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $export/sub (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.sub get_local $0
(get_local $0) get_local $1
(get_local $1) i32.sub
)
) )
(func $export/mul (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $export/mul (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.mul get_local $0
(get_local $0) get_local $1
(get_local $1) i32.mul
)
) )
(func $export/ns.two (; 3 ;) (type $v) (func $export/ns.two (; 3 ;) (type $v)
(nop) nop
) )
(func $null (; 4 ;) (type $v) (func $null (; 4 ;) (type $v)
) )

View File

@ -7,7 +7,7 @@
(type $v (func)) (type $v (func))
(type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$i (func (result i32)))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
@ -47,198 +47,156 @@
(export "vehicles.Car#openDoors" (func $exports/Car#openDoors)) (export "vehicles.Car#openDoors" (func $exports/Car#openDoors))
(export "outer.inner.a" (global $exports/outer.inner.a)) (export "outer.inner.a" (global $exports/outer.inner.a))
(start $start) (start $start)
(func $exports/add (; 0 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $exports/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.add get_local $0
(get_local $0) get_local $1
(get_local $1) i32.add
)
) )
(func $exports/subOpt (; 1 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $exports/subOpt (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.sub get_local $0
(get_local $0) get_local $1
(get_local $1) i32.sub
)
) )
(func $exports/Car.getNumTires (; 2 ;) (; has Stack IR ;) (type $i) (result i32) (func $exports/Car.getNumTires (; 2 ;) (type $i) (result i32)
(i32.const 4) i32.const 4
) )
(func $~lib/allocator/arena/__memory_allocate (; 3 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (func $~lib/allocator/arena/__memory_allocate (; 3 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32) (local $1 i32)
(local $2 i32) (local $2 i32)
(local $3 i32) (local $3 i32)
(if get_local $0
(i32.gt_u i32.const 1073741824
(get_local $0) i32.gt_u
(i32.const 1073741824) if
) unreachable
(unreachable) end
) get_global $~lib/allocator/arena/offset
(if tee_local $1
(i32.gt_u get_local $0
(tee_local $2 i32.const 1
(i32.and get_local $0
(i32.add i32.const 1
(i32.add i32.gt_u
(tee_local $1 select
(get_global $~lib/allocator/arena/offset) i32.add
) i32.const 7
(select i32.add
(get_local $0) i32.const -8
(i32.const 1) i32.and
(i32.gt_u tee_local $2
(get_local $0) current_memory
(i32.const 1) tee_local $3
) i32.const 16
) i32.shl
) i32.gt_u
(i32.const 7) if
) get_local $3
(i32.const -8) get_local $2
) get_local $1
) i32.sub
(i32.shl i32.const 65535
(tee_local $3 i32.add
(current_memory) i32.const -65536
) i32.and
(i32.const 16) i32.const 16
) i32.shr_u
) tee_local $0
(if get_local $3
(i32.lt_s get_local $0
(grow_memory i32.gt_s
(select select
(get_local $3) grow_memory
(tee_local $0 i32.const 0
(i32.shr_u i32.lt_s
(i32.and if
(i32.add get_local $0
(i32.sub grow_memory
(get_local $2) i32.const 0
(get_local $1) i32.lt_s
) if
(i32.const 65535) unreachable
) end
(i32.const -65536) end
) end
(i32.const 16) get_local $2
) set_global $~lib/allocator/arena/offset
) get_local $1
(i32.gt_s
(get_local $3)
(get_local $0)
)
)
)
(i32.const 0)
)
(if
(i32.lt_s
(grow_memory
(get_local $0)
)
(i32.const 0)
)
(unreachable)
)
)
)
(set_global $~lib/allocator/arena/offset
(get_local $2)
)
(get_local $1)
) )
(func $~lib/memory/memory.allocate (; 4 ;) (; has Stack IR ;) (type $FUNCSIG$i) (result i32) (func $~lib/memory/memory.allocate (; 4 ;) (type $FUNCSIG$i) (result i32)
(call $~lib/allocator/arena/__memory_allocate i32.const 4
(i32.const 4) call $~lib/allocator/arena/__memory_allocate
)
) )
(func $exports/Car#constructor (; 5 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $exports/Car#constructor (; 5 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(if get_local $0
(i32.eqz i32.eqz
(get_local $0) if
) call $~lib/memory/memory.allocate
(i32.store tee_local $0
(tee_local $0 get_local $1
(call $~lib/memory/memory.allocate) i32.store
) end
(get_local $1) get_local $0
) get_local $1
) i32.store
(i32.store get_local $0
(get_local $0)
(get_local $1)
)
(get_local $0)
) )
(func $exports/Car#get:numDoors (; 6 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (func $exports/Car#get:numDoors (; 6 ;) (type $ii) (param $0 i32) (result i32)
(i32.load get_local $0
(get_local $0) i32.load
)
) )
(func $exports/Car#set:numDoors (; 7 ;) (; has Stack IR ;) (type $iiv) (param $0 i32) (param $1 i32) (func $exports/Car#set:numDoors (; 7 ;) (type $iiv) (param $0 i32) (param $1 i32)
(i32.store get_local $0
(get_local $0) get_local $1
(get_local $1) i32.store
)
) )
(func $exports/Car#openDoors (; 8 ;) (; has Stack IR ;) (type $iv) (param $0 i32) (func $exports/Car#openDoors (; 8 ;) (type $iv) (param $0 i32)
(nop) nop
) )
(func $start (; 9 ;) (; has Stack IR ;) (type $v) (func $start (; 9 ;) (type $v)
(set_global $~lib/allocator/arena/startOffset i32.const 8
(i32.const 8) set_global $~lib/allocator/arena/startOffset
) get_global $~lib/allocator/arena/startOffset
(set_global $~lib/allocator/arena/offset set_global $~lib/allocator/arena/offset
(get_global $~lib/allocator/arena/startOffset)
)
) )
(func $null (; 10 ;) (; has Stack IR ;) (type $v) (func $null (; 10 ;) (type $v)
(nop) nop
) )
(func $exports/subOpt|trampoline (; 11 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $exports/subOpt|trampoline (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(block $1of1 block $1of1
(block $0of1 block $0of1
(block $outOfRange block $outOfRange
(br_table $0of1 $1of1 $outOfRange get_global $~argc
(i32.sub i32.const 1
(get_global $~argc) i32.sub
(i32.const 1) br_table $0of1 $1of1 $outOfRange
) end
) unreachable
) end
(unreachable) i32.const 0
) set_local $1
(set_local $1 end
(i32.const 0) get_local $0
) get_local $1
) call $exports/subOpt
(call $exports/subOpt
(get_local $0)
(get_local $1)
)
) )
(func $~setargc (; 12 ;) (; has Stack IR ;) (type $iv) (param $0 i32) (func $~setargc (; 12 ;) (type $iv) (param $0 i32)
(set_global $~argc get_local $0
(get_local $0) set_global $~argc
)
) )
(func $exports/Car#constructor|trampoline (; 13 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $exports/Car#constructor|trampoline (; 13 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(block $1of1 block $1of1
(block $0of1 block $0of1
(block $outOfRange block $outOfRange
(br_table $0of1 $1of1 $outOfRange get_global $~argc
(get_global $~argc) br_table $0of1 $1of1 $outOfRange
) end
) unreachable
(unreachable) end
) i32.const 2
(set_local $1 set_local $1
(i32.const 2) end
) get_local $0
) get_local $1
(call $exports/Car#constructor call $exports/Car#constructor
(get_local $0)
(get_local $1)
)
) )
) )

View File

@ -6,7 +6,7 @@
(type $iv (func (param i32))) (type $iv (func (param i32)))
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3))
(global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8))
@ -52,25 +52,22 @@
(export "outer.inner.a" (global $exports/outer.inner.a)) (export "outer.inner.a" (global $exports/outer.inner.a))
(start $start) (start $start)
(func $exports/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $exports/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.add get_local $0
(get_local $0) get_local $1
(get_local $1) i32.add
)
) )
(func $exports/subOpt (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $exports/subOpt (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.sub get_local $0
(get_local $0) get_local $1
(get_local $1) i32.sub
)
) )
(func $exports/math.sub (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $exports/math.sub (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.sub get_local $0
(get_local $0) get_local $1
(get_local $1) i32.sub
)
) )
(func $exports/Car.getNumTires (; 3 ;) (type $i) (result i32) (func $exports/Car.getNumTires (; 3 ;) (type $i) (result i32)
(get_global $exports/Car.TIRES) get_global $exports/Car.TIRES
) )
(func $~lib/allocator/arena/__memory_allocate (; 4 ;) (type $ii) (param $0 i32) (result i32) (func $~lib/allocator/arena/__memory_allocate (; 4 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32) (local $1 i32)
@ -79,306 +76,238 @@
(local $4 i32) (local $4 i32)
(local $5 i32) (local $5 i32)
(local $6 i32) (local $6 i32)
(if get_local $0
(i32.gt_u get_global $~lib/internal/allocator/MAX_SIZE_32
(get_local $0) i32.gt_u
(get_global $~lib/internal/allocator/MAX_SIZE_32) if
) unreachable
(unreachable) end
) get_global $~lib/allocator/arena/offset
(set_local $1 set_local $1
(get_global $~lib/allocator/arena/offset) get_local $1
) get_local $0
(set_local $4 tee_local $2
(i32.and i32.const 1
(i32.add tee_local $3
(i32.add get_local $2
(get_local $1) get_local $3
(select i32.gt_u
(tee_local $2 select
(get_local $0) i32.add
) get_global $~lib/internal/allocator/AL_MASK
(tee_local $3 i32.add
(i32.const 1) get_global $~lib/internal/allocator/AL_MASK
) i32.const -1
(i32.gt_u i32.xor
(get_local $2) i32.and
(get_local $3) set_local $4
) current_memory
) set_local $5
) get_local $4
(get_global $~lib/internal/allocator/AL_MASK) get_local $5
) i32.const 16
(i32.xor i32.shl
(get_global $~lib/internal/allocator/AL_MASK) i32.gt_u
(i32.const -1) if
) get_local $4
) get_local $1
) i32.sub
(set_local $5 i32.const 65535
(current_memory) i32.add
) i32.const 65535
(if i32.const -1
(i32.gt_u i32.xor
(get_local $4) i32.and
(i32.shl i32.const 16
(get_local $5) i32.shr_u
(i32.const 16) set_local $2
) get_local $5
) tee_local $3
(block get_local $2
(set_local $2 tee_local $6
(i32.shr_u get_local $3
(i32.and get_local $6
(i32.add i32.gt_s
(i32.sub select
(get_local $4) set_local $3
(get_local $1) get_local $3
) grow_memory
(i32.const 65535) i32.const 0
) i32.lt_s
(i32.xor if
(i32.const 65535) get_local $2
(i32.const -1) grow_memory
) i32.const 0
) i32.lt_s
(i32.const 16) if
) unreachable
) end
(set_local $3 end
(select end
(tee_local $3 get_local $4
(get_local $5) set_global $~lib/allocator/arena/offset
) get_local $1
(tee_local $6
(get_local $2)
)
(i32.gt_s
(get_local $3)
(get_local $6)
)
)
)
(if
(i32.lt_s
(grow_memory
(get_local $3)
)
(i32.const 0)
)
(if
(i32.lt_s
(grow_memory
(get_local $2)
)
(i32.const 0)
)
(unreachable)
)
)
)
)
(set_global $~lib/allocator/arena/offset
(get_local $4)
)
(get_local $1)
) )
(func $~lib/memory/memory.allocate (; 5 ;) (type $ii) (param $0 i32) (result i32) (func $~lib/memory/memory.allocate (; 5 ;) (type $ii) (param $0 i32) (result i32)
(return get_local $0
(call $~lib/allocator/arena/__memory_allocate call $~lib/allocator/arena/__memory_allocate
(get_local $0) return
)
)
) )
(func $exports/Car#constructor (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $exports/Car#constructor (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32) (local $2 i32)
(i32.store get_local $0
(tee_local $0 if (result i32)
(if (result i32) get_local $0
(get_local $0) else
(get_local $0) block (result i32)
(tee_local $0 i32.const 4
(block (result i32) call $~lib/memory/memory.allocate
(set_local $2 set_local $2
(call $~lib/memory/memory.allocate get_local $2
(i32.const 4) get_local $1
) i32.store
) get_local $2
(i32.store end
(get_local $2) tee_local $0
(get_local $1) end
) tee_local $0
(get_local $2) get_local $1
) i32.store
) get_local $0
)
)
(get_local $1)
)
(get_local $0)
) )
(func $exports/Car#get:numDoors (; 7 ;) (type $ii) (param $0 i32) (result i32) (func $exports/Car#get:numDoors (; 7 ;) (type $ii) (param $0 i32) (result i32)
(i32.load get_local $0
(get_local $0) i32.load
)
) )
(func $exports/Car#set:numDoors (; 8 ;) (type $iiv) (param $0 i32) (param $1 i32) (func $exports/Car#set:numDoors (; 8 ;) (type $iiv) (param $0 i32) (param $1 i32)
(i32.store get_local $0
(get_local $0) get_local $1
(get_local $1) i32.store
)
) )
(func $exports/Car#openDoors (; 9 ;) (type $iv) (param $0 i32) (func $exports/Car#openDoors (; 9 ;) (type $iv) (param $0 i32)
(nop) nop
) )
(func $exports/vehicles.Car.getNumTires (; 10 ;) (type $i) (result i32) (func $exports/vehicles.Car.getNumTires (; 10 ;) (type $i) (result i32)
(get_global $exports/vehicles.Car.TIRES) get_global $exports/vehicles.Car.TIRES
) )
(func $exports/vehicles.Car#constructor (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $exports/vehicles.Car#constructor (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32) (local $2 i32)
(i32.store get_local $0
(tee_local $0 if (result i32)
(if (result i32) get_local $0
(get_local $0) else
(get_local $0) block (result i32)
(tee_local $0 i32.const 4
(block (result i32) call $~lib/memory/memory.allocate
(set_local $2 set_local $2
(call $~lib/memory/memory.allocate get_local $2
(i32.const 4) get_local $1
) i32.store
) get_local $2
(i32.store end
(get_local $2) tee_local $0
(get_local $1) end
) tee_local $0
(get_local $2) get_local $1
) i32.store
) get_local $0
)
)
(get_local $1)
)
(get_local $0)
) )
(func $exports/vehicles.Car#get:numDoors (; 12 ;) (type $ii) (param $0 i32) (result i32) (func $exports/vehicles.Car#get:numDoors (; 12 ;) (type $ii) (param $0 i32) (result i32)
(i32.load get_local $0
(get_local $0) i32.load
)
) )
(func $exports/vehicles.Car#set:numDoors (; 13 ;) (type $iiv) (param $0 i32) (param $1 i32) (func $exports/vehicles.Car#set:numDoors (; 13 ;) (type $iiv) (param $0 i32) (param $1 i32)
(i32.store get_local $0
(get_local $0) get_local $1
(get_local $1) i32.store
)
) )
(func $exports/vehicles.Car#openDoors (; 14 ;) (type $iv) (param $0 i32) (func $exports/vehicles.Car#openDoors (; 14 ;) (type $iv) (param $0 i32)
(nop) nop
) )
(func $start (; 15 ;) (type $v) (func $start (; 15 ;) (type $v)
(set_global $~lib/allocator/arena/startOffset get_global $HEAP_BASE
(i32.and get_global $~lib/internal/allocator/AL_MASK
(i32.add i32.add
(get_global $HEAP_BASE) get_global $~lib/internal/allocator/AL_MASK
(get_global $~lib/internal/allocator/AL_MASK) i32.const -1
) i32.xor
(i32.xor i32.and
(get_global $~lib/internal/allocator/AL_MASK) set_global $~lib/allocator/arena/startOffset
(i32.const -1) get_global $~lib/allocator/arena/startOffset
) set_global $~lib/allocator/arena/offset
)
)
(set_global $~lib/allocator/arena/offset
(get_global $~lib/allocator/arena/startOffset)
)
) )
(func $null (; 16 ;) (type $v) (func $null (; 16 ;) (type $v)
) )
(func $exports/subOpt|trampoline (; 17 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $exports/subOpt|trampoline (; 17 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(block $1of1 block $1of1
(block $0of1 block $0of1
(block $outOfRange block $outOfRange
(br_table $0of1 $1of1 $outOfRange get_global $~argc
(i32.sub i32.const 1
(get_global $~argc) i32.sub
(i32.const 1) br_table $0of1 $1of1 $outOfRange
) end
) unreachable
) end
(unreachable) i32.const 0
) set_local $1
(set_local $1 end
(i32.const 0) get_local $0
) get_local $1
) call $exports/subOpt
(call $exports/subOpt
(get_local $0)
(get_local $1)
)
) )
(func $~setargc (; 18 ;) (type $iv) (param $0 i32) (func $~setargc (; 18 ;) (type $iv) (param $0 i32)
(set_global $~argc get_local $0
(get_local $0) set_global $~argc
)
) )
(func $exports/Car#constructor|trampoline (; 19 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $exports/Car#constructor|trampoline (; 19 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(block $1of1 block $1of1
(block $0of1 block $0of1
(block $outOfRange block $outOfRange
(br_table $0of1 $1of1 $outOfRange get_global $~argc
(get_global $~argc) br_table $0of1 $1of1 $outOfRange
) end
) unreachable
(unreachable) end
) i32.const 2
(set_local $1 set_local $1
(i32.const 2) end
) get_local $0
) get_local $1
(call $exports/Car#constructor call $exports/Car#constructor
(get_local $0)
(get_local $1)
)
) )
(func $Car#get:doors (; 20 ;) (type $ii) (param $0 i32) (result i32) (func $Car#get:doors (; 20 ;) (type $ii) (param $0 i32) (result i32)
(i32.load get_local $0
(get_local $0) i32.load
)
) )
(func $Car#set:doors (; 21 ;) (type $iiv) (param $0 i32) (param $1 i32) (func $Car#set:doors (; 21 ;) (type $iiv) (param $0 i32) (param $1 i32)
(i32.store get_local $0
(get_local $0) get_local $1
(get_local $1) i32.store
)
) )
(func $exports/vehicles.Car#constructor|trampoline (; 22 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $exports/vehicles.Car#constructor|trampoline (; 22 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(block $1of1 block $1of1
(block $0of1 block $0of1
(block $outOfRange block $outOfRange
(br_table $0of1 $1of1 $outOfRange get_global $~argc
(get_global $~argc) br_table $0of1 $1of1 $outOfRange
) end
) unreachable
(unreachable) end
) i32.const 2
(set_local $1 set_local $1
(i32.const 2) end
) get_local $0
) get_local $1
(call $exports/vehicles.Car#constructor call $exports/vehicles.Car#constructor
(get_local $0)
(get_local $1)
)
) )
(func $vehicles.Car#get:doors (; 23 ;) (type $ii) (param $0 i32) (result i32) (func $vehicles.Car#get:doors (; 23 ;) (type $ii) (param $0 i32) (result i32)
(i32.load get_local $0
(get_local $0) i32.load
)
) )
(func $vehicles.Car#set:doors (; 24 ;) (type $iiv) (param $0 i32) (param $1 i32) (func $vehicles.Car#set:doors (; 24 ;) (type $iiv) (param $0 i32) (param $1 i32)
(i32.store get_local $0
(get_local $0) get_local $1
(get_local $1) i32.store
)
) )
) )

View File

@ -1,13 +1,13 @@
(module (module
(type $v (func)) (type $v (func))
(memory $0 0)
(table 1 anyfunc)
(elem (i32.const 0) $null)
(import "foo" "var" (global $external/var_ i32)) (import "foo" "var" (global $external/var_ i32))
(import "external" "foo" (func $external/foo)) (import "external" "foo" (func $external/foo))
(import "external" "foo.bar" (func $external/foo.bar)) (import "external" "foo.bar" (func $external/foo.bar))
(import "external" "bar" (func $external/two)) (import "external" "bar" (func $external/two))
(import "foo" "baz" (func $external/three)) (import "foo" "baz" (func $external/three))
(memory $0 0)
(table $0 1 anyfunc)
(elem (i32.const 0) $null)
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(export "foo.bar" (func $external/foo.bar)) (export "foo.bar" (func $external/foo.bar))
@ -15,7 +15,7 @@
(export "two" (func $external/two)) (export "two" (func $external/two))
(export "three" (func $external/three)) (export "three" (func $external/three))
(export "var_" (global $external/var_)) (export "var_" (global $external/var_))
(func $null (; 4 ;) (; has Stack IR ;) (type $v) (func $null (; 4 ;) (type $v)
(nop) nop
) )
) )

View File

@ -1,13 +1,13 @@
(module (module
(type $v (func)) (type $v (func))
(memory $0 0)
(table 1 anyfunc)
(elem (i32.const 0) $null)
(import "foo" "var" (global $external/var_ i32)) (import "foo" "var" (global $external/var_ i32))
(import "external" "foo" (func $external/foo)) (import "external" "foo" (func $external/foo))
(import "external" "foo.bar" (func $external/foo.bar)) (import "external" "foo.bar" (func $external/foo.bar))
(import "external" "bar" (func $external/two)) (import "external" "bar" (func $external/two))
(import "foo" "baz" (func $external/three)) (import "foo" "baz" (func $external/three))
(memory $0 0)
(table $0 1 anyfunc)
(elem (i32.const 0) $null)
(global $HEAP_BASE i32 (i32.const 8)) (global $HEAP_BASE i32 (i32.const 8))
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))

View File

@ -1,212 +1,178 @@
(module (module
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func)) (type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\06\00\00\00f\00o\00r\00.\00t\00s") (data (i32.const 8) "\06\00\00\00f\00o\00r\00.\00t\00s")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $for/i (mut i32) (i32.const 0)) (global $for/i (mut i32) (i32.const 0))
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $start (; 1 ;) (; has Stack IR ;) (type $v) (func $start (; 1 ;) (type $v)
(local $0 i32) (local $0 i32)
(local $1 i32) (local $1 i32)
(block $break|0 block $break|0
(set_global $for/i i32.const 0
(i32.const 0) set_global $for/i
) loop $repeat|0
(loop $repeat|0 get_global $for/i
(br_if $break|0 i32.const 10
(i32.ge_s i32.ge_s
(get_global $for/i) br_if $break|0
(i32.const 10) get_global $for/i
) i32.const 1
) i32.add
(set_global $for/i set_global $for/i
(i32.add br $repeat|0
(get_global $for/i) unreachable
(i32.const 1) end
) unreachable
) end
(br $repeat|0) get_global $for/i
) i32.const 10
) i32.ne
(if if
(i32.ne i32.const 0
(get_global $for/i) i32.const 8
(i32.const 10) i32.const 5
) i32.const 0
(block call $~lib/env/abort
(call $~lib/env/abort unreachable
(i32.const 0) end
(i32.const 8) block $break|1
(i32.const 5) loop $repeat|1
(i32.const 0) get_local $0
) i32.const 10
(unreachable) i32.ge_s
) br_if $break|1
) get_local $0
(block $break|1 i32.const 1
(loop $repeat|1 i32.add
(br_if $break|1 set_local $0
(i32.ge_s br $repeat|1
(get_local $0) unreachable
(i32.const 10) end
) unreachable
) end
(set_local $0 block $break|2
(i32.add loop $repeat|2
(get_local $0) get_global $for/i
(i32.const 1) i32.const 0
) i32.le_s
) br_if $break|2
(br $repeat|1) get_global $for/i
) i32.const 1
) i32.sub
(block $break|2 set_global $for/i
(loop $repeat|2 br $repeat|2
(br_if $break|2 unreachable
(i32.le_s end
(get_global $for/i) unreachable
(i32.const 0) end
) get_global $for/i
) if
(set_global $for/i i32.const 0
(i32.sub i32.const 8
(get_global $for/i) i32.const 12
(i32.const 1) i32.const 0
) call $~lib/env/abort
) unreachable
(br $repeat|2) end
) block $break|3
) loop $repeat|3
(if get_global $for/i
(get_global $for/i) i32.const 10
(block i32.eq
(call $~lib/env/abort br_if $break|3
(i32.const 0) get_global $for/i
(i32.const 8) i32.const 1
(i32.const 12) i32.add
(i32.const 0) set_global $for/i
) br $repeat|3
(unreachable) unreachable
) end
) unreachable
(block $break|3 end
(loop $repeat|3 loop $repeat|4
(br_if $break|3 get_global $for/i
(i32.eq i32.const 1
(get_global $for/i) i32.sub
(i32.const 10) set_global $for/i
) get_global $for/i
) br_if $repeat|4
(set_global $for/i end
(i32.add block $break|5
(get_global $for/i) i32.const 0
(i32.const 1) set_local $0
) loop $repeat|5
) get_local $0
(br $repeat|3) i32.const 10
) i32.ge_s
) br_if $break|5
(loop $repeat|4 get_local $0
(set_global $for/i i32.const 1
(i32.sub i32.add
(get_global $for/i) set_local $0
(i32.const 1) br $repeat|5
) unreachable
) end
(br_if $repeat|4 unreachable
(get_global $for/i) end
) get_local $0
) i32.const 10
(block $break|5 i32.ne
(set_local $0 if
(i32.const 0) i32.const 0
) i32.const 8
(loop $repeat|5 i32.const 19
(br_if $break|5 i32.const 0
(i32.ge_s call $~lib/env/abort
(get_local $0) unreachable
(i32.const 10) end
) block $break|6
) i32.const 0
(set_local $0 set_local $0
(i32.add loop $repeat|6
(get_local $0) get_local $0
(i32.const 1) i32.const 10
) i32.ge_s
) br_if $break|6
(br $repeat|5) block $break|7
) i32.const 0
) set_local $1
(if loop $repeat|7
(i32.ne block $continue|7
(get_local $0) get_local $1
(i32.const 10) i32.const 10
) i32.ge_s
(block br_if $break|7
(call $~lib/env/abort get_local $0
(i32.const 0) get_local $1
(i32.const 8) i32.eq
(i32.const 19) br_if $continue|7
(i32.const 0) end
) get_local $1
(unreachable) i32.const 1
) i32.add
) set_local $1
(block $break|6 br $repeat|7
(set_local $0 unreachable
(i32.const 0) end
) unreachable
(loop $repeat|6 end
(br_if $break|6 get_local $0
(i32.ge_s i32.const 1
(get_local $0) i32.add
(i32.const 10) set_local $0
) br $repeat|6
) unreachable
(block $break|7 end
(set_local $1 unreachable
(i32.const 0) end
)
(loop $repeat|7
(block $continue|7
(br_if $break|7
(i32.ge_s
(get_local $1)
(i32.const 10)
)
)
(br_if $continue|7
(i32.eq
(get_local $0)
(get_local $1)
)
)
)
(set_local $1
(i32.add
(get_local $1)
(i32.const 1)
)
)
(br $repeat|7)
)
)
(set_local $0
(i32.add
(get_local $0)
(i32.const 1)
)
)
(br $repeat|6)
)
)
) )
(func $null (; 2 ;) (; has Stack IR ;) (type $v) (func $null (; 2 ;) (type $v)
(nop) nop
) )
) )

View File

@ -1,11 +1,11 @@
(module (module
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func)) (type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\06\00\00\00f\00o\00r\00.\00t\00s\00") (data (i32.const 8) "\06\00\00\00f\00o\00r\00.\00t\00s\00")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $for/i (mut i32) (i32.const 0)) (global $for/i (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 24)) (global $HEAP_BASE i32 (i32.const 24))
(export "memory" (memory $0)) (export "memory" (memory $0))
@ -16,249 +16,204 @@
(local $1 i32) (local $1 i32)
(local $2 i32) (local $2 i32)
(local $3 i32) (local $3 i32)
(block $break|0 block $break|0
(set_global $for/i i32.const 0
(i32.const 0) set_global $for/i
) loop $repeat|0
(loop $repeat|0 get_global $for/i
(br_if $break|0 i32.const 10
(i32.eqz i32.lt_s
(i32.lt_s i32.eqz
(get_global $for/i) br_if $break|0
(i32.const 10) nop
) get_global $for/i
) i32.const 1
) i32.add
(nop) set_global $for/i
(set_global $for/i br $repeat|0
(i32.add unreachable
(get_global $for/i) end
(i32.const 1) unreachable
) end
) get_global $for/i
(br $repeat|0) i32.const 10
) i32.eq
) i32.eqz
(if if
(i32.eqz i32.const 0
(i32.eq i32.const 8
(get_global $for/i) i32.const 5
(i32.const 10) i32.const 0
) call $~lib/env/abort
) unreachable
(block end
(call $~lib/env/abort block $break|1
(i32.const 0) i32.const 0
(i32.const 8) set_local $0
(i32.const 5) loop $repeat|1
(i32.const 0) get_local $0
) i32.const 10
(unreachable) i32.lt_s
) i32.eqz
) br_if $break|1
(block $break|1 nop
(set_local $0 get_local $0
(i32.const 0) i32.const 1
) i32.add
(loop $repeat|1 set_local $0
(br_if $break|1 br $repeat|1
(i32.eqz unreachable
(i32.lt_s end
(get_local $0) unreachable
(i32.const 10) end
) block $break|2
) loop $repeat|2
) get_global $for/i
(nop) i32.const 0
(set_local $0 i32.gt_s
(i32.add i32.eqz
(get_local $0) br_if $break|2
(i32.const 1) nop
) get_global $for/i
) i32.const 1
(br $repeat|1) i32.sub
) set_global $for/i
) br $repeat|2
(block $break|2 unreachable
(loop $repeat|2 end
(br_if $break|2 unreachable
(i32.eqz end
(i32.gt_s get_global $for/i
(get_global $for/i) i32.const 0
(i32.const 0) i32.eq
) i32.eqz
) if
) i32.const 0
(nop) i32.const 8
(set_global $for/i i32.const 12
(i32.sub i32.const 0
(get_global $for/i) call $~lib/env/abort
(i32.const 1) unreachable
) end
) block $break|3
(br $repeat|2) loop $repeat|3
) i32.const 1
) i32.eqz
(if br_if $break|3
(i32.eqz get_global $for/i
(i32.eq i32.const 10
(get_global $for/i) i32.eq
(i32.const 0) if
) br $break|3
) end
(block get_global $for/i
(call $~lib/env/abort i32.const 1
(i32.const 0) i32.add
(i32.const 8) set_global $for/i
(i32.const 12) br $repeat|3
(i32.const 0) unreachable
) end
(unreachable) unreachable
) end
) block $break|4
(block $break|3 loop $repeat|4
(loop $repeat|3 i32.const 1
(br_if $break|3 i32.eqz
(i32.eqz br_if $break|4
(i32.const 1) block (result i32)
) get_global $for/i
) i32.const 1
(if i32.sub
(i32.eq set_global $for/i
(get_global $for/i) get_global $for/i
(i32.const 10) end
) i32.const 0
(br $break|3) i32.eq
) if
(set_global $for/i br $break|4
(i32.add end
(get_global $for/i) br $repeat|4
(i32.const 1) unreachable
) end
) unreachable
(br $repeat|3) end
) block $break|5
) i32.const 0
(block $break|4 set_local $1
(loop $repeat|4 loop $repeat|5
(br_if $break|4 block $continue|5
(i32.eqz get_local $1
(i32.const 1) i32.const 10
) i32.lt_s
) i32.eqz
(if br_if $break|5
(i32.eq br $continue|5
(block (result i32) end
(set_global $for/i get_local $1
(i32.sub i32.const 1
(get_global $for/i) i32.add
(i32.const 1) set_local $1
) br $repeat|5
) unreachable
(get_global $for/i) end
) unreachable
(i32.const 0) end
) get_local $1
(br $break|4) i32.const 10
) i32.eq
(br $repeat|4) i32.eqz
) if
) i32.const 0
(block $break|5 i32.const 8
(set_local $1 i32.const 19
(i32.const 0) i32.const 0
) call $~lib/env/abort
(loop $repeat|5 unreachable
(block $continue|5 end
(br_if $break|5 block $break|6
(i32.eqz i32.const 0
(i32.lt_s set_local $2
(get_local $1) loop $repeat|6
(i32.const 10) get_local $2
) i32.const 10
) i32.lt_s
) i32.eqz
(br $continue|5) br_if $break|6
) block $break|7
(set_local $1 i32.const 0
(i32.add set_local $3
(get_local $1) loop $repeat|7
(i32.const 1) block $continue|7
) get_local $3
) i32.const 10
(br $repeat|5) i32.lt_s
) i32.eqz
) br_if $break|7
(if get_local $2
(i32.eqz get_local $3
(i32.eq i32.eq
(get_local $1) if
(i32.const 10) br $continue|7
) end
) end
(block get_local $3
(call $~lib/env/abort i32.const 1
(i32.const 0) i32.add
(i32.const 8) set_local $3
(i32.const 19) br $repeat|7
(i32.const 0) unreachable
) end
(unreachable) unreachable
) end
) get_local $2
(block $break|6 i32.const 1
(set_local $2 i32.add
(i32.const 0) set_local $2
) br $repeat|6
(loop $repeat|6 unreachable
(br_if $break|6 end
(i32.eqz unreachable
(i32.lt_s end
(get_local $2)
(i32.const 10)
)
)
)
(block $break|7
(set_local $3
(i32.const 0)
)
(loop $repeat|7
(block $continue|7
(br_if $break|7
(i32.eqz
(i32.lt_s
(get_local $3)
(i32.const 10)
)
)
)
(if
(i32.eq
(get_local $2)
(get_local $3)
)
(br $continue|7)
)
)
(set_local $3
(i32.add
(get_local $3)
(i32.const 1)
)
)
(br $repeat|7)
)
)
(set_local $2
(i32.add
(get_local $2)
(i32.const 1)
)
)
(br $repeat|6)
)
)
) )
(func $null (; 2 ;) (type $v) (func $null (; 2 ;) (type $v)
) )

View File

@ -3,11 +3,11 @@
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func)) (type $v (func))
(type $i (func (result i32))) (type $i (func (result i32)))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\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") (data (i32.const 8) "\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")
(table 5 anyfunc) (table $0 5 anyfunc)
(elem (i32.const 0) $start~someName|3 $start~anonymous|1 $start~anonymous|1 $start~someName|3 $start~anonymous|4) (elem (i32.const 0) $start~someName|3 $start~anonymous|1 $start~anonymous|1 $start~someName|3 $start~anonymous|4)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $function-expression/f1 (mut i32) (i32.const 1)) (global $function-expression/f1 (mut i32) (i32.const 1))
(global $~argc (mut i32) (i32.const 0)) (global $~argc (mut i32) (i32.const 0))
(global $function-expression/f2 (mut i32) (i32.const 2)) (global $function-expression/f2 (mut i32) (i32.const 2))
@ -16,83 +16,63 @@
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $start~anonymous|1 (; 1 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (func $start~anonymous|1 (; 1 ;) (type $ii) (param $0 i32) (result i32)
(get_local $0) get_local $0
) )
(func $start~someName|3 (; 2 ;) (; has Stack IR ;) (type $v) (func $start~someName|3 (; 2 ;) (type $v)
(nop) nop
) )
(func $start~anonymous|4 (; 3 ;) (; has Stack IR ;) (type $i) (result i32) (func $start~anonymous|4 (; 3 ;) (type $i) (result i32)
(i32.const 1) i32.const 1
) )
(func $start (; 4 ;) (; has Stack IR ;) (type $v) (func $start (; 4 ;) (type $v)
(set_global $~argc i32.const 1
(i32.const 1) set_global $~argc
) i32.const 1
(if get_global $function-expression/f1
(i32.ne call_indirect (type $ii)
(call_indirect (type $ii) i32.const 1
(i32.const 1) i32.ne
(get_global $function-expression/f1) if
) i32.const 0
(i32.const 1) i32.const 8
) i32.const 4
(block i32.const 0
(call $~lib/env/abort call $~lib/env/abort
(i32.const 0) unreachable
(i32.const 8) end
(i32.const 4) i32.const 1
(i32.const 0) set_global $~argc
) i32.const 2
(unreachable) get_global $function-expression/f2
) call_indirect (type $ii)
) i32.const 2
(set_global $~argc i32.ne
(i32.const 1) if
) i32.const 0
(if i32.const 8
(i32.ne i32.const 9
(call_indirect (type $ii) i32.const 0
(i32.const 2) call $~lib/env/abort
(get_global $function-expression/f2) unreachable
) end
(i32.const 2) i32.const 0
) set_global $~argc
(block get_global $function-expression/f3
(call $~lib/env/abort call_indirect (type $v)
(i32.const 0) i32.const 0
(i32.const 8) set_global $~argc
(i32.const 9) get_global $function-expression/f4
(i32.const 0) call_indirect (type $i)
) i32.const 1
(unreachable) i32.ne
) if
) i32.const 0
(set_global $~argc i32.const 8
(i32.const 0) i32.const 16
) i32.const 0
(call_indirect (type $v) call $~lib/env/abort
(get_global $function-expression/f3) unreachable
) end
(set_global $~argc
(i32.const 0)
)
(if
(i32.ne
(call_indirect (type $i)
(get_global $function-expression/f4)
)
(i32.const 1)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 16)
(i32.const 0)
)
(unreachable)
)
)
) )
) )

View File

@ -3,11 +3,11 @@
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func)) (type $v (func))
(type $i (func (result i32))) (type $i (func (result i32)))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\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") (data (i32.const 8) "\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")
(table 5 anyfunc) (table $0 5 anyfunc)
(elem (i32.const 0) $null $start~anonymous|1 $start~anonymous|2 $start~someName|3 $start~anonymous|4) (elem (i32.const 0) $null $start~anonymous|1 $start~anonymous|2 $start~someName|3 $start~anonymous|4)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $function-expression/f1 (mut i32) (i32.const 1)) (global $function-expression/f1 (mut i32) (i32.const 1))
(global $~argc (mut i32) (i32.const 0)) (global $~argc (mut i32) (i32.const 0))
(global $function-expression/f2 (mut i32) (i32.const 2)) (global $function-expression/f2 (mut i32) (i32.const 2))
@ -18,100 +18,77 @@
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $start~anonymous|1 (; 1 ;) (type $ii) (param $0 i32) (result i32) (func $start~anonymous|1 (; 1 ;) (type $ii) (param $0 i32) (result i32)
(get_local $0) get_local $0
) )
(func $start~anonymous|2 (; 2 ;) (type $ii) (param $0 i32) (result i32) (func $start~anonymous|2 (; 2 ;) (type $ii) (param $0 i32) (result i32)
(get_local $0) get_local $0
) )
(func $start~someName|3 (; 3 ;) (type $v) (func $start~someName|3 (; 3 ;) (type $v)
(nop) nop
) )
(func $start~anonymous|4 (; 4 ;) (type $i) (result i32) (func $start~anonymous|4 (; 4 ;) (type $i) (result i32)
(i32.const 1) i32.const 1
) )
(func $start (; 5 ;) (type $v) (func $start (; 5 ;) (type $v)
(if block (result i32)
(i32.eqz i32.const 1
(i32.eq set_global $~argc
(block (result i32) i32.const 1
(set_global $~argc get_global $function-expression/f1
(i32.const 1) call_indirect (type $ii)
) end
(call_indirect (type $ii) i32.const 1
(i32.const 1) i32.eq
(get_global $function-expression/f1) i32.eqz
) if
) i32.const 0
(i32.const 1) i32.const 8
) i32.const 4
) i32.const 0
(block call $~lib/env/abort
(call $~lib/env/abort unreachable
(i32.const 0) end
(i32.const 8) block (result i32)
(i32.const 4) i32.const 1
(i32.const 0) set_global $~argc
) i32.const 2
(unreachable) get_global $function-expression/f2
) call_indirect (type $ii)
) end
(if i32.const 2
(i32.eqz i32.eq
(i32.eq i32.eqz
(block (result i32) if
(set_global $~argc i32.const 0
(i32.const 1) i32.const 8
) i32.const 9
(call_indirect (type $ii) i32.const 0
(i32.const 2) call $~lib/env/abort
(get_global $function-expression/f2) unreachable
) end
) block
(i32.const 2) i32.const 0
) set_global $~argc
) get_global $function-expression/f3
(block call_indirect (type $v)
(call $~lib/env/abort end
(i32.const 0) block (result i32)
(i32.const 8) i32.const 0
(i32.const 9) set_global $~argc
(i32.const 0) get_global $function-expression/f4
) call_indirect (type $i)
(unreachable) end
) i32.const 1
) i32.eq
(block i32.eqz
(set_global $~argc if
(i32.const 0) i32.const 0
) i32.const 8
(call_indirect (type $v) i32.const 16
(get_global $function-expression/f3) i32.const 0
) call $~lib/env/abort
) unreachable
(if end
(i32.eqz
(i32.eq
(block (result i32)
(set_global $~argc
(i32.const 0)
)
(call_indirect (type $i)
(get_global $function-expression/f4)
)
)
(i32.const 1)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 16)
(i32.const 0)
)
(unreachable)
)
)
) )
(func $null (; 6 ;) (type $v) (func $null (; 6 ;) (type $v)
) )

View File

@ -7,253 +7,198 @@
(type $iiii (func (param i32 i32 i32) (result i32))) (type $iiii (func (param i32 i32 i32) (result i32)))
(type $v (func)) (type $v (func))
(type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$i (func (result i32)))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\11\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00t\00y\00p\00e\00s\00.\00t\00s") (data (i32.const 8) "\11\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00t\00y\00p\00e\00s\00.\00t\00s")
(table 5 anyfunc) (table $0 5 anyfunc)
(elem (i32.const 0) $null $function-types/makeAdder<i32>~anonymous|1 $function-types/makeAdder<i64>~anonymous|2 $function-types/makeAdder<f64>~anonymous|3 $function-types/makeAdder<i32>~anonymous|1) (elem (i32.const 0) $null $function-types/makeAdder<i32>~anonymous|1 $function-types/makeAdder<i64>~anonymous|2 $function-types/makeAdder<f64>~anonymous|3 $function-types/makeAdder<i32>~anonymous|1)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $function-types/i32Adder (mut i32) (i32.const 0)) (global $function-types/i32Adder (mut i32) (i32.const 0))
(global $~argc (mut i32) (i32.const 0)) (global $~argc (mut i32) (i32.const 0))
(global $function-types/i64Adder (mut i32) (i32.const 0)) (global $function-types/i64Adder (mut i32) (i32.const 0))
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $function-types/makeAdder<i32>~anonymous|1 (; 1 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $function-types/makeAdder<i32>~anonymous|1 (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.add get_local $0
(get_local $0) get_local $1
(get_local $1) i32.add
)
) )
(func $function-types/makeAdder<i32> (; 2 ;) (; has Stack IR ;) (type $i) (result i32) (func $function-types/makeAdder<i32> (; 2 ;) (type $i) (result i32)
(i32.const 1) i32.const 1
) )
(func $function-types/makeAdder<i64>~anonymous|2 (; 3 ;) (; has Stack IR ;) (type $III) (param $0 i64) (param $1 i64) (result i64) (func $function-types/makeAdder<i64>~anonymous|2 (; 3 ;) (type $III) (param $0 i64) (param $1 i64) (result i64)
(i64.add get_local $0
(get_local $0) get_local $1
(get_local $1) i64.add
)
) )
(func $function-types/makeAdder<i64> (; 4 ;) (; has Stack IR ;) (type $i) (result i32) (func $function-types/makeAdder<i64> (; 4 ;) (type $i) (result i32)
(i32.const 2) i32.const 2
) )
(func $function-types/makeAdder<f64>~anonymous|3 (; 5 ;) (; has Stack IR ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) (func $function-types/makeAdder<f64>~anonymous|3 (; 5 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64)
(f64.add get_local $0
(get_local $0) get_local $1
(get_local $1) f64.add
)
) )
(func $function-types/makeAdder<f64> (; 6 ;) (; has Stack IR ;) (type $i) (result i32) (func $function-types/makeAdder<f64> (; 6 ;) (type $i) (result i32)
(i32.const 3) i32.const 3
) )
(func $function-types/doAddWithFn<i32> (; 7 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (func $function-types/doAddWithFn<i32> (; 7 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(set_global $~argc i32.const 2
(i32.const 2) set_global $~argc
) get_local $0
(call_indirect (type $iii) get_local $1
(get_local $0) get_local $2
(get_local $1) call_indirect (type $iii)
(get_local $2)
)
) )
(func $function-types/doAdd<i32> (; 8 ;) (; has Stack IR ;) (type $FUNCSIG$i) (result i32) (func $function-types/doAdd<i32> (; 8 ;) (type $FUNCSIG$i) (result i32)
(set_global $~argc i32.const 2
(i32.const 2) set_global $~argc
) i32.const 3
(call_indirect (type $iii) i32.const 4
(i32.const 3) call $function-types/makeAdder<i32>
(i32.const 4) call_indirect (type $iii)
(call $function-types/makeAdder<i32>)
)
) )
(func $function-types/makeAndAdd<i32>|trampoline (; 9 ;) (; has Stack IR ;) (type $FUNCSIG$i) (result i32) (func $function-types/makeAndAdd<i32>|trampoline (; 9 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32) (local $0 i32)
(block $1of1 block $1of1
(block $0of1 block $0of1
(block $outOfRange block $outOfRange
(br_table $0of1 $1of1 $outOfRange get_global $~argc
(i32.sub i32.const 2
(get_global $~argc) i32.sub
(i32.const 2) br_table $0of1 $1of1 $outOfRange
) end
) unreachable
) end
(unreachable) call $function-types/makeAdder<i32>
) set_local $0
(set_local $0 end
(call $function-types/makeAdder<i32>) i32.const 1
) i32.const 2
) get_local $0
(call $function-types/doAddWithFn<i32> call $function-types/doAddWithFn<i32>
(i32.const 1)
(i32.const 2)
(get_local $0)
)
) )
(func $start (; 10 ;) (; has Stack IR ;) (type $v) (func $start (; 10 ;) (type $v)
(set_global $function-types/i32Adder call $function-types/makeAdder<i32>
(call $function-types/makeAdder<i32>) set_global $function-types/i32Adder
) i32.const 2
(set_global $~argc set_global $~argc
(i32.const 2) i32.const 1
) i32.const 2
(if get_global $function-types/i32Adder
(i32.ne call_indirect (type $iii)
(call_indirect (type $iii) i32.const 3
(i32.const 1) i32.ne
(i32.const 2) if
(get_global $function-types/i32Adder) i32.const 0
) i32.const 8
(i32.const 3) i32.const 11
) i32.const 0
(block call $~lib/env/abort
(call $~lib/env/abort unreachable
(i32.const 0) end
(i32.const 8) call $function-types/makeAdder<i64>
(i32.const 11) set_global $function-types/i64Adder
(i32.const 0) i32.const 2
) set_global $~argc
(unreachable) i64.const 10
) i64.const 20
) get_global $function-types/i64Adder
(set_global $function-types/i64Adder call_indirect (type $III)
(call $function-types/makeAdder<i64>) i64.const 30
) i64.ne
(set_global $~argc if
(i32.const 2) i32.const 0
) i32.const 8
(if i32.const 15
(i64.ne i32.const 0
(call_indirect (type $III) call $~lib/env/abort
(i64.const 10) unreachable
(i64.const 20) end
(get_global $function-types/i64Adder) i32.const 2
) set_global $~argc
(i64.const 30) f64.const 1.5
) f64.const 2.5
(block call $function-types/makeAdder<f64>
(call $~lib/env/abort call_indirect (type $FFF)
(i32.const 0) f64.const 4
(i32.const 8) f64.ne
(i32.const 15) if
(i32.const 0) i32.const 0
) i32.const 8
(unreachable) i32.const 17
) i32.const 0
) call $~lib/env/abort
(set_global $~argc unreachable
(i32.const 2) end
) i32.const 2
(if i32.const 3
(f64.ne get_global $function-types/i32Adder
(call_indirect (type $FFF) call $function-types/doAddWithFn<i32>
(f64.const 1.5) i32.const 5
(f64.const 2.5) i32.ne
(call $function-types/makeAdder<f64>) if
) i32.const 0
(f64.const 4) i32.const 8
) i32.const 23
(block i32.const 0
(call $~lib/env/abort call $~lib/env/abort
(i32.const 0) unreachable
(i32.const 8) end
(i32.const 17) call $function-types/doAdd<i32>
(i32.const 0) i32.const 7
) i32.ne
(unreachable) if
) i32.const 0
) i32.const 8
(if i32.const 29
(i32.ne i32.const 0
(call $function-types/doAddWithFn<i32> call $~lib/env/abort
(i32.const 2) unreachable
(i32.const 3) end
(get_global $function-types/i32Adder) i32.const 4
) i32.const 5
(i32.const 5) i32.const 4
) call $function-types/doAddWithFn<i32>
(block i32.const 9
(call $~lib/env/abort i32.ne
(i32.const 0) if
(i32.const 8) i32.const 0
(i32.const 23) i32.const 8
(i32.const 0) i32.const 35
) i32.const 0
(unreachable) call $~lib/env/abort
) unreachable
) end
(if i32.const 2
(i32.ne set_global $~argc
(call $function-types/doAdd<i32>) call $function-types/makeAndAdd<i32>|trampoline
(i32.const 7) i32.const 3
) i32.ne
(block if
(call $~lib/env/abort i32.const 0
(i32.const 0) i32.const 8
(i32.const 8) i32.const 41
(i32.const 29) i32.const 0
(i32.const 0) call $~lib/env/abort
) unreachable
(unreachable) end
) i32.const 1
) i32.const 2
(if call $function-types/makeAdder<i32>
(i32.ne call $function-types/doAddWithFn<i32>
(call $function-types/doAddWithFn<i32> i32.const 3
(i32.const 4) i32.ne
(i32.const 5) if
(i32.const 4) i32.const 0
) i32.const 8
(i32.const 9) i32.const 42
) i32.const 0
(block call $~lib/env/abort
(call $~lib/env/abort unreachable
(i32.const 0) end
(i32.const 8)
(i32.const 35)
(i32.const 0)
)
(unreachable)
)
)
(set_global $~argc
(i32.const 2)
)
(if
(i32.ne
(call $function-types/makeAndAdd<i32>|trampoline)
(i32.const 3)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 41)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.ne
(call $function-types/doAddWithFn<i32>
(i32.const 1)
(i32.const 2)
(call $function-types/makeAdder<i32>)
)
(i32.const 3)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 42)
(i32.const 0)
)
(unreachable)
)
)
) )
(func $null (; 11 ;) (; has Stack IR ;) (type $v) (func $null (; 11 ;) (type $v)
(nop) nop
) )
) )

View File

@ -6,11 +6,11 @@
(type $FFF (func (param f64 f64) (result f64))) (type $FFF (func (param f64 f64) (result f64)))
(type $iiii (func (param i32 i32 i32) (result i32))) (type $iiii (func (param i32 i32 i32) (result i32)))
(type $v (func)) (type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\11\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00t\00y\00p\00e\00s\00.\00t\00s\00") (data (i32.const 8) "\11\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00t\00y\00p\00e\00s\00.\00t\00s\00")
(table 5 anyfunc) (table $0 5 anyfunc)
(elem (i32.const 0) $null $function-types/makeAdder<i32>~anonymous|1 $function-types/makeAdder<i64>~anonymous|2 $function-types/makeAdder<f64>~anonymous|3 $function-types/addI32) (elem (i32.const 0) $null $function-types/makeAdder<i32>~anonymous|1 $function-types/makeAdder<i64>~anonymous|2 $function-types/makeAdder<f64>~anonymous|3 $function-types/addI32)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $function-types/i32Adder (mut i32) (i32.const 0)) (global $function-types/i32Adder (mut i32) (i32.const 0))
(global $~argc (mut i32) (i32.const 0)) (global $~argc (mut i32) (i32.const 0))
(global $function-types/i64Adder (mut i32) (i32.const 0)) (global $function-types/i64Adder (mut i32) (i32.const 0))
@ -19,286 +19,218 @@
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $function-types/makeAdder<i32>~anonymous|1 (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $function-types/makeAdder<i32>~anonymous|1 (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.add get_local $0
(get_local $0) get_local $1
(get_local $1) i32.add
)
) )
(func $function-types/makeAdder<i32> (; 2 ;) (type $i) (result i32) (func $function-types/makeAdder<i32> (; 2 ;) (type $i) (result i32)
(i32.const 1) i32.const 1
) )
(func $function-types/makeAdder<i64>~anonymous|2 (; 3 ;) (type $III) (param $0 i64) (param $1 i64) (result i64) (func $function-types/makeAdder<i64>~anonymous|2 (; 3 ;) (type $III) (param $0 i64) (param $1 i64) (result i64)
(i64.add get_local $0
(get_local $0) get_local $1
(get_local $1) i64.add
)
) )
(func $function-types/makeAdder<i64> (; 4 ;) (type $i) (result i32) (func $function-types/makeAdder<i64> (; 4 ;) (type $i) (result i32)
(i32.const 2) i32.const 2
) )
(func $function-types/makeAdder<f64>~anonymous|3 (; 5 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) (func $function-types/makeAdder<f64>~anonymous|3 (; 5 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64)
(f64.add get_local $0
(get_local $0) get_local $1
(get_local $1) f64.add
)
) )
(func $function-types/makeAdder<f64> (; 6 ;) (type $i) (result i32) (func $function-types/makeAdder<f64> (; 6 ;) (type $i) (result i32)
(i32.const 3) i32.const 3
) )
(func $function-types/doAddWithFn<i32> (; 7 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (func $function-types/doAddWithFn<i32> (; 7 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(set_global $~argc i32.const 2
(i32.const 2) set_global $~argc
) get_local $0
(call_indirect (type $iii) get_local $1
(get_local $0) get_local $2
(get_local $1) call_indirect (type $iii)
(get_local $2)
)
) )
(func $function-types/doAdd<i32> (; 8 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $function-types/doAdd<i32> (; 8 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(set_global $~argc i32.const 2
(i32.const 2) set_global $~argc
) get_local $0
(call_indirect (type $iii) get_local $1
(get_local $0) call $function-types/makeAdder<i32>
(get_local $1) call_indirect (type $iii)
(call $function-types/makeAdder<i32>)
)
) )
(func $function-types/addI32 (; 9 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $function-types/addI32 (; 9 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.add get_local $0
(get_local $0) get_local $1
(get_local $1) i32.add
)
) )
(func $function-types/makeAndAdd<i32> (; 10 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (func $function-types/makeAndAdd<i32> (; 10 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(set_global $~argc i32.const 2
(i32.const 2) set_global $~argc
) get_local $0
(call_indirect (type $iii) get_local $1
(get_local $0) get_local $2
(get_local $1) call_indirect (type $iii)
(get_local $2)
)
) )
(func $function-types/makeAndAdd<i32>|trampoline (; 11 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (func $function-types/makeAndAdd<i32>|trampoline (; 11 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(block $1of1 block $1of1
(block $0of1 block $0of1
(block $outOfRange block $outOfRange
(br_table $0of1 $1of1 $outOfRange get_global $~argc
(i32.sub i32.const 2
(get_global $~argc) i32.sub
(i32.const 2) br_table $0of1 $1of1 $outOfRange
) end
) unreachable
) end
(unreachable) call $function-types/makeAdder<i32>
) set_local $2
(set_local $2 end
(call $function-types/makeAdder<i32>) get_local $0
) get_local $1
) get_local $2
(call $function-types/makeAndAdd<i32> call $function-types/makeAndAdd<i32>
(get_local $0)
(get_local $1)
(get_local $2)
)
) )
(func $start (; 12 ;) (type $v) (func $start (; 12 ;) (type $v)
(nop) nop
(set_global $function-types/i32Adder call $function-types/makeAdder<i32>
(call $function-types/makeAdder<i32>) set_global $function-types/i32Adder
) block (result i32)
(if i32.const 2
(i32.eqz set_global $~argc
(i32.eq i32.const 1
(block (result i32) i32.const 2
(set_global $~argc get_global $function-types/i32Adder
(i32.const 2) call_indirect (type $iii)
) end
(call_indirect (type $iii) i32.const 3
(i32.const 1) i32.eq
(i32.const 2) i32.eqz
(get_global $function-types/i32Adder) if
) i32.const 0
) i32.const 8
(i32.const 3) i32.const 11
) i32.const 0
) call $~lib/env/abort
(block unreachable
(call $~lib/env/abort end
(i32.const 0) call $function-types/makeAdder<i64>
(i32.const 8) set_global $function-types/i64Adder
(i32.const 11) block (result i64)
(i32.const 0) i32.const 2
) set_global $~argc
(unreachable) i64.const 10
) i64.const 20
) get_global $function-types/i64Adder
(set_global $function-types/i64Adder call_indirect (type $III)
(call $function-types/makeAdder<i64>) end
) i64.const 30
(if i64.eq
(i32.eqz i32.eqz
(i64.eq if
(block (result i64) i32.const 0
(set_global $~argc i32.const 8
(i32.const 2) i32.const 15
) i32.const 0
(call_indirect (type $III) call $~lib/env/abort
(i64.const 10) unreachable
(i64.const 20) end
(get_global $function-types/i64Adder) block (result f64)
) i32.const 2
) set_global $~argc
(i64.const 30) f64.const 1.5
) f64.const 2.5
) call $function-types/makeAdder<f64>
(block call_indirect (type $FFF)
(call $~lib/env/abort end
(i32.const 0) f64.const 4
(i32.const 8) f64.eq
(i32.const 15) i32.eqz
(i32.const 0) if
) i32.const 0
(unreachable) i32.const 8
) i32.const 17
) i32.const 0
(if call $~lib/env/abort
(i32.eqz unreachable
(f64.eq end
(block (result f64) i32.const 2
(set_global $~argc i32.const 3
(i32.const 2) get_global $function-types/i32Adder
) call $function-types/doAddWithFn<i32>
(call_indirect (type $FFF) i32.const 5
(f64.const 1.5) i32.eq
(f64.const 2.5) i32.eqz
(call $function-types/makeAdder<f64>) if
) i32.const 0
) i32.const 8
(f64.const 4) i32.const 23
) i32.const 0
) call $~lib/env/abort
(block unreachable
(call $~lib/env/abort end
(i32.const 0) i32.const 3
(i32.const 8) i32.const 4
(i32.const 17) call $function-types/doAdd<i32>
(i32.const 0) i32.const 7
) i32.eq
(unreachable) i32.eqz
) if
) i32.const 0
(if i32.const 8
(i32.eqz i32.const 29
(i32.eq i32.const 0
(call $function-types/doAddWithFn<i32> call $~lib/env/abort
(i32.const 2) unreachable
(i32.const 3) end
(get_global $function-types/i32Adder) i32.const 4
) i32.const 5
(i32.const 5) i32.const 4
) call $function-types/doAddWithFn<i32>
) i32.const 9
(block i32.eq
(call $~lib/env/abort i32.eqz
(i32.const 0) if
(i32.const 8) i32.const 0
(i32.const 23) i32.const 8
(i32.const 0) i32.const 35
) i32.const 0
(unreachable) call $~lib/env/abort
) unreachable
) end
(if block (result i32)
(i32.eqz i32.const 2
(i32.eq set_global $~argc
(call $function-types/doAdd<i32> i32.const 1
(i32.const 3) i32.const 2
(i32.const 4) i32.const 0
) call $function-types/makeAndAdd<i32>|trampoline
(i32.const 7) end
) i32.const 3
) i32.eq
(block i32.eqz
(call $~lib/env/abort if
(i32.const 0) i32.const 0
(i32.const 8) i32.const 8
(i32.const 29) i32.const 41
(i32.const 0) i32.const 0
) call $~lib/env/abort
(unreachable) unreachable
) end
) i32.const 1
(if i32.const 2
(i32.eqz call $function-types/makeAdder<i32>
(i32.eq call $function-types/makeAndAdd<i32>
(call $function-types/doAddWithFn<i32> i32.const 3
(i32.const 4) i32.eq
(i32.const 5) i32.eqz
(i32.const 4) if
) i32.const 0
(i32.const 9) i32.const 8
) i32.const 42
) i32.const 0
(block call $~lib/env/abort
(call $~lib/env/abort unreachable
(i32.const 0) end
(i32.const 8)
(i32.const 35)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(block (result i32)
(set_global $~argc
(i32.const 2)
)
(call $function-types/makeAndAdd<i32>|trampoline
(i32.const 1)
(i32.const 2)
(i32.const 0)
)
)
(i32.const 3)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 41)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(call $function-types/makeAndAdd<i32>
(i32.const 1)
(i32.const 2)
(call $function-types/makeAdder<i32>)
)
(i32.const 3)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 42)
(i32.const 0)
)
(unreachable)
)
)
) )
(func $null (; 13 ;) (type $v) (func $null (; 13 ;) (type $v)
) )

View File

@ -10,92 +10,80 @@
(type $FUNCSIG$f (func (result f32))) (type $FUNCSIG$f (func (result f32)))
(type $FUNCSIG$d (func (result f64))) (type $FUNCSIG$d (func (result f64)))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $function/v) (elem (i32.const 0) $function/v)
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $function/v (; 0 ;) (; has Stack IR ;) (type $v) (func $function/v (; 0 ;) (type $v)
(nop) nop
) )
(func $function/i (; 1 ;) (; has Stack IR ;) (type $i) (result i32) (func $function/i (; 1 ;) (type $i) (result i32)
(i32.const 0) i32.const 0
) )
(func $function/I (; 2 ;) (; has Stack IR ;) (type $I) (result i64) (func $function/I (; 2 ;) (type $I) (result i64)
(i64.const 0) i64.const 0
) )
(func $function/f (; 3 ;) (; has Stack IR ;) (type $f) (result f32) (func $function/f (; 3 ;) (type $f) (result f32)
(f32.const 0) f32.const 0
) )
(func $function/F (; 4 ;) (; has Stack IR ;) (type $F) (result f64) (func $function/F (; 4 ;) (type $F) (result f64)
(f64.const 0) f64.const 0
) )
(func $function/iv (; 5 ;) (; has Stack IR ;) (type $FUNCSIG$v) (func $function/iv (; 5 ;) (type $FUNCSIG$v)
(nop) nop
) )
(func $function/ii (; 6 ;) (; has Stack IR ;) (type $FUNCSIG$i) (result i32) (func $function/ii (; 6 ;) (type $FUNCSIG$i) (result i32)
(i32.const 0) i32.const 0
) )
(func $function/II (; 7 ;) (; has Stack IR ;) (type $FUNCSIG$j) (result i64) (func $function/II (; 7 ;) (type $FUNCSIG$j) (result i64)
(i64.const 0) i64.const 0
) )
(func $function/ff (; 8 ;) (; has Stack IR ;) (type $FUNCSIG$f) (result f32) (func $function/ff (; 8 ;) (type $FUNCSIG$f) (result f32)
(f32.const 0) f32.const 0
) )
(func $function/FF (; 9 ;) (; has Stack IR ;) (type $FUNCSIG$d) (result f64) (func $function/FF (; 9 ;) (type $FUNCSIG$d) (result f64)
(f64.const 0) f64.const 0
) )
(func $function/iii (; 10 ;) (; has Stack IR ;) (type $FUNCSIG$i) (result i32) (func $function/iii (; 10 ;) (type $FUNCSIG$i) (result i32)
(i32.const 3) i32.const 3
) )
(func $function/III (; 11 ;) (; has Stack IR ;) (type $FUNCSIG$j) (result i64) (func $function/III (; 11 ;) (type $FUNCSIG$j) (result i64)
(i64.const 3) i64.const 3
) )
(func $function/fff (; 12 ;) (; has Stack IR ;) (type $FUNCSIG$f) (result f32) (func $function/fff (; 12 ;) (type $FUNCSIG$f) (result f32)
(f32.const 3) f32.const 3
) )
(func $function/FFF (; 13 ;) (; has Stack IR ;) (type $FUNCSIG$d) (result f64) (func $function/FFF (; 13 ;) (type $FUNCSIG$d) (result f64)
(f64.const 3) f64.const 3
) )
(func $start (; 14 ;) (; has Stack IR ;) (type $v) (func $start (; 14 ;) (type $v)
(call $function/v) call $function/v
(drop call $function/i
(call $function/i) drop
) call $function/I
(drop drop
(call $function/I) call $function/f
) drop
(drop call $function/F
(call $function/f) drop
) call $function/iv
(drop call $function/ii
(call $function/F) drop
) call $function/II
(call $function/iv) drop
(drop call $function/ff
(call $function/ii) drop
) call $function/FF
(drop drop
(call $function/II) call $function/iv
) call $function/iii
(drop drop
(call $function/ff) call $function/III
) drop
(drop call $function/fff
(call $function/FF) drop
) call $function/FFF
(call $function/iv) drop
(drop
(call $function/iii)
)
(drop
(call $function/III)
)
(drop
(call $function/fff)
)
(drop
(call $function/FFF)
)
) )
) )

View File

@ -15,136 +15,109 @@
(type $fff (func (param f32 f32) (result f32))) (type $fff (func (param f32 f32) (result f32)))
(type $FFF (func (param f64 f64) (result f64))) (type $FFF (func (param f64 f64) (result f64)))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(global $HEAP_BASE i32 (i32.const 8)) (global $HEAP_BASE i32 (i32.const 8))
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $function/v (; 0 ;) (type $v) (func $function/v (; 0 ;) (type $v)
(nop) nop
) )
(func $function/i (; 1 ;) (type $i) (result i32) (func $function/i (; 1 ;) (type $i) (result i32)
(i32.const 0) i32.const 0
) )
(func $function/I (; 2 ;) (type $I) (result i64) (func $function/I (; 2 ;) (type $I) (result i64)
(i64.const 0) i64.const 0
) )
(func $function/f (; 3 ;) (type $f) (result f32) (func $function/f (; 3 ;) (type $f) (result f32)
(f32.const 0) f32.const 0
) )
(func $function/F (; 4 ;) (type $F) (result f64) (func $function/F (; 4 ;) (type $F) (result f64)
(f64.const 0) f64.const 0
) )
(func $function/iv (; 5 ;) (type $iv) (param $0 i32) (func $function/iv (; 5 ;) (type $iv) (param $0 i32)
(nop) nop
) )
(func $function/ii (; 6 ;) (type $ii) (param $0 i32) (result i32) (func $function/ii (; 6 ;) (type $ii) (param $0 i32) (result i32)
(get_local $0) get_local $0
) )
(func $function/II (; 7 ;) (type $II) (param $0 i64) (result i64) (func $function/II (; 7 ;) (type $II) (param $0 i64) (result i64)
(get_local $0) get_local $0
) )
(func $function/ff (; 8 ;) (type $ff) (param $0 f32) (result f32) (func $function/ff (; 8 ;) (type $ff) (param $0 f32) (result f32)
(get_local $0) get_local $0
) )
(func $function/FF (; 9 ;) (type $FF) (param $0 f64) (result f64) (func $function/FF (; 9 ;) (type $FF) (param $0 f64) (result f64)
(get_local $0) get_local $0
) )
(func $function/iiv (; 10 ;) (type $iiv) (param $0 i32) (param $1 i32) (func $function/iiv (; 10 ;) (type $iiv) (param $0 i32) (param $1 i32)
(nop) nop
) )
(func $function/iii (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $function/iii (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.add get_local $0
(get_local $0) get_local $1
(get_local $1) i32.add
)
) )
(func $function/III (; 12 ;) (type $IiI) (param $0 i64) (param $1 i32) (result i64) (func $function/III (; 12 ;) (type $IiI) (param $0 i64) (param $1 i32) (result i64)
(i64.add get_local $0
(get_local $0) get_local $1
(i64.extend_s/i32 i64.extend_s/i32
(get_local $1) i64.add
)
)
) )
(func $function/fff (; 13 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32) (func $function/fff (; 13 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32)
(f32.add get_local $0
(get_local $0) get_local $1
(get_local $1) f32.add
)
) )
(func $function/FFF (; 14 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64) (func $function/FFF (; 14 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64)
(f64.add get_local $0
(get_local $0) get_local $1
(get_local $1) f64.add
)
) )
(func $start (; 15 ;) (type $v) (func $start (; 15 ;) (type $v)
(call $function/v) call $function/v
(drop call $function/i
(call $function/i) drop
) call $function/I
(drop drop
(call $function/I) call $function/f
) drop
(drop call $function/F
(call $function/f) drop
) i32.const 0
(drop call $function/iv
(call $function/F) i32.const 0
) call $function/ii
(call $function/iv drop
(i32.const 0) i64.const 0
) call $function/II
(drop drop
(call $function/ii f32.const 0
(i32.const 0) call $function/ff
) drop
) f64.const 0
(drop call $function/FF
(call $function/II drop
(i64.const 0) i32.const 1
) i32.const 2
) call $function/iiv
(drop i32.const 1
(call $function/ff i32.const 2
(f32.const 0) call $function/iii
) drop
) i64.const 1
(drop i32.const 2
(call $function/FF call $function/III
(f64.const 0) drop
) f32.const 1
) f32.const 2
(call $function/iiv call $function/fff
(i32.const 1) drop
(i32.const 2) f64.const 1
) f64.const 2
(drop call $function/FFF
(call $function/iii drop
(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)
)
)
) )
(func $null (; 16 ;) (type $v) (func $null (; 16 ;) (type $v)
) )

View File

@ -4,7 +4,7 @@
(type $v (func)) (type $v (func))
(type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$i (func (result i32)))
(memory $0 0) (memory $0 0)
(table 2 anyfunc) (table $0 2 anyfunc)
(elem (i32.const 0) $null $getter-call/C#get:x~anonymous|1) (elem (i32.const 0) $null $getter-call/C#get:x~anonymous|1)
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0)) (global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0)) (global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
@ -13,123 +13,94 @@
(export "table" (table $0)) (export "table" (table $0))
(export "test" (func $getter-call/test)) (export "test" (func $getter-call/test))
(start $start) (start $start)
(func $~lib/allocator/arena/__memory_allocate (; 0 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (func $~lib/allocator/arena/__memory_allocate (; 0 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32) (local $1 i32)
(local $2 i32) (local $2 i32)
(local $3 i32) (local $3 i32)
(if get_local $0
(i32.gt_u i32.const 1073741824
(get_local $0) i32.gt_u
(i32.const 1073741824) if
) unreachable
(unreachable) end
) get_global $~lib/allocator/arena/offset
(if tee_local $1
(i32.gt_u get_local $0
(tee_local $2 i32.const 1
(i32.and get_local $0
(i32.add i32.const 1
(i32.add i32.gt_u
(tee_local $1 select
(get_global $~lib/allocator/arena/offset) i32.add
) i32.const 7
(select i32.add
(get_local $0) i32.const -8
(i32.const 1) i32.and
(i32.gt_u tee_local $2
(get_local $0) current_memory
(i32.const 1) tee_local $3
) i32.const 16
) i32.shl
) i32.gt_u
(i32.const 7) if
) get_local $3
(i32.const -8) get_local $2
) get_local $1
) i32.sub
(i32.shl i32.const 65535
(tee_local $3 i32.add
(current_memory) i32.const -65536
) i32.and
(i32.const 16) i32.const 16
) i32.shr_u
) tee_local $0
(if get_local $3
(i32.lt_s get_local $0
(grow_memory i32.gt_s
(select select
(get_local $3) grow_memory
(tee_local $0 i32.const 0
(i32.shr_u i32.lt_s
(i32.and if
(i32.add get_local $0
(i32.sub grow_memory
(get_local $2) i32.const 0
(get_local $1) i32.lt_s
) if
(i32.const 65535) unreachable
) end
(i32.const -65536) end
) end
(i32.const 16) get_local $2
) set_global $~lib/allocator/arena/offset
) get_local $1
(i32.gt_s
(get_local $3)
(get_local $0)
)
)
)
(i32.const 0)
)
(if
(i32.lt_s
(grow_memory
(get_local $0)
)
(i32.const 0)
)
(unreachable)
)
)
)
(set_global $~lib/allocator/arena/offset
(get_local $2)
)
(get_local $1)
) )
(func $~lib/memory/memory.allocate (; 1 ;) (; has Stack IR ;) (type $FUNCSIG$i) (result i32) (func $~lib/memory/memory.allocate (; 1 ;) (type $FUNCSIG$i) (result i32)
(call $~lib/allocator/arena/__memory_allocate i32.const 0
(i32.const 0) call $~lib/allocator/arena/__memory_allocate
)
) )
(func $getter-call/C#get:x~anonymous|1 (; 2 ;) (; has Stack IR ;) (type $i) (result i32) (func $getter-call/C#get:x~anonymous|1 (; 2 ;) (type $i) (result i32)
(i32.const 42) i32.const 42
) )
(func $getter-call/C#get:x (; 3 ;) (; has Stack IR ;) (type $FUNCSIG$i) (result i32) (func $getter-call/C#get:x (; 3 ;) (type $FUNCSIG$i) (result i32)
(i32.const 1) i32.const 1
) )
(func $getter-call/test (; 4 ;) (; has Stack IR ;) (type $i) (result i32) (func $getter-call/test (; 4 ;) (type $i) (result i32)
(local $0 i32) (local $0 i32)
(set_local $0 call $~lib/memory/memory.allocate
(call $~lib/memory/memory.allocate) set_local $0
) i32.const 0
(set_global $~argc set_global $~argc
(i32.const 0) call $getter-call/C#get:x
) call_indirect (type $i)
(call_indirect (type $i)
(call $getter-call/C#get:x)
)
) )
(func $start (; 5 ;) (; has Stack IR ;) (type $v) (func $start (; 5 ;) (type $v)
(set_global $~lib/allocator/arena/startOffset i32.const 8
(i32.const 8) set_global $~lib/allocator/arena/startOffset
) get_global $~lib/allocator/arena/startOffset
(set_global $~lib/allocator/arena/offset set_global $~lib/allocator/arena/offset
(get_global $~lib/allocator/arena/startOffset)
)
) )
(func $null (; 6 ;) (; has Stack IR ;) (type $v) (func $null (; 6 ;) (type $v)
(nop) nop
) )
) )

View File

@ -3,7 +3,7 @@
(type $ii (func (param i32) (result i32))) (type $ii (func (param i32) (result i32)))
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 2 anyfunc) (table $0 2 anyfunc)
(elem (i32.const 0) $null $getter-call/C#get:x~anonymous|1) (elem (i32.const 0) $null $getter-call/C#get:x~anonymous|1)
(global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (global $~lib/internal/allocator/AL_BITS i32 (i32.const 3))
(global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8)) (global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8))
@ -24,160 +24,115 @@
(local $4 i32) (local $4 i32)
(local $5 i32) (local $5 i32)
(local $6 i32) (local $6 i32)
(if get_local $0
(i32.gt_u get_global $~lib/internal/allocator/MAX_SIZE_32
(get_local $0) i32.gt_u
(get_global $~lib/internal/allocator/MAX_SIZE_32) if
) unreachable
(unreachable) end
) get_global $~lib/allocator/arena/offset
(set_local $1 set_local $1
(get_global $~lib/allocator/arena/offset) get_local $1
) get_local $0
(set_local $4 tee_local $2
(i32.and i32.const 1
(i32.add tee_local $3
(i32.add get_local $2
(get_local $1) get_local $3
(select i32.gt_u
(tee_local $2 select
(get_local $0) i32.add
) get_global $~lib/internal/allocator/AL_MASK
(tee_local $3 i32.add
(i32.const 1) get_global $~lib/internal/allocator/AL_MASK
) i32.const -1
(i32.gt_u i32.xor
(get_local $2) i32.and
(get_local $3) set_local $4
) current_memory
) set_local $5
) get_local $4
(get_global $~lib/internal/allocator/AL_MASK) get_local $5
) i32.const 16
(i32.xor i32.shl
(get_global $~lib/internal/allocator/AL_MASK) i32.gt_u
(i32.const -1) if
) get_local $4
) get_local $1
) i32.sub
(set_local $5 i32.const 65535
(current_memory) i32.add
) i32.const 65535
(if i32.const -1
(i32.gt_u i32.xor
(get_local $4) i32.and
(i32.shl i32.const 16
(get_local $5) i32.shr_u
(i32.const 16) set_local $2
) get_local $5
) tee_local $3
(block get_local $2
(set_local $2 tee_local $6
(i32.shr_u get_local $3
(i32.and get_local $6
(i32.add i32.gt_s
(i32.sub select
(get_local $4) set_local $3
(get_local $1) get_local $3
) grow_memory
(i32.const 65535) i32.const 0
) i32.lt_s
(i32.xor if
(i32.const 65535) get_local $2
(i32.const -1) grow_memory
) i32.const 0
) i32.lt_s
(i32.const 16) if
) unreachable
) end
(set_local $3 end
(select end
(tee_local $3 get_local $4
(get_local $5) set_global $~lib/allocator/arena/offset
) get_local $1
(tee_local $6
(get_local $2)
)
(i32.gt_s
(get_local $3)
(get_local $6)
)
)
)
(if
(i32.lt_s
(grow_memory
(get_local $3)
)
(i32.const 0)
)
(if
(i32.lt_s
(grow_memory
(get_local $2)
)
(i32.const 0)
)
(unreachable)
)
)
)
)
(set_global $~lib/allocator/arena/offset
(get_local $4)
)
(get_local $1)
) )
(func $~lib/memory/memory.allocate (; 1 ;) (type $ii) (param $0 i32) (result i32) (func $~lib/memory/memory.allocate (; 1 ;) (type $ii) (param $0 i32) (result i32)
(return get_local $0
(call $~lib/allocator/arena/__memory_allocate call $~lib/allocator/arena/__memory_allocate
(get_local $0) return
)
)
) )
(func $getter-call/C#get:x~anonymous|1 (; 2 ;) (type $i) (result i32) (func $getter-call/C#get:x~anonymous|1 (; 2 ;) (type $i) (result i32)
(i32.const 42) i32.const 42
) )
(func $getter-call/C#get:x (; 3 ;) (type $ii) (param $0 i32) (result i32) (func $getter-call/C#get:x (; 3 ;) (type $ii) (param $0 i32) (result i32)
(i32.const 1) i32.const 1
) )
(func $getter-call/test (; 4 ;) (type $i) (result i32) (func $getter-call/test (; 4 ;) (type $i) (result i32)
(local $0 i32) (local $0 i32)
(set_local $0 block (result i32)
(block (result i32) i32.const 0
(set_local $0 call $~lib/memory/memory.allocate
(call $~lib/memory/memory.allocate set_local $0
(i32.const 0) get_local $0
) end
) set_local $0
(get_local $0) i32.const 0
) set_global $~argc
) get_local $0
(set_global $~argc call $getter-call/C#get:x
(i32.const 0) call_indirect (type $i)
)
(call_indirect (type $i)
(call $getter-call/C#get:x
(get_local $0)
)
)
) )
(func $start (; 5 ;) (type $v) (func $start (; 5 ;) (type $v)
(set_global $~lib/allocator/arena/startOffset get_global $HEAP_BASE
(i32.and get_global $~lib/internal/allocator/AL_MASK
(i32.add i32.add
(get_global $HEAP_BASE) get_global $~lib/internal/allocator/AL_MASK
(get_global $~lib/internal/allocator/AL_MASK) i32.const -1
) i32.xor
(i32.xor i32.and
(get_global $~lib/internal/allocator/AL_MASK) set_global $~lib/allocator/arena/startOffset
(i32.const -1) get_global $~lib/allocator/arena/startOffset
) set_global $~lib/allocator/arena/offset
)
)
(set_global $~lib/allocator/arena/offset
(get_global $~lib/allocator/arena/startOffset)
)
) )
(func $null (; 6 ;) (type $v) (func $null (; 6 ;) (type $v)
) )

View File

@ -3,74 +3,60 @@
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(type $iv (func (param i32))) (type $iv (func (param i32)))
(type $v (func)) (type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\10\00\00\00g\00e\00t\00t\00e\00r\00-\00s\00e\00t\00t\00e\00r\00.\00t\00s") (data (i32.const 8) "\10\00\00\00g\00e\00t\00t\00e\00r\00-\00s\00e\00t\00t\00e\00r\00.\00t\00s")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $getter-setter/Foo._bar (mut i32) (i32.const 0)) (global $getter-setter/Foo._bar (mut i32) (i32.const 0))
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $getter-setter/Foo.get:bar (; 1 ;) (; has Stack IR ;) (type $i) (result i32) (func $getter-setter/Foo.get:bar (; 1 ;) (type $i) (result i32)
(get_global $getter-setter/Foo._bar) get_global $getter-setter/Foo._bar
) )
(func $getter-setter/Foo.set:bar (; 2 ;) (; has Stack IR ;) (type $iv) (param $0 i32) (func $getter-setter/Foo.set:bar (; 2 ;) (type $iv) (param $0 i32)
(set_global $getter-setter/Foo._bar get_local $0
(get_local $0) set_global $getter-setter/Foo._bar
)
) )
(func $start (; 3 ;) (; has Stack IR ;) (type $v) (func $start (; 3 ;) (type $v)
(if call $getter-setter/Foo.get:bar
(call $getter-setter/Foo.get:bar) if
(block i32.const 0
(call $~lib/env/abort i32.const 8
(i32.const 0) i32.const 13
(i32.const 8) i32.const 0
(i32.const 13) call $~lib/env/abort
(i32.const 0) unreachable
) end
(unreachable) i32.const 1
) call $getter-setter/Foo.set:bar
) call $getter-setter/Foo.get:bar
(call $getter-setter/Foo.set:bar i32.const 1
(i32.const 1) i32.ne
) if
(if i32.const 0
(i32.ne i32.const 8
(call $getter-setter/Foo.get:bar) i32.const 15
(i32.const 1) i32.const 0
) call $~lib/env/abort
(block unreachable
(call $~lib/env/abort end
(i32.const 0) i32.const 2
(i32.const 8) call $getter-setter/Foo.set:bar
(i32.const 15) call $getter-setter/Foo.get:bar
(i32.const 0) i32.const 2
) i32.ne
(unreachable) if
) i32.const 0
) i32.const 8
(call $getter-setter/Foo.set:bar i32.const 16
(i32.const 2) i32.const 0
) call $~lib/env/abort
(if unreachable
(i32.ne end
(call $getter-setter/Foo.get:bar)
(i32.const 2)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 16)
(i32.const 0)
)
(unreachable)
)
)
) )
(func $null (; 4 ;) (; has Stack IR ;) (type $v) (func $null (; 4 ;) (type $v)
(nop) nop
) )
) )

View File

@ -3,84 +3,66 @@
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(type $iv (func (param i32))) (type $iv (func (param i32)))
(type $v (func)) (type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\10\00\00\00g\00e\00t\00t\00e\00r\00-\00s\00e\00t\00t\00e\00r\00.\00t\00s\00") (data (i32.const 8) "\10\00\00\00g\00e\00t\00t\00e\00r\00-\00s\00e\00t\00t\00e\00r\00.\00t\00s\00")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $getter-setter/Foo._bar (mut i32) (i32.const 0)) (global $getter-setter/Foo._bar (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 44)) (global $HEAP_BASE i32 (i32.const 44))
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $getter-setter/Foo.get:bar (; 1 ;) (type $i) (result i32) (func $getter-setter/Foo.get:bar (; 1 ;) (type $i) (result i32)
(get_global $getter-setter/Foo._bar) get_global $getter-setter/Foo._bar
) )
(func $getter-setter/Foo.set:bar (; 2 ;) (type $iv) (param $0 i32) (func $getter-setter/Foo.set:bar (; 2 ;) (type $iv) (param $0 i32)
(set_global $getter-setter/Foo._bar get_local $0
(get_local $0) set_global $getter-setter/Foo._bar
)
) )
(func $start (; 3 ;) (type $v) (func $start (; 3 ;) (type $v)
(if call $getter-setter/Foo.get:bar
(i32.eqz i32.const 0
(i32.eq i32.eq
(call $getter-setter/Foo.get:bar) i32.eqz
(i32.const 0) if
) i32.const 0
) i32.const 8
(block i32.const 13
(call $~lib/env/abort i32.const 0
(i32.const 0) call $~lib/env/abort
(i32.const 8) unreachable
(i32.const 13) end
(i32.const 0) i32.const 1
) call $getter-setter/Foo.set:bar
(unreachable) call $getter-setter/Foo.get:bar
) i32.const 1
) i32.eq
(call $getter-setter/Foo.set:bar i32.eqz
(i32.const 1) if
) i32.const 0
(if i32.const 8
(i32.eqz i32.const 15
(i32.eq i32.const 0
(call $getter-setter/Foo.get:bar) call $~lib/env/abort
(i32.const 1) unreachable
) end
) block (result i32)
(block i32.const 2
(call $~lib/env/abort call $getter-setter/Foo.set:bar
(i32.const 0) call $getter-setter/Foo.get:bar
(i32.const 8) end
(i32.const 15) i32.const 2
(i32.const 0) i32.eq
) i32.eqz
(unreachable) if
) i32.const 0
) i32.const 8
(if i32.const 16
(i32.eqz i32.const 0
(i32.eq call $~lib/env/abort
(block (result i32) unreachable
(call $getter-setter/Foo.set:bar end
(i32.const 2)
)
(call $getter-setter/Foo.get:bar)
)
(i32.const 2)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 16)
(i32.const 0)
)
(unreachable)
)
)
) )
(func $null (; 4 ;) (type $v) (func $null (; 4 ;) (type $v)
) )

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2,11 +2,11 @@
(type $ii (func (param i32) (result i32))) (type $ii (func (param i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func)) (type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\05\00\00\00i\00f\00.\00t\00s") (data (i32.const 8) "\05\00\00\00i\00f\00.\00t\00s")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(export "ifThenElse" (func $if/ifThenElse)) (export "ifThenElse" (func $if/ifThenElse))
@ -14,133 +14,104 @@
(export "ifThenElseBlock" (func $if/ifThenElse)) (export "ifThenElseBlock" (func $if/ifThenElse))
(export "ifAlwaysReturns" (func $if/ifAlwaysReturns)) (export "ifAlwaysReturns" (func $if/ifAlwaysReturns))
(start $start) (start $start)
(func $if/ifThenElse (; 1 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (func $if/ifThenElse (; 1 ;) (type $ii) (param $0 i32) (result i32)
(if (result i32) get_local $0
(get_local $0) if (result i32)
(i32.const 1) i32.const 1
(i32.const 0) else
) i32.const 0
end
) )
(func $if/ifThen (; 2 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (func $if/ifThen (; 2 ;) (type $ii) (param $0 i32) (result i32)
(if get_local $0
(get_local $0) if
(return i32.const 1
(i32.const 1) return
) end
) i32.const 0
(i32.const 0)
) )
(func $if/ifAlwaysReturns (; 3 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (func $if/ifAlwaysReturns (; 3 ;) (type $ii) (param $0 i32) (result i32)
(if (result i32) get_local $0
(get_local $0) if (result i32)
(i32.const 1) i32.const 1
(block else
(call $~lib/env/abort i32.const 0
(i32.const 0) i32.const 8
(i32.const 8) i32.const 37
(i32.const 37) i32.const 4
(i32.const 4) call $~lib/env/abort
) unreachable
(unreachable) end
)
)
) )
(func $start (; 4 ;) (; has Stack IR ;) (type $v) (func $start (; 4 ;) (type $v)
(if i32.const 0
(call $if/ifThenElse call $if/ifThenElse
(i32.const 0) if
) i32.const 0
(block i32.const 8
(call $~lib/env/abort i32.const 8
(i32.const 0) i32.const 0
(i32.const 8) call $~lib/env/abort
(i32.const 8) unreachable
(i32.const 0) end
) i32.const 1
(unreachable) call $if/ifThenElse
) i32.const 1
) i32.ne
(if if
(i32.ne i32.const 0
(call $if/ifThenElse i32.const 8
(i32.const 1) i32.const 9
) i32.const 0
(i32.const 1) call $~lib/env/abort
) unreachable
(block end
(call $~lib/env/abort i32.const 0
(i32.const 0) call $if/ifThen
(i32.const 8) if
(i32.const 9) i32.const 0
(i32.const 0) i32.const 8
) i32.const 17
(unreachable) i32.const 0
) call $~lib/env/abort
) unreachable
(if end
(call $if/ifThen i32.const 1
(i32.const 0) call $if/ifThen
) i32.const 1
(block i32.ne
(call $~lib/env/abort if
(i32.const 0) i32.const 0
(i32.const 8) i32.const 8
(i32.const 17) i32.const 18
(i32.const 0) i32.const 0
) call $~lib/env/abort
(unreachable) unreachable
) end
) i32.const 0
(if call $if/ifThenElse
(i32.ne if
(call $if/ifThen i32.const 0
(i32.const 1) i32.const 8
) i32.const 30
(i32.const 1) i32.const 0
) call $~lib/env/abort
(block unreachable
(call $~lib/env/abort end
(i32.const 0) i32.const 1
(i32.const 8) call $if/ifThenElse
(i32.const 18) i32.const 1
(i32.const 0) i32.ne
) if
(unreachable) i32.const 0
) i32.const 8
) i32.const 31
(if i32.const 0
(call $if/ifThenElse call $~lib/env/abort
(i32.const 0) unreachable
) end
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 30)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.ne
(call $if/ifThenElse
(i32.const 1)
)
(i32.const 1)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 31)
(i32.const 0)
)
(unreachable)
)
)
) )
(func $null (; 5 ;) (; has Stack IR ;) (type $v) (func $null (; 5 ;) (type $v)
(nop) nop
) )
) )

View File

@ -2,11 +2,11 @@
(type $ii (func (param i32) (result i32))) (type $ii (func (param i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func)) (type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\05\00\00\00i\00f\00.\00t\00s\00") (data (i32.const 8) "\05\00\00\00i\00f\00.\00t\00s\00")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $HEAP_BASE i32 (i32.const 24)) (global $HEAP_BASE i32 (i32.const 24))
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
@ -16,171 +16,132 @@
(export "ifAlwaysReturns" (func $if/ifAlwaysReturns)) (export "ifAlwaysReturns" (func $if/ifAlwaysReturns))
(start $start) (start $start)
(func $if/ifThenElse (; 1 ;) (type $ii) (param $0 i32) (result i32) (func $if/ifThenElse (; 1 ;) (type $ii) (param $0 i32) (result i32)
(if get_local $0
(get_local $0) if
(return i32.const 1
(i32.const 1) return
) else
(return i32.const 0
(i32.const 0) return
) end
) unreachable
(unreachable) unreachable
) )
(func $if/ifThen (; 2 ;) (type $ii) (param $0 i32) (result i32) (func $if/ifThen (; 2 ;) (type $ii) (param $0 i32) (result i32)
(if get_local $0
(get_local $0) if
(return i32.const 1
(i32.const 1) return
) end
) i32.const 0
(i32.const 0)
) )
(func $if/ifThenElseBlock (; 3 ;) (type $ii) (param $0 i32) (result i32) (func $if/ifThenElseBlock (; 3 ;) (type $ii) (param $0 i32) (result i32)
(if get_local $0
(get_local $0) if
(return i32.const 1
(i32.const 1) return
) else
(return i32.const 0
(i32.const 0) return
) end
) unreachable
(unreachable) unreachable
) )
(func $if/ifAlwaysReturns (; 4 ;) (type $ii) (param $0 i32) (result i32) (func $if/ifAlwaysReturns (; 4 ;) (type $ii) (param $0 i32) (result i32)
(if get_local $0
(get_local $0) if
(return i32.const 1
(i32.const 1) return
) else
(block i32.const 0
(call $~lib/env/abort i32.const 8
(i32.const 0) i32.const 37
(i32.const 8) i32.const 4
(i32.const 37) call $~lib/env/abort
(i32.const 4) unreachable
) end
(unreachable) unreachable
) unreachable
)
(unreachable)
) )
(func $start (; 5 ;) (type $v) (func $start (; 5 ;) (type $v)
(if i32.const 0
(i32.eqz call $if/ifThenElse
(i32.eq i32.const 0
(call $if/ifThenElse i32.eq
(i32.const 0) i32.eqz
) if
(i32.const 0) i32.const 0
) i32.const 8
) i32.const 8
(block i32.const 0
(call $~lib/env/abort call $~lib/env/abort
(i32.const 0) unreachable
(i32.const 8) end
(i32.const 8) i32.const 1
(i32.const 0) call $if/ifThenElse
) i32.const 1
(unreachable) i32.eq
) i32.eqz
) if
(if i32.const 0
(i32.eqz i32.const 8
(i32.eq i32.const 9
(call $if/ifThenElse i32.const 0
(i32.const 1) call $~lib/env/abort
) unreachable
(i32.const 1) end
) i32.const 0
) call $if/ifThen
(block i32.const 0
(call $~lib/env/abort i32.eq
(i32.const 0) i32.eqz
(i32.const 8) if
(i32.const 9) i32.const 0
(i32.const 0) i32.const 8
) i32.const 17
(unreachable) i32.const 0
) call $~lib/env/abort
) unreachable
(if end
(i32.eqz i32.const 1
(i32.eq call $if/ifThen
(call $if/ifThen i32.const 1
(i32.const 0) i32.eq
) i32.eqz
(i32.const 0) if
) i32.const 0
) i32.const 8
(block i32.const 18
(call $~lib/env/abort i32.const 0
(i32.const 0) call $~lib/env/abort
(i32.const 8) unreachable
(i32.const 17) end
(i32.const 0) i32.const 0
) call $if/ifThenElseBlock
(unreachable) i32.const 0
) i32.eq
) i32.eqz
(if if
(i32.eqz i32.const 0
(i32.eq i32.const 8
(call $if/ifThen i32.const 30
(i32.const 1) i32.const 0
) call $~lib/env/abort
(i32.const 1) unreachable
) end
) i32.const 1
(block call $if/ifThenElseBlock
(call $~lib/env/abort i32.const 1
(i32.const 0) i32.eq
(i32.const 8) i32.eqz
(i32.const 18) if
(i32.const 0) i32.const 0
) i32.const 8
(unreachable) i32.const 31
) i32.const 0
) call $~lib/env/abort
(if unreachable
(i32.eqz end
(i32.eq
(call $if/ifThenElseBlock
(i32.const 0)
)
(i32.const 0)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 30)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(call $if/ifThenElseBlock
(i32.const 1)
)
(i32.const 1)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 31)
(i32.const 0)
)
(unreachable)
)
)
) )
(func $null (; 6 ;) (type $v) (func $null (; 6 ;) (type $v)
) )

View File

@ -2,42 +2,36 @@
(type $v (func)) (type $v (func))
(type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$i (func (result i32)))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $export/ns.two) (elem (i32.const 0) $export/ns.two)
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $export/add (; 0 ;) (; has Stack IR ;) (type $FUNCSIG$i) (result i32) (func $export/add (; 0 ;) (type $FUNCSIG$i) (result i32)
(i32.const 3) i32.const 3
) )
(func $export/sub (; 1 ;) (; has Stack IR ;) (type $FUNCSIG$i) (result i32) (func $export/sub (; 1 ;) (type $FUNCSIG$i) (result i32)
(i32.const -1) i32.const -1
) )
(func $export/ns.two (; 2 ;) (; has Stack IR ;) (type $v) (func $export/ns.two (; 2 ;) (type $v)
(nop) nop
) )
(func $start (; 3 ;) (; has Stack IR ;) (type $v) (func $start (; 3 ;) (type $v)
(local $0 i32) (local $0 i32)
(local $1 i32) (local $1 i32)
(set_local $0 call $export/add
(call $export/add) set_local $0
) call $export/sub
(set_local $1 set_local $1
(call $export/sub) call $export/add
) drop
(drop call $export/ns.two
(call $export/add) call $export/add
) set_local $0
(call $export/ns.two) call $export/sub
(set_local $0 set_local $1
(call $export/add) call $export/add
) drop
(set_local $1 call $export/ns.two
(call $export/sub)
)
(drop
(call $export/add)
)
(call $export/ns.two)
) )
) )

View File

@ -2,7 +2,7 @@
(type $iii (func (param i32 i32) (result i32))) (type $iii (func (param i32 i32) (result i32)))
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(global $export/a i32 (i32.const 1)) (global $export/a i32 (i32.const 1))
(global $export/b i32 (i32.const 2)) (global $export/b i32 (i32.const 2))
@ -12,65 +12,50 @@
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $export/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $export/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.add get_local $0
(get_local $0) get_local $1
(get_local $1) i32.add
)
) )
(func $export/sub (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $export/sub (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.sub get_local $0
(get_local $0) get_local $1
(get_local $1) i32.sub
)
) )
(func $export/mul (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $export/mul (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.mul get_local $0
(get_local $0) get_local $1
(get_local $1) i32.mul
)
) )
(func $export/ns.two (; 3 ;) (type $v) (func $export/ns.two (; 3 ;) (type $v)
(nop) nop
) )
(func $start (; 4 ;) (type $v) (func $start (; 4 ;) (type $v)
(drop get_global $export/a
(i32.add get_global $export/b
(i32.add call $export/add
(call $export/add get_global $export/b
(get_global $export/a) get_global $export/c
(get_global $export/b) call $export/sub
) i32.add
(call $export/sub get_global $export/c
(get_global $export/b) get_global $export/a
(get_global $export/c) call $export/mul
) i32.add
) drop
(call $export/mul call $export/ns.two
(get_global $export/c) get_global $export/a
(get_global $export/a) get_global $export/b
) call $export/add
) get_global $export/b
) get_global $export/c
(call $export/ns.two) call $export/sub
(drop i32.add
(i32.add get_global $export/c
(i32.add get_global $export/a
(call $export/add call $export/mul
(get_global $export/a) i32.add
(get_global $export/b) drop
) call $export/ns.two
(call $export/sub
(get_global $export/b)
(get_global $export/c)
)
)
(call $export/mul
(get_global $export/c)
(get_global $export/a)
)
)
)
(call $export/ns.two)
) )
(func $null (; 5 ;) (type $v) (func $null (; 5 ;) (type $v)
) )

View File

@ -6,7 +6,7 @@
(type $F (func (result f64))) (type $F (func (result f64)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\0d\00\00\00i\00n\00f\00e\00r\00-\00t\00y\00p\00e\00.\00t\00s") (data (i32.const 8) "\0d\00\00\00i\00n\00f\00e\00r\00-\00t\00y\00p\00e\00.\00t\00s")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $infer-type/locals) (elem (i32.const 0) $infer-type/locals)
(global $infer-type/ri (mut i32) (i32.const 0)) (global $infer-type/ri (mut i32) (i32.const 0))
(global $infer-type/rI (mut i64) (i64.const 0)) (global $infer-type/rI (mut i64) (i64.const 0))
@ -15,52 +15,46 @@
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $infer-type/locals (; 0 ;) (; has Stack IR ;) (type $v) (func $infer-type/locals (; 0 ;) (type $v)
(nop) nop
) )
(func $infer-type/reti (; 1 ;) (; has Stack IR ;) (type $i) (result i32) (func $infer-type/reti (; 1 ;) (type $i) (result i32)
(i32.const 0) i32.const 0
) )
(func $infer-type/retI (; 2 ;) (; has Stack IR ;) (type $I) (result i64) (func $infer-type/retI (; 2 ;) (type $I) (result i64)
(i64.const 0) i64.const 0
) )
(func $infer-type/retf (; 3 ;) (; has Stack IR ;) (type $f) (result f32) (func $infer-type/retf (; 3 ;) (type $f) (result f32)
(f32.const 0) f32.const 0
) )
(func $infer-type/refF (; 4 ;) (; has Stack IR ;) (type $F) (result f64) (func $infer-type/refF (; 4 ;) (type $F) (result f64)
(f64.const 0) f64.const 0
) )
(func $start (; 5 ;) (; has Stack IR ;) (type $v) (func $start (; 5 ;) (type $v)
(local $0 i32) (local $0 i32)
(call $infer-type/locals) call $infer-type/locals
(set_global $infer-type/ri call $infer-type/reti
(call $infer-type/reti) set_global $infer-type/ri
) call $infer-type/retI
(set_global $infer-type/rI set_global $infer-type/rI
(call $infer-type/retI) call $infer-type/retf
) set_global $infer-type/rf
(set_global $infer-type/rf call $infer-type/refF
(call $infer-type/retf) set_global $infer-type/rF
) block $break|0
(set_global $infer-type/rF loop $repeat|0
(call $infer-type/refF) get_local $0
) i32.const 10
(block $break|0 i32.ge_s
(loop $repeat|0 br_if $break|0
(br_if $break|0 get_local $0
(i32.ge_s i32.const 1
(get_local $0) i32.add
(i32.const 10) set_local $0
) br $repeat|0
) unreachable
(set_local $0 end
(i32.add unreachable
(get_local $0) end
(i32.const 1)
)
)
(br $repeat|0)
)
)
) )
) )

View File

@ -5,11 +5,11 @@
(type $f (func (result f32))) (type $f (func (result f32)))
(type $F (func (result f64))) (type $F (func (result f64)))
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\0d\00\00\00i\00n\00f\00e\00r\00-\00t\00y\00p\00e\00.\00t\00s\00") (data (i32.const 8) "\0d\00\00\00i\00n\00f\00e\00r\00-\00t\00y\00p\00e\00.\00t\00s\00")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $infer-type/i i32 (i32.const 10)) (global $infer-type/i i32 (i32.const 10))
(global $infer-type/I i64 (i64.const 4294967296)) (global $infer-type/I i64 (i64.const 4294967296))
(global $infer-type/F f64 (f64.const 1.5)) (global $infer-type/F f64 (f64.const 1.5))
@ -30,132 +30,101 @@
(local $3 i32) (local $3 i32)
(local $4 i64) (local $4 i64)
(local $5 f64) (local $5 f64)
(set_local $0 i32.const 10
(i32.const 10) set_local $0
) i64.const 4294967296
(set_local $1 set_local $1
(i64.const 4294967296) f64.const 1.5
) set_local $2
(set_local $2 get_global $infer-type/i
(f64.const 1.5) set_local $3
) get_global $infer-type/I
(set_local $3 set_local $4
(get_global $infer-type/i) get_global $infer-type/F
) set_local $5
(set_local $4
(get_global $infer-type/I)
)
(set_local $5
(get_global $infer-type/F)
)
) )
(func $infer-type/reti (; 2 ;) (type $i) (result i32) (func $infer-type/reti (; 2 ;) (type $i) (result i32)
(i32.const 0) i32.const 0
) )
(func $infer-type/retI (; 3 ;) (type $I) (result i64) (func $infer-type/retI (; 3 ;) (type $I) (result i64)
(i64.const 0) i64.const 0
) )
(func $infer-type/retf (; 4 ;) (type $f) (result f32) (func $infer-type/retf (; 4 ;) (type $f) (result f32)
(f32.const 0) f32.const 0
) )
(func $infer-type/refF (; 5 ;) (type $F) (result f64) (func $infer-type/refF (; 5 ;) (type $F) (result f64)
(f64.const 0) f64.const 0
) )
(func $start (; 6 ;) (type $v) (func $start (; 6 ;) (type $v)
(local $0 i32) (local $0 i32)
(local $1 i32) (local $1 i32)
(drop get_global $infer-type/i
(get_global $infer-type/i) drop
) get_global $infer-type/I
(drop drop
(get_global $infer-type/I) get_global $infer-type/F
) drop
(drop call $infer-type/locals
(get_global $infer-type/F) call $infer-type/reti
) set_global $infer-type/ri
(call $infer-type/locals) get_global $infer-type/ri
(set_global $infer-type/ri drop
(call $infer-type/reti) call $infer-type/retI
) set_global $infer-type/rI
(drop get_global $infer-type/rI
(get_global $infer-type/ri) drop
) call $infer-type/retf
(set_global $infer-type/rI set_global $infer-type/rf
(call $infer-type/retI) get_global $infer-type/rf
) drop
(drop call $infer-type/refF
(get_global $infer-type/rI) set_global $infer-type/rF
) get_global $infer-type/rF
(set_global $infer-type/rf drop
(call $infer-type/retf) block $break|0
) block
(drop i32.const 0
(get_global $infer-type/rf) set_local $0
) i32.const 10
(set_global $infer-type/rF set_local $1
(call $infer-type/refF) end
) loop $repeat|0
(drop get_local $0
(get_global $infer-type/rF) get_local $1
) i32.lt_s
(block $break|0 i32.eqz
(block br_if $break|0
(set_local $0 nop
(i32.const 0) get_local $0
) i32.const 1
(set_local $1 i32.add
(i32.const 10) set_local $0
) br $repeat|0
) unreachable
(loop $repeat|0 end
(br_if $break|0 unreachable
(i32.eqz end
(i32.lt_s i32.const 0
(get_local $0) i32.eqz
(get_local $1) i32.eqz
) if
) i32.const 0
) i32.const 8
(nop) i32.const 49
(set_local $0 i32.const 0
(i32.add call $~lib/env/abort
(get_local $0) unreachable
(i32.const 1) end
) i32.const 1
) i32.eqz
(br $repeat|0) if
) i32.const 0
) i32.const 8
(if i32.const 52
(i32.eqz i32.const 0
(i32.eqz call $~lib/env/abort
(i32.const 0) unreachable
) end
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 49)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.const 1)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 52)
(i32.const 0)
)
(unreachable)
)
)
) )
(func $null (; 7 ;) (type $v) (func $null (; 7 ;) (type $v)
) )

View File

@ -1,23 +1,23 @@
(module (module
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(export "foo" (func $inlining-recursive/foo)) (export "foo" (func $inlining-recursive/foo))
(export "bar" (func $inlining-recursive/bar)) (export "bar" (func $inlining-recursive/bar))
(export "baz" (func $inlining-recursive/baz)) (export "baz" (func $inlining-recursive/baz))
(func $inlining-recursive/foo (; 0 ;) (; has Stack IR ;) (type $v) (func $inlining-recursive/foo (; 0 ;) (type $v)
(call $inlining-recursive/foo) call $inlining-recursive/foo
) )
(func $inlining-recursive/baz (; 1 ;) (; has Stack IR ;) (type $v) (func $inlining-recursive/baz (; 1 ;) (type $v)
(call $inlining-recursive/bar) call $inlining-recursive/bar
) )
(func $inlining-recursive/bar (; 2 ;) (; has Stack IR ;) (type $v) (func $inlining-recursive/bar (; 2 ;) (type $v)
(call $inlining-recursive/baz) call $inlining-recursive/baz
) )
(func $null (; 3 ;) (; has Stack IR ;) (type $v) (func $null (; 3 ;) (type $v)
(nop) nop
) )
) )

View File

@ -1,7 +1,7 @@
(module (module
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(global $HEAP_BASE i32 (i32.const 8)) (global $HEAP_BASE i32 (i32.const 8))
(export "memory" (memory $0)) (export "memory" (memory $0))
@ -10,19 +10,15 @@
(export "bar" (func $inlining-recursive/bar)) (export "bar" (func $inlining-recursive/bar))
(export "baz" (func $inlining-recursive/baz)) (export "baz" (func $inlining-recursive/baz))
(func $inlining-recursive/foo (; 0 ;) (type $v) (func $inlining-recursive/foo (; 0 ;) (type $v)
(block $inlining-recursive/foo|inlined.0 call $inlining-recursive/foo
(call $inlining-recursive/foo)
)
) )
(func $inlining-recursive/baz (; 1 ;) (type $v) (func $inlining-recursive/baz (; 1 ;) (type $v)
(call $inlining-recursive/bar) call $inlining-recursive/bar
) )
(func $inlining-recursive/bar (; 2 ;) (type $v) (func $inlining-recursive/bar (; 2 ;) (type $v)
(block $inlining-recursive/baz|inlined.0 block $inlining-recursive/bar|inlined.0
(block $inlining-recursive/bar|inlined.0 call $inlining-recursive/baz
(call $inlining-recursive/baz) end
)
)
) )
(func $null (; 3 ;) (type $v) (func $null (; 3 ;) (type $v)
) )

View File

@ -3,64 +3,54 @@
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func)) (type $v (func))
(type $ii (func (param i32) (result i32))) (type $ii (func (param i32) (result i32)))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\0b\00\00\00i\00n\00l\00i\00n\00i\00n\00g\00.\00t\00s") (data (i32.const 8) "\0b\00\00\00i\00n\00l\00i\00n\00i\00n\00g\00.\00t\00s")
(table 2 anyfunc) (table $0 2 anyfunc)
(elem (i32.const 0) $null $inlining/test_funcs~anonymous|1) (elem (i32.const 0) $null $inlining/test_funcs~anonymous|1)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $~argc (mut i32) (i32.const 0)) (global $~argc (mut i32) (i32.const 0))
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(export "test" (func $inlining/test)) (export "test" (func $inlining/test))
(start $start) (start $start)
(func $inlining/test (; 1 ;) (; has Stack IR ;) (type $i) (result i32) (func $inlining/test (; 1 ;) (type $i) (result i32)
(i32.const 3) i32.const 3
) )
(func $inlining/test_funcs~anonymous|1 (; 2 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (func $inlining/test_funcs~anonymous|1 (; 2 ;) (type $ii) (param $0 i32) (result i32)
(get_local $0) get_local $0
) )
(func $inlining/test_funcs (; 3 ;) (; has Stack IR ;) (type $v) (func $inlining/test_funcs (; 3 ;) (type $v)
(set_global $~argc i32.const 1
(i32.const 1) set_global $~argc
) i32.const 2
(if i32.const 1
(i32.ne call_indirect (type $ii)
(call_indirect (type $ii) i32.const 2
(i32.const 2) i32.ne
(i32.const 1) if
) i32.const 0
(i32.const 2) i32.const 8
) i32.const 68
(block i32.const 2
(call $~lib/env/abort call $~lib/env/abort
(i32.const 0) unreachable
(i32.const 8) end
(i32.const 68)
(i32.const 2)
)
(unreachable)
)
)
) )
(func $start (; 4 ;) (; has Stack IR ;) (type $v) (func $start (; 4 ;) (type $v)
(if call $inlining/test
(i32.ne i32.const 3
(call $inlining/test) i32.ne
(i32.const 3) if
) i32.const 0
(block i32.const 8
(call $~lib/env/abort i32.const 10
(i32.const 0) i32.const 0
(i32.const 8) call $~lib/env/abort
(i32.const 10) unreachable
(i32.const 0) end
) call $inlining/test_funcs
(unreachable)
)
)
(call $inlining/test_funcs)
) )
(func $null (; 5 ;) (; has Stack IR ;) (type $v) (func $null (; 5 ;) (type $v)
(nop) nop
) )
) )

View File

@ -3,11 +3,11 @@
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func)) (type $v (func))
(type $ii (func (param i32) (result i32))) (type $ii (func (param i32) (result i32)))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\0b\00\00\00i\00n\00l\00i\00n\00i\00n\00g\00.\00t\00s\00") (data (i32.const 8) "\0b\00\00\00i\00n\00l\00i\00n\00i\00n\00g\00.\00t\00s\00")
(table 2 anyfunc) (table $0 2 anyfunc)
(elem (i32.const 0) $null $inlining/test_funcs~anonymous|1) (elem (i32.const 0) $null $inlining/test_funcs~anonymous|1)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $inlining/constantGlobal i32 (i32.const 1)) (global $inlining/constantGlobal i32 (i32.const 1))
(global $~argc (mut i32) (i32.const 0)) (global $~argc (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 36)) (global $HEAP_BASE i32 (i32.const 36))
@ -16,13 +16,12 @@
(export "test" (func $inlining/test)) (export "test" (func $inlining/test))
(start $start) (start $start)
(func $inlining/test (; 1 ;) (type $i) (result i32) (func $inlining/test (; 1 ;) (type $i) (result i32)
(i32.add get_global $inlining/constantGlobal
(get_global $inlining/constantGlobal) i32.const 2
(i32.const 2) i32.add
)
) )
(func $inlining/test_funcs~anonymous|1 (; 2 ;) (type $ii) (param $0 i32) (result i32) (func $inlining/test_funcs~anonymous|1 (; 2 ;) (type $ii) (param $0 i32) (result i32)
(get_local $0) get_local $0
) )
(func $inlining/test_funcs (; 3 ;) (type $v) (func $inlining/test_funcs (; 3 ;) (type $v)
(local $0 f32) (local $0 f32)
@ -33,356 +32,267 @@
(local $5 i32) (local $5 i32)
(local $6 i32) (local $6 i32)
(local $7 i32) (local $7 i32)
(set_local $0 f32.const -1
(f32.const -1) set_local $0
) f64.const -2
(set_local $1 set_local $1
(f64.const -2) block $inlining/func_ii|inlined.0 (result i32)
) i32.const 42
(if set_local $2
(i32.eqz get_local $2
(i32.eq i32.const 42
(block $inlining/func_ii|inlined.0 (result i32) i32.eq
(set_local $2 if
(i32.const 42) i32.const 1
) br $inlining/func_ii|inlined.0
(if end
(i32.eq get_local $2
(get_local $2) i32.const 42
(i32.const 42) i32.lt_s
) if (result i32)
(br $inlining/func_ii|inlined.0 i32.const 2
(i32.const 1) else
) i32.const 3
) end
(if (result i32) end
(i32.lt_s i32.const 1
(get_local $2) i32.eq
(i32.const 42) i32.eqz
) if
(i32.const 2) i32.const 0
(i32.const 3) i32.const 8
) i32.const 60
) i32.const 2
(i32.const 1) call $~lib/env/abort
) unreachable
) end
(block block $inlining/func_ii|inlined.1 (result i32)
(call $~lib/env/abort i32.const 41
(i32.const 0) set_local $2
(i32.const 8) get_local $2
(i32.const 60) i32.const 42
(i32.const 2) i32.eq
) if
(unreachable) i32.const 1
) br $inlining/func_ii|inlined.1
) end
(if get_local $2
(i32.eqz i32.const 42
(i32.eq i32.lt_s
(block $inlining/func_ii|inlined.1 (result i32) if (result i32)
(set_local $2 i32.const 2
(i32.const 41) else
) i32.const 3
(if end
(i32.eq end
(get_local $2) i32.const 2
(i32.const 42) i32.eq
) i32.eqz
(br $inlining/func_ii|inlined.1 if
(i32.const 1) i32.const 0
) i32.const 8
) i32.const 61
(if (result i32) i32.const 2
(i32.lt_s call $~lib/env/abort
(get_local $2) unreachable
(i32.const 42) end
) block $inlining/func_ii|inlined.2 (result i32)
(i32.const 2) i32.const 43
(i32.const 3) set_local $2
) get_local $2
) i32.const 42
(i32.const 2) i32.eq
) if
) i32.const 1
(block br $inlining/func_ii|inlined.2
(call $~lib/env/abort end
(i32.const 0) get_local $2
(i32.const 8) i32.const 42
(i32.const 61) i32.lt_s
(i32.const 2) if (result i32)
) i32.const 2
(unreachable) else
) i32.const 3
) end
(if end
(i32.eqz i32.const 3
(i32.eq i32.eq
(block $inlining/func_ii|inlined.2 (result i32) i32.eqz
(set_local $2 if
(i32.const 43) i32.const 0
) i32.const 8
(if i32.const 62
(i32.eq i32.const 2
(get_local $2) call $~lib/env/abort
(i32.const 42) unreachable
) end
(br $inlining/func_ii|inlined.2 block $inlining/func_ii_opt|inlined.0 (result i32)
(i32.const 1) i32.const 0
) set_local $2
) get_local $2
(if (result i32) end
(i32.lt_s i32.const 0
(get_local $2) i32.eq
(i32.const 42) i32.eqz
) if
(i32.const 2) i32.const 0
(i32.const 3) i32.const 8
) i32.const 63
) i32.const 2
(i32.const 3) call $~lib/env/abort
) unreachable
) end
(block block $inlining/func_ii_opt|inlined.1 (result i32)
(call $~lib/env/abort i32.const 1
(i32.const 0) set_local $2
(i32.const 8) get_local $2
(i32.const 62) end
(i32.const 2) i32.const 1
) i32.eq
(unreachable) i32.eqz
) if
) i32.const 0
(if i32.const 8
(i32.eqz i32.const 64
(i32.eq i32.const 2
(block $inlining/func_ii_opt|inlined.0 (result i32) call $~lib/env/abort
(set_local $2 unreachable
(i32.const 0) end
) block $inlining/func_ii_loc|inlined.0 (result i32)
(get_local $2) i32.const 2
) set_local $2
(i32.const 0) get_local $2
) set_local $3
) block
(block get_local $3
(call $~lib/env/abort set_local $5
(i32.const 0) get_local $5
(i32.const 8) set_local $6
(i32.const 63) get_local $6
(i32.const 2) i32.const 1
) i32.add
(unreachable) set_local $4
) end
) get_local $4
(if end
(i32.eqz i32.const 3
(i32.eq i32.eq
(block $inlining/func_ii_opt|inlined.1 (result i32) i32.eqz
(set_local $2 if
(i32.const 1) i32.const 0
) i32.const 8
(get_local $2) i32.const 65
) i32.const 2
(i32.const 1) call $~lib/env/abort
) unreachable
) end
(block block $inlining/func_ii_loc|inlined.1 (result i32)
(call $~lib/env/abort i32.const 3
(i32.const 0) set_local $4
(i32.const 8) get_local $4
(i32.const 64) set_local $3
(i32.const 2) block
) get_local $3
(unreachable) set_local $6
) get_local $6
) set_local $5
(if get_local $5
(i32.eqz i32.const 1
(i32.eq i32.add
(block $inlining/func_ii_loc|inlined.0 (result i32) set_local $2
(set_local $2 end
(i32.const 2) get_local $2
) end
(set_local $3 i32.const 4
(get_local $2) i32.eq
) i32.eqz
(block if
(set_local $5 i32.const 0
(get_local $3) i32.const 8
) i32.const 66
(set_local $6 i32.const 2
(get_local $5) call $~lib/env/abort
) unreachable
(set_local $4 end
(i32.add block $inlining/func_iv|inlined.0
(get_local $6) i32.const 0
(i32.const 1) set_local $2
) end
) block (result i32)
) i32.const 1
(get_local $4) set_global $~argc
) i32.const 2
(i32.const 3) block $inlining/func_fe|inlined.0 (result i32)
) i32.const 1
) end
(block call_indirect (type $ii)
(call $~lib/env/abort end
(i32.const 0) i32.const 2
(i32.const 8) i32.eq
(i32.const 65) i32.eqz
(i32.const 2) if
) i32.const 0
(unreachable) i32.const 8
) i32.const 68
) i32.const 2
(if call $~lib/env/abort
(i32.eqz unreachable
(i32.eq end
(block $inlining/func_ii_loc|inlined.1 (result i32) block $inlining/Foo.method_static|inlined.0 (result i32)
(set_local $4 i32.const 42
(i32.const 3) set_local $2
) i32.const 2
(set_local $3 set_local $3
(get_local $4) get_local $2
) get_local $3
(block i32.add
(set_local $6 end
(get_local $3) i32.const 44
) i32.eq
(set_local $5 i32.eqz
(get_local $6) if
) i32.const 0
(set_local $2 i32.const 8
(i32.add i32.const 69
(get_local $5) i32.const 2
(i32.const 1) call $~lib/env/abort
) unreachable
) end
) i32.const 123
(get_local $2) set_local $7
) block $inlining/Foo#method_this|inlined.0 (result i32)
(i32.const 4) i32.const 43
) set_local $3
) i32.const 3
(block set_local $2
(call $~lib/env/abort get_local $7
(i32.const 0) end
(i32.const 8) i32.const 123
(i32.const 66) i32.eq
(i32.const 2) i32.eqz
) if
(unreachable) i32.const 0
) i32.const 8
) i32.const 71
(block $inlining/func_iv|inlined.0 i32.const 2
(set_local $2 call $~lib/env/abort
(i32.const 0) unreachable
) end
)
(if
(i32.eqz
(i32.eq
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(call_indirect (type $ii)
(i32.const 2)
(block $inlining/func_fe|inlined.0 (result i32)
(i32.const 1)
)
)
)
(i32.const 2)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 68)
(i32.const 2)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(block $inlining/Foo.method_static|inlined.0 (result i32)
(set_local $2
(i32.const 42)
)
(set_local $3
(i32.const 2)
)
(i32.add
(get_local $2)
(get_local $3)
)
)
(i32.const 44)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 69)
(i32.const 2)
)
(unreachable)
)
)
(set_local $7
(i32.const 123)
)
(if
(i32.eqz
(i32.eq
(block $inlining/Foo#method_this|inlined.0 (result i32)
(set_local $3
(i32.const 43)
)
(set_local $2
(i32.const 3)
)
(get_local $7)
)
(i32.const 123)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 71)
(i32.const 2)
)
(unreachable)
)
)
) )
(func $start (; 4 ;) (type $v) (func $start (; 4 ;) (type $v)
(if call $inlining/test
(i32.eqz i32.const 3
(i32.eq i32.eq
(call $inlining/test) i32.eqz
(i32.const 3) if
) i32.const 0
) i32.const 8
(block i32.const 10
(call $~lib/env/abort i32.const 0
(i32.const 0) call $~lib/env/abort
(i32.const 8) unreachable
(i32.const 10) end
(i32.const 0) call $inlining/test_funcs
)
(unreachable)
)
)
(call $inlining/test_funcs)
) )
(func $null (; 5 ;) (type $v) (func $null (; 5 ;) (type $v)
) )

View File

@ -2,91 +2,73 @@
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func)) (type $v (func))
(type $FUNCSIG$i (func (result i32))) (type $FUNCSIG$i (func (result i32)))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\0d\00\00\00i\00n\00s\00t\00a\00n\00c\00e\00o\00f\00.\00t\00s") (data (i32.const 8) "\0d\00\00\00i\00n\00s\00t\00a\00n\00c\00e\00o\00f\00.\00t\00s")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $instanceof/an (mut i32) (i32.const 0)) (global $instanceof/an (mut i32) (i32.const 0))
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $instanceof/isI32<i32> (; 1 ;) (; has Stack IR ;) (type $FUNCSIG$i) (result i32) (func $instanceof/isI32<i32> (; 1 ;) (type $FUNCSIG$i) (result i32)
(i32.const 1) i32.const 1
) )
(func $instanceof/isI32<f64> (; 2 ;) (; has Stack IR ;) (type $FUNCSIG$i) (result i32) (func $instanceof/isI32<f64> (; 2 ;) (type $FUNCSIG$i) (result i32)
(i32.const 0) i32.const 0
) )
(func $start (; 3 ;) (; has Stack IR ;) (type $v) (func $start (; 3 ;) (type $v)
(if call $instanceof/isI32<i32>
(i32.eqz i32.eqz
(call $instanceof/isI32<i32>) if
) i32.const 0
(block i32.const 8
(call $~lib/env/abort i32.const 38
(i32.const 0) i32.const 0
(i32.const 8) call $~lib/env/abort
(i32.const 38) unreachable
(i32.const 0) end
) call $instanceof/isI32<f64>
(unreachable) if
) i32.const 0
) i32.const 8
(if i32.const 39
(call $instanceof/isI32<f64>) i32.const 0
(block call $~lib/env/abort
(call $~lib/env/abort unreachable
(i32.const 0) end
(i32.const 8) call $instanceof/isI32<f64>
(i32.const 39) if
(i32.const 0) i32.const 0
) i32.const 8
(unreachable) i32.const 40
) i32.const 0
) call $~lib/env/abort
(if unreachable
(call $instanceof/isI32<f64>) end
(block get_global $instanceof/an
(call $~lib/env/abort if
(i32.const 0) i32.const 0
(i32.const 8) i32.const 8
(i32.const 40) i32.const 43
(i32.const 0) i32.const 0
) call $~lib/env/abort
(unreachable) unreachable
) end
) i32.const 1
(if set_global $instanceof/an
(get_global $instanceof/an) get_global $instanceof/an
(block i32.eqz
(call $~lib/env/abort if
(i32.const 0) i32.const 0
(i32.const 8) i32.const 8
(i32.const 43) i32.const 46
(i32.const 0) i32.const 0
) call $~lib/env/abort
(unreachable) unreachable
) end
)
(set_global $instanceof/an
(i32.const 1)
)
(if
(i32.eqz
(get_global $instanceof/an)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 46)
(i32.const 0)
)
(unreachable)
)
)
) )
(func $null (; 4 ;) (; has Stack IR ;) (type $v) (func $null (; 4 ;) (type $v)
(nop) nop
) )
) )

View File

@ -3,11 +3,11 @@
(type $ii (func (param i32) (result i32))) (type $ii (func (param i32) (result i32)))
(type $Fi (func (param f64) (result i32))) (type $Fi (func (param f64) (result i32)))
(type $v (func)) (type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\0d\00\00\00i\00n\00s\00t\00a\00n\00c\00e\00o\00f\00.\00t\00s\00") (data (i32.const 8) "\0d\00\00\00i\00n\00s\00t\00a\00n\00c\00e\00o\00f\00.\00t\00s\00")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $instanceof/a (mut i32) (i32.const 0)) (global $instanceof/a (mut i32) (i32.const 0))
(global $instanceof/b (mut i32) (i32.const 0)) (global $instanceof/b (mut i32) (i32.const 0))
(global $instanceof/i (mut i32) (i32.const 0)) (global $instanceof/i (mut i32) (i32.const 0))
@ -18,386 +18,271 @@
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $instanceof/isI32<i32> (; 1 ;) (type $ii) (param $0 i32) (result i32) (func $instanceof/isI32<i32> (; 1 ;) (type $ii) (param $0 i32) (result i32)
(return i32.const 1
(i32.const 1) return
)
) )
(func $instanceof/isI32<f64> (; 2 ;) (type $Fi) (param $0 f64) (result i32) (func $instanceof/isI32<f64> (; 2 ;) (type $Fi) (param $0 f64) (result i32)
(return i32.const 0
(i32.const 0) return
)
) )
(func $instanceof/isI32<u32> (; 3 ;) (type $ii) (param $0 i32) (result i32) (func $instanceof/isI32<u32> (; 3 ;) (type $ii) (param $0 i32) (result i32)
(return i32.const 0
(i32.const 0) return
)
) )
(func $start (; 4 ;) (type $v) (func $start (; 4 ;) (type $v)
(if i32.const 1
(i32.eqz i32.eqz
(i32.const 1) if
) i32.const 0
(block i32.const 8
(call $~lib/env/abort i32.const 9
(i32.const 0) i32.const 0
(i32.const 8) call $~lib/env/abort
(i32.const 9) unreachable
(i32.const 0) end
) i32.const 1
(unreachable) i32.eqz
) if
) i32.const 0
(if i32.const 8
(i32.eqz i32.const 10
(i32.const 1) i32.const 0
) call $~lib/env/abort
(block unreachable
(call $~lib/env/abort end
(i32.const 0) i32.const 0
(i32.const 8) i32.eqz
(i32.const 10) i32.eqz
(i32.const 0) if
) i32.const 0
(unreachable) i32.const 8
) i32.const 11
) i32.const 0
(if call $~lib/env/abort
(i32.eqz unreachable
(i32.eqz end
(i32.const 0) i32.const 0
) i32.eqz
) i32.eqz
(block if
(call $~lib/env/abort i32.const 0
(i32.const 0) i32.const 8
(i32.const 8) i32.const 12
(i32.const 11) i32.const 0
(i32.const 0) call $~lib/env/abort
) unreachable
(unreachable) end
) i32.const 0
) i32.eqz
(if i32.eqz
(i32.eqz if
(i32.eqz i32.const 0
(i32.const 0) i32.const 8
) i32.const 14
) i32.const 0
(block call $~lib/env/abort
(call $~lib/env/abort unreachable
(i32.const 0) end
(i32.const 8) i32.const 1
(i32.const 12) i32.eqz
(i32.const 0) if
) i32.const 0
(unreachable) i32.const 8
) i32.const 15
) i32.const 0
(if call $~lib/env/abort
(i32.eqz unreachable
(i32.eqz end
(i32.const 0) i32.const 0
) i32.eqz
) i32.eqz
(block if
(call $~lib/env/abort i32.const 0
(i32.const 0) i32.const 8
(i32.const 8) i32.const 16
(i32.const 14) i32.const 0
(i32.const 0) call $~lib/env/abort
) unreachable
(unreachable) end
) i32.const 0
) i32.eqz
(if i32.eqz
(i32.eqz if
(i32.const 1) i32.const 0
) i32.const 8
(block i32.const 17
(call $~lib/env/abort i32.const 0
(i32.const 0) call $~lib/env/abort
(i32.const 8) unreachable
(i32.const 15) end
(i32.const 0) i32.const 0
) i32.eqz
(unreachable) i32.eqz
) if
) i32.const 0
(if i32.const 8
(i32.eqz i32.const 19
(i32.eqz i32.const 0
(i32.const 0) call $~lib/env/abort
) unreachable
) end
(block i32.const 0
(call $~lib/env/abort i32.eqz
(i32.const 0) i32.eqz
(i32.const 8) if
(i32.const 16) i32.const 0
(i32.const 0) i32.const 8
) i32.const 20
(unreachable) i32.const 0
) call $~lib/env/abort
) unreachable
(if end
(i32.eqz i32.const 1
(i32.eqz i32.eqz
(i32.const 0) if
) i32.const 0
) i32.const 8
(block i32.const 21
(call $~lib/env/abort i32.const 0
(i32.const 0) call $~lib/env/abort
(i32.const 8) unreachable
(i32.const 17) end
(i32.const 0) i32.const 0
) i32.eqz
(unreachable) i32.eqz
) if
) i32.const 0
(if i32.const 8
(i32.eqz i32.const 22
(i32.eqz i32.const 0
(i32.const 0) call $~lib/env/abort
) unreachable
) end
(block i32.const 0
(call $~lib/env/abort i32.eqz
(i32.const 0) i32.eqz
(i32.const 8) if
(i32.const 19) i32.const 0
(i32.const 0) i32.const 8
) i32.const 24
(unreachable) i32.const 0
) call $~lib/env/abort
) unreachable
(if end
(i32.eqz i32.const 0
(i32.eqz i32.eqz
(i32.const 0) i32.eqz
) if
) i32.const 0
(block i32.const 8
(call $~lib/env/abort i32.const 25
(i32.const 0) i32.const 0
(i32.const 8) call $~lib/env/abort
(i32.const 20) unreachable
(i32.const 0) end
) i32.const 0
(unreachable) i32.eqz
) i32.eqz
) if
(if i32.const 0
(i32.eqz i32.const 8
(i32.const 1) i32.const 26
) i32.const 0
(block call $~lib/env/abort
(call $~lib/env/abort unreachable
(i32.const 0) end
(i32.const 8) i32.const 1
(i32.const 21) i32.eqz
(i32.const 0) if
) i32.const 0
(unreachable) i32.const 8
) i32.const 27
) i32.const 0
(if call $~lib/env/abort
(i32.eqz unreachable
(i32.eqz end
(i32.const 0) i32.const 0
) call $instanceof/isI32<i32>
) i32.eqz
(block if
(call $~lib/env/abort i32.const 0
(i32.const 0) i32.const 8
(i32.const 8) i32.const 38
(i32.const 22) i32.const 0
(i32.const 0) call $~lib/env/abort
) unreachable
(unreachable) end
) f64.const 0
) call $instanceof/isI32<f64>
(if i32.eqz
(i32.eqz i32.eqz
(i32.eqz if
(i32.const 0) i32.const 0
) i32.const 8
) i32.const 39
(block i32.const 0
(call $~lib/env/abort call $~lib/env/abort
(i32.const 0) unreachable
(i32.const 8) end
(i32.const 24) i32.const 0
(i32.const 0) call $instanceof/isI32<u32>
) i32.eqz
(unreachable) i32.eqz
) if
) i32.const 0
(if i32.const 8
(i32.eqz i32.const 40
(i32.eqz i32.const 0
(i32.const 0) call $~lib/env/abort
) unreachable
) end
(block get_global $instanceof/an
(call $~lib/env/abort i32.const 0
(i32.const 0) i32.ne
(i32.const 8) i32.eqz
(i32.const 25) i32.eqz
(i32.const 0) if
) i32.const 0
(unreachable) i32.const 8
) i32.const 43
) i32.const 0
(if call $~lib/env/abort
(i32.eqz unreachable
(i32.eqz end
(i32.const 0) i32.const 1
) i32.eqz
) if
(block i32.const 0
(call $~lib/env/abort i32.const 8
(i32.const 0) i32.const 44
(i32.const 8) i32.const 0
(i32.const 26) call $~lib/env/abort
(i32.const 0) unreachable
) end
(unreachable) i32.const 1
) set_global $instanceof/an
) get_global $instanceof/an
(if i32.const 0
(i32.eqz i32.ne
(i32.const 1) i32.eqz
) if
(block i32.const 0
(call $~lib/env/abort i32.const 8
(i32.const 0) i32.const 46
(i32.const 8) i32.const 0
(i32.const 27) call $~lib/env/abort
(i32.const 0) unreachable
) end
(unreachable) i32.const 1
) i32.eqz
) if
(if i32.const 0
(i32.eqz i32.const 8
(call $instanceof/isI32<i32> i32.const 47
(i32.const 0) i32.const 0
) call $~lib/env/abort
) unreachable
(block end
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 38)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eqz
(call $instanceof/isI32<f64>
(f64.const 0)
)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 39)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eqz
(call $instanceof/isI32<u32>
(i32.const 0)
)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 40)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eqz
(i32.ne
(get_global $instanceof/an)
(i32.const 0)
)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 43)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.const 1)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 44)
(i32.const 0)
)
(unreachable)
)
)
(set_global $instanceof/an
(i32.const 1)
)
(if
(i32.eqz
(i32.ne
(get_global $instanceof/an)
(i32.const 0)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 46)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.const 1)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 47)
(i32.const 0)
)
(unreachable)
)
)
) )
(func $null (; 5 ;) (type $v) (func $null (; 5 ;) (type $v)
) )

View File

@ -1,11 +1,11 @@
(module (module
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $start) (elem (i32.const 0) $start)
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(func $start (; 0 ;) (; has Stack IR ;) (type $v) (func $start (; 0 ;) (type $v)
(nop) nop
) )
) )

View File

@ -1,7 +1,7 @@
(module (module
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(global $~lib/builtins/i8.MIN_VALUE i32 (i32.const -128)) (global $~lib/builtins/i8.MIN_VALUE i32 (i32.const -128))
(global $~lib/builtins/i8.MAX_VALUE i32 (i32.const 127)) (global $~lib/builtins/i8.MAX_VALUE i32 (i32.const 127))
@ -34,84 +34,58 @@
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $start (; 0 ;) (type $v) (func $start (; 0 ;) (type $v)
(drop get_global $~lib/builtins/i8.MIN_VALUE
(get_global $~lib/builtins/i8.MIN_VALUE) drop
) get_global $~lib/builtins/i8.MAX_VALUE
(drop drop
(get_global $~lib/builtins/i8.MAX_VALUE) get_global $~lib/builtins/i16.MIN_VALUE
) drop
(drop get_global $~lib/builtins/i16.MAX_VALUE
(get_global $~lib/builtins/i16.MIN_VALUE) drop
) get_global $~lib/builtins/i32.MIN_VALUE
(drop drop
(get_global $~lib/builtins/i16.MAX_VALUE) get_global $~lib/builtins/i32.MAX_VALUE
) drop
(drop get_global $~lib/builtins/i64.MIN_VALUE
(get_global $~lib/builtins/i32.MIN_VALUE) drop
) get_global $~lib/builtins/i64.MAX_VALUE
(drop drop
(get_global $~lib/builtins/i32.MAX_VALUE) get_global $~lib/builtins/isize.MIN_VALUE
) drop
(drop get_global $~lib/builtins/isize.MAX_VALUE
(get_global $~lib/builtins/i64.MIN_VALUE) drop
) get_global $~lib/builtins/u8.MIN_VALUE
(drop drop
(get_global $~lib/builtins/i64.MAX_VALUE) get_global $~lib/builtins/u8.MAX_VALUE
) drop
(drop get_global $~lib/builtins/u16.MIN_VALUE
(get_global $~lib/builtins/isize.MIN_VALUE) drop
) get_global $~lib/builtins/u16.MAX_VALUE
(drop drop
(get_global $~lib/builtins/isize.MAX_VALUE) get_global $~lib/builtins/u32.MIN_VALUE
) drop
(drop get_global $~lib/builtins/u32.MAX_VALUE
(get_global $~lib/builtins/u8.MIN_VALUE) drop
) get_global $~lib/builtins/u64.MIN_VALUE
(drop drop
(get_global $~lib/builtins/u8.MAX_VALUE) get_global $~lib/builtins/u64.MAX_VALUE
) drop
(drop get_global $~lib/builtins/usize.MIN_VALUE
(get_global $~lib/builtins/u16.MIN_VALUE) drop
) get_global $~lib/builtins/usize.MAX_VALUE
(drop drop
(get_global $~lib/builtins/u16.MAX_VALUE) get_global $~lib/builtins/bool.MIN_VALUE
) drop
(drop get_global $~lib/builtins/bool.MAX_VALUE
(get_global $~lib/builtins/u32.MIN_VALUE) drop
) get_global $~lib/builtins/f32.MIN_SAFE_INTEGER
(drop drop
(get_global $~lib/builtins/u32.MAX_VALUE) get_global $~lib/builtins/f32.MAX_SAFE_INTEGER
) drop
(drop get_global $~lib/builtins/f64.MIN_SAFE_INTEGER
(get_global $~lib/builtins/u64.MIN_VALUE) drop
) get_global $~lib/builtins/f64.MAX_SAFE_INTEGER
(drop drop
(get_global $~lib/builtins/u64.MAX_VALUE)
)
(drop
(get_global $~lib/builtins/usize.MIN_VALUE)
)
(drop
(get_global $~lib/builtins/usize.MAX_VALUE)
)
(drop
(get_global $~lib/builtins/bool.MIN_VALUE)
)
(drop
(get_global $~lib/builtins/bool.MAX_VALUE)
)
(drop
(get_global $~lib/builtins/f32.MIN_SAFE_INTEGER)
)
(drop
(get_global $~lib/builtins/f32.MAX_SAFE_INTEGER)
)
(drop
(get_global $~lib/builtins/f64.MIN_SAFE_INTEGER)
)
(drop
(get_global $~lib/builtins/f64.MAX_SAFE_INTEGER)
)
) )
(func $null (; 1 ;) (type $v) (func $null (; 1 ;) (type $v)
) )

View File

@ -1,11 +1,11 @@
(module (module
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $start) (elem (i32.const 0) $start)
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(func $start (; 0 ;) (; has Stack IR ;) (type $v) (func $start (; 0 ;) (type $v)
(nop) nop
) )
) )

View File

@ -1,145 +1,101 @@
(module (module
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(global $HEAP_BASE i32 (i32.const 8)) (global $HEAP_BASE i32 (i32.const 8))
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $start (; 0 ;) (type $v) (func $start (; 0 ;) (type $v)
(drop i32.const 0
(i32.const 0) drop
) i32.const 1
(drop drop
(i32.const 1) i32.const 2
) drop
(drop i32.const 3
(i32.const 2) drop
) i32.const 4
(drop drop
(i32.const 3) i32.const 5
) drop
(drop i32.const 6
(i32.const 4) drop
) i32.const 7
(drop drop
(i32.const 5) i32.const 8
) drop
(drop i32.const 9
(i32.const 6) drop
) i32.const 0
(drop drop
(i32.const 7) i32.const 1
) drop
(drop i32.const 2
(i32.const 8) drop
) i32.const 3
(drop drop
(i32.const 9) i32.const 4
) drop
(drop i32.const 5
(i32.const 0) drop
) i32.const 6
(drop drop
(i32.const 1) i32.const 7
) drop
(drop i32.const 8
(i32.const 2) drop
) i32.const 9
(drop drop
(i32.const 3) i32.const 10
) drop
(drop i32.const 11
(i32.const 4) drop
) i32.const 12
(drop drop
(i32.const 5) i32.const 13
) drop
(drop i32.const 14
(i32.const 6) drop
) i32.const 15
(drop drop
(i32.const 7) i32.const 10
) drop
(drop i32.const 11
(i32.const 8) drop
) i32.const 12
(drop drop
(i32.const 9) i32.const 13
) drop
(drop i32.const 14
(i32.const 10) drop
) i32.const 15
(drop drop
(i32.const 11) i32.const 0
) drop
(drop i32.const 1
(i32.const 12) drop
) i32.const 2
(drop drop
(i32.const 13) i32.const 3
) drop
(drop i32.const 4
(i32.const 14) drop
) i32.const 5
(drop drop
(i32.const 15) i32.const 6
) drop
(drop i32.const 7
(i32.const 10) drop
) i32.const 0
(drop drop
(i32.const 11) i32.const 1
) drop
(drop i32.const 1
(i32.const 12) drop
) i32.const 0
(drop drop
(i32.const 13)
)
(drop
(i32.const 14)
)
(drop
(i32.const 15)
)
(drop
(i32.const 0)
)
(drop
(i32.const 1)
)
(drop
(i32.const 2)
)
(drop
(i32.const 3)
)
(drop
(i32.const 4)
)
(drop
(i32.const 5)
)
(drop
(i32.const 6)
)
(drop
(i32.const 7)
)
(drop
(i32.const 0)
)
(drop
(i32.const 1)
)
(drop
(i32.const 1)
)
(drop
(i32.const 0)
)
) )
(func $null (; 1 ;) (type $v) (func $null (; 1 ;) (type $v)
) )

View File

@ -1,11 +1,11 @@
(module (module
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func)) (type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\n\00\00\00l\00o\00g\00i\00c\00a\00l\00.\00t\00s") (data (i32.const 8) "\n\00\00\00l\00o\00g\00i\00c\00a\00l\00.\00t\00s")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $logical/i (mut i32) (i32.const 0)) (global $logical/i (mut i32) (i32.const 0))
(global $logical/I (mut i64) (i64.const 0)) (global $logical/I (mut i64) (i64.const 0))
(global $logical/f (mut f32) (f32.const 0)) (global $logical/f (mut f32) (f32.const 0))
@ -13,153 +13,113 @@
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(start $start) (start $start)
(func $start (; 1 ;) (; has Stack IR ;) (type $v) (func $start (; 1 ;) (type $v)
(set_global $logical/i i32.const 2
(i32.const 2) set_global $logical/i
) get_global $logical/i
(if i32.const 2
(i32.ne i32.ne
(get_global $logical/i) if
(i32.const 2) i32.const 0
) i32.const 8
(block i32.const 12
(call $~lib/env/abort i32.const 0
(i32.const 0) call $~lib/env/abort
(i32.const 8) unreachable
(i32.const 12) end
(i32.const 0) i32.const 1
) set_global $logical/i
(unreachable) get_global $logical/i
) i32.const 1
) i32.ne
(set_global $logical/i if
(i32.const 1) i32.const 0
) i32.const 8
(if i32.const 15
(i32.ne i32.const 0
(get_global $logical/i) call $~lib/env/abort
(i32.const 1) unreachable
) end
(block i64.const 2
(call $~lib/env/abort set_global $logical/I
(i32.const 0) get_global $logical/I
(i32.const 8) i64.const 2
(i32.const 15) i64.ne
(i32.const 0) if
) i32.const 0
(unreachable) i32.const 8
) i32.const 20
) i32.const 0
(set_global $logical/I call $~lib/env/abort
(i64.const 2) unreachable
) end
(if i64.const 1
(i64.ne set_global $logical/I
(get_global $logical/I) get_global $logical/I
(i64.const 2) i64.const 1
) i64.ne
(block if
(call $~lib/env/abort i32.const 0
(i32.const 0) i32.const 8
(i32.const 8) i32.const 23
(i32.const 20) i32.const 0
(i32.const 0) call $~lib/env/abort
) unreachable
(unreachable) end
) f32.const 2
) set_global $logical/f
(set_global $logical/I get_global $logical/f
(i64.const 1) f32.const 2
) f32.ne
(if if
(i64.ne i32.const 0
(get_global $logical/I) i32.const 8
(i64.const 1) i32.const 28
) i32.const 0
(block call $~lib/env/abort
(call $~lib/env/abort unreachable
(i32.const 0) end
(i32.const 8) f32.const 1
(i32.const 23) set_global $logical/f
(i32.const 0) get_global $logical/f
) f32.const 1
(unreachable) f32.ne
) if
) i32.const 0
(set_global $logical/f i32.const 8
(f32.const 2) i32.const 31
) i32.const 0
(if call $~lib/env/abort
(f32.ne unreachable
(get_global $logical/f) end
(f32.const 2) f64.const 2
) set_global $logical/F
(block get_global $logical/F
(call $~lib/env/abort f64.const 2
(i32.const 0) f64.ne
(i32.const 8) if
(i32.const 28) i32.const 0
(i32.const 0) i32.const 8
) i32.const 36
(unreachable) i32.const 0
) call $~lib/env/abort
) unreachable
(set_global $logical/f end
(f32.const 1) f64.const 1
) set_global $logical/F
(if get_global $logical/F
(f32.ne f64.const 1
(get_global $logical/f) f64.ne
(f32.const 1) if
) i32.const 0
(block i32.const 8
(call $~lib/env/abort i32.const 39
(i32.const 0) i32.const 0
(i32.const 8) call $~lib/env/abort
(i32.const 31) unreachable
(i32.const 0) end
)
(unreachable)
)
)
(set_global $logical/F
(f64.const 2)
)
(if
(f64.ne
(get_global $logical/F)
(f64.const 2)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 36)
(i32.const 0)
)
(unreachable)
)
)
(set_global $logical/F
(f64.const 1)
)
(if
(f64.ne
(get_global $logical/F)
(f64.const 1)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 39)
(i32.const 0)
)
(unreachable)
)
)
) )
(func $null (; 2 ;) (; has Stack IR ;) (type $v) (func $null (; 2 ;) (type $v)
(nop) nop
) )
) )

View File

@ -1,11 +1,11 @@
(module (module
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func)) (type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\n\00\00\00l\00o\00g\00i\00c\00a\00l\00.\00t\00s\00") (data (i32.const 8) "\n\00\00\00l\00o\00g\00i\00c\00a\00l\00.\00t\00s\00")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $logical/i (mut i32) (i32.const 0)) (global $logical/i (mut i32) (i32.const 0))
(global $logical/I (mut i64) (i64.const 0)) (global $logical/I (mut i64) (i64.const 0))
(global $logical/f (mut f32) (f32.const 0)) (global $logical/f (mut f32) (f32.const 0))
@ -17,282 +17,232 @@
(func $start (; 1 ;) (type $v) (func $start (; 1 ;) (type $v)
(local $0 i32) (local $0 i32)
(local $1 f64) (local $1 f64)
(drop i32.const 0
(if (result i32) if (result i32)
(i32.const 0) unreachable
(unreachable) else
(i32.const 0) i32.const 0
) end
) drop
(drop f64.const 0
(if (result f64) f64.const 0
(f64.ne f64.ne
(f64.const 0) if (result f64)
(f64.const 0) unreachable
) else
(unreachable) f64.const 0
(f64.const 0) end
) drop
) i32.const 1
(drop if (result i32)
(if (result i32) i32.const 1
(i32.const 1) else
(i32.const 1) unreachable
(unreachable) end
) drop
) f64.const 1
(drop f64.const 0
(if (result f64) f64.ne
(f64.ne if (result f64)
(f64.const 1) f64.const 1
(f64.const 0) else
) unreachable
(f64.const 1) end
(unreachable) drop
) i32.const 1
) if (result i32)
(drop i32.const 2
(if (result i32) else
(tee_local $0 i32.const 1
(if (result i32) end
(i32.const 1) tee_local $0
(i32.const 2) if (result i32)
(i32.const 1) get_local $0
) else
) unreachable
(get_local $0) end
(unreachable) drop
) f64.const 1
) f64.const 0
(drop f64.ne
(if (result f64) if (result f64)
(f64.ne f64.const 2
(tee_local $1 else
(if (result f64) f64.const 1
(f64.ne end
(f64.const 1) tee_local $1
(f64.const 0) f64.const 0
) f64.ne
(f64.const 2) if (result f64)
(f64.const 1) get_local $1
) else
) unreachable
(f64.const 0) end
) drop
(get_local $1) i32.const 1
(unreachable) if (result i32)
) i32.const 2
) else
(set_global $logical/i i32.const 1
(if (result i32) end
(i32.const 1) set_global $logical/i
(i32.const 2) get_global $logical/i
(i32.const 1) i32.const 2
) i32.eq
) i32.eqz
(if if
(i32.eqz i32.const 0
(i32.eq i32.const 8
(get_global $logical/i) i32.const 12
(i32.const 2) i32.const 0
) call $~lib/env/abort
) unreachable
(block end
(call $~lib/env/abort i32.const 0
(i32.const 0) if (result i32)
(i32.const 8) i32.const 0
(i32.const 12) else
(i32.const 0) i32.const 1
) end
(unreachable) set_global $logical/i
) get_global $logical/i
) i32.const 1
(set_global $logical/i i32.eq
(if (result i32) i32.eqz
(i32.const 0) if
(i32.const 0) i32.const 0
(i32.const 1) i32.const 8
) i32.const 15
) i32.const 0
(if call $~lib/env/abort
(i32.eqz unreachable
(i32.eq end
(get_global $logical/i) i64.const 1
(i32.const 1) i64.const 0
) i64.ne
) if (result i64)
(block i64.const 2
(call $~lib/env/abort else
(i32.const 0) i64.const 1
(i32.const 8) end
(i32.const 15) set_global $logical/I
(i32.const 0) get_global $logical/I
) i64.const 2
(unreachable) i64.eq
) i32.eqz
) if
(set_global $logical/I i32.const 0
(if (result i64) i32.const 8
(i64.ne i32.const 20
(i64.const 1) i32.const 0
(i64.const 0) call $~lib/env/abort
) unreachable
(i64.const 2) end
(i64.const 1) i64.const 0
) i64.const 0
) i64.ne
(if if (result i64)
(i32.eqz i64.const 0
(i64.eq else
(get_global $logical/I) i64.const 1
(i64.const 2) end
) set_global $logical/I
) get_global $logical/I
(block i64.const 1
(call $~lib/env/abort i64.eq
(i32.const 0) i32.eqz
(i32.const 8) if
(i32.const 20) i32.const 0
(i32.const 0) i32.const 8
) i32.const 23
(unreachable) i32.const 0
) call $~lib/env/abort
) unreachable
(set_global $logical/I end
(if (result i64) f32.const 1
(i64.ne f32.const 0
(i64.const 0) f32.ne
(i64.const 0) if (result f32)
) f32.const 2
(i64.const 0) else
(i64.const 1) f32.const 1
) end
) set_global $logical/f
(if get_global $logical/f
(i32.eqz f32.const 2
(i64.eq f32.eq
(get_global $logical/I) i32.eqz
(i64.const 1) if
) i32.const 0
) i32.const 8
(block i32.const 28
(call $~lib/env/abort i32.const 0
(i32.const 0) call $~lib/env/abort
(i32.const 8) unreachable
(i32.const 23) end
(i32.const 0) f32.const 0
) f32.const 0
(unreachable) f32.ne
) if (result f32)
) f32.const 0
(set_global $logical/f else
(if (result f32) f32.const 1
(f32.ne end
(f32.const 1) set_global $logical/f
(f32.const 0) get_global $logical/f
) f32.const 1
(f32.const 2) f32.eq
(f32.const 1) i32.eqz
) if
) i32.const 0
(if i32.const 8
(i32.eqz i32.const 31
(f32.eq i32.const 0
(get_global $logical/f) call $~lib/env/abort
(f32.const 2) unreachable
) end
) f64.const 1
(block f64.const 0
(call $~lib/env/abort f64.ne
(i32.const 0) if (result f64)
(i32.const 8) f64.const 2
(i32.const 28) else
(i32.const 0) f64.const 1
) end
(unreachable) set_global $logical/F
) get_global $logical/F
) f64.const 2
(set_global $logical/f f64.eq
(if (result f32) i32.eqz
(f32.ne if
(f32.const 0) i32.const 0
(f32.const 0) i32.const 8
) i32.const 36
(f32.const 0) i32.const 0
(f32.const 1) call $~lib/env/abort
) unreachable
) end
(if f64.const 0
(i32.eqz f64.const 0
(f32.eq f64.ne
(get_global $logical/f) if (result f64)
(f32.const 1) f64.const 0
) else
) f64.const 1
(block end
(call $~lib/env/abort set_global $logical/F
(i32.const 0) get_global $logical/F
(i32.const 8) f64.const 1
(i32.const 31) f64.eq
(i32.const 0) i32.eqz
) if
(unreachable) i32.const 0
) i32.const 8
) i32.const 39
(set_global $logical/F i32.const 0
(if (result f64) call $~lib/env/abort
(f64.ne unreachable
(f64.const 1) end
(f64.const 0)
)
(f64.const 2)
(f64.const 1)
)
)
(if
(i32.eqz
(f64.eq
(get_global $logical/F)
(f64.const 2)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 36)
(i32.const 0)
)
(unreachable)
)
)
(set_global $logical/F
(if (result f64)
(f64.ne
(f64.const 0)
(f64.const 0)
)
(f64.const 0)
(f64.const 1)
)
)
(if
(i32.eqz
(f64.eq
(get_global $logical/F)
(f64.const 1)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 39)
(i32.const 0)
)
(unreachable)
)
)
) )
(func $null (; 2 ;) (type $v) (func $null (; 2 ;) (type $v)
) )

View File

@ -2,33 +2,28 @@
(type $iii (func (param i32 i32) (result i32))) (type $iii (func (param i32 i32) (result i32)))
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(global $main/code (mut i32) (i32.const 0)) (global $main/code (mut i32) (i32.const 0))
(global $~started (mut i32) (i32.const 0)) (global $~started (mut i32) (i32.const 0))
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(export "main" (func $main/main)) (export "main" (func $main/main))
(func $main/main (; 0 ;) (; has Stack IR ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $main/main (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(if get_global $~started
(i32.eqz i32.eqz
(get_global $~started) if
) call $start
(block i32.const 1
(call $start) set_global $~started
(set_global $~started end
(i32.const 1) get_global $main/code
)
)
)
(get_global $main/code)
) )
(func $start (; 1 ;) (; has Stack IR ;) (type $v) (func $start (; 1 ;) (type $v)
(set_global $main/code i32.const 1
(i32.const 1) set_global $main/code
)
) )
(func $null (; 2 ;) (; has Stack IR ;) (type $v) (func $null (; 2 ;) (type $v)
(nop) nop
) )
) )

View File

@ -2,7 +2,7 @@
(type $iii (func (param i32 i32) (result i32))) (type $iii (func (param i32 i32) (result i32)))
(type $v (func)) (type $v (func))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(global $main/code (mut i32) (i32.const 0)) (global $main/code (mut i32) (i32.const 0))
(global $~started (mut i32) (i32.const 0)) (global $~started (mut i32) (i32.const 0))
@ -11,23 +11,18 @@
(export "table" (table $0)) (export "table" (table $0))
(export "main" (func $main/main)) (export "main" (func $main/main))
(func $main/main (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $main/main (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(if get_global $~started
(i32.eqz i32.eqz
(get_global $~started) if
) call $start
(block i32.const 1
(call $start) set_global $~started
(set_global $~started end
(i32.const 1) get_global $main/code
)
)
)
(get_global $main/code)
) )
(func $start (; 1 ;) (type $v) (func $start (; 1 ;) (type $v)
(set_global $main/code i32.const 1
(i32.const 1) set_global $main/code
)
) )
(func $null (; 2 ;) (type $v) (func $null (; 2 ;) (type $v)
) )

View File

@ -5,12 +5,12 @@
(type $v (func)) (type $v (func))
(type $FUNCSIG$dd (func (param f64) (result f64))) (type $FUNCSIG$dd (func (param f64) (result f64)))
(memory $0 0) (memory $0 0)
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(export "computeLine" (func $../../examples/mandelbrot/assembly/index/computeLine)) (export "computeLine" (func $../../examples/mandelbrot/assembly/index/computeLine))
(func $~lib/math/NativeMath.log (; 0 ;) (; has Stack IR ;) (type $FF) (param $0 f64) (result f64) (func $~lib/math/NativeMath.log (; 0 ;) (type $FF) (param $0 f64) (result f64)
(local $1 i32) (local $1 i32)
(local $2 i32) (local $2 i32)
(local $3 i32) (local $3 i32)
@ -18,279 +18,191 @@
(local $5 f64) (local $5 f64)
(local $6 f64) (local $6 f64)
(local $7 f64) (local $7 f64)
(if get_local $0
(i32.eqz i64.reinterpret/f64
(tee_local $2 tee_local $4
(i32.lt_u i64.const 32
(tee_local $1 i64.shr_u
(i32.wrap/i64 i32.wrap/i64
(i64.shr_u tee_local $1
(tee_local $4 i32.const 1048576
(i64.reinterpret/f64 i32.lt_u
(get_local $0) tee_local $2
) i32.eqz
) if
(i64.const 32) get_local $1
) i32.const 31
) i32.shr_u
) set_local $2
(i32.const 1048576) end
) get_local $2
) if
) get_local $4
(set_local $2 i64.const 1
(i32.shr_u i64.shl
(get_local $1) i64.const 0
(i32.const 31) i64.eq
) if
) f64.const -1
) get_local $0
(if get_local $0
(get_local $2) f64.mul
(block f64.div
(if return
(i64.eq end
(i64.shl get_local $1
(get_local $4) i32.const 31
(i64.const 1) i32.shr_u
) if
(i64.const 0) get_local $0
) get_local $0
(return f64.sub
(f64.div f64.const 0
(f64.const -1) f64.div
(f64.mul return
(get_local $0) end
(get_local $0) i32.const -54
) set_local $3
) get_local $0
) f64.const 18014398509481984
) f64.mul
(if i64.reinterpret/f64
(i32.shr_u tee_local $4
(get_local $1) i64.const 32
(i32.const 31) i64.shr_u
) i32.wrap/i64
(return set_local $1
(f64.div else
(f64.sub get_local $1
(get_local $0) i32.const 2146435072
(get_local $0) i32.ge_u
) if
(f64.const 0) get_local $0
) return
) else
) get_local $1
(set_local $3 i32.const 1072693248
(i32.const -54) i32.eq
) tee_local $2
(set_local $1 if
(i32.wrap/i64 get_local $4
(i64.shr_u i64.const 32
(tee_local $4 i64.shl
(i64.reinterpret/f64 i64.const 0
(f64.mul i64.eq
(get_local $0) set_local $2
(f64.const 18014398509481984) end
) get_local $2
) if
) f64.const 0
(i64.const 32) return
) end
) end
) end
) get_local $3
(if get_local $1
(i32.ge_u i32.const 614242
(get_local $1) i32.add
(i32.const 2146435072) tee_local $1
) i32.const 20
(return i32.shr_s
(get_local $0) i32.const 1023
) i32.sub
(block i32.add
(if set_local $3
(tee_local $2 get_local $1
(i32.eq i32.const 1048575
(get_local $1) i32.and
(i32.const 1072693248) i32.const 1072079006
) i32.add
) i64.extend_u/i32
(set_local $2 i64.const 32
(i64.eq i64.shl
(i64.shl get_local $4
(get_local $4) i64.const 4294967295
(i64.const 32) i64.and
) i64.or
(i64.const 0) f64.reinterpret/i64
) f64.const 1
) f64.sub
) tee_local $5
(if f64.const 2
(get_local $2) get_local $5
(return f64.add
(f64.const 0) f64.div
) tee_local $6
) get_local $6
) f64.mul
) tee_local $7
) get_local $7
(set_local $3 f64.mul
(i32.add set_local $0
(get_local $3) get_local $6
(i32.sub f64.const 0.5
(i32.shr_s get_local $5
(tee_local $1 f64.mul
(i32.add get_local $5
(get_local $1) f64.mul
(i32.const 614242) tee_local $6
) get_local $7
) f64.const 0.6666666666666735
(i32.const 20) get_local $0
) f64.const 0.2857142874366239
(i32.const 1023) get_local $0
) f64.const 0.1818357216161805
) get_local $0
) f64.const 0.14798198605116586
(set_local $0 f64.mul
(f64.mul f64.add
(tee_local $7 f64.mul
(f64.mul f64.add
(tee_local $6 f64.mul
(f64.div f64.add
(tee_local $5 f64.mul
(f64.sub get_local $0
(f64.reinterpret/i64 f64.const 0.3999999999940942
(i64.or get_local $0
(i64.shl f64.const 0.22222198432149784
(i64.extend_u/i32 get_local $0
(i32.add f64.const 0.15313837699209373
(i32.and f64.mul
(get_local $1) f64.add
(i32.const 1048575) f64.mul
) f64.add
(i32.const 1072079006) f64.mul
) f64.add
) f64.add
(i64.const 32) f64.mul
) get_local $3
(i64.and f64.convert_s/i32
(get_local $4) tee_local $0
(i64.const 4294967295) f64.const 1.9082149292705877e-10
) f64.mul
) f64.add
) get_local $6
(f64.const 1) f64.sub
) get_local $5
) f64.add
(f64.add get_local $0
(f64.const 2) f64.const 0.6931471803691238
(get_local $5) f64.mul
) f64.add
)
)
(get_local $6)
)
)
(get_local $7)
)
)
(f64.add
(f64.add
(f64.sub
(f64.add
(f64.mul
(get_local $6)
(f64.add
(tee_local $6
(f64.mul
(f64.mul
(f64.const 0.5)
(get_local $5)
)
(get_local $5)
)
)
(f64.add
(f64.mul
(get_local $7)
(f64.add
(f64.const 0.6666666666666735)
(f64.mul
(get_local $0)
(f64.add
(f64.const 0.2857142874366239)
(f64.mul
(get_local $0)
(f64.add
(f64.const 0.1818357216161805)
(f64.mul
(get_local $0)
(f64.const 0.14798198605116586)
)
)
)
)
)
)
)
(f64.mul
(get_local $0)
(f64.add
(f64.const 0.3999999999940942)
(f64.mul
(get_local $0)
(f64.add
(f64.const 0.22222198432149784)
(f64.mul
(get_local $0)
(f64.const 0.15313837699209373)
)
)
)
)
)
)
)
)
(f64.mul
(tee_local $0
(f64.convert_s/i32
(get_local $3)
)
)
(f64.const 1.9082149292705877e-10)
)
)
(get_local $6)
)
(get_local $5)
)
(f64.mul
(get_local $0)
(f64.const 0.6931471803691238)
)
)
) )
(func $~lib/builtins/isFinite<f64> (; 1 ;) (; has Stack IR ;) (type $Fi) (param $0 f64) (result i32) (func $~lib/builtins/isFinite<f64> (; 1 ;) (type $Fi) (param $0 f64) (result i32)
(f64.eq get_local $0
(f64.sub get_local $0
(get_local $0) f64.sub
(get_local $0) f64.const 0
) f64.eq
(f64.const 0)
)
) )
(func $../../examples/mandelbrot/assembly/index/clamp<f64> (; 2 ;) (; has Stack IR ;) (type $FUNCSIG$dd) (param $0 f64) (result f64) (func $../../examples/mandelbrot/assembly/index/clamp<f64> (; 2 ;) (type $FUNCSIG$dd) (param $0 f64) (result f64)
(f64.min get_local $0
(f64.max f64.const 0
(get_local $0) f64.max
(f64.const 0) f64.const 1
) f64.min
(f64.const 1)
)
) )
(func $../../examples/mandelbrot/assembly/index/computeLine (; 3 ;) (; has Stack IR ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (func $../../examples/mandelbrot/assembly/index/computeLine (; 3 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32)
(local $4 f64) (local $4 f64)
(local $5 f64) (local $5 f64)
(local $6 f64) (local $6 f64)
@ -300,269 +212,186 @@
(local $10 f64) (local $10 f64)
(local $11 f64) (local $11 f64)
(local $12 f64) (local $12 f64)
(set_local $11 get_local $1
(f64.div f64.convert_u/i32
(tee_local $6 tee_local $6
(f64.convert_u/i32 f64.const 1.6
(get_local $1) f64.div
) set_local $11
) get_local $0
(f64.const 1.6) f64.convert_u/i32
) get_local $2
) f64.convert_u/i32
(set_local $9 tee_local $4
(f64.mul f64.const 2
(f64.sub f64.div
(f64.convert_u/i32 tee_local $8
(get_local $0) f64.sub
) f64.const 10
(tee_local $8 f64.const 3
(f64.div get_local $6
(tee_local $4 f64.mul
(f64.convert_u/i32 f64.const 4
(get_local $2) get_local $4
) f64.mul
) f64.min
(f64.const 2) f64.div
) tee_local $12
) f64.mul
) set_local $9
(tee_local $12 block $break|0
(f64.div loop $repeat|0
(f64.const 10) get_local $7
(f64.min get_local $1
(f64.mul i32.ge_u
(f64.const 3) br_if $break|0
(get_local $6) get_local $7
) f64.convert_u/i32
(f64.mul get_local $11
(f64.const 4) f64.sub
(get_local $4) get_local $12
) f64.mul
) set_local $10
) f64.const 0
) set_local $4
) f64.const 0
) set_local $5
(block $break|0 i32.const 0
(loop $repeat|0 set_local $2
(br_if $break|0 block $break|1
(i32.ge_u loop $continue|1
(get_local $7) get_local $4
(get_local $1) get_local $4
) f64.mul
) tee_local $6
(set_local $10 get_local $5
(f64.mul get_local $5
(f64.sub f64.mul
(f64.convert_u/i32 tee_local $8
(get_local $7) f64.add
) f64.const 4
(get_local $11) f64.le
) if
(get_local $12) f64.const 2
) get_local $4
) f64.mul
(set_local $4 get_local $5
(f64.const 0) f64.mul
) get_local $9
(set_local $5 f64.add
(f64.const 0) set_local $5
) get_local $6
(set_local $2 get_local $8
(i32.const 0) f64.sub
) get_local $10
(block $break|1 f64.add
(loop $continue|1 set_local $4
(if get_local $2
(f64.le get_local $3
(f64.add i32.ge_u
(tee_local $6 br_if $break|1
(f64.mul get_local $2
(get_local $4) i32.const 1
(get_local $4) i32.add
) set_local $2
) br $continue|1
(tee_local $8 end
(f64.mul end
(get_local $5) end
(get_local $5) block $break|2
) f64.const 8
) get_local $3
) f64.convert_u/i32
(f64.const 4) f64.min
) set_local $6
(block loop $repeat|2
(set_local $5 get_local $2
(f64.add f64.convert_u/i32
(f64.mul get_local $6
(f64.mul f64.lt
(f64.const 2) i32.eqz
(get_local $4) br_if $break|2
) get_local $4
(get_local $5) get_local $4
) f64.mul
(get_local $9) get_local $5
) get_local $5
) f64.mul
(set_local $4 f64.sub
(f64.add get_local $10
(f64.sub f64.add
(get_local $6) set_local $8
(get_local $8) f64.const 2
) get_local $4
(get_local $10) f64.mul
) get_local $5
) f64.mul
(br_if $break|1 get_local $9
(i32.ge_u f64.add
(get_local $2) set_local $5
(get_local $3) get_local $8
) set_local $4
) get_local $2
(set_local $2 i32.const 1
(i32.add i32.add
(get_local $2) set_local $2
(i32.const 1) br $repeat|2
) unreachable
) end
(br $continue|1) unreachable
) end
) get_local $4
) get_local $4
) f64.mul
(block $break|2 get_local $5
(set_local $6 get_local $5
(f64.min f64.mul
(f64.const 8) f64.add
(f64.convert_u/i32 f64.sqrt
(get_local $3) call $~lib/math/NativeMath.log
) call $~lib/math/NativeMath.log
) f64.const 0.6931471805599453
) f64.div
(loop $repeat|2 tee_local $6
(br_if $break|2 call $~lib/builtins/isFinite<f64>
(i32.eqz if (result i32)
(f64.lt f64.const 2047
(f64.convert_u/i32 get_local $2
(get_local $2) i32.const 1
) i32.add
(get_local $6) f64.convert_u/i32
) get_local $6
) f64.sub
) get_local $3
(set_local $8 f64.convert_u/i32
(f64.add f64.div
(f64.sub call $../../examples/mandelbrot/assembly/index/clamp<f64>
(f64.mul f64.mul
(get_local $4) i32.trunc_u/f64
(get_local $4) else
) i32.const 2047
(f64.mul end
(get_local $5) set_local $2
(get_local $5) get_local $0
) get_local $1
) i32.mul
(get_local $10) get_local $7
) i32.add
) i32.const 1
(set_local $5 i32.shl
(f64.add get_local $2
(f64.mul i32.store16
(f64.mul get_local $7
(f64.const 2) i32.const 1
(get_local $4) i32.add
) set_local $7
(get_local $5) br $repeat|0
) unreachable
(get_local $9) end
) unreachable
) end
(set_local $4
(get_local $8)
)
(set_local $2
(i32.add
(get_local $2)
(i32.const 1)
)
)
(br $repeat|2)
)
)
(set_local $2
(if (result i32)
(call $~lib/builtins/isFinite<f64>
(tee_local $6
(f64.div
(call $~lib/math/NativeMath.log
(call $~lib/math/NativeMath.log
(f64.sqrt
(f64.add
(f64.mul
(get_local $4)
(get_local $4)
)
(f64.mul
(get_local $5)
(get_local $5)
)
)
)
)
)
(f64.const 0.6931471805599453)
)
)
)
(i32.trunc_u/f64
(f64.mul
(f64.const 2047)
(call $../../examples/mandelbrot/assembly/index/clamp<f64>
(f64.div
(f64.sub
(f64.convert_u/i32
(i32.add
(get_local $2)
(i32.const 1)
)
)
(get_local $6)
)
(f64.convert_u/i32
(get_local $3)
)
)
)
)
)
(i32.const 2047)
)
)
(i32.store16
(i32.shl
(i32.add
(i32.mul
(get_local $0)
(get_local $1)
)
(get_local $7)
)
(i32.const 1)
)
(get_local $2)
)
(set_local $7
(i32.add
(get_local $7)
(i32.const 1)
)
)
(br $repeat|0)
)
)
) )
(func $null (; 4 ;) (; has Stack IR ;) (type $v) (func $null (; 4 ;) (type $v)
(nop) nop
) )
) )

File diff suppressed because it is too large Load Diff

View File

@ -2,65 +2,53 @@
(type $ii (func (param i32) (result i32))) (type $ii (func (param i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func)) (type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1) (memory $0 1)
(data (i32.const 8) "\0e\00\00\00m\00a\00n\00y\00-\00l\00o\00c\00a\00l\00s\00.\00t\00s") (data (i32.const 8) "\0e\00\00\00m\00a\00n\00y\00-\00l\00o\00c\00a\00l\00s\00.\00t\00s")
(table 1 anyfunc) (table $0 1 anyfunc)
(elem (i32.const 0) $null) (elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(export "memory" (memory $0)) (export "memory" (memory $0))
(export "table" (table $0)) (export "table" (table $0))
(export "testI32" (func $many-locals/testI32)) (export "testI32" (func $many-locals/testI32))
(export "testI8" (func $many-locals/testI8)) (export "testI8" (func $many-locals/testI8))
(start $start) (start $start)
(func $many-locals/testI32 (; 1 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (func $many-locals/testI32 (; 1 ;) (type $ii) (param $0 i32) (result i32)
(get_local $0) get_local $0
) )
(func $many-locals/testI8 (; 2 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32) (func $many-locals/testI8 (; 2 ;) (type $ii) (param $0 i32) (result i32)
(i32.shr_s get_local $0
(i32.shl i32.const 24
(get_local $0) i32.shl
(i32.const 24) i32.const 24
) i32.shr_s
(i32.const 24)
)
) )
(func $start (; 3 ;) (; has Stack IR ;) (type $v) (func $start (; 3 ;) (type $v)
(if i32.const 42
(i32.ne call $many-locals/testI32
(call $many-locals/testI32 i32.const 42
(i32.const 42) i32.ne
) if
(i32.const 42) i32.const 0
) i32.const 8
(block i32.const 133
(call $~lib/env/abort i32.const 0
(i32.const 0) call $~lib/env/abort
(i32.const 8) unreachable
(i32.const 133) end
(i32.const 0) i32.const 42
) call $many-locals/testI8
(unreachable) i32.const 42
) i32.ne
) if
(if i32.const 0
(i32.ne i32.const 8
(call $many-locals/testI8 i32.const 267
(i32.const 42) i32.const 0
) call $~lib/env/abort
(i32.const 42) unreachable
) end
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 267)
(i32.const 0)
)
(unreachable)
)
)
) )
(func $null (; 4 ;) (; has Stack IR ;) (type $v) (func $null (; 4 ;) (type $v)
(nop) nop
) )
) )

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More