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 $v (func))
(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" "sqrt" (func $~lib/bindings/Math/sqrt (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 "table" (table $0))
(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 $5 f64)
(local $6 f64)
@ -21,342 +21,191 @@
(local $10 f64)
(local $11 f64)
(local $12 f64)
;;@ assembly/index.ts:8:2
(set_local $11
;;@ assembly/index.ts:8:19
(f64.div
(tee_local $6
(f64.convert_u/i32
(get_local $1)
)
)
;;@ assembly/index.ts:8:27
(f64.const 1.6)
)
)
;;@ assembly/index.ts:11:2
(set_local $9
;;@ assembly/index.ts:11:18
(f64.mul
(f64.sub
(f64.convert_u/i32
(get_local $0)
)
;;@ assembly/index.ts:9:2
(tee_local $7
;;@ assembly/index.ts:9:19
(f64.div
(tee_local $4
(f64.convert_u/i32
(get_local $2)
)
)
;;@ assembly/index.ts:9:28
(f64.const 2)
)
)
)
;;@ assembly/index.ts:10:2
(tee_local $12
;;@ assembly/index.ts:10:14
(f64.div
(f64.const 10)
;;@ assembly/index.ts:10:21
(f64.min
;;@ assembly/index.ts:10:25
(f64.mul
(f64.const 3)
(get_local $6)
)
;;@ assembly/index.ts:10:36
(f64.mul
(f64.const 4)
(get_local $4)
)
)
)
)
)
)
;;@ assembly/index.ts:12:2
(block $break|0
(loop $repeat|0
(br_if $break|0
;;@ assembly/index.ts:12:23
(i32.ge_u
(get_local $8)
(get_local $1)
)
)
;;@ assembly/index.ts:13:4
(set_local $10
;;@ assembly/index.ts:13:15
(f64.mul
(f64.sub
(f64.convert_u/i32
(get_local $8)
)
(get_local $11)
)
(get_local $12)
)
)
(set_local $4
;;@ assembly/index.ts:16:13
(f64.const 0)
)
(set_local $5
;;@ assembly/index.ts:16:23
(f64.const 0)
)
;;@ assembly/index.ts:17:4
(set_local $2
;;@ assembly/index.ts:17:25
(i32.const 0)
)
;;@ assembly/index.ts:18:4
(block $break|1
(loop $continue|1
(if
;;@ assembly/index.ts:18:11
(f64.le
(f64.add
(tee_local $6
;;@ assembly/index.ts:18:19
(f64.mul
(get_local $4)
(get_local $4)
)
)
;;@ assembly/index.ts:18:30
(tee_local $7
;;@ assembly/index.ts:18:38
(f64.mul
(get_local $5)
(get_local $5)
)
)
)
;;@ assembly/index.ts:18:50
(f64.const 4)
)
(block
;;@ assembly/index.ts:20:6
(set_local $5
;;@ assembly/index.ts:20:11
(f64.add
(f64.mul
(f64.mul
(f64.const 2)
(get_local $4)
)
(get_local $5)
)
(get_local $9)
)
)
;;@ assembly/index.ts:21:6
(set_local $4
;;@ assembly/index.ts:19:18
(f64.add
(f64.sub
(get_local $6)
(get_local $7)
)
(get_local $10)
)
)
;;@ assembly/index.ts:22:30
(br_if $break|1
;;@ assembly/index.ts:22:10
(i32.ge_u
(get_local $2)
(get_local $3)
)
)
;;@ assembly/index.ts:23:6
(set_local $2
(i32.add
(get_local $2)
(i32.const 1)
)
)
(br $continue|1)
)
)
)
)
;;@ assembly/index.ts:27:4
(block $break|2
;;@ assembly/index.ts:27:9
(set_local $6
;;@ 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 $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)
)
)
get_local $1
f64.convert_u/i32
tee_local $6
f64.const 1.6
f64.div
set_local $11
get_local $0
f64.convert_u/i32
get_local $2
f64.convert_u/i32
tee_local $4
f64.const 2
f64.div
tee_local $7
f64.sub
f64.const 10
f64.const 3
get_local $6
f64.mul
f64.const 4
get_local $4
f64.mul
f64.min
f64.div
tee_local $12
f64.mul
set_local $9
block $break|0
loop $repeat|0
get_local $8
get_local $1
i32.ge_u
br_if $break|0
get_local $8
f64.convert_u/i32
get_local $11
f64.sub
get_local $12
f64.mul
set_local $10
f64.const 0
set_local $4
f64.const 0
set_local $5
i32.const 0
set_local $2
block $break|1
loop $continue|1
get_local $4
get_local $4
f64.mul
tee_local $6
get_local $5
get_local $5
f64.mul
tee_local $7
f64.add
f64.const 4
f64.le
if
f64.const 2
get_local $4
f64.mul
get_local $5
f64.mul
get_local $9
f64.add
set_local $5
get_local $6
get_local $7
f64.sub
get_local $10
f64.add
set_local $4
get_local $2
get_local $3
i32.ge_u
br_if $break|1
get_local $2
i32.const 1
i32.add
set_local $2
br $continue|1
end
end
end
block $break|2
f64.const 8
get_local $3
f64.convert_u/i32
f64.min
set_local $6
loop $repeat|2
get_local $2
f64.convert_u/i32
get_local $6
f64.lt
i32.eqz
br_if $break|2
get_local $4
get_local $4
f64.mul
get_local $5
get_local $5
f64.mul
f64.sub
get_local $10
f64.add
set_local $7
f64.const 2
get_local $4
f64.mul
get_local $5
f64.mul
get_local $9
f64.add
set_local $5
get_local $7
set_local $4
get_local $2
i32.const 1
i32.add
set_local $2
br $repeat|2
unreachable
end
unreachable
end
get_local $0
get_local $1
i32.mul
get_local $8
i32.add
i32.const 1
i32.shl
get_local $4
get_local $4
f64.mul
get_local $5
get_local $5
f64.mul
f64.add
call $~lib/bindings/Math/sqrt
call $~lib/bindings/Math/log
call $~lib/bindings/Math/log
get_global $~lib/bindings/Math/LN2
f64.div
tee_local $6
get_local $6
f64.sub
f64.const 0
f64.eq
if (result i32)
f64.const 2047
get_local $2
i32.const 1
i32.add
f64.convert_u/i32
get_local $6
f64.sub
get_local $3
f64.convert_u/i32
f64.div
f64.const 0
f64.max
f64.const 1
f64.min
f64.mul
i32.trunc_u/f64
else
i32.const 2047
end
tee_local $2
i32.store16
get_local $8
i32.const 1
i32.add
set_local $8
br $repeat|0
unreachable
end
unreachable
end
)
(func $null (; 3 ;) (; has Stack IR ;) (type $v)
(nop)
(func $null (; 3 ;) (type $v)
nop
)
)

View File

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

View File

@ -447,7 +447,7 @@ function asmFunc(global, env, buffer) {
pagesToAdd = pagesToAdd | 0;
var oldPages = __wasm_current_memory() | 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 newHEAP8 = new global.Int8Array(newBuffer);
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 $i (func (result i32)))
(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" "onTrue" (func $assembly/pson/onTrue))
(import "pson" "onFalse" (func $assembly/pson/onFalse))
@ -23,6 +20,9 @@
(import "pson" "onDouble" (func $assembly/pson/onDouble (param f64)))
(import "pson" "onString" (func $assembly/pson/onString (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))
(export "memory" (memory $0))
(export "table" (table $0))
@ -41,537 +41,304 @@
(export "onString" (func $assembly/pson/onString))
(export "onBinary" (func $assembly/pson/onBinary))
(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 $1 i32)
(local $2 i32)
(loop $continue|0
;;@ assembly/pson.ts:138:4
(set_local $0
(i32.or
(get_local $0)
;;@ assembly/pson.ts:137:17
(block (result i32)
(set_global $assembly/pson/offset
(i32.add
(tee_local $0
(get_global $assembly/pson/offset)
)
(i32.const 1)
)
)
;;@ assembly/pson.ts:138:13
(i32.shl
(i32.and
;;@ assembly/pson.ts:137:4
(tee_local $2
;;@ assembly/pson.ts:137:8
(i32.load8_u
(get_local $0)
)
)
;;@ assembly/pson.ts:138:23
(i32.const 127)
)
;;@ assembly/pson.ts:138:37
(block (result i32)
(set_local $1
(i32.add
(tee_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)
loop $continue|0
get_local $0
block (result i32)
get_global $assembly/pson/offset
tee_local $0
i32.const 1
i32.add
set_global $assembly/pson/offset
get_local $0
i32.load8_u
tee_local $2
i32.const 127
i32.and
block (result i32)
get_local $1
tee_local $0
i32.const 1
i32.add
set_local $1
get_local $0
i32.const 7
i32.mul
end
i32.shl
end
i32.or
set_local $0
get_local $2
i32.const 128
i32.and
br_if $continue|0
end
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 $1 i32)
(local $2 i64)
(loop $continue|0
;;@ assembly/pson.ts:149:4
(set_local $0
(i64.or
(get_local $0)
;;@ assembly/pson.ts:148:17
(block (result i64)
(set_global $assembly/pson/offset
(i32.add
(tee_local $1
(get_global $assembly/pson/offset)
)
(i32.const 1)
)
)
(set_local $2
(i64.add
(tee_local $0
;;@ assembly/pson.ts:149:37
(get_local $2)
)
(i64.const 1)
)
)
;;@ assembly/pson.ts:149:13
(i64.shl
(i64.extend_u/i32
;;@ assembly/pson.ts:149:19
(i32.and
;;@ assembly/pson.ts:148:4
(tee_local $1
;;@ assembly/pson.ts:148:8
(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)
loop $continue|0
get_local $0
block (result i64)
get_global $assembly/pson/offset
tee_local $1
i32.const 1
i32.add
set_global $assembly/pson/offset
get_local $2
tee_local $0
i64.const 1
i64.add
set_local $2
get_local $1
i32.load8_u
tee_local $1
i32.const 127
i32.and
i64.extend_u/i32
get_local $0
i64.const 7
i64.mul
i64.shl
end
i64.or
set_local $0
get_local $1
i32.const 128
i32.and
br_if $continue|0
end
get_local $0
)
(func $assembly/pson/decodeValue (; 16 ;) (; has Stack IR ;) (type $v)
(func $assembly/pson/decodeValue (; 16 ;) (type $v)
(local $0 i32)
(local $1 i32)
(local $2 i64)
;;@ assembly/pson.ts:49:2
(block $break|0
(block $case16|0
(block $case15|0
(block $case14|0
(block $case12|0
(block $case11|0
(block $case10|0
(block $case9|0
(block $case8|0
(block $case7|0
(block $case6|0
(block $case5|0
(block $case4|0
(block $case3|0
(block $case2|0
(block $case1|0
(if
;;@ assembly/pson.ts:46:28
(block (result i32)
(set_global $assembly/pson/offset
(i32.add
(tee_local $1
(get_global $assembly/pson/offset)
)
(i32.const 1)
)
)
(i32.ne
(tee_local $1
;;@ assembly/pson.ts:46:2
(tee_local $0
;;@ assembly/pson.ts:46:19
(i32.load8_u
(get_local $1)
)
)
)
(i32.const 240)
)
)
(block
(block $tablify|0
(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
(i32.sub
(get_local $1)
(i32.const 241)
)
)
)
(br_if $case14|0
(i32.or
(i32.eq
(get_local $1)
(i32.const 253)
)
(i32.eq
(get_local $1)
(i32.const 254)
)
)
)
(br_if $case15|0
(i32.eq
(get_local $1)
(i32.const 255)
)
)
(br $case16|0)
)
)
;;@ assembly/pson.ts:51:6
(call $assembly/pson/onNull)
;;@ assembly/pson.ts:52:6
(br $break|0)
)
;;@ assembly/pson.ts:55:6
(call $assembly/pson/onTrue)
;;@ assembly/pson.ts:56:6
(br $break|0)
)
;;@ assembly/pson.ts:59:6
(call $assembly/pson/onFalse)
;;@ assembly/pson.ts:60:6
(br $break|0)
)
;;@ assembly/pson.ts:63:6
(call $assembly/pson/onEObject)
;;@ assembly/pson.ts:64:6
(br $break|0)
)
;;@ assembly/pson.ts:67:6
(call $assembly/pson/onEArray)
;;@ assembly/pson.ts:68:6
(br $break|0)
)
;;@ assembly/pson.ts:71:6
(call $assembly/pson/onEString)
;;@ assembly/pson.ts:72:6
(br $break|0)
)
;;@ assembly/pson.ts:75:6
(call $assembly/pson/onObject
;;@ assembly/pson.ts:75:15
(tee_local $0
;;@ assembly/pson.ts:75:22
(call $assembly/pson/readVarint32)
)
)
(loop $continue|1
(if
;;@ assembly/pson.ts:76:13
(block (result i32)
(set_local $0
(i32.sub
(tee_local $1
(get_local $0)
)
(i32.const 1)
)
)
(get_local $1)
)
(block
;;@ assembly/pson.ts:77:8
(call $assembly/pson/decodeValue)
;;@ assembly/pson.ts:78:8
(call $assembly/pson/decodeValue)
(br $continue|1)
)
)
)
;;@ assembly/pson.ts:80:6
(br $break|0)
)
;;@ assembly/pson.ts:83:6
(call $assembly/pson/onArray
;;@ assembly/pson.ts:83:14
(tee_local $0
;;@ assembly/pson.ts:83:21
(call $assembly/pson/readVarint32)
)
)
(loop $continue|2
(if
;;@ assembly/pson.ts:84:13
(block (result i32)
(set_local $0
(i32.sub
(tee_local $1
(get_local $0)
)
(i32.const 1)
)
)
(get_local $1)
)
(block
;;@ assembly/pson.ts:84:21
(call $assembly/pson/decodeValue)
(br $continue|2)
)
)
)
;;@ assembly/pson.ts:85:6
(br $break|0)
)
;;@ assembly/pson.ts:88:6
(call $assembly/pson/onInteger
;;@ assembly/pson.ts:88:16
(i32.xor
(i32.shr_u
;;@ assembly/pson.ts:88:17
(tee_local $0
;;@ assembly/pson.ts:88:25
(call $assembly/pson/readVarint32)
)
;;@ assembly/pson.ts:88:44
(i32.const 1)
)
;;@ assembly/pson.ts:88:49
(i32.sub
(i32.const 0)
;;@ assembly/pson.ts:88:50
(i32.and
;;@ assembly/pson.ts:88:51
(get_local $0)
;;@ assembly/pson.ts:88:58
(i32.const 1)
)
)
)
)
;;@ assembly/pson.ts:89:6
(br $break|0)
)
;;@ assembly/pson.ts:93:6
(call $assembly/pson/onLong
;;@ 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)
)
)
)
)
)
block $break|0
block $case16|0
block $case15|0
block $case14|0
block $case12|0
block $case11|0
block $case10|0
block $case9|0
block $case8|0
block $case7|0
block $case6|0
block $case5|0
block $case4|0
block $case3|0
block $case2|0
block $case1|0
block (result i32)
get_global $assembly/pson/offset
tee_local $1
i32.const 1
i32.add
set_global $assembly/pson/offset
get_local $1
i32.load8_u
tee_local $0
tee_local $1
i32.const 240
i32.ne
end
if
block $tablify|0
get_local $1
i32.const 241
i32.sub
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.eq
get_local $1
i32.const 254
i32.eq
i32.or
br_if $case14|0
get_local $1
i32.const 255
i32.eq
br_if $case15|0
br $case16|0
end
call $assembly/pson/onNull
br $break|0
end
call $assembly/pson/onTrue
br $break|0
end
call $assembly/pson/onFalse
br $break|0
end
call $assembly/pson/onEObject
br $break|0
end
call $assembly/pson/onEArray
br $break|0
end
call $assembly/pson/onEString
br $break|0
end
call $assembly/pson/readVarint32
tee_local $0
call $assembly/pson/onObject
loop $continue|1
block (result i32)
get_local $0
tee_local $1
i32.const 1
i32.sub
set_local $0
get_local $1
end
if
call $assembly/pson/decodeValue
call $assembly/pson/decodeValue
br $continue|1
end
end
br $break|0
end
call $assembly/pson/readVarint32
tee_local $0
call $assembly/pson/onArray
loop $continue|2
block (result i32)
get_local $0
tee_local $1
i32.const 1
i32.sub
set_local $0
get_local $1
end
if
call $assembly/pson/decodeValue
br $continue|2
end
end
br $break|0
end
call $assembly/pson/readVarint32
tee_local $0
i32.const 1
i32.shr_u
i32.const 0
get_local $0
i32.const 1
i32.and
i32.sub
i32.xor
call $assembly/pson/onInteger
br $break|0
end
call $assembly/pson/readVarint64
tee_local $2
i64.const 1
i64.shr_u
i64.const 0
get_local $2
i64.const 1
i64.and
i64.sub
i64.xor
tee_local $2
i32.wrap/i64
get_local $2
i64.const 32
i64.shr_u
i32.wrap/i64
call $assembly/pson/onLong
br $break|0
end
get_global $assembly/pson/offset
f32.load
call $assembly/pson/onFloat
get_global $assembly/pson/offset
i32.const 4
i32.add
set_global $assembly/pson/offset
br $break|0
end
get_global $assembly/pson/offset
f64.load
call $assembly/pson/onDouble
get_global $assembly/pson/offset
i32.const 8
i32.add
set_global $assembly/pson/offset
br $break|0
end
call $assembly/pson/readVarint32
set_local $0
get_global $assembly/pson/offset
get_local $0
call $assembly/pson/onString
get_global $assembly/pson/offset
get_local $0
i32.add
set_global $assembly/pson/offset
br $break|0
end
unreachable
end
call $assembly/pson/readVarint32
set_local $0
get_global $assembly/pson/offset
get_local $0
call $assembly/pson/onBinary
get_global $assembly/pson/offset
get_local $0
i32.add
set_global $assembly/pson/offset
br $break|0
end
get_local $0
i32.const 239
i32.gt_u
if
unreachable
end
get_local $0
i32.const 1
i32.shr_u
i32.const 0
get_local $0
i32.const 1
i32.and
i32.sub
i32.xor
call $assembly/pson/onInteger
end
)
(func $assembly/pson/decode (; 17 ;) (; has Stack IR ;) (type $iv) (param $0 i32)
;;@ assembly/pson.ts:40:2
(set_global $assembly/pson/offset
;;@ assembly/pson.ts:40:11
(i32.const 0)
)
(loop $continue|0
(if
;;@ assembly/pson.ts:41:9
(i32.lt_u
(get_global $assembly/pson/offset)
;;@ assembly/pson.ts:41:18
(get_local $0)
)
(block
;;@ assembly/pson.ts:41:26
(call $assembly/pson/decodeValue)
(br $continue|0)
)
)
)
;;@ 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 $assembly/pson/decode (; 17 ;) (type $iv) (param $0 i32)
i32.const 0
set_global $assembly/pson/offset
loop $continue|0
get_global $assembly/pson/offset
get_local $0
i32.lt_u
if
call $assembly/pson/decodeValue
br $continue|0
end
end
get_global $assembly/pson/offset
get_local $0
i32.ne
if
unreachable
end
)
(func $null (; 18 ;) (; has Stack IR ;) (type $v)
(nop)
(func $null (; 18 ;) (type $v)
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": {
"@protobufjs/utf8": "^1.1.0",
"binaryen": "51.0.0-nightly.20181010",
"binaryen": "52.0.0-nightly.20181104",
"glob": "^7.1.3",
"long": "^4.0.0"
},

View File

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

View File

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

View File

@ -14,7 +14,7 @@ import "./i64";
import { Module } from "../../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) {

View File

@ -239,12 +239,6 @@ export class Module {
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 {
var module = new Module();
module.ref = _BinaryenModuleCreate();
@ -824,6 +818,9 @@ export class Module {
}
}
/** Unlimited memory constant. */
static readonly UNLIMITED_MEMORY: Index = <Index>-1;
setMemory(
initial: Index,
maximum: Index,

View File

@ -2,11 +2,11 @@
(type $i (func (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1)
(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)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $abi/condition (mut i32) (i32.const 0))
(global $abi/y (mut i32) (i32.const 0))
(export "memory" (memory $0))
@ -15,48 +15,40 @@
(export "exportedExported" (func $abi/exportedExported))
(export "exportedInternal" (func $abi/exportedInternal))
(start $start)
(func $abi/exported (; 1 ;) (; has Stack IR ;) (type $i) (result i32)
(i32.const -128)
(func $abi/exported (; 1 ;) (type $i) (result i32)
i32.const -128
)
(func $abi/exportedExported (; 2 ;) (; has Stack IR ;) (type $i) (result i32)
(call $abi/exported)
(func $abi/exportedExported (; 2 ;) (type $i) (result i32)
call $abi/exported
)
(func $abi/internal (; 3 ;) (; has Stack IR ;) (type $i) (result i32)
(i32.const 128)
(func $abi/internal (; 3 ;) (type $i) (result i32)
i32.const 128
)
(func $abi/exportedInternal (; 4 ;) (; has Stack IR ;) (type $i) (result i32)
(i32.shr_s
(i32.shl
(call $abi/internal)
(i32.const 24)
)
(i32.const 24)
)
(func $abi/exportedInternal (; 4 ;) (type $i) (result i32)
call $abi/internal
i32.const 24
i32.shl
i32.const 24
i32.shr_s
)
(func $start (; 5 ;) (; has Stack IR ;) (type $v)
(drop
(call $abi/internal)
)
(set_global $abi/condition
(i32.const 1)
)
(set_global $abi/y
(i32.const 0)
)
(if
(get_global $abi/y)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 65)
(i32.const 2)
)
(unreachable)
)
)
(func $start (; 5 ;) (type $v)
call $abi/internal
drop
i32.const 1
set_global $abi/condition
i32.const 0
set_global $abi/y
get_global $abi/y
if
i32.const 0
i32.const 8
i32.const 65
i32.const 2
call $~lib/env/abort
unreachable
end
)
(func $null (; 6 ;) (; has Stack IR ;) (type $v)
(nop)
(func $null (; 6 ;) (type $v)
nop
)
)

View File

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

View File

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

View File

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

View File

@ -3,11 +3,11 @@
(memory $0 1)
(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")
(table 1 anyfunc)
(table $0 1 anyfunc)
(elem (i32.const 0) $start)
(export "memory" (memory $0))
(export "table" (table $0))
(func $start (; 0 ;) (; has Stack IR ;) (type $v)
(nop)
(func $start (; 0 ;) (type $v)
nop
)
)

View File

@ -1,146 +1,111 @@
(module
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1)
(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")
(table 1 anyfunc)
(table $0 1 anyfunc)
(elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $HEAP_BASE i32 (i32.const 60))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $start (; 1 ;) (type $v)
(local $0 i32)
(if
(i32.eqz
(i32.const 1)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 1)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.const 1)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 2)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.gt_u
(i32.const 1)
(i32.const 0)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 3)
(i32.const 0)
)
(unreachable)
)
)
(if
(f64.eq
(f64.const 0.5)
(f64.const 0)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 4)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(f64.gt
(f64.const 0.5)
(f64.const 0.4)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 5)
(i32.const 0)
)
(unreachable)
)
)
(if
(i64.eqz
(i64.const 4294967296)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 6)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(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)
)
i32.const 1
i32.eqz
if
i32.const 0
i32.const 8
i32.const 1
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 1
i32.eqz
if
i32.const 0
i32.const 8
i32.const 2
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 1
i32.const 0
i32.gt_u
i32.eqz
if
i32.const 0
i32.const 8
i32.const 3
i32.const 0
call $~lib/env/abort
unreachable
end
f64.const 0.5
f64.const 0
f64.eq
if
i32.const 0
i32.const 8
i32.const 4
i32.const 0
call $~lib/env/abort
unreachable
end
f64.const 0.5
f64.const 0.4
f64.gt
i32.eqz
if
i32.const 0
i32.const 8
i32.const 5
i32.const 0
call $~lib/env/abort
unreachable
end
i64.const 4294967296
i64.eqz
if
i32.const 0
i32.const 8
i32.const 6
i32.const 0
call $~lib/env/abort
unreachable
end
i64.const 4294967296
i64.const 1
i64.gt_s
i32.eqz
if
i32.const 0
i32.const 8
i32.const 7
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 1
tee_local $0
if (result i32)
get_local $0
else
i32.const 32
i32.const 8
i32.const 10
i32.const 5
call $~lib/env/abort
unreachable
end
i32.eqz
if
unreachable
end
)
(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$d (func (result f64)))
(type $FUNCSIG$f (func (result f32)))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(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")
(table 1 anyfunc)
(table $0 1 anyfunc)
(elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $call-inferred/foo<i32> (; 1 ;) (; has Stack IR ;) (type $FUNCSIG$i) (result i32)
(i32.const 42)
(func $call-inferred/foo<i32> (; 1 ;) (type $FUNCSIG$i) (result i32)
i32.const 42
)
(func $call-inferred/foo<f64> (; 2 ;) (; has Stack IR ;) (type $FUNCSIG$d) (result f64)
(f64.const 42)
(func $call-inferred/foo<f64> (; 2 ;) (type $FUNCSIG$d) (result f64)
f64.const 42
)
(func $call-inferred/foo<f32> (; 3 ;) (; has Stack IR ;) (type $FUNCSIG$f) (result f32)
(f32.const 42)
(func $call-inferred/foo<f32> (; 3 ;) (type $FUNCSIG$f) (result f32)
f32.const 42
)
(func $start (; 4 ;) (; has Stack IR ;) (type $v)
(if
(i32.ne
(call $call-inferred/foo<i32>)
(i32.const 42)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 5)
(i32.const 0)
)
(unreachable)
)
)
(if
(f64.ne
(call $call-inferred/foo<f64>)
(f64.const 42)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 6)
(i32.const 0)
)
(unreachable)
)
)
(if
(f32.ne
(call $call-inferred/foo<f32>)
(f32.const 42)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 7)
(i32.const 0)
)
(unreachable)
)
)
(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 $start (; 4 ;) (type $v)
call $call-inferred/foo<i32>
i32.const 42
i32.ne
if
i32.const 0
i32.const 8
i32.const 5
i32.const 0
call $~lib/env/abort
unreachable
end
call $call-inferred/foo<f64>
f64.const 42
f64.ne
if
i32.const 0
i32.const 8
i32.const 6
i32.const 0
call $~lib/env/abort
unreachable
end
call $call-inferred/foo<f32>
f32.const 42
f32.ne
if
i32.const 0
i32.const 8
i32.const 7
i32.const 0
call $~lib/env/abort
unreachable
end
call $call-inferred/foo<f32>
f32.const 42
f32.ne
if
i32.const 0
i32.const 8
i32.const 13
i32.const 0
call $~lib/env/abort
unreachable
end
)
(func $null (; 5 ;) (; has Stack IR ;) (type $v)
(nop)
(func $null (; 5 ;) (type $v)
nop
)
)

View File

@ -4,104 +4,80 @@
(type $FF (func (param f64) (result f64)))
(type $ff (func (param f32) (result f32)))
(type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(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")
(table 1 anyfunc)
(table $0 1 anyfunc)
(elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $HEAP_BASE i32 (i32.const 44))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(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)
(get_local $0)
get_local $0
)
(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)
(get_local $0)
get_local $0
)
(func $start (; 5 ;) (type $v)
(if
(i32.eqz
(i32.eq
(call $call-inferred/foo<i32>
(i32.const 42)
)
(i32.const 42)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 5)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(f64.eq
(call $call-inferred/foo<f64>
(f64.const 42)
)
(f64.const 42)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 6)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(f32.eq
(call $call-inferred/foo<f32>
(f32.const 42)
)
(f32.const 42)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 7)
(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)
)
)
i32.const 42
call $call-inferred/foo<i32>
i32.const 42
i32.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 5
i32.const 0
call $~lib/env/abort
unreachable
end
f64.const 42
call $call-inferred/foo<f64>
f64.const 42
f64.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 6
i32.const 0
call $~lib/env/abort
unreachable
end
f32.const 42
call $call-inferred/foo<f32>
f32.const 42
f32.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 7
i32.const 0
call $~lib/env/abort
unreachable
end
f32.const 42
call $call-inferred/bar<f32>
f32.const 42
f32.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 13
i32.const 0
call $~lib/env/abort
unreachable
end
)
(func $null (; 6 ;) (type $v)
)

View File

@ -2,182 +2,142 @@
(type $iiii (func (param i32 i32 i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(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")
(table 2 anyfunc)
(table $0 2 anyfunc)
(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 $call-optional/optIndirect (mut i32) (i32.const 1))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $call-optional/opt (; 1 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(i32.add
(i32.add
(get_local $0)
(get_local $1)
)
(get_local $2)
)
(func $call-optional/opt (; 1 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
get_local $0
get_local $1
i32.add
get_local $2
i32.add
)
(func $call-optional/opt|trampoline (; 2 ;) (; has Stack IR ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(block $2of2
(block $1of2
(block $0of2
(block $outOfRange
(br_table $0of2 $1of2 $2of2 $outOfRange
(i32.sub
(get_global $~argc)
(i32.const 1)
)
)
)
(unreachable)
)
(set_local $1
(i32.const -1)
)
)
(set_local $2
(i32.const -2)
)
)
(call $call-optional/opt
(get_local $0)
(get_local $1)
(get_local $2)
)
(func $call-optional/opt|trampoline (; 2 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
block $2of2
block $1of2
block $0of2
block $outOfRange
get_global $~argc
i32.const 1
i32.sub
br_table $0of2 $1of2 $2of2 $outOfRange
end
unreachable
end
i32.const -1
set_local $1
end
i32.const -2
set_local $2
end
get_local $0
get_local $1
get_local $2
call $call-optional/opt
)
(func $start (; 3 ;) (; has Stack IR ;) (type $v)
(set_global $~argc
(i32.const 1)
)
(if
(call $call-optional/opt|trampoline
(i32.const 3)
(i32.const 0)
(i32.const 0)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 4)
(i32.const 0)
)
(unreachable)
)
)
(set_global $~argc
(i32.const 2)
)
(if
(i32.ne
(call $call-optional/opt|trampoline
(i32.const 3)
(i32.const 4)
(i32.const 0)
)
(i32.const 5)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 5)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.ne
(call $call-optional/opt
(i32.const 3)
(i32.const 4)
(i32.const 5)
)
(i32.const 12)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 6)
(i32.const 0)
)
(unreachable)
)
)
(set_global $~argc
(i32.const 1)
)
(if
(call_indirect (type $iiii)
(i32.const 3)
(i32.const 0)
(i32.const 0)
(get_global $call-optional/optIndirect)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 9)
(i32.const 0)
)
(unreachable)
)
)
(set_global $~argc
(i32.const 2)
)
(if
(i32.ne
(call_indirect (type $iiii)
(i32.const 3)
(i32.const 4)
(i32.const 0)
(get_global $call-optional/optIndirect)
)
(i32.const 5)
)
(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 $start (; 3 ;) (type $v)
i32.const 1
set_global $~argc
i32.const 3
i32.const 0
i32.const 0
call $call-optional/opt|trampoline
if
i32.const 0
i32.const 8
i32.const 4
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 2
set_global $~argc
i32.const 3
i32.const 4
i32.const 0
call $call-optional/opt|trampoline
i32.const 5
i32.ne
if
i32.const 0
i32.const 8
i32.const 5
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 3
i32.const 4
i32.const 5
call $call-optional/opt
i32.const 12
i32.ne
if
i32.const 0
i32.const 8
i32.const 6
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 1
set_global $~argc
i32.const 3
i32.const 0
i32.const 0
get_global $call-optional/optIndirect
call_indirect (type $iiii)
if
i32.const 0
i32.const 8
i32.const 9
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 2
set_global $~argc
i32.const 3
i32.const 4
i32.const 0
get_global $call-optional/optIndirect
call_indirect (type $iiii)
i32.const 5
i32.ne
if
i32.const 0
i32.const 8
i32.const 10
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 3
set_global $~argc
i32.const 3
i32.const 4
i32.const 5
get_global $call-optional/optIndirect
call_indirect (type $iiii)
i32.const 12
i32.ne
if
i32.const 0
i32.const 8
i32.const 11
i32.const 0
call $~lib/env/abort
unreachable
end
)
(func $null (; 4 ;) (; has Stack IR ;) (type $v)
(nop)
(func $null (; 4 ;) (type $v)
nop
)
)

View File

@ -2,11 +2,11 @@
(type $iiii (func (param i32 i32 i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(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")
(table 2 anyfunc)
(table $0 2 anyfunc)
(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 $call-optional/optIndirect (mut i32) (i32.const 1))
(global $HEAP_BASE i32 (i32.const 44))
@ -14,197 +14,149 @@
(export "table" (table $0))
(start $start)
(func $call-optional/opt (; 1 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(i32.add
(i32.add
(get_local $0)
(get_local $1)
)
(get_local $2)
)
get_local $0
get_local $1
i32.add
get_local $2
i32.add
)
(func $call-optional/opt|trampoline (; 2 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(block $2of2
(block $1of2
(block $0of2
(block $outOfRange
(br_table $0of2 $1of2 $2of2 $outOfRange
(i32.sub
(get_global $~argc)
(i32.const 1)
)
)
)
(unreachable)
)
(set_local $1
(i32.const -1)
)
)
(set_local $2
(i32.const -2)
)
)
(call $call-optional/opt
(get_local $0)
(get_local $1)
(get_local $2)
)
block $2of2
block $1of2
block $0of2
block $outOfRange
get_global $~argc
i32.const 1
i32.sub
br_table $0of2 $1of2 $2of2 $outOfRange
end
unreachable
end
i32.const -1
set_local $1
end
i32.const -2
set_local $2
end
get_local $0
get_local $1
get_local $2
call $call-optional/opt
)
(func $start (; 3 ;) (type $v)
(if
(i32.eqz
(i32.eq
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(call $call-optional/opt|trampoline
(i32.const 3)
(i32.const 0)
(i32.const 0)
)
)
(i32.const 0)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 4)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(block (result i32)
(set_global $~argc
(i32.const 2)
)
(call $call-optional/opt|trampoline
(i32.const 3)
(i32.const 4)
(i32.const 0)
)
)
(i32.const 5)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 5)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(call $call-optional/opt
(i32.const 3)
(i32.const 4)
(i32.const 5)
)
(i32.const 12)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 6)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(call_indirect (type $iiii)
(i32.const 3)
(i32.const 0)
(i32.const 0)
(get_global $call-optional/optIndirect)
)
)
(i32.const 0)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 9)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(block (result i32)
(set_global $~argc
(i32.const 2)
)
(call_indirect (type $iiii)
(i32.const 3)
(i32.const 4)
(i32.const 0)
(get_global $call-optional/optIndirect)
)
)
(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)
)
)
block (result i32)
i32.const 1
set_global $~argc
i32.const 3
i32.const 0
i32.const 0
call $call-optional/opt|trampoline
end
i32.const 0
i32.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 4
i32.const 0
call $~lib/env/abort
unreachable
end
block (result i32)
i32.const 2
set_global $~argc
i32.const 3
i32.const 4
i32.const 0
call $call-optional/opt|trampoline
end
i32.const 5
i32.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 5
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 3
i32.const 4
i32.const 5
call $call-optional/opt
i32.const 12
i32.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 6
i32.const 0
call $~lib/env/abort
unreachable
end
block (result i32)
i32.const 1
set_global $~argc
i32.const 3
i32.const 0
i32.const 0
get_global $call-optional/optIndirect
call_indirect (type $iiii)
end
i32.const 0
i32.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 9
i32.const 0
call $~lib/env/abort
unreachable
end
block (result i32)
i32.const 2
set_global $~argc
i32.const 3
i32.const 4
i32.const 0
get_global $call-optional/optIndirect
call_indirect (type $iiii)
end
i32.const 5
i32.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 10
i32.const 0
call $~lib/env/abort
unreachable
end
block (result i32)
i32.const 3
set_global $~argc
i32.const 3
i32.const 4
i32.const 5
get_global $call-optional/optIndirect
call_indirect (type $iiii)
end
i32.const 12
i32.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 11
i32.const 0
call $~lib/env/abort
unreachable
end
)
(func $null (; 4 ;) (type $v)
)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,53 +1,45 @@
(module
(type $v (func))
(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" "my.externalConstant" (global $declare/my.externalConstant i32))
(import "declare" "externalFunction" (func $declare/externalFunction))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(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 "table" (table $0))
(start $start)
(func $start (; 3 ;) (; has Stack IR ;) (type $v)
(call $declare/externalFunction)
(if
(i32.ne
(get_global $declare/externalConstant)
(i32.const 1)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 5)
(i32.const 0)
)
(unreachable)
)
)
(call $declare/my.externalFunction)
(if
(i32.ne
(get_global $declare/my.externalConstant)
(i32.const 2)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 13)
(i32.const 0)
)
(unreachable)
)
)
(func $start (; 3 ;) (type $v)
call $declare/externalFunction
get_global $declare/externalConstant
i32.const 1
i32.ne
if
i32.const 0
i32.const 8
i32.const 5
i32.const 0
call $~lib/env/abort
unreachable
end
call $declare/my.externalFunction
get_global $declare/my.externalConstant
i32.const 2
i32.ne
if
i32.const 0
i32.const 8
i32.const 13
i32.const 0
call $~lib/env/abort
unreachable
end
)
(func $null (; 4 ;) (; has Stack IR ;) (type $v)
(nop)
(func $null (; 4 ;) (type $v)
nop
)
)

View File

@ -1,56 +1,46 @@
(module
(type $v (func))
(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" "my.externalConstant" (global $declare/my.externalConstant i32))
(import "declare" "externalFunction" (func $declare/externalFunction))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(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))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $start (; 3 ;) (type $v)
(call $declare/externalFunction)
(if
(i32.eqz
(i32.eq
(get_global $declare/externalConstant)
(i32.const 1)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 5)
(i32.const 0)
)
(unreachable)
)
)
(call $declare/my.externalFunction)
(if
(i32.eqz
(i32.eq
(get_global $declare/my.externalConstant)
(i32.const 2)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 13)
(i32.const 0)
)
(unreachable)
)
)
call $declare/externalFunction
get_global $declare/externalConstant
i32.const 1
i32.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 5
i32.const 0
call $~lib/env/abort
unreachable
end
call $declare/my.externalFunction
get_global $declare/my.externalConstant
i32.const 2
i32.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 13
i32.const 0
call $~lib/env/abort
unreachable
end
)
(func $null (; 4 ;) (type $v)
)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,13 +1,13 @@
(module
(type $v (func))
(memory $0 0)
(table 1 anyfunc)
(elem (i32.const 0) $null)
(import "foo" "var" (global $external/var_ i32))
(import "external" "foo" (func $external/foo))
(import "external" "foo.bar" (func $external/foo.bar))
(import "external" "bar" (func $external/two))
(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))
(export "memory" (memory $0))
(export "table" (table $0))

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -3,74 +3,60 @@
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $iv (func (param i32)))
(type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(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")
(table 1 anyfunc)
(table $0 1 anyfunc)
(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))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $getter-setter/Foo.get:bar (; 1 ;) (; has Stack IR ;) (type $i) (result i32)
(get_global $getter-setter/Foo._bar)
(func $getter-setter/Foo.get:bar (; 1 ;) (type $i) (result i32)
get_global $getter-setter/Foo._bar
)
(func $getter-setter/Foo.set:bar (; 2 ;) (; has Stack IR ;) (type $iv) (param $0 i32)
(set_global $getter-setter/Foo._bar
(get_local $0)
)
(func $getter-setter/Foo.set:bar (; 2 ;) (type $iv) (param $0 i32)
get_local $0
set_global $getter-setter/Foo._bar
)
(func $start (; 3 ;) (; has Stack IR ;) (type $v)
(if
(call $getter-setter/Foo.get:bar)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 13)
(i32.const 0)
)
(unreachable)
)
)
(call $getter-setter/Foo.set:bar
(i32.const 1)
)
(if
(i32.ne
(call $getter-setter/Foo.get:bar)
(i32.const 1)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 15)
(i32.const 0)
)
(unreachable)
)
)
(call $getter-setter/Foo.set:bar
(i32.const 2)
)
(if
(i32.ne
(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 $start (; 3 ;) (type $v)
call $getter-setter/Foo.get:bar
if
i32.const 0
i32.const 8
i32.const 13
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 1
call $getter-setter/Foo.set:bar
call $getter-setter/Foo.get:bar
i32.const 1
i32.ne
if
i32.const 0
i32.const 8
i32.const 15
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 2
call $getter-setter/Foo.set:bar
call $getter-setter/Foo.get:bar
i32.const 2
i32.ne
if
i32.const 0
i32.const 8
i32.const 16
i32.const 0
call $~lib/env/abort
unreachable
end
)
(func $null (; 4 ;) (; has Stack IR ;) (type $v)
(nop)
(func $null (; 4 ;) (type $v)
nop
)
)

View File

@ -3,84 +3,66 @@
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $iv (func (param i32)))
(type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(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")
(table 1 anyfunc)
(table $0 1 anyfunc)
(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 $HEAP_BASE i32 (i32.const 44))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(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)
(set_global $getter-setter/Foo._bar
(get_local $0)
)
get_local $0
set_global $getter-setter/Foo._bar
)
(func $start (; 3 ;) (type $v)
(if
(i32.eqz
(i32.eq
(call $getter-setter/Foo.get:bar)
(i32.const 0)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 13)
(i32.const 0)
)
(unreachable)
)
)
(call $getter-setter/Foo.set:bar
(i32.const 1)
)
(if
(i32.eqz
(i32.eq
(call $getter-setter/Foo.get:bar)
(i32.const 1)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 15)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(block (result i32)
(call $getter-setter/Foo.set:bar
(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)
)
)
call $getter-setter/Foo.get:bar
i32.const 0
i32.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 13
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 1
call $getter-setter/Foo.set:bar
call $getter-setter/Foo.get:bar
i32.const 1
i32.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 15
i32.const 0
call $~lib/env/abort
unreachable
end
block (result i32)
i32.const 2
call $getter-setter/Foo.set:bar
call $getter-setter/Foo.get:bar
end
i32.const 2
i32.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 16
i32.const 0
call $~lib/env/abort
unreachable
end
)
(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 $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\05\00\00\00i\00f\00.\00t\00s")
(table 1 anyfunc)
(table $0 1 anyfunc)
(elem (i32.const 0) $null)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(export "memory" (memory $0))
(export "table" (table $0))
(export "ifThenElse" (func $if/ifThenElse))
@ -14,133 +14,104 @@
(export "ifThenElseBlock" (func $if/ifThenElse))
(export "ifAlwaysReturns" (func $if/ifAlwaysReturns))
(start $start)
(func $if/ifThenElse (; 1 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
(if (result i32)
(get_local $0)
(i32.const 1)
(i32.const 0)
)
(func $if/ifThenElse (; 1 ;) (type $ii) (param $0 i32) (result i32)
get_local $0
if (result i32)
i32.const 1
else
i32.const 0
end
)
(func $if/ifThen (; 2 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
(if
(get_local $0)
(return
(i32.const 1)
)
)
(i32.const 0)
(func $if/ifThen (; 2 ;) (type $ii) (param $0 i32) (result i32)
get_local $0
if
i32.const 1
return
end
i32.const 0
)
(func $if/ifAlwaysReturns (; 3 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
(if (result i32)
(get_local $0)
(i32.const 1)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 37)
(i32.const 4)
)
(unreachable)
)
)
(func $if/ifAlwaysReturns (; 3 ;) (type $ii) (param $0 i32) (result i32)
get_local $0
if (result i32)
i32.const 1
else
i32.const 0
i32.const 8
i32.const 37
i32.const 4
call $~lib/env/abort
unreachable
end
)
(func $start (; 4 ;) (; has Stack IR ;) (type $v)
(if
(call $if/ifThenElse
(i32.const 0)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 8)
(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 9)
(i32.const 0)
)
(unreachable)
)
)
(if
(call $if/ifThen
(i32.const 0)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 17)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.ne
(call $if/ifThen
(i32.const 1)
)
(i32.const 1)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 18)
(i32.const 0)
)
(unreachable)
)
)
(if
(call $if/ifThenElse
(i32.const 0)
)
(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 $start (; 4 ;) (type $v)
i32.const 0
call $if/ifThenElse
if
i32.const 0
i32.const 8
i32.const 8
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 1
call $if/ifThenElse
i32.const 1
i32.ne
if
i32.const 0
i32.const 8
i32.const 9
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 0
call $if/ifThen
if
i32.const 0
i32.const 8
i32.const 17
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 1
call $if/ifThen
i32.const 1
i32.ne
if
i32.const 0
i32.const 8
i32.const 18
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 0
call $if/ifThenElse
if
i32.const 0
i32.const 8
i32.const 30
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 1
call $if/ifThenElse
i32.const 1
i32.ne
if
i32.const 0
i32.const 8
i32.const 31
i32.const 0
call $~lib/env/abort
unreachable
end
)
(func $null (; 5 ;) (; has Stack IR ;) (type $v)
(nop)
(func $null (; 5 ;) (type $v)
nop
)
)

View File

@ -2,11 +2,11 @@
(type $ii (func (param i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1)
(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)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $HEAP_BASE i32 (i32.const 24))
(export "memory" (memory $0))
(export "table" (table $0))
@ -16,171 +16,132 @@
(export "ifAlwaysReturns" (func $if/ifAlwaysReturns))
(start $start)
(func $if/ifThenElse (; 1 ;) (type $ii) (param $0 i32) (result i32)
(if
(get_local $0)
(return
(i32.const 1)
)
(return
(i32.const 0)
)
)
(unreachable)
get_local $0
if
i32.const 1
return
else
i32.const 0
return
end
unreachable
unreachable
)
(func $if/ifThen (; 2 ;) (type $ii) (param $0 i32) (result i32)
(if
(get_local $0)
(return
(i32.const 1)
)
)
(i32.const 0)
get_local $0
if
i32.const 1
return
end
i32.const 0
)
(func $if/ifThenElseBlock (; 3 ;) (type $ii) (param $0 i32) (result i32)
(if
(get_local $0)
(return
(i32.const 1)
)
(return
(i32.const 0)
)
)
(unreachable)
get_local $0
if
i32.const 1
return
else
i32.const 0
return
end
unreachable
unreachable
)
(func $if/ifAlwaysReturns (; 4 ;) (type $ii) (param $0 i32) (result i32)
(if
(get_local $0)
(return
(i32.const 1)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 37)
(i32.const 4)
)
(unreachable)
)
)
(unreachable)
get_local $0
if
i32.const 1
return
else
i32.const 0
i32.const 8
i32.const 37
i32.const 4
call $~lib/env/abort
unreachable
end
unreachable
unreachable
)
(func $start (; 5 ;) (type $v)
(if
(i32.eqz
(i32.eq
(call $if/ifThenElse
(i32.const 0)
)
(i32.const 0)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 8)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(call $if/ifThenElse
(i32.const 1)
)
(i32.const 1)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 9)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(call $if/ifThen
(i32.const 0)
)
(i32.const 0)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 17)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(call $if/ifThen
(i32.const 1)
)
(i32.const 1)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 18)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(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)
)
)
i32.const 0
call $if/ifThenElse
i32.const 0
i32.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 8
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 1
call $if/ifThenElse
i32.const 1
i32.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 9
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 0
call $if/ifThen
i32.const 0
i32.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 17
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 1
call $if/ifThen
i32.const 1
i32.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 18
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 0
call $if/ifThenElseBlock
i32.const 0
i32.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 30
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 1
call $if/ifThenElseBlock
i32.const 1
i32.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 31
i32.const 0
call $~lib/env/abort
unreachable
end
)
(func $null (; 6 ;) (type $v)
)

View File

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

View File

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

View File

@ -6,7 +6,7 @@
(type $F (func (result f64)))
(memory $0 1)
(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)
(global $infer-type/ri (mut i32) (i32.const 0))
(global $infer-type/rI (mut i64) (i64.const 0))
@ -15,52 +15,46 @@
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $infer-type/locals (; 0 ;) (; has Stack IR ;) (type $v)
(nop)
(func $infer-type/locals (; 0 ;) (type $v)
nop
)
(func $infer-type/reti (; 1 ;) (; has Stack IR ;) (type $i) (result i32)
(i32.const 0)
(func $infer-type/reti (; 1 ;) (type $i) (result i32)
i32.const 0
)
(func $infer-type/retI (; 2 ;) (; has Stack IR ;) (type $I) (result i64)
(i64.const 0)
(func $infer-type/retI (; 2 ;) (type $I) (result i64)
i64.const 0
)
(func $infer-type/retf (; 3 ;) (; has Stack IR ;) (type $f) (result f32)
(f32.const 0)
(func $infer-type/retf (; 3 ;) (type $f) (result f32)
f32.const 0
)
(func $infer-type/refF (; 4 ;) (; has Stack IR ;) (type $F) (result f64)
(f64.const 0)
(func $infer-type/refF (; 4 ;) (type $F) (result f64)
f64.const 0
)
(func $start (; 5 ;) (; has Stack IR ;) (type $v)
(func $start (; 5 ;) (type $v)
(local $0 i32)
(call $infer-type/locals)
(set_global $infer-type/ri
(call $infer-type/reti)
)
(set_global $infer-type/rI
(call $infer-type/retI)
)
(set_global $infer-type/rf
(call $infer-type/retf)
)
(set_global $infer-type/rF
(call $infer-type/refF)
)
(block $break|0
(loop $repeat|0
(br_if $break|0
(i32.ge_s
(get_local $0)
(i32.const 10)
)
)
(set_local $0
(i32.add
(get_local $0)
(i32.const 1)
)
)
(br $repeat|0)
)
)
call $infer-type/locals
call $infer-type/reti
set_global $infer-type/ri
call $infer-type/retI
set_global $infer-type/rI
call $infer-type/retf
set_global $infer-type/rf
call $infer-type/refF
set_global $infer-type/rF
block $break|0
loop $repeat|0
get_local $0
i32.const 10
i32.ge_s
br_if $break|0
get_local $0
i32.const 1
i32.add
set_local $0
br $repeat|0
unreachable
end
unreachable
end
)
)

View File

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

View File

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

View File

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

View File

@ -3,64 +3,54 @@
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func))
(type $ii (func (param i32) (result i32)))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1)
(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)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $~argc (mut i32) (i32.const 0))
(export "memory" (memory $0))
(export "table" (table $0))
(export "test" (func $inlining/test))
(start $start)
(func $inlining/test (; 1 ;) (; has Stack IR ;) (type $i) (result i32)
(i32.const 3)
(func $inlining/test (; 1 ;) (type $i) (result i32)
i32.const 3
)
(func $inlining/test_funcs~anonymous|1 (; 2 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
(get_local $0)
(func $inlining/test_funcs~anonymous|1 (; 2 ;) (type $ii) (param $0 i32) (result i32)
get_local $0
)
(func $inlining/test_funcs (; 3 ;) (; has Stack IR ;) (type $v)
(set_global $~argc
(i32.const 1)
)
(if
(i32.ne
(call_indirect (type $ii)
(i32.const 2)
(i32.const 1)
)
(i32.const 2)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 68)
(i32.const 2)
)
(unreachable)
)
)
(func $inlining/test_funcs (; 3 ;) (type $v)
i32.const 1
set_global $~argc
i32.const 2
i32.const 1
call_indirect (type $ii)
i32.const 2
i32.ne
if
i32.const 0
i32.const 8
i32.const 68
i32.const 2
call $~lib/env/abort
unreachable
end
)
(func $start (; 4 ;) (; has Stack IR ;) (type $v)
(if
(i32.ne
(call $inlining/test)
(i32.const 3)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 10)
(i32.const 0)
)
(unreachable)
)
)
(call $inlining/test_funcs)
(func $start (; 4 ;) (type $v)
call $inlining/test
i32.const 3
i32.ne
if
i32.const 0
i32.const 8
i32.const 10
i32.const 0
call $~lib/env/abort
unreachable
end
call $inlining/test_funcs
)
(func $null (; 5 ;) (; has Stack IR ;) (type $v)
(nop)
(func $null (; 5 ;) (type $v)
nop
)
)

View File

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

View File

@ -2,91 +2,73 @@
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func))
(type $FUNCSIG$i (func (result i32)))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1)
(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)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $instanceof/an (mut i32) (i32.const 0))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $instanceof/isI32<i32> (; 1 ;) (; has Stack IR ;) (type $FUNCSIG$i) (result i32)
(i32.const 1)
(func $instanceof/isI32<i32> (; 1 ;) (type $FUNCSIG$i) (result i32)
i32.const 1
)
(func $instanceof/isI32<f64> (; 2 ;) (; has Stack IR ;) (type $FUNCSIG$i) (result i32)
(i32.const 0)
(func $instanceof/isI32<f64> (; 2 ;) (type $FUNCSIG$i) (result i32)
i32.const 0
)
(func $start (; 3 ;) (; has Stack IR ;) (type $v)
(if
(i32.eqz
(call $instanceof/isI32<i32>)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 38)
(i32.const 0)
)
(unreachable)
)
)
(if
(call $instanceof/isI32<f64>)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 39)
(i32.const 0)
)
(unreachable)
)
)
(if
(call $instanceof/isI32<f64>)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 40)
(i32.const 0)
)
(unreachable)
)
)
(if
(get_global $instanceof/an)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 43)
(i32.const 0)
)
(unreachable)
)
)
(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 $start (; 3 ;) (type $v)
call $instanceof/isI32<i32>
i32.eqz
if
i32.const 0
i32.const 8
i32.const 38
i32.const 0
call $~lib/env/abort
unreachable
end
call $instanceof/isI32<f64>
if
i32.const 0
i32.const 8
i32.const 39
i32.const 0
call $~lib/env/abort
unreachable
end
call $instanceof/isI32<f64>
if
i32.const 0
i32.const 8
i32.const 40
i32.const 0
call $~lib/env/abort
unreachable
end
get_global $instanceof/an
if
i32.const 0
i32.const 8
i32.const 43
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 1
set_global $instanceof/an
get_global $instanceof/an
i32.eqz
if
i32.const 0
i32.const 8
i32.const 46
i32.const 0
call $~lib/env/abort
unreachable
end
)
(func $null (; 4 ;) (; has Stack IR ;) (type $v)
(nop)
(func $null (; 4 ;) (type $v)
nop
)
)

View File

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

View File

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

View File

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

View File

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

View File

@ -1,145 +1,101 @@
(module
(type $v (func))
(memory $0 0)
(table 1 anyfunc)
(table $0 1 anyfunc)
(elem (i32.const 0) $null)
(global $HEAP_BASE i32 (i32.const 8))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $start (; 0 ;) (type $v)
(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 8)
)
(drop
(i32.const 9)
)
(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 8)
)
(drop
(i32.const 9)
)
(drop
(i32.const 10)
)
(drop
(i32.const 11)
)
(drop
(i32.const 12)
)
(drop
(i32.const 13)
)
(drop
(i32.const 14)
)
(drop
(i32.const 15)
)
(drop
(i32.const 10)
)
(drop
(i32.const 11)
)
(drop
(i32.const 12)
)
(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)
)
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 8
drop
i32.const 9
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 8
drop
i32.const 9
drop
i32.const 10
drop
i32.const 11
drop
i32.const 12
drop
i32.const 13
drop
i32.const 14
drop
i32.const 15
drop
i32.const 10
drop
i32.const 11
drop
i32.const 12
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
drop
)
(func $null (; 1 ;) (type $v)
)

View File

@ -1,11 +1,11 @@
(module
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1)
(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)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $logical/i (mut i32) (i32.const 0))
(global $logical/I (mut i64) (i64.const 0))
(global $logical/f (mut f32) (f32.const 0))
@ -13,153 +13,113 @@
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $start (; 1 ;) (; has Stack IR ;) (type $v)
(set_global $logical/i
(i32.const 2)
)
(if
(i32.ne
(get_global $logical/i)
(i32.const 2)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 12)
(i32.const 0)
)
(unreachable)
)
)
(set_global $logical/i
(i32.const 1)
)
(if
(i32.ne
(get_global $logical/i)
(i32.const 1)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 15)
(i32.const 0)
)
(unreachable)
)
)
(set_global $logical/I
(i64.const 2)
)
(if
(i64.ne
(get_global $logical/I)
(i64.const 2)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 20)
(i32.const 0)
)
(unreachable)
)
)
(set_global $logical/I
(i64.const 1)
)
(if
(i64.ne
(get_global $logical/I)
(i64.const 1)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 23)
(i32.const 0)
)
(unreachable)
)
)
(set_global $logical/f
(f32.const 2)
)
(if
(f32.ne
(get_global $logical/f)
(f32.const 2)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 28)
(i32.const 0)
)
(unreachable)
)
)
(set_global $logical/f
(f32.const 1)
)
(if
(f32.ne
(get_global $logical/f)
(f32.const 1)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 31)
(i32.const 0)
)
(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 $start (; 1 ;) (type $v)
i32.const 2
set_global $logical/i
get_global $logical/i
i32.const 2
i32.ne
if
i32.const 0
i32.const 8
i32.const 12
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 1
set_global $logical/i
get_global $logical/i
i32.const 1
i32.ne
if
i32.const 0
i32.const 8
i32.const 15
i32.const 0
call $~lib/env/abort
unreachable
end
i64.const 2
set_global $logical/I
get_global $logical/I
i64.const 2
i64.ne
if
i32.const 0
i32.const 8
i32.const 20
i32.const 0
call $~lib/env/abort
unreachable
end
i64.const 1
set_global $logical/I
get_global $logical/I
i64.const 1
i64.ne
if
i32.const 0
i32.const 8
i32.const 23
i32.const 0
call $~lib/env/abort
unreachable
end
f32.const 2
set_global $logical/f
get_global $logical/f
f32.const 2
f32.ne
if
i32.const 0
i32.const 8
i32.const 28
i32.const 0
call $~lib/env/abort
unreachable
end
f32.const 1
set_global $logical/f
get_global $logical/f
f32.const 1
f32.ne
if
i32.const 0
i32.const 8
i32.const 31
i32.const 0
call $~lib/env/abort
unreachable
end
f64.const 2
set_global $logical/F
get_global $logical/F
f64.const 2
f64.ne
if
i32.const 0
i32.const 8
i32.const 36
i32.const 0
call $~lib/env/abort
unreachable
end
f64.const 1
set_global $logical/F
get_global $logical/F
f64.const 1
f64.ne
if
i32.const 0
i32.const 8
i32.const 39
i32.const 0
call $~lib/env/abort
unreachable
end
)
(func $null (; 2 ;) (; has Stack IR ;) (type $v)
(nop)
(func $null (; 2 ;) (type $v)
nop
)
)

View File

@ -1,11 +1,11 @@
(module
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1)
(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)
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $logical/i (mut i32) (i32.const 0))
(global $logical/I (mut i64) (i64.const 0))
(global $logical/f (mut f32) (f32.const 0))
@ -17,282 +17,232 @@
(func $start (; 1 ;) (type $v)
(local $0 i32)
(local $1 f64)
(drop
(if (result i32)
(i32.const 0)
(unreachable)
(i32.const 0)
)
)
(drop
(if (result f64)
(f64.ne
(f64.const 0)
(f64.const 0)
)
(unreachable)
(f64.const 0)
)
)
(drop
(if (result i32)
(i32.const 1)
(i32.const 1)
(unreachable)
)
)
(drop
(if (result f64)
(f64.ne
(f64.const 1)
(f64.const 0)
)
(f64.const 1)
(unreachable)
)
)
(drop
(if (result i32)
(tee_local $0
(if (result i32)
(i32.const 1)
(i32.const 2)
(i32.const 1)
)
)
(get_local $0)
(unreachable)
)
)
(drop
(if (result f64)
(f64.ne
(tee_local $1
(if (result f64)
(f64.ne
(f64.const 1)
(f64.const 0)
)
(f64.const 2)
(f64.const 1)
)
)
(f64.const 0)
)
(get_local $1)
(unreachable)
)
)
(set_global $logical/i
(if (result i32)
(i32.const 1)
(i32.const 2)
(i32.const 1)
)
)
(if
(i32.eqz
(i32.eq
(get_global $logical/i)
(i32.const 2)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 12)
(i32.const 0)
)
(unreachable)
)
)
(set_global $logical/i
(if (result i32)
(i32.const 0)
(i32.const 0)
(i32.const 1)
)
)
(if
(i32.eqz
(i32.eq
(get_global $logical/i)
(i32.const 1)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 15)
(i32.const 0)
)
(unreachable)
)
)
(set_global $logical/I
(if (result i64)
(i64.ne
(i64.const 1)
(i64.const 0)
)
(i64.const 2)
(i64.const 1)
)
)
(if
(i32.eqz
(i64.eq
(get_global $logical/I)
(i64.const 2)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 20)
(i32.const 0)
)
(unreachable)
)
)
(set_global $logical/I
(if (result i64)
(i64.ne
(i64.const 0)
(i64.const 0)
)
(i64.const 0)
(i64.const 1)
)
)
(if
(i32.eqz
(i64.eq
(get_global $logical/I)
(i64.const 1)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 23)
(i32.const 0)
)
(unreachable)
)
)
(set_global $logical/f
(if (result f32)
(f32.ne
(f32.const 1)
(f32.const 0)
)
(f32.const 2)
(f32.const 1)
)
)
(if
(i32.eqz
(f32.eq
(get_global $logical/f)
(f32.const 2)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 28)
(i32.const 0)
)
(unreachable)
)
)
(set_global $logical/f
(if (result f32)
(f32.ne
(f32.const 0)
(f32.const 0)
)
(f32.const 0)
(f32.const 1)
)
)
(if
(i32.eqz
(f32.eq
(get_global $logical/f)
(f32.const 1)
)
)
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 8)
(i32.const 31)
(i32.const 0)
)
(unreachable)
)
)
(set_global $logical/F
(if (result f64)
(f64.ne
(f64.const 1)
(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)
)
)
i32.const 0
if (result i32)
unreachable
else
i32.const 0
end
drop
f64.const 0
f64.const 0
f64.ne
if (result f64)
unreachable
else
f64.const 0
end
drop
i32.const 1
if (result i32)
i32.const 1
else
unreachable
end
drop
f64.const 1
f64.const 0
f64.ne
if (result f64)
f64.const 1
else
unreachable
end
drop
i32.const 1
if (result i32)
i32.const 2
else
i32.const 1
end
tee_local $0
if (result i32)
get_local $0
else
unreachable
end
drop
f64.const 1
f64.const 0
f64.ne
if (result f64)
f64.const 2
else
f64.const 1
end
tee_local $1
f64.const 0
f64.ne
if (result f64)
get_local $1
else
unreachable
end
drop
i32.const 1
if (result i32)
i32.const 2
else
i32.const 1
end
set_global $logical/i
get_global $logical/i
i32.const 2
i32.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 12
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 0
if (result i32)
i32.const 0
else
i32.const 1
end
set_global $logical/i
get_global $logical/i
i32.const 1
i32.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 15
i32.const 0
call $~lib/env/abort
unreachable
end
i64.const 1
i64.const 0
i64.ne
if (result i64)
i64.const 2
else
i64.const 1
end
set_global $logical/I
get_global $logical/I
i64.const 2
i64.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 20
i32.const 0
call $~lib/env/abort
unreachable
end
i64.const 0
i64.const 0
i64.ne
if (result i64)
i64.const 0
else
i64.const 1
end
set_global $logical/I
get_global $logical/I
i64.const 1
i64.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 23
i32.const 0
call $~lib/env/abort
unreachable
end
f32.const 1
f32.const 0
f32.ne
if (result f32)
f32.const 2
else
f32.const 1
end
set_global $logical/f
get_global $logical/f
f32.const 2
f32.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 28
i32.const 0
call $~lib/env/abort
unreachable
end
f32.const 0
f32.const 0
f32.ne
if (result f32)
f32.const 0
else
f32.const 1
end
set_global $logical/f
get_global $logical/f
f32.const 1
f32.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 31
i32.const 0
call $~lib/env/abort
unreachable
end
f64.const 1
f64.const 0
f64.ne
if (result f64)
f64.const 2
else
f64.const 1
end
set_global $logical/F
get_global $logical/F
f64.const 2
f64.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 36
i32.const 0
call $~lib/env/abort
unreachable
end
f64.const 0
f64.const 0
f64.ne
if (result f64)
f64.const 0
else
f64.const 1
end
set_global $logical/F
get_global $logical/F
f64.const 1
f64.eq
i32.eqz
if
i32.const 0
i32.const 8
i32.const 39
i32.const 0
call $~lib/env/abort
unreachable
end
)
(func $null (; 2 ;) (type $v)
)

View File

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

View File

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

View File

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