mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-21 18:51:43 +00:00
Rework resolver (#489)
* Rework IR and resolver to use nested lookup tables * Integrate types into IR * Make components prefer IR, slimmed down AST * Implement `export *` * Add `@lazy` annotation and remove `--noTreeShaking` * Add `@start` annotation and remove magic `main` * Related refactoring, cleanup and docs
This commit is contained in:
@ -9,34 +9,17 @@
|
||||
(elem (i32.const 0) $null)
|
||||
(global $abi/condition (mut i32) (i32.const 0))
|
||||
(global $abi/y (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 24))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 24))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "exported" (func $abi/exported))
|
||||
(export "exportedExported" (func $abi/exportedExported))
|
||||
(export "exportedInternal" (func $abi/exportedInternal))
|
||||
(start $start)
|
||||
(func $abi/exported (; 1 ;) (type $i) (result i32)
|
||||
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
|
||||
)
|
||||
(func $abi/internal (; 3 ;) (type $i) (result i32)
|
||||
(func $abi/internal (; 1 ;) (type $i) (result i32)
|
||||
i32.const 128
|
||||
)
|
||||
(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 ;) (type $_)
|
||||
(func $start:abi (; 2 ;) (type $_)
|
||||
(local $0 i32)
|
||||
(local $1 i32)
|
||||
call $abi/internal
|
||||
@ -211,6 +194,26 @@
|
||||
end
|
||||
end
|
||||
)
|
||||
(func $null (; 6 ;) (type $_)
|
||||
(func $abi/exported (; 3 ;) (type $i) (result i32)
|
||||
i32.const 128
|
||||
i32.const 24
|
||||
i32.shl
|
||||
i32.const 24
|
||||
i32.shr_s
|
||||
)
|
||||
(func $abi/exportedExported (; 4 ;) (type $i) (result i32)
|
||||
call $abi/exported
|
||||
)
|
||||
(func $abi/exportedInternal (; 5 ;) (type $i) (result i32)
|
||||
call $abi/internal
|
||||
i32.const 24
|
||||
i32.shl
|
||||
i32.const 24
|
||||
i32.shr_s
|
||||
)
|
||||
(func $start (; 6 ;) (type $_)
|
||||
call $start:abi
|
||||
)
|
||||
(func $null (; 7 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -1,5 +1,4 @@
|
||||
ASC_TARGET;
|
||||
ASC_NO_TREESHAKING;
|
||||
ASC_NO_ASSERT;
|
||||
ASC_MEMORY_BASE;
|
||||
ASC_OPTIMIZE_LEVEL;
|
||||
|
@ -3,19 +3,18 @@
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $ASC_TARGET i32 (i32.const 0))
|
||||
(global $ASC_NO_TREESHAKING i32 (i32.const 0))
|
||||
(global $ASC_NO_ASSERT i32 (i32.const 0))
|
||||
(global $ASC_MEMORY_BASE i32 (i32.const 0))
|
||||
(global $ASC_OPTIMIZE_LEVEL i32 (i32.const 0))
|
||||
(global $ASC_SHRINK_LEVEL i32 (i32.const 0))
|
||||
(global $ASC_FEATURE_MUTABLE_GLOBAL i32 (i32.const 0))
|
||||
(global $ASC_FEATURE_SIGN_EXTENSION i32 (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/ASC_TARGET i32 (i32.const 0))
|
||||
(global $~lib/ASC_NO_ASSERT i32 (i32.const 0))
|
||||
(global $~lib/ASC_MEMORY_BASE i32 (i32.const 0))
|
||||
(global $~lib/ASC_OPTIMIZE_LEVEL i32 (i32.const 0))
|
||||
(global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0))
|
||||
(global $~lib/ASC_FEATURE_MUTABLE_GLOBAL i32 (i32.const 0))
|
||||
(global $~lib/ASC_FEATURE_SIGN_EXTENSION i32 (i32.const 0))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start (; 0 ;) (type $_)
|
||||
(func $start:asc-constants (; 0 ;) (type $_)
|
||||
i32.const 1
|
||||
drop
|
||||
i32.const 0
|
||||
@ -30,9 +29,10 @@
|
||||
drop
|
||||
i32.const 0
|
||||
drop
|
||||
i32.const 0
|
||||
drop
|
||||
)
|
||||
(func $null (; 1 ;) (type $_)
|
||||
(func $start (; 1 ;) (type $_)
|
||||
call $start:asc-constants
|
||||
)
|
||||
(func $null (; 2 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -7,11 +7,11 @@
|
||||
(data (i32.const 32) "\0c\00\00\00m\00u\00s\00t\00 \00b\00e\00 \00t\00r\00u\00e\00")
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $HEAP_BASE i32 (i32.const 60))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 60))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start (; 1 ;) (type $_)
|
||||
(func $start:assert (; 1 ;) (type $_)
|
||||
(local $0 i32)
|
||||
i32.const 1
|
||||
i32.eqz
|
||||
@ -107,6 +107,9 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 2 ;) (type $_)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
call $start:assert
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -406,7 +406,7 @@
|
||||
local.get $0
|
||||
f64.mul
|
||||
)
|
||||
(func $start (; 4 ;) (type $_)
|
||||
(func $start:binary (; 4 ;) (type $_)
|
||||
(local $0 i32)
|
||||
(local $1 i64)
|
||||
(local $2 f32)
|
||||
@ -749,7 +749,10 @@
|
||||
call $~lib/math/NativeMath.pow
|
||||
global.set $binary/F
|
||||
)
|
||||
(func $null (; 5 ;) (type $_)
|
||||
(func $start (; 5 ;) (type $_)
|
||||
call $start:binary
|
||||
)
|
||||
(func $null (; 6 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
@ -9,11 +9,10 @@
|
||||
(elem (i32.const 0) $null)
|
||||
(global $binary/b (mut i32) (i32.const 0))
|
||||
(global $binary/i (mut i32) (i32.const 0))
|
||||
(global $NaN f64 (f64.const nan:0x8000000000000))
|
||||
(global $binary/I (mut i64) (i64.const 0))
|
||||
(global $binary/f (mut f32) (f32.const 0))
|
||||
(global $binary/F (mut f64) (f64.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
@ -2738,7 +2737,7 @@
|
||||
local.get $2
|
||||
f64.reinterpret_i64
|
||||
)
|
||||
(func $start (; 6 ;) (type $_)
|
||||
(func $start:binary (; 6 ;) (type $_)
|
||||
global.get $binary/i
|
||||
i32.const 1
|
||||
i32.lt_s
|
||||
@ -3346,6 +3345,9 @@
|
||||
call $~lib/math/NativeMath.pow
|
||||
global.set $binary/F
|
||||
)
|
||||
(func $null (; 7 ;) (type $_)
|
||||
(func $start (; 7 ;) (type $_)
|
||||
call $start:binary
|
||||
)
|
||||
(func $null (; 8 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -16,7 +16,7 @@
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start (; 1 ;) (type $_)
|
||||
(func $start:bool (; 1 ;) (type $_)
|
||||
global.get $bool/i
|
||||
i32.const 0
|
||||
i32.ne
|
||||
@ -109,7 +109,10 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 2 ;) (type $_)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
call $start:bool
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
@ -13,11 +13,11 @@
|
||||
(global $bool/f (mut f32) (f32.const 2))
|
||||
(global $bool/F (mut f64) (f64.const 2))
|
||||
(global $bool/uu (mut i32) (i32.const 2))
|
||||
(global $HEAP_BASE i32 (i32.const 28))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 28))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start (; 1 ;) (type $_)
|
||||
(func $start:bool (; 1 ;) (type $_)
|
||||
global.get $bool/i
|
||||
i32.const 0
|
||||
i32.ne
|
||||
@ -117,6 +117,9 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 2 ;) (type $_)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
call $start:bool
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -7,7 +7,7 @@
|
||||
(data (i32.const 8) "\0b\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s")
|
||||
(data (i32.const 40) "\01\00\00\001")
|
||||
(table $0 2 funcref)
|
||||
(elem (i32.const 0) $builtins/test $start~anonymous|1)
|
||||
(elem (i32.const 0) $builtins/test $start:builtins~anonymous|1)
|
||||
(global $builtins/b (mut i32) (i32.const 0))
|
||||
(global $builtins/i (mut i32) (i32.const 0))
|
||||
(global $builtins/I (mut i64) (i64.const 0))
|
||||
@ -21,13 +21,10 @@
|
||||
(export "table" (table $0))
|
||||
(export "test" (func $builtins/test))
|
||||
(start $start)
|
||||
(func $start~anonymous|1 (; 1 ;) (type $ii_) (param $0 i32) (param $1 i32)
|
||||
(func $start:builtins~anonymous|1 (; 1 ;) (type $ii_) (param $0 i32) (param $1 i32)
|
||||
nop
|
||||
)
|
||||
(func $builtins/test (; 2 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $start (; 3 ;) (type $_)
|
||||
(func $start:builtins (; 2 ;) (type $_)
|
||||
i32.const 31
|
||||
global.set $builtins/i
|
||||
i32.const 0
|
||||
@ -447,4 +444,10 @@
|
||||
f64.const 1
|
||||
f64.store
|
||||
)
|
||||
(func $builtins/test (; 3 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $start (; 4 ;) (type $_)
|
||||
call $start:builtins
|
||||
)
|
||||
)
|
||||
|
@ -7,13 +7,11 @@
|
||||
(data (i32.const 8) "\0b\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s\00")
|
||||
(data (i32.const 40) "\01\00\00\001\00")
|
||||
(table $0 2 funcref)
|
||||
(elem (i32.const 0) $null $start~anonymous|1)
|
||||
(elem (i32.const 0) $null $start:builtins~anonymous|1)
|
||||
(global $builtins/b (mut i32) (i32.const 0))
|
||||
(global $builtins/i (mut i32) (i32.const 0))
|
||||
(global $builtins/I (mut i64) (i64.const 0))
|
||||
(global $builtins/f (mut f32) (f32.const 0))
|
||||
(global $NaN f64 (f64.const nan:0x8000000000000))
|
||||
(global $Infinity f64 (f64.const inf))
|
||||
(global $builtins/F (mut f64) (f64.const 0))
|
||||
(global $builtins/constantOffset i32 (i32.const 8))
|
||||
(global $builtins/u (mut i32) (i32.const 0))
|
||||
@ -50,18 +48,15 @@
|
||||
(global $~lib/builtins/f64.MIN_SAFE_INTEGER f64 (f64.const -9007199254740991))
|
||||
(global $~lib/builtins/f64.MAX_SAFE_INTEGER f64 (f64.const 9007199254740991))
|
||||
(global $~lib/builtins/f64.EPSILON f64 (f64.const 2.220446049250313e-16))
|
||||
(global $HEAP_BASE i32 (i32.const 48))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 48))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "test" (func $builtins/test))
|
||||
(start $start)
|
||||
(func $start~anonymous|1 (; 1 ;) (type $ii_) (param $0 i32) (param $1 i32)
|
||||
(func $start:builtins~anonymous|1 (; 1 ;) (type $ii_) (param $0 i32) (param $1 i32)
|
||||
nop
|
||||
)
|
||||
(func $builtins/test (; 2 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $start (; 3 ;) (type $_)
|
||||
(func $start:builtins (; 2 ;) (type $_)
|
||||
(local $0 i32)
|
||||
(local $1 i32)
|
||||
(local $2 i64)
|
||||
@ -2179,6 +2174,12 @@
|
||||
end
|
||||
drop
|
||||
)
|
||||
(func $null (; 4 ;) (type $_)
|
||||
(func $builtins/test (; 3 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $start (; 4 ;) (type $_)
|
||||
call $start:builtins
|
||||
)
|
||||
(func $null (; 5 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -9,7 +9,7 @@
|
||||
(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 $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $HEAP_BASE i32 (i32.const 44))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 44))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
@ -25,7 +25,7 @@
|
||||
(func $call-inferred/bar<f32> (; 4 ;) (type $ff) (param $0 f32) (result f32)
|
||||
local.get $0
|
||||
)
|
||||
(func $start (; 5 ;) (type $_)
|
||||
(func $start:call-inferred (; 5 ;) (type $_)
|
||||
i32.const 42
|
||||
call $call-inferred/foo<i32>
|
||||
i32.const 42
|
||||
@ -79,6 +79,9 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 6 ;) (type $_)
|
||||
(func $start (; 6 ;) (type $_)
|
||||
call $start:call-inferred
|
||||
)
|
||||
(func $null (; 7 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -7,7 +7,7 @@
|
||||
(data (i32.const 8) "\10\00\00\00c\00a\00l\00l\00-\00o\00p\00t\00i\00o\00n\00a\00l\00.\00t\00s")
|
||||
(table $0 2 funcref)
|
||||
(elem (i32.const 0) $null $call-optional/opt|trampoline)
|
||||
(global $~argc (mut i32) (i32.const 0))
|
||||
(global $~lib/argc (mut i32) (i32.const 0))
|
||||
(global $call-optional/optIndirect (mut i32) (i32.const 1))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
@ -17,7 +17,7 @@
|
||||
block $1of2
|
||||
block $0of2
|
||||
block $outOfRange
|
||||
global.get $~argc
|
||||
global.get $~lib/argc
|
||||
i32.const 1
|
||||
i32.sub
|
||||
br_table $0of2 $1of2 $2of2 $outOfRange
|
||||
@ -36,16 +36,16 @@
|
||||
local.get $2
|
||||
i32.add
|
||||
)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
(func $start:call-optional (; 2 ;) (type $_)
|
||||
(local $0 i32)
|
||||
(local $1 i32)
|
||||
i32.const 1
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
block $2of2
|
||||
block $1of2
|
||||
block $0of2
|
||||
block $outOfRange
|
||||
global.get $~argc
|
||||
global.get $~lib/argc
|
||||
i32.const 1
|
||||
i32.sub
|
||||
br_table $0of2 $1of2 $2of2 $outOfRange
|
||||
@ -72,7 +72,7 @@
|
||||
unreachable
|
||||
end
|
||||
i32.const 2
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 4
|
||||
local.set $0
|
||||
i32.const 0
|
||||
@ -81,7 +81,7 @@
|
||||
block $1of22
|
||||
block $0of23
|
||||
block $outOfRange4
|
||||
global.get $~argc
|
||||
global.get $~lib/argc
|
||||
i32.const 1
|
||||
i32.sub
|
||||
br_table $0of23 $1of22 $2of21 $outOfRange4
|
||||
@ -110,7 +110,7 @@
|
||||
unreachable
|
||||
end
|
||||
i32.const 1
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 3
|
||||
i32.const 0
|
||||
i32.const 0
|
||||
@ -125,7 +125,7 @@
|
||||
unreachable
|
||||
end
|
||||
i32.const 2
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 3
|
||||
i32.const 4
|
||||
i32.const 0
|
||||
@ -142,7 +142,7 @@
|
||||
unreachable
|
||||
end
|
||||
i32.const 3
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 3
|
||||
i32.const 4
|
||||
i32.const 5
|
||||
@ -159,7 +159,10 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
(func $start (; 3 ;) (type $_)
|
||||
call $start:call-optional
|
||||
)
|
||||
(func $null (; 4 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
@ -7,9 +7,9 @@
|
||||
(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 $0 2 funcref)
|
||||
(elem (i32.const 0) $null $call-optional/opt|trampoline)
|
||||
(global $~argc (mut i32) (i32.const 0))
|
||||
(global $~lib/argc (mut i32) (i32.const 0))
|
||||
(global $call-optional/optIndirect (mut i32) (i32.const 1))
|
||||
(global $HEAP_BASE i32 (i32.const 44))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 44))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
@ -25,7 +25,7 @@
|
||||
block $1of2
|
||||
block $0of2
|
||||
block $outOfRange
|
||||
global.get $~argc
|
||||
global.get $~lib/argc
|
||||
i32.const 1
|
||||
i32.sub
|
||||
br_table $0of2 $1of2 $2of2 $outOfRange
|
||||
@ -43,10 +43,10 @@
|
||||
local.get $2
|
||||
call $call-optional/opt
|
||||
)
|
||||
(func $start (; 3 ;) (type $_)
|
||||
(func $start:call-optional (; 3 ;) (type $_)
|
||||
block (result i32)
|
||||
i32.const 1
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 3
|
||||
i32.const 0
|
||||
i32.const 0
|
||||
@ -65,7 +65,7 @@
|
||||
end
|
||||
block (result i32)
|
||||
i32.const 2
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 3
|
||||
i32.const 4
|
||||
i32.const 0
|
||||
@ -99,7 +99,7 @@
|
||||
end
|
||||
block (result i32)
|
||||
i32.const 1
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 3
|
||||
i32.const 0
|
||||
i32.const 0
|
||||
@ -119,7 +119,7 @@
|
||||
end
|
||||
block (result i32)
|
||||
i32.const 2
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 3
|
||||
i32.const 4
|
||||
i32.const 0
|
||||
@ -139,7 +139,7 @@
|
||||
end
|
||||
block (result i32)
|
||||
i32.const 3
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 3
|
||||
i32.const 4
|
||||
i32.const 5
|
||||
@ -158,6 +158,9 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 4 ;) (type $_)
|
||||
(func $start (; 4 ;) (type $_)
|
||||
call $start:call-optional
|
||||
)
|
||||
(func $null (; 5 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -7,17 +7,25 @@
|
||||
(data (i32.const 8) "\0d\00\00\00c\00a\00l\00l\00-\00s\00u\00p\00e\00r\00.\00t\00s\00")
|
||||
(table $0 1 funcref)
|
||||
(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))
|
||||
(global $~lib/internal/allocator/AL_MASK i32 (i32.const 7))
|
||||
(global $~lib/internal/allocator/MAX_SIZE_32 i32 (i32.const 1073741824))
|
||||
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 40))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 40))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $~lib/allocator/arena/__memory_allocate (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $start:~lib/allocator/arena (; 1 ;) (type $_)
|
||||
global.get $~lib/memory/HEAP_BASE
|
||||
i32.const 7
|
||||
i32.add
|
||||
i32.const 7
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
global.set $~lib/allocator/arena/startOffset
|
||||
global.get $~lib/allocator/arena/startOffset
|
||||
global.set $~lib/allocator/arena/offset
|
||||
)
|
||||
(func $~lib/allocator/arena/__memory_allocate (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
@ -25,7 +33,7 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $0
|
||||
global.get $~lib/internal/allocator/MAX_SIZE_32
|
||||
i32.const 1073741824
|
||||
i32.gt_u
|
||||
if
|
||||
unreachable
|
||||
@ -42,9 +50,9 @@
|
||||
i32.gt_u
|
||||
select
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const 7
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const 7
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
@ -96,12 +104,12 @@
|
||||
global.set $~lib/allocator/arena/offset
|
||||
local.get $1
|
||||
)
|
||||
(func $~lib/memory/memory.allocate (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $~lib/memory/memory.allocate (; 3 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
call $~lib/allocator/arena/__memory_allocate
|
||||
return
|
||||
)
|
||||
(func $call-super/A#constructor (; 3 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $call-super/A#constructor (; 4 ;) (type $ii) (param $0 i32) (result i32)
|
||||
block (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
@ -129,7 +137,7 @@
|
||||
end
|
||||
local.get $0
|
||||
)
|
||||
(func $call-super/B#constructor (; 4 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $call-super/B#constructor (; 5 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
if (result i32)
|
||||
local.get $0
|
||||
@ -170,7 +178,7 @@
|
||||
end
|
||||
local.get $0
|
||||
)
|
||||
(func $call-super/test1 (; 5 ;) (type $_)
|
||||
(func $call-super/test1 (; 6 ;) (type $_)
|
||||
(local $0 i32)
|
||||
i32.const 0
|
||||
call $call-super/B#constructor
|
||||
@ -202,7 +210,7 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $call-super/C#constructor (; 6 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $call-super/C#constructor (; 7 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
if
|
||||
@ -215,7 +223,7 @@
|
||||
i32.store
|
||||
local.get $0
|
||||
)
|
||||
(func $call-super/D#constructor (; 7 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $call-super/D#constructor (; 8 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
if (result i32)
|
||||
local.get $0
|
||||
@ -256,7 +264,7 @@
|
||||
end
|
||||
local.get $0
|
||||
)
|
||||
(func $call-super/test2 (; 8 ;) (type $_)
|
||||
(func $call-super/test2 (; 9 ;) (type $_)
|
||||
(local $0 i32)
|
||||
i32.const 0
|
||||
call $call-super/D#constructor
|
||||
@ -288,7 +296,7 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $call-super/E#constructor (; 9 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $call-super/E#constructor (; 10 ;) (type $ii) (param $0 i32) (result i32)
|
||||
block (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
@ -316,7 +324,7 @@
|
||||
end
|
||||
local.get $0
|
||||
)
|
||||
(func $call-super/F#constructor (; 10 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $call-super/F#constructor (; 11 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
if
|
||||
@ -332,7 +340,7 @@
|
||||
i32.store offset=4
|
||||
local.get $0
|
||||
)
|
||||
(func $call-super/test3 (; 11 ;) (type $_)
|
||||
(func $call-super/test3 (; 12 ;) (type $_)
|
||||
(local $0 i32)
|
||||
i32.const 0
|
||||
call $call-super/F#constructor
|
||||
@ -364,7 +372,7 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $call-super/G#constructor (; 12 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $call-super/G#constructor (; 13 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
if
|
||||
@ -377,7 +385,7 @@
|
||||
i32.store
|
||||
local.get $0
|
||||
)
|
||||
(func $call-super/H#constructor (; 13 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $call-super/H#constructor (; 14 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
if
|
||||
@ -393,7 +401,7 @@
|
||||
i32.store offset=4
|
||||
local.get $0
|
||||
)
|
||||
(func $call-super/test4 (; 14 ;) (type $_)
|
||||
(func $call-super/test4 (; 15 ;) (type $_)
|
||||
(local $0 i32)
|
||||
i32.const 0
|
||||
call $call-super/H#constructor
|
||||
@ -425,7 +433,7 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $call-super/I#constructor (; 15 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $call-super/I#constructor (; 16 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
if
|
||||
@ -438,7 +446,7 @@
|
||||
i32.store
|
||||
local.get $0
|
||||
)
|
||||
(func $call-super/J#constructor (; 16 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $call-super/J#constructor (; 17 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
if
|
||||
@ -454,7 +462,7 @@
|
||||
i32.store offset=4
|
||||
local.get $0
|
||||
)
|
||||
(func $call-super/test5 (; 17 ;) (type $_)
|
||||
(func $call-super/test5 (; 18 ;) (type $_)
|
||||
(local $0 i32)
|
||||
i32.const 0
|
||||
call $call-super/J#constructor
|
||||
@ -486,23 +494,17 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $start (; 18 ;) (type $_)
|
||||
global.get $HEAP_BASE
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
global.set $~lib/allocator/arena/startOffset
|
||||
global.get $~lib/allocator/arena/startOffset
|
||||
global.set $~lib/allocator/arena/offset
|
||||
(func $start:call-super (; 19 ;) (type $_)
|
||||
call $start:~lib/allocator/arena
|
||||
call $call-super/test1
|
||||
call $call-super/test2
|
||||
call $call-super/test3
|
||||
call $call-super/test4
|
||||
call $call-super/test5
|
||||
)
|
||||
(func $null (; 19 ;) (type $_)
|
||||
(func $start (; 20 ;) (type $_)
|
||||
call $start:call-super
|
||||
)
|
||||
(func $null (; 21 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -4,7 +4,7 @@
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "test" (func $class-extends/test))
|
||||
|
@ -4,7 +4,7 @@
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "test" (func $class-overloading/test))
|
||||
@ -16,10 +16,13 @@
|
||||
local.get $0
|
||||
call $class-overloading/Foo#baz
|
||||
)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
(func $start:class-overloading (; 2 ;) (type $_)
|
||||
i32.const 0
|
||||
call $class-overloading/test
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
(func $start (; 3 ;) (type $_)
|
||||
call $start:class-overloading
|
||||
)
|
||||
(func $null (; 4 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -1,22 +0,0 @@
|
||||
(module
|
||||
(type $i (func (result i32)))
|
||||
(type $_ (func))
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(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 ;) (type $i) (result i32)
|
||||
i32.const 0
|
||||
i32.const 1
|
||||
i32.store8
|
||||
i32.const 0
|
||||
i32.load8_u
|
||||
i32.const 0
|
||||
i32.ne
|
||||
)
|
||||
(func $null (; 1 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
)
|
@ -1,9 +0,0 @@
|
||||
class A {
|
||||
boolValue: bool;
|
||||
}
|
||||
|
||||
export function test(): bool {
|
||||
let a: A;
|
||||
a.boolValue = true;
|
||||
return a.boolValue;
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
(module
|
||||
(type $i (func (result i32)))
|
||||
(type $_ (func))
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "test" (func $class-with-boolean-field/test))
|
||||
(func $class-with-boolean-field/test (; 0 ;) (type $i) (result i32)
|
||||
(local $0 i32)
|
||||
local.get $0
|
||||
i32.const 1
|
||||
i32.store8
|
||||
local.get $0
|
||||
i32.load8_u
|
||||
i32.const 0
|
||||
i32.ne
|
||||
)
|
||||
(func $null (; 1 ;) (type $_)
|
||||
)
|
||||
)
|
@ -1,6 +1,6 @@
|
||||
(module
|
||||
(type $ii (func (param i32) (result i32)))
|
||||
(type $_ (func))
|
||||
(type $ii (func (param i32) (result i32)))
|
||||
(memory $0 1)
|
||||
(data (i32.const 8) "\08\00\00\00c\00l\00a\00s\00s\00.\00t\00s")
|
||||
(table $0 1 funcref)
|
||||
|
@ -2,17 +2,17 @@
|
||||
(type $iiii_ (func (param i32 i32 i32 i32)))
|
||||
(type $iii (func (param i32 i32) (result i32)))
|
||||
(type $fff (func (param f32 f32) (result f32)))
|
||||
(type $_ (func))
|
||||
(type $ii (func (param i32) (result i32)))
|
||||
(type $iiii (func (param i32 i32 i32) (result i32)))
|
||||
(type $ifff (func (param i32 f32 f32) (result f32)))
|
||||
(type $_ (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 $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $class/Animal.ONE (mut i32) (i32.const 1))
|
||||
(global $HEAP_BASE i32 (i32.const 28))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 28))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "test" (func $class/test))
|
||||
@ -32,14 +32,38 @@
|
||||
f32.convert_i32_s
|
||||
f32.add
|
||||
)
|
||||
(func $class/Animal<f64>#instanceAdd (; 3 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
(func $start:class (; 3 ;) (type $_)
|
||||
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
|
||||
global.get $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 $class/Animal<f64>#instanceAdd (; 4 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
local.get $1
|
||||
local.get $2
|
||||
i32.add
|
||||
global.get $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)
|
||||
(func $class/Animal<f64>#instanceSub<f32> (; 5 ;) (type $ifff) (param $0 i32) (param $1 f32) (param $2 f32) (result f32)
|
||||
local.get $1
|
||||
local.get $2
|
||||
f32.sub
|
||||
@ -47,7 +71,7 @@
|
||||
f32.convert_i32_s
|
||||
f32.add
|
||||
)
|
||||
(func $class/test (; 5 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $class/test (; 6 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
local.get $0
|
||||
@ -92,30 +116,9 @@
|
||||
local.set $2
|
||||
local.get $2
|
||||
)
|
||||
(func $start (; 6 ;) (type $_)
|
||||
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
|
||||
global.get $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 $start (; 7 ;) (type $_)
|
||||
call $start:class
|
||||
)
|
||||
(func $null (; 7 ;) (type $_)
|
||||
(func $null (; 8 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -3,7 +3,7 @@
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(func $null (; 0 ;) (type $_)
|
||||
|
@ -11,7 +11,7 @@
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start (; 1 ;) (type $_)
|
||||
(func $start:comma (; 1 ;) (type $_)
|
||||
(local $0 i32)
|
||||
global.get $comma/a
|
||||
local.tee $0
|
||||
@ -163,7 +163,10 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 2 ;) (type $_)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
call $start:comma
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
@ -8,11 +8,11 @@
|
||||
(elem (i32.const 0) $null)
|
||||
(global $comma/a (mut i32) (i32.const 0))
|
||||
(global $comma/b (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 28))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 28))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start (; 1 ;) (type $_)
|
||||
(func $start:comma (; 1 ;) (type $_)
|
||||
(local $0 i32)
|
||||
(local $1 i32)
|
||||
block
|
||||
@ -204,6 +204,9 @@
|
||||
drop
|
||||
end
|
||||
)
|
||||
(func $null (; 2 ;) (type $_)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
call $start:comma
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -1,23 +1,23 @@
|
||||
(module
|
||||
(type $ii (func (param i32) (result i32)))
|
||||
(type $_ (func))
|
||||
(type $ii (func (param i32) (result i32)))
|
||||
(type $FUNCSIG$i (func (result i32)))
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(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))
|
||||
(global $std/constructor/emptyCtor (mut i32) (i32.const 0))
|
||||
(global $std/constructor/emptyCtorWithFieldInit (mut i32) (i32.const 0))
|
||||
(global $std/constructor/emptyCtorWithFieldNoInit (mut i32) (i32.const 0))
|
||||
(global $std/constructor/none (mut i32) (i32.const 0))
|
||||
(global $std/constructor/justFieldInit (mut i32) (i32.const 0))
|
||||
(global $std/constructor/justFieldNoInit (mut i32) (i32.const 0))
|
||||
(global $std/constructor/ctorReturns (mut i32) (i32.const 0))
|
||||
(global $std/constructor/b (mut i32) (i32.const 1))
|
||||
(global $std/constructor/ctorConditionallyReturns (mut i32) (i32.const 0))
|
||||
(global $std/constructor/ctorAllocates (mut i32) (i32.const 0))
|
||||
(global $std/constructor/ctorConditionallyAllocates (mut i32) (i32.const 0))
|
||||
(global $constructor/emptyCtor (mut i32) (i32.const 0))
|
||||
(global $constructor/emptyCtorWithFieldInit (mut i32) (i32.const 0))
|
||||
(global $constructor/emptyCtorWithFieldNoInit (mut i32) (i32.const 0))
|
||||
(global $constructor/none (mut i32) (i32.const 0))
|
||||
(global $constructor/justFieldInit (mut i32) (i32.const 0))
|
||||
(global $constructor/justFieldNoInit (mut i32) (i32.const 0))
|
||||
(global $constructor/ctorReturns (mut i32) (i32.const 0))
|
||||
(global $constructor/b (mut i32) (i32.const 1))
|
||||
(global $constructor/ctorConditionallyReturns (mut i32) (i32.const 0))
|
||||
(global $constructor/ctorAllocates (mut i32) (i32.const 0))
|
||||
(global $constructor/ctorConditionallyAllocates (mut i32) (i32.const 0))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
@ -83,7 +83,7 @@
|
||||
global.set $~lib/allocator/arena/offset
|
||||
local.get $1
|
||||
)
|
||||
(func $std/constructor/EmptyCtorWithFieldInit#constructor (; 1 ;) (type $FUNCSIG$i) (result i32)
|
||||
(func $constructor/EmptyCtorWithFieldInit#constructor (; 1 ;) (type $FUNCSIG$i) (result i32)
|
||||
(local $0 i32)
|
||||
i32.const 4
|
||||
call $~lib/allocator/arena/__memory_allocate
|
||||
@ -92,7 +92,7 @@
|
||||
i32.store
|
||||
local.get $0
|
||||
)
|
||||
(func $std/constructor/EmptyCtorWithFieldNoInit#constructor (; 2 ;) (type $FUNCSIG$i) (result i32)
|
||||
(func $constructor/EmptyCtorWithFieldNoInit#constructor (; 2 ;) (type $FUNCSIG$i) (result i32)
|
||||
(local $0 i32)
|
||||
i32.const 4
|
||||
call $~lib/allocator/arena/__memory_allocate
|
||||
@ -101,7 +101,7 @@
|
||||
i32.store
|
||||
local.get $0
|
||||
)
|
||||
(func $start (; 3 ;) (type $_)
|
||||
(func $start:constructor (; 3 ;) (type $_)
|
||||
(local $0 i32)
|
||||
i32.const 8
|
||||
global.set $~lib/allocator/arena/startOffset
|
||||
@ -109,37 +109,37 @@
|
||||
global.set $~lib/allocator/arena/offset
|
||||
i32.const 0
|
||||
call $~lib/allocator/arena/__memory_allocate
|
||||
global.set $std/constructor/emptyCtor
|
||||
call $std/constructor/EmptyCtorWithFieldInit#constructor
|
||||
global.set $std/constructor/emptyCtorWithFieldInit
|
||||
call $std/constructor/EmptyCtorWithFieldNoInit#constructor
|
||||
global.set $std/constructor/emptyCtorWithFieldNoInit
|
||||
global.set $constructor/emptyCtor
|
||||
call $constructor/EmptyCtorWithFieldInit#constructor
|
||||
global.set $constructor/emptyCtorWithFieldInit
|
||||
call $constructor/EmptyCtorWithFieldNoInit#constructor
|
||||
global.set $constructor/emptyCtorWithFieldNoInit
|
||||
i32.const 0
|
||||
call $~lib/allocator/arena/__memory_allocate
|
||||
global.set $std/constructor/none
|
||||
call $std/constructor/EmptyCtorWithFieldInit#constructor
|
||||
global.set $std/constructor/justFieldInit
|
||||
call $std/constructor/EmptyCtorWithFieldNoInit#constructor
|
||||
global.set $std/constructor/justFieldNoInit
|
||||
global.set $constructor/none
|
||||
call $constructor/EmptyCtorWithFieldInit#constructor
|
||||
global.set $constructor/justFieldInit
|
||||
call $constructor/EmptyCtorWithFieldNoInit#constructor
|
||||
global.set $constructor/justFieldNoInit
|
||||
i32.const 0
|
||||
call $~lib/allocator/arena/__memory_allocate
|
||||
global.set $std/constructor/ctorReturns
|
||||
block $__inlined_func$std/constructor/CtorConditionallyReturns#constructor (result i32)
|
||||
global.get $std/constructor/b
|
||||
global.set $constructor/ctorReturns
|
||||
block $__inlined_func$constructor/CtorConditionallyReturns#constructor (result i32)
|
||||
global.get $constructor/b
|
||||
if
|
||||
i32.const 0
|
||||
call $~lib/allocator/arena/__memory_allocate
|
||||
br $__inlined_func$std/constructor/CtorConditionallyReturns#constructor
|
||||
br $__inlined_func$constructor/CtorConditionallyReturns#constructor
|
||||
end
|
||||
i32.const 0
|
||||
call $~lib/allocator/arena/__memory_allocate
|
||||
end
|
||||
global.set $std/constructor/ctorConditionallyReturns
|
||||
global.set $constructor/ctorConditionallyReturns
|
||||
i32.const 0
|
||||
call $~lib/allocator/arena/__memory_allocate
|
||||
global.set $std/constructor/ctorAllocates
|
||||
global.set $constructor/ctorAllocates
|
||||
block (result i32)
|
||||
global.get $std/constructor/b
|
||||
global.get $constructor/b
|
||||
if
|
||||
i32.const 0
|
||||
call $~lib/allocator/arena/__memory_allocate
|
||||
@ -154,9 +154,12 @@
|
||||
local.set $0
|
||||
end
|
||||
local.get $0
|
||||
global.set $std/constructor/ctorConditionallyAllocates
|
||||
global.set $constructor/ctorConditionallyAllocates
|
||||
)
|
||||
(func $null (; 4 ;) (type $_)
|
||||
(func $start (; 4 ;) (type $_)
|
||||
call $start:constructor
|
||||
)
|
||||
(func $null (; 5 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
)
|
@ -1,31 +1,39 @@
|
||||
(module
|
||||
(type $ii (func (param i32) (result i32)))
|
||||
(type $_ (func))
|
||||
(type $ii (func (param i32) (result i32)))
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(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))
|
||||
(global $~lib/internal/allocator/AL_MASK i32 (i32.const 7))
|
||||
(global $~lib/internal/allocator/MAX_SIZE_32 i32 (i32.const 1073741824))
|
||||
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
|
||||
(global $std/constructor/emptyCtor (mut i32) (i32.const 0))
|
||||
(global $std/constructor/emptyCtorWithFieldInit (mut i32) (i32.const 0))
|
||||
(global $std/constructor/emptyCtorWithFieldNoInit (mut i32) (i32.const 0))
|
||||
(global $std/constructor/none (mut i32) (i32.const 0))
|
||||
(global $std/constructor/justFieldInit (mut i32) (i32.const 0))
|
||||
(global $std/constructor/justFieldNoInit (mut i32) (i32.const 0))
|
||||
(global $std/constructor/ctorReturns (mut i32) (i32.const 0))
|
||||
(global $std/constructor/b (mut i32) (i32.const 1))
|
||||
(global $std/constructor/ctorConditionallyReturns (mut i32) (i32.const 0))
|
||||
(global $std/constructor/ctorAllocates (mut i32) (i32.const 0))
|
||||
(global $std/constructor/ctorConditionallyAllocates (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $constructor/emptyCtor (mut i32) (i32.const 0))
|
||||
(global $constructor/emptyCtorWithFieldInit (mut i32) (i32.const 0))
|
||||
(global $constructor/emptyCtorWithFieldNoInit (mut i32) (i32.const 0))
|
||||
(global $constructor/none (mut i32) (i32.const 0))
|
||||
(global $constructor/justFieldInit (mut i32) (i32.const 0))
|
||||
(global $constructor/justFieldNoInit (mut i32) (i32.const 0))
|
||||
(global $constructor/ctorReturns (mut i32) (i32.const 0))
|
||||
(global $constructor/b (mut i32) (i32.const 1))
|
||||
(global $constructor/ctorConditionallyReturns (mut i32) (i32.const 0))
|
||||
(global $constructor/ctorAllocates (mut i32) (i32.const 0))
|
||||
(global $constructor/ctorConditionallyAllocates (mut i32) (i32.const 0))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $~lib/allocator/arena/__memory_allocate (; 0 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $start:~lib/allocator/arena (; 0 ;) (type $_)
|
||||
global.get $~lib/memory/HEAP_BASE
|
||||
i32.const 7
|
||||
i32.add
|
||||
i32.const 7
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
global.set $~lib/allocator/arena/startOffset
|
||||
global.get $~lib/allocator/arena/startOffset
|
||||
global.set $~lib/allocator/arena/offset
|
||||
)
|
||||
(func $~lib/allocator/arena/__memory_allocate (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
@ -33,7 +41,7 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $0
|
||||
global.get $~lib/internal/allocator/MAX_SIZE_32
|
||||
i32.const 1073741824
|
||||
i32.gt_u
|
||||
if
|
||||
unreachable
|
||||
@ -50,9 +58,9 @@
|
||||
i32.gt_u
|
||||
select
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const 7
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const 7
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
@ -104,12 +112,12 @@
|
||||
global.set $~lib/allocator/arena/offset
|
||||
local.get $1
|
||||
)
|
||||
(func $~lib/memory/memory.allocate (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $~lib/memory/memory.allocate (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
call $~lib/allocator/arena/__memory_allocate
|
||||
return
|
||||
)
|
||||
(func $std/constructor/EmptyCtor#constructor (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $constructor/EmptyCtor#constructor (; 3 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
if
|
||||
@ -119,7 +127,7 @@
|
||||
end
|
||||
local.get $0
|
||||
)
|
||||
(func $std/constructor/EmptyCtorWithFieldInit#constructor (; 3 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $constructor/EmptyCtorWithFieldInit#constructor (; 4 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
if
|
||||
@ -132,7 +140,7 @@
|
||||
i32.store
|
||||
local.get $0
|
||||
)
|
||||
(func $std/constructor/EmptyCtorWithFieldNoInit#constructor (; 4 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $constructor/EmptyCtorWithFieldNoInit#constructor (; 5 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
if
|
||||
@ -145,7 +153,7 @@
|
||||
i32.store
|
||||
local.get $0
|
||||
)
|
||||
(func $std/constructor/None#constructor (; 5 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $constructor/None#constructor (; 6 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
if
|
||||
@ -155,7 +163,7 @@
|
||||
end
|
||||
local.get $0
|
||||
)
|
||||
(func $std/constructor/JustFieldInit#constructor (; 6 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $constructor/JustFieldInit#constructor (; 7 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
if
|
||||
@ -168,7 +176,7 @@
|
||||
i32.store
|
||||
local.get $0
|
||||
)
|
||||
(func $std/constructor/JustFieldNoInit#constructor (; 7 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $constructor/JustFieldNoInit#constructor (; 8 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
if
|
||||
@ -181,7 +189,7 @@
|
||||
i32.store
|
||||
local.get $0
|
||||
)
|
||||
(func $std/constructor/CtorReturns#constructor (; 8 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $constructor/CtorReturns#constructor (; 9 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
block $~lib/memory/memory.allocate|inlined.0 (result i32)
|
||||
i32.const 0
|
||||
@ -191,9 +199,9 @@
|
||||
br $~lib/memory/memory.allocate|inlined.0
|
||||
end
|
||||
)
|
||||
(func $std/constructor/CtorConditionallyReturns#constructor (; 9 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $constructor/CtorConditionallyReturns#constructor (; 10 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
global.get $std/constructor/b
|
||||
global.get $constructor/b
|
||||
if
|
||||
block $~lib/memory/memory.allocate|inlined.1 (result i32)
|
||||
i32.const 0
|
||||
@ -213,7 +221,7 @@
|
||||
end
|
||||
local.get $0
|
||||
)
|
||||
(func $std/constructor/CtorAllocates#constructor (; 10 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $constructor/CtorAllocates#constructor (; 11 ;) (type $ii) (param $0 i32) (result i32)
|
||||
block (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
@ -227,8 +235,8 @@
|
||||
drop
|
||||
local.get $0
|
||||
)
|
||||
(func $std/constructor/CtorConditionallyAllocates#constructor (; 11 ;) (type $ii) (param $0 i32) (result i32)
|
||||
global.get $std/constructor/b
|
||||
(func $constructor/CtorConditionallyAllocates#constructor (; 12 ;) (type $ii) (param $0 i32) (result i32)
|
||||
global.get $constructor/b
|
||||
if
|
||||
block (result i32)
|
||||
local.get $0
|
||||
@ -251,48 +259,42 @@
|
||||
end
|
||||
local.get $0
|
||||
)
|
||||
(func $start (; 12 ;) (type $_)
|
||||
global.get $HEAP_BASE
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
global.set $~lib/allocator/arena/startOffset
|
||||
global.get $~lib/allocator/arena/startOffset
|
||||
global.set $~lib/allocator/arena/offset
|
||||
(func $start:constructor (; 13 ;) (type $_)
|
||||
call $start:~lib/allocator/arena
|
||||
i32.const 0
|
||||
call $std/constructor/EmptyCtor#constructor
|
||||
global.set $std/constructor/emptyCtor
|
||||
call $constructor/EmptyCtor#constructor
|
||||
global.set $constructor/emptyCtor
|
||||
i32.const 0
|
||||
call $std/constructor/EmptyCtorWithFieldInit#constructor
|
||||
global.set $std/constructor/emptyCtorWithFieldInit
|
||||
call $constructor/EmptyCtorWithFieldInit#constructor
|
||||
global.set $constructor/emptyCtorWithFieldInit
|
||||
i32.const 0
|
||||
call $std/constructor/EmptyCtorWithFieldNoInit#constructor
|
||||
global.set $std/constructor/emptyCtorWithFieldNoInit
|
||||
call $constructor/EmptyCtorWithFieldNoInit#constructor
|
||||
global.set $constructor/emptyCtorWithFieldNoInit
|
||||
i32.const 0
|
||||
call $std/constructor/None#constructor
|
||||
global.set $std/constructor/none
|
||||
call $constructor/None#constructor
|
||||
global.set $constructor/none
|
||||
i32.const 0
|
||||
call $std/constructor/JustFieldInit#constructor
|
||||
global.set $std/constructor/justFieldInit
|
||||
call $constructor/JustFieldInit#constructor
|
||||
global.set $constructor/justFieldInit
|
||||
i32.const 0
|
||||
call $std/constructor/JustFieldNoInit#constructor
|
||||
global.set $std/constructor/justFieldNoInit
|
||||
call $constructor/JustFieldNoInit#constructor
|
||||
global.set $constructor/justFieldNoInit
|
||||
i32.const 0
|
||||
call $std/constructor/CtorReturns#constructor
|
||||
global.set $std/constructor/ctorReturns
|
||||
call $constructor/CtorReturns#constructor
|
||||
global.set $constructor/ctorReturns
|
||||
i32.const 0
|
||||
call $std/constructor/CtorConditionallyReturns#constructor
|
||||
global.set $std/constructor/ctorConditionallyReturns
|
||||
call $constructor/CtorConditionallyReturns#constructor
|
||||
global.set $constructor/ctorConditionallyReturns
|
||||
i32.const 0
|
||||
call $std/constructor/CtorAllocates#constructor
|
||||
global.set $std/constructor/ctorAllocates
|
||||
call $constructor/CtorAllocates#constructor
|
||||
global.set $constructor/ctorAllocates
|
||||
i32.const 0
|
||||
call $std/constructor/CtorConditionallyAllocates#constructor
|
||||
global.set $std/constructor/ctorConditionallyAllocates
|
||||
call $constructor/CtorConditionallyAllocates#constructor
|
||||
global.set $constructor/ctorConditionallyAllocates
|
||||
)
|
||||
(func $null (; 13 ;) (type $_)
|
||||
(func $start (; 14 ;) (type $_)
|
||||
call $start:constructor
|
||||
)
|
||||
(func $null (; 15 ;) (type $_)
|
||||
)
|
||||
)
|
@ -13,7 +13,7 @@
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start (; 3 ;) (type $_)
|
||||
(func $start:declare (; 3 ;) (type $_)
|
||||
call $declare/externalFunction
|
||||
global.get $declare/externalConstant
|
||||
i32.const 1
|
||||
@ -39,7 +39,10 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 4 ;) (type $_)
|
||||
(func $start (; 4 ;) (type $_)
|
||||
call $start:declare
|
||||
)
|
||||
(func $null (; 5 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
@ -10,11 +10,11 @@
|
||||
(data (i32.const 8) "\n\00\00\00d\00e\00c\00l\00a\00r\00e\00.\00t\00s\00")
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $HEAP_BASE i32 (i32.const 32))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 32))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start (; 3 ;) (type $_)
|
||||
(func $start:declare (; 3 ;) (type $_)
|
||||
call $declare/externalFunction
|
||||
global.get $declare/externalConstant
|
||||
i32.const 1
|
||||
@ -42,6 +42,9 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 4 ;) (type $_)
|
||||
(func $start (; 4 ;) (type $_)
|
||||
call $start:declare
|
||||
)
|
||||
(func $null (; 5 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -12,7 +12,7 @@
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start (; 1 ;) (type $_)
|
||||
(func $start:do (; 1 ;) (type $_)
|
||||
(local $0 i32)
|
||||
loop $continue|0
|
||||
global.get $do/n
|
||||
@ -148,7 +148,10 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 2 ;) (type $_)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
call $start:do
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
@ -9,11 +9,11 @@
|
||||
(global $do/n (mut i32) (i32.const 10))
|
||||
(global $do/m (mut i32) (i32.const 0))
|
||||
(global $do/o (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 24))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 24))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start (; 1 ;) (type $_)
|
||||
(func $start:do (; 1 ;) (type $_)
|
||||
(local $0 i32)
|
||||
block $break|0
|
||||
loop $continue|0
|
||||
@ -180,6 +180,9 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 2 ;) (type $_)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
call $start:do
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -3,7 +3,7 @@
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(func $null (; 0 ;) (type $_)
|
||||
|
@ -21,7 +21,7 @@
|
||||
(global $enum/SelfReference.ZERO i32 (i32.const 0))
|
||||
(global $enum/SelfReference.ONE i32 (i32.const 1))
|
||||
(global $enum/enumType (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "Implicit.ZERO" (global $enum/Implicit.ZERO))
|
||||
@ -42,7 +42,7 @@
|
||||
(func $enum/getZero (; 0 ;) (type $i) (result i32)
|
||||
i32.const 0
|
||||
)
|
||||
(func $start (; 1 ;) (type $_)
|
||||
(func $start:enum (; 1 ;) (type $_)
|
||||
call $enum/getZero
|
||||
global.set $enum/NonConstant.ZERO
|
||||
call $enum/getZero
|
||||
@ -54,6 +54,9 @@
|
||||
global.get $enum/NonConstant.ONE
|
||||
drop
|
||||
)
|
||||
(func $null (; 2 ;) (type $_)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
call $start:enum
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -3,7 +3,7 @@
|
||||
(type $_ (func))
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $export/ns.two)
|
||||
(elem (i32.const 0) $export/ns.one)
|
||||
(global $export/a i32 (i32.const 1))
|
||||
(global $export/b i32 (i32.const 2))
|
||||
(global $export/c i32 (i32.const 3))
|
||||
@ -15,7 +15,7 @@
|
||||
(export "a" (global $export/a))
|
||||
(export "b" (global $export/b))
|
||||
(export "renamed_c" (global $export/c))
|
||||
(export "ns.two" (func $export/ns.two))
|
||||
(export "ns.two" (func $export/ns.one))
|
||||
(func $export/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
@ -31,7 +31,7 @@
|
||||
local.get $1
|
||||
i32.mul
|
||||
)
|
||||
(func $export/ns.two (; 3 ;) (type $_)
|
||||
(func $export/ns.one (; 3 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
@ -7,7 +7,7 @@
|
||||
(global $export/a i32 (i32.const 1))
|
||||
(global $export/b i32 (i32.const 2))
|
||||
(global $export/c i32 (i32.const 3))
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "add" (func $export/add))
|
||||
@ -32,9 +32,12 @@
|
||||
local.get $1
|
||||
i32.mul
|
||||
)
|
||||
(func $export/ns.two (; 3 ;) (type $_)
|
||||
(func $export/ns.one (; 3 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $null (; 4 ;) (type $_)
|
||||
(func $export/ns.two (; 4 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $null (; 5 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -1,10 +1,10 @@
|
||||
(module
|
||||
(type $_ (func))
|
||||
(type $iii (func (param i32 i32) (result i32)))
|
||||
(type $i (func (result i32)))
|
||||
(type $ii (func (param i32) (result i32)))
|
||||
(type $ii_ (func (param i32 i32)))
|
||||
(type $i_ (func (param i32)))
|
||||
(type $_ (func))
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
@ -17,33 +17,33 @@
|
||||
(global $exports/Car.TIRES i32 (i32.const 4))
|
||||
(global $exports/vehicles.Car.TIRES i32 (i32.const 4))
|
||||
(global $exports/outer.inner.a i32 (i32.const 42))
|
||||
(global $~argc (mut i32) (i32.const 0))
|
||||
(global $~lib/argc (mut i32) (i32.const 0))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "add" (func $exports/add))
|
||||
(export "_setargc" (func $~setargc))
|
||||
(export "_setargc" (func $~lib/setargc))
|
||||
(export "subOpt" (func $exports/subOpt|trampoline))
|
||||
(export "math.sub" (func $exports/subOpt))
|
||||
(export "Animal.CAT" (global $exports/Animal.CAT))
|
||||
(export "Animal.DOG" (global $exports/Animal.DOG))
|
||||
(export "animals.Animal.CAT" (global $exports/animals.Animal.CAT))
|
||||
(export "animals.Animal.DOG" (global $exports/animals.Animal.DOG))
|
||||
(export "Car.TIRES" (global $exports/Car.TIRES))
|
||||
(export "Car.getNumTires" (func $exports/Car.getNumTires))
|
||||
(export "Car#constructor" (func $exports/Car#constructor|trampoline))
|
||||
(export "Car#get:doors" (func $exports/Car#get:numDoors))
|
||||
(export "Car#set:doors" (func $exports/Car#set:numDoors))
|
||||
(export "Car#constructor" (func $exports/Car#constructor|trampoline))
|
||||
(export "Car#get:numDoors" (func $exports/Car#get:numDoors))
|
||||
(export "Car#set:numDoors" (func $exports/Car#set:numDoors))
|
||||
(export "Car#openDoors" (func $exports/Car#openDoors))
|
||||
(export "vehicles.Car.TIRES" (global $exports/vehicles.Car.TIRES))
|
||||
(export "vehicles.Car.getNumTires" (func $exports/Car.getNumTires))
|
||||
(export "vehicles.Car#constructor" (func $exports/Car#constructor|trampoline))
|
||||
(export "Car.TIRES" (global $exports/Car.TIRES))
|
||||
(export "Car.getNumTires" (func $exports/Car.getNumTires))
|
||||
(export "vehicles.Car#get:doors" (func $exports/Car#get:numDoors))
|
||||
(export "vehicles.Car#set:doors" (func $exports/Car#set:numDoors))
|
||||
(export "vehicles.Car#constructor" (func $exports/Car#constructor|trampoline))
|
||||
(export "vehicles.Car#get:numDoors" (func $exports/Car#get:numDoors))
|
||||
(export "vehicles.Car#set:numDoors" (func $exports/Car#set:numDoors))
|
||||
(export "vehicles.Car#openDoors" (func $exports/Car#openDoors))
|
||||
(export "vehicles.Car.TIRES" (global $exports/vehicles.Car.TIRES))
|
||||
(export "vehicles.Car.getNumTires" (func $exports/Car.getNumTires))
|
||||
(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)
|
||||
@ -146,7 +146,7 @@
|
||||
block $1of1
|
||||
block $0of1
|
||||
block $outOfRange
|
||||
global.get $~argc
|
||||
global.get $~lib/argc
|
||||
i32.const 1
|
||||
i32.sub
|
||||
br_table $0of1 $1of1 $outOfRange
|
||||
@ -160,15 +160,15 @@
|
||||
local.get $1
|
||||
i32.sub
|
||||
)
|
||||
(func $~setargc (; 10 ;) (type $i_) (param $0 i32)
|
||||
(func $~lib/setargc (; 10 ;) (type $i_) (param $0 i32)
|
||||
local.get $0
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
)
|
||||
(func $exports/Car#constructor|trampoline (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
block $1of1
|
||||
block $0of1
|
||||
block $outOfRange
|
||||
global.get $~argc
|
||||
global.get $~lib/argc
|
||||
br_table $0of1 $1of1 $outOfRange
|
||||
end
|
||||
unreachable
|
||||
|
@ -1,17 +1,13 @@
|
||||
(module
|
||||
(type $_ (func))
|
||||
(type $iii (func (param i32 i32) (result i32)))
|
||||
(type $i (func (result i32)))
|
||||
(type $ii (func (param i32) (result i32)))
|
||||
(type $ii_ (func (param i32 i32)))
|
||||
(type $i_ (func (param i32)))
|
||||
(type $_ (func))
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(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))
|
||||
(global $~lib/internal/allocator/AL_MASK i32 (i32.const 7))
|
||||
(global $~lib/internal/allocator/MAX_SIZE_32 i32 (i32.const 1073741824))
|
||||
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
|
||||
(global $exports/Animal.CAT i32 (i32.const 0))
|
||||
@ -21,55 +17,70 @@
|
||||
(global $exports/Car.TIRES i32 (i32.const 4))
|
||||
(global $exports/vehicles.Car.TIRES i32 (i32.const 4))
|
||||
(global $exports/outer.inner.a i32 (i32.const 42))
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~argc (mut i32) (i32.const 0))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/argc (mut i32) (i32.const 0))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "add" (func $exports/add))
|
||||
(export "_setargc" (func $~setargc))
|
||||
(export "_setargc" (func $~lib/setargc))
|
||||
(export "subOpt" (func $exports/subOpt|trampoline))
|
||||
(export "math.sub" (func $exports/math.sub))
|
||||
(export "Animal.CAT" (global $exports/Animal.CAT))
|
||||
(export "Animal.DOG" (global $exports/Animal.DOG))
|
||||
(export "animals.Animal.CAT" (global $exports/animals.Animal.CAT))
|
||||
(export "animals.Animal.DOG" (global $exports/animals.Animal.DOG))
|
||||
(export "Car.TIRES" (global $exports/Car.TIRES))
|
||||
(export "Car.getNumTires" (func $exports/Car.getNumTires))
|
||||
(export "Car#constructor" (func $exports/Car#constructor|trampoline))
|
||||
(export "Car#get:doors" (func $Car#get:doors))
|
||||
(export "Car#set:doors" (func $Car#set:doors))
|
||||
(export "Car#constructor" (func $exports/Car#constructor|trampoline))
|
||||
(export "Car#get:numDoors" (func $exports/Car#get:numDoors))
|
||||
(export "Car#set:numDoors" (func $exports/Car#set:numDoors))
|
||||
(export "Car#openDoors" (func $exports/Car#openDoors))
|
||||
(export "vehicles.Car.TIRES" (global $exports/vehicles.Car.TIRES))
|
||||
(export "vehicles.Car.getNumTires" (func $exports/vehicles.Car.getNumTires))
|
||||
(export "vehicles.Car#constructor" (func $exports/vehicles.Car#constructor|trampoline))
|
||||
(export "Car.TIRES" (global $exports/Car.TIRES))
|
||||
(export "Car.getNumTires" (func $exports/Car.getNumTires))
|
||||
(export "vehicles.Car#get:doors" (func $vehicles.Car#get:doors))
|
||||
(export "vehicles.Car#set:doors" (func $vehicles.Car#set:doors))
|
||||
(export "vehicles.Car#constructor" (func $exports/vehicles.Car#constructor|trampoline))
|
||||
(export "vehicles.Car#get:numDoors" (func $exports/vehicles.Car#get:numDoors))
|
||||
(export "vehicles.Car#set:numDoors" (func $exports/vehicles.Car#set:numDoors))
|
||||
(export "vehicles.Car#openDoors" (func $exports/vehicles.Car#openDoors))
|
||||
(export "vehicles.Car.TIRES" (global $exports/vehicles.Car.TIRES))
|
||||
(export "vehicles.Car.getNumTires" (func $exports/vehicles.Car.getNumTires))
|
||||
(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)
|
||||
(func $start:~lib/allocator/arena (; 0 ;) (type $_)
|
||||
global.get $~lib/memory/HEAP_BASE
|
||||
i32.const 7
|
||||
i32.add
|
||||
i32.const 7
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
global.set $~lib/allocator/arena/startOffset
|
||||
global.get $~lib/allocator/arena/startOffset
|
||||
global.set $~lib/allocator/arena/offset
|
||||
)
|
||||
(func $start:exports (; 1 ;) (type $_)
|
||||
call $start:~lib/allocator/arena
|
||||
)
|
||||
(func $exports/add (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.add
|
||||
)
|
||||
(func $exports/subOpt (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(func $exports/subOpt (; 3 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.sub
|
||||
)
|
||||
(func $exports/math.sub (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(func $exports/math.sub (; 4 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.sub
|
||||
)
|
||||
(func $exports/Car.getNumTires (; 3 ;) (type $i) (result i32)
|
||||
(func $exports/Car.getNumTires (; 5 ;) (type $i) (result i32)
|
||||
global.get $exports/Car.TIRES
|
||||
)
|
||||
(func $~lib/allocator/arena/__memory_allocate (; 4 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $~lib/allocator/arena/__memory_allocate (; 6 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
@ -77,7 +88,7 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $0
|
||||
global.get $~lib/internal/allocator/MAX_SIZE_32
|
||||
i32.const 1073741824
|
||||
i32.gt_u
|
||||
if
|
||||
unreachable
|
||||
@ -94,9 +105,9 @@
|
||||
i32.gt_u
|
||||
select
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const 7
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const 7
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
@ -148,12 +159,12 @@
|
||||
global.set $~lib/allocator/arena/offset
|
||||
local.get $1
|
||||
)
|
||||
(func $~lib/memory/memory.allocate (; 5 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $~lib/memory/memory.allocate (; 7 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
call $~lib/allocator/arena/__memory_allocate
|
||||
return
|
||||
)
|
||||
(func $exports/Car#constructor (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(func $exports/Car#constructor (; 8 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
block (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
@ -171,22 +182,22 @@
|
||||
i32.store
|
||||
local.get $0
|
||||
)
|
||||
(func $exports/Car#get:numDoors (; 7 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $exports/Car#get:numDoors (; 9 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
)
|
||||
(func $exports/Car#set:numDoors (; 8 ;) (type $ii_) (param $0 i32) (param $1 i32)
|
||||
(func $exports/Car#set:numDoors (; 10 ;) (type $ii_) (param $0 i32) (param $1 i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.store
|
||||
)
|
||||
(func $exports/Car#openDoors (; 9 ;) (type $i_) (param $0 i32)
|
||||
(func $exports/Car#openDoors (; 11 ;) (type $i_) (param $0 i32)
|
||||
nop
|
||||
)
|
||||
(func $exports/vehicles.Car.getNumTires (; 10 ;) (type $i) (result i32)
|
||||
(func $exports/vehicles.Car.getNumTires (; 12 ;) (type $i) (result i32)
|
||||
global.get $exports/vehicles.Car.TIRES
|
||||
)
|
||||
(func $exports/vehicles.Car#constructor (; 11 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(func $exports/vehicles.Car#constructor (; 13 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
block (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
@ -204,37 +215,28 @@
|
||||
i32.store
|
||||
local.get $0
|
||||
)
|
||||
(func $exports/vehicles.Car#get:numDoors (; 12 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $exports/vehicles.Car#get:numDoors (; 14 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
)
|
||||
(func $exports/vehicles.Car#set:numDoors (; 13 ;) (type $ii_) (param $0 i32) (param $1 i32)
|
||||
(func $exports/vehicles.Car#set:numDoors (; 15 ;) (type $ii_) (param $0 i32) (param $1 i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.store
|
||||
)
|
||||
(func $exports/vehicles.Car#openDoors (; 14 ;) (type $i_) (param $0 i32)
|
||||
(func $exports/vehicles.Car#openDoors (; 16 ;) (type $i_) (param $0 i32)
|
||||
nop
|
||||
)
|
||||
(func $start (; 15 ;) (type $_)
|
||||
global.get $HEAP_BASE
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
global.set $~lib/allocator/arena/startOffset
|
||||
global.get $~lib/allocator/arena/startOffset
|
||||
global.set $~lib/allocator/arena/offset
|
||||
(func $start (; 17 ;) (type $_)
|
||||
call $start:exports
|
||||
)
|
||||
(func $null (; 16 ;) (type $_)
|
||||
(func $null (; 18 ;) (type $_)
|
||||
)
|
||||
(func $exports/subOpt|trampoline (; 17 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(func $exports/subOpt|trampoline (; 19 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
block $1of1
|
||||
block $0of1
|
||||
block $outOfRange
|
||||
global.get $~argc
|
||||
global.get $~lib/argc
|
||||
i32.const 1
|
||||
i32.sub
|
||||
br_table $0of1 $1of1 $outOfRange
|
||||
@ -248,15 +250,24 @@
|
||||
local.get $1
|
||||
call $exports/subOpt
|
||||
)
|
||||
(func $~setargc (; 18 ;) (type $i_) (param $0 i32)
|
||||
(func $~lib/setargc (; 20 ;) (type $i_) (param $0 i32)
|
||||
local.get $0
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
)
|
||||
(func $exports/Car#constructor|trampoline (; 19 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(func $Car#get:doors (; 21 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
)
|
||||
(func $Car#set:doors (; 22 ;) (type $ii_) (param $0 i32) (param $1 i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.store
|
||||
)
|
||||
(func $exports/Car#constructor|trampoline (; 23 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
block $1of1
|
||||
block $0of1
|
||||
block $outOfRange
|
||||
global.get $~argc
|
||||
global.get $~lib/argc
|
||||
br_table $0of1 $1of1 $outOfRange
|
||||
end
|
||||
unreachable
|
||||
@ -268,20 +279,20 @@
|
||||
local.get $1
|
||||
call $exports/Car#constructor
|
||||
)
|
||||
(func $Car#get:doors (; 20 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $vehicles.Car#get:doors (; 24 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
)
|
||||
(func $Car#set:doors (; 21 ;) (type $ii_) (param $0 i32) (param $1 i32)
|
||||
(func $vehicles.Car#set:doors (; 25 ;) (type $ii_) (param $0 i32) (param $1 i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.store
|
||||
)
|
||||
(func $exports/vehicles.Car#constructor|trampoline (; 22 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(func $exports/vehicles.Car#constructor|trampoline (; 26 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
block $1of1
|
||||
block $0of1
|
||||
block $outOfRange
|
||||
global.get $~argc
|
||||
global.get $~lib/argc
|
||||
br_table $0of1 $1of1 $outOfRange
|
||||
end
|
||||
unreachable
|
||||
@ -293,13 +304,4 @@
|
||||
local.get $1
|
||||
call $exports/vehicles.Car#constructor
|
||||
)
|
||||
(func $vehicles.Car#get:doors (; 23 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
)
|
||||
(func $vehicles.Car#set:doors (; 24 ;) (type $ii_) (param $0 i32) (param $1 i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.store
|
||||
)
|
||||
)
|
||||
|
@ -10,8 +10,8 @@
|
||||
(elem (i32.const 0) $null)
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "foo.bar" (func $external/foo.bar))
|
||||
(export "foo" (func $external/foo))
|
||||
(export "foo.bar" (func $external/foo.bar))
|
||||
(export "two" (func $external/two))
|
||||
(export "three" (func $external/three))
|
||||
(export "var_" (global $external/var_))
|
||||
|
@ -8,11 +8,11 @@
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "foo.bar" (func $external/foo.bar))
|
||||
(export "foo" (func $external/foo))
|
||||
(export "foo.bar" (func $external/foo.bar))
|
||||
(export "two" (func $external/two))
|
||||
(export "three" (func $external/three))
|
||||
(export "var_" (global $external/var_))
|
||||
|
@ -10,7 +10,7 @@
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start (; 1 ;) (type $_)
|
||||
(func $start:for (; 1 ;) (type $_)
|
||||
(local $0 i32)
|
||||
(local $1 i32)
|
||||
i32.const 0
|
||||
@ -158,7 +158,10 @@
|
||||
end
|
||||
end
|
||||
)
|
||||
(func $null (; 2 ;) (type $_)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
call $start:for
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
@ -7,11 +7,11 @@
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $for/i (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 24))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 24))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start (; 1 ;) (type $_)
|
||||
(func $start:for (; 1 ;) (type $_)
|
||||
(local $0 i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
@ -215,6 +215,9 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 2 ;) (type $_)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
call $start:for
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -7,27 +7,27 @@
|
||||
(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 $0 5 funcref)
|
||||
(elem (i32.const 0) $start~someName|3 $start~anonymous|1 $start~anonymous|1 $start~someName|3 $start~anonymous|4)
|
||||
(elem (i32.const 0) $start:function-expression~someName|3 $start:function-expression~anonymous|1 $start:function-expression~anonymous|1 $start:function-expression~someName|3 $start:function-expression~anonymous|4)
|
||||
(global $function-expression/f1 (mut i32) (i32.const 1))
|
||||
(global $~argc (mut i32) (i32.const 0))
|
||||
(global $~lib/argc (mut i32) (i32.const 0))
|
||||
(global $function-expression/f2 (mut i32) (i32.const 2))
|
||||
(global $function-expression/f3 (mut i32) (i32.const 3))
|
||||
(global $function-expression/f4 (mut i32) (i32.const 4))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start~anonymous|1 (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $start:function-expression~anonymous|1 (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
)
|
||||
(func $start~someName|3 (; 2 ;) (type $_)
|
||||
(func $start:function-expression~someName|3 (; 2 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $start~anonymous|4 (; 3 ;) (type $i) (result i32)
|
||||
(func $start:function-expression~anonymous|4 (; 3 ;) (type $i) (result i32)
|
||||
i32.const 1
|
||||
)
|
||||
(func $start (; 4 ;) (type $_)
|
||||
(func $start:function-expression (; 4 ;) (type $_)
|
||||
i32.const 1
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 1
|
||||
global.get $function-expression/f1
|
||||
call_indirect (type $ii)
|
||||
@ -42,7 +42,7 @@
|
||||
unreachable
|
||||
end
|
||||
i32.const 1
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 2
|
||||
global.get $function-expression/f2
|
||||
call_indirect (type $ii)
|
||||
@ -57,11 +57,11 @@
|
||||
unreachable
|
||||
end
|
||||
i32.const 0
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
global.get $function-expression/f3
|
||||
call_indirect (type $_)
|
||||
i32.const 0
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
global.get $function-expression/f4
|
||||
call_indirect (type $i)
|
||||
i32.const 1
|
||||
@ -75,4 +75,7 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $start (; 5 ;) (type $_)
|
||||
call $start:function-expression
|
||||
)
|
||||
)
|
||||
|
@ -7,32 +7,32 @@
|
||||
(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 $0 5 funcref)
|
||||
(elem (i32.const 0) $null $start~anonymous|1 $start~anonymous|2 $start~someName|3 $start~anonymous|4)
|
||||
(elem (i32.const 0) $null $start:function-expression~anonymous|1 $start:function-expression~anonymous|2 $start:function-expression~someName|3 $start:function-expression~anonymous|4)
|
||||
(global $function-expression/f1 (mut i32) (i32.const 1))
|
||||
(global $~argc (mut i32) (i32.const 0))
|
||||
(global $~lib/argc (mut i32) (i32.const 0))
|
||||
(global $function-expression/f2 (mut i32) (i32.const 2))
|
||||
(global $function-expression/f3 (mut i32) (i32.const 3))
|
||||
(global $function-expression/f4 (mut i32) (i32.const 4))
|
||||
(global $HEAP_BASE i32 (i32.const 56))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 56))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start~anonymous|1 (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $start:function-expression~anonymous|1 (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
)
|
||||
(func $start~anonymous|2 (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $start:function-expression~anonymous|2 (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
)
|
||||
(func $start~someName|3 (; 3 ;) (type $_)
|
||||
(func $start:function-expression~someName|3 (; 3 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $start~anonymous|4 (; 4 ;) (type $i) (result i32)
|
||||
(func $start:function-expression~anonymous|4 (; 4 ;) (type $i) (result i32)
|
||||
i32.const 1
|
||||
)
|
||||
(func $start (; 5 ;) (type $_)
|
||||
(func $start:function-expression (; 5 ;) (type $_)
|
||||
block (result i32)
|
||||
i32.const 1
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 1
|
||||
global.get $function-expression/f1
|
||||
call_indirect (type $ii)
|
||||
@ -50,7 +50,7 @@
|
||||
end
|
||||
block (result i32)
|
||||
i32.const 1
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 2
|
||||
global.get $function-expression/f2
|
||||
call_indirect (type $ii)
|
||||
@ -68,13 +68,13 @@
|
||||
end
|
||||
block
|
||||
i32.const 0
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
global.get $function-expression/f3
|
||||
call_indirect (type $_)
|
||||
end
|
||||
block (result i32)
|
||||
i32.const 0
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
global.get $function-expression/f4
|
||||
call_indirect (type $i)
|
||||
end
|
||||
@ -90,6 +90,9 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 6 ;) (type $_)
|
||||
(func $start (; 6 ;) (type $_)
|
||||
call $start:function-expression
|
||||
)
|
||||
(func $null (; 7 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -10,7 +10,7 @@
|
||||
(table $0 5 funcref)
|
||||
(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)
|
||||
(global $function-types/i32Adder (mut i32) (i32.const 0))
|
||||
(global $~argc (mut i32) (i32.const 0))
|
||||
(global $~lib/argc (mut i32) (i32.const 0))
|
||||
(global $function-types/i64Adder (mut i32) (i32.const 0))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
@ -30,12 +30,12 @@
|
||||
local.get $1
|
||||
f64.add
|
||||
)
|
||||
(func $start (; 4 ;) (type $_)
|
||||
(func $start:function-types (; 4 ;) (type $_)
|
||||
(local $0 i32)
|
||||
i32.const 1
|
||||
global.set $function-types/i32Adder
|
||||
i32.const 2
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 1
|
||||
i32.const 2
|
||||
global.get $function-types/i32Adder
|
||||
@ -53,7 +53,7 @@
|
||||
i32.const 2
|
||||
global.set $function-types/i64Adder
|
||||
i32.const 2
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i64.const 10
|
||||
i64.const 20
|
||||
global.get $function-types/i64Adder
|
||||
@ -69,7 +69,7 @@
|
||||
unreachable
|
||||
end
|
||||
i32.const 2
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
f64.const 1.5
|
||||
f64.const 2.5
|
||||
i32.const 3
|
||||
@ -85,7 +85,7 @@
|
||||
unreachable
|
||||
end
|
||||
i32.const 2
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 2
|
||||
i32.const 3
|
||||
global.get $function-types/i32Adder
|
||||
@ -101,7 +101,7 @@
|
||||
unreachable
|
||||
end
|
||||
i32.const 2
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 3
|
||||
i32.const 4
|
||||
i32.const 1
|
||||
@ -117,7 +117,7 @@
|
||||
unreachable
|
||||
end
|
||||
i32.const 2
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 4
|
||||
i32.const 5
|
||||
i32.const 4
|
||||
@ -133,11 +133,11 @@
|
||||
unreachable
|
||||
end
|
||||
i32.const 2
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
block $1of1
|
||||
block $0of1
|
||||
block $outOfRange
|
||||
global.get $~argc
|
||||
global.get $~lib/argc
|
||||
i32.const 2
|
||||
i32.sub
|
||||
br_table $0of1 $1of1 $outOfRange
|
||||
@ -148,7 +148,7 @@
|
||||
local.set $0
|
||||
end
|
||||
i32.const 2
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 1
|
||||
i32.const 2
|
||||
local.get $0
|
||||
@ -164,7 +164,7 @@
|
||||
unreachable
|
||||
end
|
||||
i32.const 2
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 1
|
||||
i32.const 2
|
||||
i32.const 1
|
||||
@ -180,7 +180,10 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 5 ;) (type $_)
|
||||
(func $start (; 5 ;) (type $_)
|
||||
call $start:function-types
|
||||
)
|
||||
(func $null (; 6 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
@ -12,9 +12,9 @@
|
||||
(table $0 5 funcref)
|
||||
(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)
|
||||
(global $function-types/i32Adder (mut i32) (i32.const 0))
|
||||
(global $~argc (mut i32) (i32.const 0))
|
||||
(global $~lib/argc (mut i32) (i32.const 0))
|
||||
(global $function-types/i64Adder (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 48))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 48))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
@ -44,7 +44,7 @@
|
||||
)
|
||||
(func $function-types/doAddWithFn<i32> (; 7 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
i32.const 2
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
local.get $0
|
||||
local.get $1
|
||||
local.get $2
|
||||
@ -52,7 +52,7 @@
|
||||
)
|
||||
(func $function-types/doAdd<i32> (; 8 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
i32.const 2
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
local.get $0
|
||||
local.get $1
|
||||
call $function-types/makeAdder<i32>
|
||||
@ -65,7 +65,7 @@
|
||||
)
|
||||
(func $function-types/makeAndAdd<i32> (; 10 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
i32.const 2
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
local.get $0
|
||||
local.get $1
|
||||
local.get $2
|
||||
@ -75,7 +75,7 @@
|
||||
block $1of1
|
||||
block $0of1
|
||||
block $outOfRange
|
||||
global.get $~argc
|
||||
global.get $~lib/argc
|
||||
i32.const 2
|
||||
i32.sub
|
||||
br_table $0of1 $1of1 $outOfRange
|
||||
@ -90,13 +90,12 @@
|
||||
local.get $2
|
||||
call $function-types/makeAndAdd<i32>
|
||||
)
|
||||
(func $start (; 12 ;) (type $_)
|
||||
nop
|
||||
(func $start:function-types (; 12 ;) (type $_)
|
||||
call $function-types/makeAdder<i32>
|
||||
global.set $function-types/i32Adder
|
||||
block (result i32)
|
||||
i32.const 2
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 1
|
||||
i32.const 2
|
||||
global.get $function-types/i32Adder
|
||||
@ -117,7 +116,7 @@
|
||||
global.set $function-types/i64Adder
|
||||
block (result i64)
|
||||
i32.const 2
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i64.const 10
|
||||
i64.const 20
|
||||
global.get $function-types/i64Adder
|
||||
@ -136,7 +135,7 @@
|
||||
end
|
||||
block (result f64)
|
||||
i32.const 2
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
f64.const 1.5
|
||||
f64.const 2.5
|
||||
call $function-types/makeAdder<f64>
|
||||
@ -199,7 +198,7 @@
|
||||
end
|
||||
block (result i32)
|
||||
i32.const 2
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 1
|
||||
i32.const 2
|
||||
i32.const 0
|
||||
@ -232,6 +231,9 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 13 ;) (type $_)
|
||||
(func $start (; 13 ;) (type $_)
|
||||
call $start:function-types
|
||||
)
|
||||
(func $null (; 14 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -17,7 +17,7 @@
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
@ -75,7 +75,7 @@
|
||||
local.get $1
|
||||
f64.add
|
||||
)
|
||||
(func $start (; 15 ;) (type $_)
|
||||
(func $start:function (; 15 ;) (type $_)
|
||||
call $function/v
|
||||
call $function/i
|
||||
drop
|
||||
@ -119,6 +119,9 @@
|
||||
call $function/FFF
|
||||
drop
|
||||
)
|
||||
(func $null (; 16 ;) (type $_)
|
||||
(func $start (; 16 ;) (type $_)
|
||||
call $start:function
|
||||
)
|
||||
(func $null (; 17 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -1,13 +1,13 @@
|
||||
(module
|
||||
(type $_ (func))
|
||||
(type $i (func (result i32)))
|
||||
(type $ii (func (param i32) (result i32)))
|
||||
(type $_ (func))
|
||||
(memory $0 0)
|
||||
(table $0 2 funcref)
|
||||
(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))
|
||||
(global $~argc (mut i32) (i32.const 0))
|
||||
(global $~lib/argc (mut i32) (i32.const 0))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "test" (func $getter-call/test))
|
||||
@ -82,7 +82,7 @@
|
||||
call $~lib/allocator/arena/__memory_allocate
|
||||
drop
|
||||
i32.const 0
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 1
|
||||
call_indirect (type $i)
|
||||
)
|
||||
|
@ -1,23 +1,34 @@
|
||||
(module
|
||||
(type $_ (func))
|
||||
(type $i (func (result i32)))
|
||||
(type $ii (func (param i32) (result i32)))
|
||||
(type $_ (func))
|
||||
(memory $0 0)
|
||||
(table $0 2 funcref)
|
||||
(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))
|
||||
(global $~lib/internal/allocator/AL_MASK i32 (i32.const 7))
|
||||
(global $~lib/internal/allocator/MAX_SIZE_32 i32 (i32.const 1073741824))
|
||||
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
|
||||
(global $~argc (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/argc (mut i32) (i32.const 0))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "test" (func $getter-call/test))
|
||||
(start $start)
|
||||
(func $~lib/allocator/arena/__memory_allocate (; 0 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $start:~lib/allocator/arena (; 0 ;) (type $_)
|
||||
global.get $~lib/memory/HEAP_BASE
|
||||
i32.const 7
|
||||
i32.add
|
||||
i32.const 7
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
global.set $~lib/allocator/arena/startOffset
|
||||
global.get $~lib/allocator/arena/startOffset
|
||||
global.set $~lib/allocator/arena/offset
|
||||
)
|
||||
(func $start:getter-call (; 1 ;) (type $_)
|
||||
call $start:~lib/allocator/arena
|
||||
)
|
||||
(func $~lib/allocator/arena/__memory_allocate (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
@ -25,7 +36,7 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $0
|
||||
global.get $~lib/internal/allocator/MAX_SIZE_32
|
||||
i32.const 1073741824
|
||||
i32.gt_u
|
||||
if
|
||||
unreachable
|
||||
@ -42,9 +53,9 @@
|
||||
i32.gt_u
|
||||
select
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const 7
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const 7
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
@ -96,12 +107,12 @@
|
||||
global.set $~lib/allocator/arena/offset
|
||||
local.get $1
|
||||
)
|
||||
(func $~lib/memory/memory.allocate (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $~lib/memory/memory.allocate (; 3 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
call $~lib/allocator/arena/__memory_allocate
|
||||
return
|
||||
)
|
||||
(func $getter-call/C#constructor (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $getter-call/C#constructor (; 4 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
if
|
||||
@ -111,35 +122,26 @@
|
||||
end
|
||||
local.get $0
|
||||
)
|
||||
(func $getter-call/C#get:x~anonymous|1 (; 3 ;) (type $i) (result i32)
|
||||
(func $getter-call/C#get:x~anonymous|1 (; 5 ;) (type $i) (result i32)
|
||||
i32.const 42
|
||||
)
|
||||
(func $getter-call/C#get:x (; 4 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $getter-call/C#get:x (; 6 ;) (type $ii) (param $0 i32) (result i32)
|
||||
i32.const 1
|
||||
)
|
||||
(func $getter-call/test (; 5 ;) (type $i) (result i32)
|
||||
(func $getter-call/test (; 7 ;) (type $i) (result i32)
|
||||
(local $0 i32)
|
||||
i32.const 0
|
||||
call $getter-call/C#constructor
|
||||
local.set $0
|
||||
i32.const 0
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
local.get $0
|
||||
call $getter-call/C#get:x
|
||||
call_indirect (type $i)
|
||||
)
|
||||
(func $start (; 6 ;) (type $_)
|
||||
global.get $HEAP_BASE
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
global.set $~lib/allocator/arena/startOffset
|
||||
global.get $~lib/allocator/arena/startOffset
|
||||
global.set $~lib/allocator/arena/offset
|
||||
(func $start (; 8 ;) (type $_)
|
||||
call $start:getter-call
|
||||
)
|
||||
(func $null (; 7 ;) (type $_)
|
||||
(func $null (; 9 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -10,7 +10,7 @@
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start (; 1 ;) (type $_)
|
||||
(func $start:getter-setter (; 1 ;) (type $_)
|
||||
global.get $getter-setter/Foo._bar
|
||||
if
|
||||
i32.const 0
|
||||
@ -47,7 +47,10 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 2 ;) (type $_)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
call $start:getter-setter
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
@ -9,19 +9,19 @@
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $getter-setter/Foo._bar (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 44))
|
||||
(global $~lib/memory/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)
|
||||
(func $getter-setter/Foo.bar.get:bar (; 1 ;) (type $i) (result i32)
|
||||
global.get $getter-setter/Foo._bar
|
||||
)
|
||||
(func $getter-setter/Foo.set:bar (; 2 ;) (type $i_) (param $0 i32)
|
||||
(func $getter-setter/Foo.bar.set:bar (; 2 ;) (type $i_) (param $0 i32)
|
||||
local.get $0
|
||||
global.set $getter-setter/Foo._bar
|
||||
)
|
||||
(func $start (; 3 ;) (type $_)
|
||||
call $getter-setter/Foo.get:bar
|
||||
(func $start:getter-setter (; 3 ;) (type $_)
|
||||
call $getter-setter/Foo.bar.get:bar
|
||||
i32.const 0
|
||||
i32.eq
|
||||
i32.eqz
|
||||
@ -34,8 +34,8 @@
|
||||
unreachable
|
||||
end
|
||||
i32.const 1
|
||||
call $getter-setter/Foo.set:bar
|
||||
call $getter-setter/Foo.get:bar
|
||||
call $getter-setter/Foo.bar.set:bar
|
||||
call $getter-setter/Foo.bar.get:bar
|
||||
i32.const 1
|
||||
i32.eq
|
||||
i32.eqz
|
||||
@ -49,8 +49,8 @@
|
||||
end
|
||||
block (result i32)
|
||||
i32.const 2
|
||||
call $getter-setter/Foo.set:bar
|
||||
call $getter-setter/Foo.get:bar
|
||||
call $getter-setter/Foo.bar.set:bar
|
||||
call $getter-setter/Foo.bar.get:bar
|
||||
end
|
||||
i32.const 2
|
||||
i32.eq
|
||||
@ -64,6 +64,9 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 4 ;) (type $_)
|
||||
(func $start (; 4 ;) (type $_)
|
||||
call $start:getter-setter
|
||||
)
|
||||
(func $null (; 5 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -8,9 +8,7 @@
|
||||
(elem (i32.const 0) $null)
|
||||
(global $../../examples/i64-polyfill/assembly/i64/lo (mut i32) (i32.const 0))
|
||||
(global $../../examples/i64-polyfill/assembly/i64/hi (mut i32) (i32.const 0))
|
||||
(global $NaN f64 (f64.const nan:0x8000000000000))
|
||||
(global $Infinity f64 (f64.const inf))
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "getHi" (func $../../examples/i64-polyfill/assembly/i64/getHi))
|
||||
|
@ -7,7 +7,7 @@
|
||||
(data (i32.const 8) "\05\00\00\00i\00f\00.\00t\00s\00")
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $HEAP_BASE i32 (i32.const 24))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 24))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "ifThenElse" (func $if/ifThenElse))
|
||||
@ -47,23 +47,7 @@
|
||||
unreachable
|
||||
unreachable
|
||||
)
|
||||
(func $if/ifAlwaysReturns (; 4 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $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 $_)
|
||||
(func $start:if (; 4 ;) (type $_)
|
||||
i32.const 0
|
||||
call $if/ifThenElse
|
||||
i32.const 0
|
||||
@ -143,6 +127,25 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 6 ;) (type $_)
|
||||
(func $if/ifAlwaysReturns (; 5 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $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 (; 6 ;) (type $_)
|
||||
call $start:if
|
||||
)
|
||||
(func $null (; 7 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -7,7 +7,7 @@
|
||||
(global $export/a i32 (i32.const 1))
|
||||
(global $export/b i32 (i32.const 2))
|
||||
(global $export/c i32 (i32.const 3))
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
@ -29,7 +29,7 @@
|
||||
(func $export/ns.two (; 3 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $start (; 4 ;) (type $_)
|
||||
(func $start:import (; 4 ;) (type $_)
|
||||
global.get $export/a
|
||||
global.get $export/b
|
||||
call $export/add
|
||||
@ -57,6 +57,9 @@
|
||||
drop
|
||||
call $export/ns.two
|
||||
)
|
||||
(func $null (; 5 ;) (type $_)
|
||||
(func $start (; 5 ;) (type $_)
|
||||
call $start:import
|
||||
)
|
||||
(func $null (; 6 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -11,7 +11,7 @@
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start (; 0 ;) (type $_)
|
||||
(func $start:infer-type (; 0 ;) (type $_)
|
||||
(local $0 i32)
|
||||
i32.const 0
|
||||
global.set $infer-type/ri
|
||||
@ -34,7 +34,10 @@
|
||||
end
|
||||
end
|
||||
)
|
||||
(func $null (; 1 ;) (type $_)
|
||||
(func $start (; 1 ;) (type $_)
|
||||
call $start:infer-type
|
||||
)
|
||||
(func $null (; 2 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
@ -19,7 +19,7 @@
|
||||
(global $infer-type/rF (mut f64) (f64.const 0))
|
||||
(global $infer-type/inferi (mut i32) (i32.const -2147483648))
|
||||
(global $infer-type/inferu (mut i32) (i32.const 2147483647))
|
||||
(global $HEAP_BASE i32 (i32.const 40))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 40))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
@ -55,7 +55,7 @@
|
||||
(func $infer-type/refF (; 5 ;) (type $F) (result f64)
|
||||
f64.const 0
|
||||
)
|
||||
(func $start (; 6 ;) (type $_)
|
||||
(func $start:infer-type (; 6 ;) (type $_)
|
||||
(local $0 i32)
|
||||
(local $1 i32)
|
||||
global.get $infer-type/i
|
||||
@ -126,6 +126,9 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 7 ;) (type $_)
|
||||
(func $start (; 7 ;) (type $_)
|
||||
call $start:infer-type
|
||||
)
|
||||
(func $null (; 8 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -3,7 +3,7 @@
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "foo" (func $inlining-recursive/foo))
|
||||
|
@ -8,7 +8,7 @@
|
||||
(data (i32.const 8) "\0b\00\00\00i\00n\00l\00i\00n\00i\00n\00g\00.\00t\00s")
|
||||
(table $0 2 funcref)
|
||||
(elem (i32.const 0) $null $inlining/func_fe~anonymous|1)
|
||||
(global $~argc (mut i32) (i32.const 0))
|
||||
(global $~lib/argc (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
|
||||
(export "memory" (memory $0))
|
||||
@ -23,7 +23,7 @@
|
||||
)
|
||||
(func $inlining/test_funcs (; 3 ;) (type $_)
|
||||
i32.const 1
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 2
|
||||
i32.const 1
|
||||
call_indirect (type $ii)
|
||||
|
@ -9,14 +9,10 @@
|
||||
(table $0 2 funcref)
|
||||
(elem (i32.const 0) $null $inlining/func_fe~anonymous|1)
|
||||
(global $inlining/constantGlobal i32 (i32.const 1))
|
||||
(global $~argc (mut i32) (i32.const 0))
|
||||
(global $~lib/internal/allocator/AL_BITS i32 (i32.const 3))
|
||||
(global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8))
|
||||
(global $~lib/internal/allocator/AL_MASK i32 (i32.const 7))
|
||||
(global $~lib/internal/allocator/MAX_SIZE_32 i32 (i32.const 1073741824))
|
||||
(global $~lib/argc (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 36))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 36))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "test" (func $inlining/test))
|
||||
@ -222,7 +218,7 @@
|
||||
end
|
||||
block (result i32)
|
||||
i32.const 1
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
i32.const 2
|
||||
block $inlining/func_fe|inlined.0 (result i32)
|
||||
i32.const 1
|
||||
@ -283,7 +279,19 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $~lib/allocator/arena/__memory_allocate (; 4 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $start:~lib/allocator/arena (; 4 ;) (type $_)
|
||||
global.get $~lib/memory/HEAP_BASE
|
||||
i32.const 7
|
||||
i32.add
|
||||
i32.const 7
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
global.set $~lib/allocator/arena/startOffset
|
||||
global.get $~lib/allocator/arena/startOffset
|
||||
global.set $~lib/allocator/arena/offset
|
||||
)
|
||||
(func $~lib/allocator/arena/__memory_allocate (; 5 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
@ -291,7 +299,7 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $0
|
||||
global.get $~lib/internal/allocator/MAX_SIZE_32
|
||||
i32.const 1073741824
|
||||
i32.gt_u
|
||||
if
|
||||
unreachable
|
||||
@ -308,9 +316,9 @@
|
||||
i32.gt_u
|
||||
select
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const 7
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const 7
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
@ -362,12 +370,12 @@
|
||||
global.set $~lib/allocator/arena/offset
|
||||
local.get $1
|
||||
)
|
||||
(func $~lib/memory/memory.allocate (; 5 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $~lib/memory/memory.allocate (; 6 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
call $~lib/allocator/arena/__memory_allocate
|
||||
return
|
||||
)
|
||||
(func $inlining/test_ctor (; 6 ;) (type $_)
|
||||
(func $inlining/test_ctor (; 7 ;) (type $_)
|
||||
(local $0 i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
@ -475,7 +483,7 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $start (; 7 ;) (type $_)
|
||||
(func $start:inlining (; 8 ;) (type $_)
|
||||
call $inlining/test
|
||||
i32.const 3
|
||||
i32.eq
|
||||
@ -489,18 +497,12 @@
|
||||
unreachable
|
||||
end
|
||||
call $inlining/test_funcs
|
||||
global.get $HEAP_BASE
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
global.set $~lib/allocator/arena/startOffset
|
||||
global.get $~lib/allocator/arena/startOffset
|
||||
global.set $~lib/allocator/arena/offset
|
||||
call $start:~lib/allocator/arena
|
||||
call $inlining/test_ctor
|
||||
)
|
||||
(func $null (; 8 ;) (type $_)
|
||||
(func $start (; 9 ;) (type $_)
|
||||
call $start:inlining
|
||||
)
|
||||
(func $null (; 10 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -10,7 +10,7 @@
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start (; 1 ;) (type $_)
|
||||
(func $start:instanceof (; 1 ;) (type $_)
|
||||
global.get $instanceof/an
|
||||
if
|
||||
i32.const 0
|
||||
@ -33,7 +33,10 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 2 ;) (type $_)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
call $start:instanceof
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
@ -13,7 +13,7 @@
|
||||
(global $instanceof/i (mut i32) (i32.const 0))
|
||||
(global $instanceof/f (mut f32) (f32.const 0))
|
||||
(global $instanceof/an (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 40))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 40))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
@ -29,7 +29,7 @@
|
||||
i32.const 0
|
||||
return
|
||||
)
|
||||
(func $start (; 4 ;) (type $_)
|
||||
(func $start:instanceof (; 4 ;) (type $_)
|
||||
i32.const 1
|
||||
i32.eqz
|
||||
if
|
||||
@ -284,6 +284,9 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 5 ;) (type $_)
|
||||
(func $start (; 5 ;) (type $_)
|
||||
call $start:instanceof
|
||||
)
|
||||
(func $null (; 6 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -29,11 +29,11 @@
|
||||
(global $~lib/builtins/f32.MAX_SAFE_INTEGER f32 (f32.const 16777215))
|
||||
(global $~lib/builtins/f64.MIN_SAFE_INTEGER f64 (f64.const -9007199254740991))
|
||||
(global $~lib/builtins/f64.MAX_SAFE_INTEGER f64 (f64.const 9007199254740991))
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start (; 0 ;) (type $_)
|
||||
(func $start:limits (; 0 ;) (type $_)
|
||||
global.get $~lib/builtins/i8.MIN_VALUE
|
||||
drop
|
||||
global.get $~lib/builtins/i8.MAX_VALUE
|
||||
@ -87,6 +87,9 @@
|
||||
global.get $~lib/builtins/f64.MAX_SAFE_INTEGER
|
||||
drop
|
||||
)
|
||||
(func $null (; 1 ;) (type $_)
|
||||
(func $start (; 1 ;) (type $_)
|
||||
call $start:limits
|
||||
)
|
||||
(func $null (; 2 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -3,11 +3,11 @@
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start (; 0 ;) (type $_)
|
||||
(func $start:literals (; 0 ;) (type $_)
|
||||
i32.const 0
|
||||
drop
|
||||
i32.const 1
|
||||
@ -97,6 +97,9 @@
|
||||
i32.const 0
|
||||
drop
|
||||
)
|
||||
(func $null (; 1 ;) (type $_)
|
||||
(func $start (; 1 ;) (type $_)
|
||||
call $start:literals
|
||||
)
|
||||
(func $null (; 2 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -13,7 +13,7 @@
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start (; 1 ;) (type $_)
|
||||
(func $start:logical (; 1 ;) (type $_)
|
||||
i32.const 2
|
||||
global.set $logical/i
|
||||
global.get $logical/i
|
||||
@ -119,7 +119,10 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 2 ;) (type $_)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
call $start:logical
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
@ -10,11 +10,11 @@
|
||||
(global $logical/I (mut i64) (i64.const 0))
|
||||
(global $logical/f (mut f32) (f32.const 0))
|
||||
(global $logical/F (mut f64) (f64.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 32))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 32))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start (; 1 ;) (type $_)
|
||||
(func $start:logical (; 1 ;) (type $_)
|
||||
(local $0 i32)
|
||||
(local $1 f64)
|
||||
i32.const 0
|
||||
@ -244,6 +244,9 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 2 ;) (type $_)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
call $start:logical
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -1,22 +1,22 @@
|
||||
(module
|
||||
(type $iii (func (param i32 i32) (result i32)))
|
||||
(type $_ (func))
|
||||
(type $iii (func (param i32 i32) (result i32)))
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $main/code (mut i32) (i32.const 0))
|
||||
(global $~started (mut i32) (i32.const 0))
|
||||
(global $~lib/started (mut i32) (i32.const 0))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "main" (func $main/main))
|
||||
(func $main/main (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
global.get $~started
|
||||
global.get $~lib/started
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 1
|
||||
global.set $main/code
|
||||
i32.const 1
|
||||
global.set $~started
|
||||
global.set $~lib/started
|
||||
end
|
||||
global.get $main/code
|
||||
)
|
||||
|
@ -1,6 +1,7 @@
|
||||
var code = 0;
|
||||
code = 1;
|
||||
|
||||
@start
|
||||
export function main(argc: i32, argv: usize): i32 {
|
||||
return code;
|
||||
}
|
||||
|
@ -1,29 +1,32 @@
|
||||
(module
|
||||
(type $iii (func (param i32 i32) (result i32)))
|
||||
(type $_ (func))
|
||||
(type $iii (func (param i32 i32) (result i32)))
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $main/code (mut i32) (i32.const 0))
|
||||
(global $~started (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/started (mut i32) (i32.const 0))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "main" (func $main/main))
|
||||
(func $main/main (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
global.get $~started
|
||||
(func $start:main (; 0 ;) (type $_)
|
||||
i32.const 1
|
||||
global.set $main/code
|
||||
)
|
||||
(func $main/main (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
global.get $~lib/started
|
||||
i32.eqz
|
||||
if
|
||||
call $start
|
||||
i32.const 1
|
||||
global.set $~started
|
||||
global.set $~lib/started
|
||||
end
|
||||
global.get $main/code
|
||||
)
|
||||
(func $start (; 1 ;) (type $_)
|
||||
i32.const 1
|
||||
global.set $main/code
|
||||
(func $start (; 2 ;) (type $_)
|
||||
call $start:main
|
||||
)
|
||||
(func $null (; 2 ;) (type $_)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -7,7 +7,7 @@
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $../../examples/mandelbrot/assembly/index/NUM_COLORS i32 (i32.const 2048))
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "computeLine" (func $../../examples/mandelbrot/assembly/index/computeLine))
|
||||
|
@ -7,7 +7,7 @@
|
||||
(data (i32.const 8) "\0e\00\00\00m\00a\00n\00y\00-\00l\00o\00c\00a\00l\00s\00.\00t\00s\00")
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $HEAP_BASE i32 (i32.const 40))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 40))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "testI32" (func $many-locals/testI32))
|
||||
@ -791,7 +791,7 @@
|
||||
i32.const 24
|
||||
i32.shr_s
|
||||
)
|
||||
(func $start (; 3 ;) (type $_)
|
||||
(func $start:many-locals (; 3 ;) (type $_)
|
||||
i32.const 42
|
||||
call $many-locals/testI32
|
||||
i32.const 42
|
||||
@ -819,6 +819,9 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 4 ;) (type $_)
|
||||
(func $start (; 4 ;) (type $_)
|
||||
call $start:many-locals
|
||||
)
|
||||
(func $null (; 5 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -914,7 +914,7 @@
|
||||
end
|
||||
local.get $6
|
||||
)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
(func $start:memcpy (; 2 ;) (type $_)
|
||||
i32.const 8
|
||||
i64.const 1229782938247303441
|
||||
i64.store
|
||||
@ -1090,7 +1090,10 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
(func $start (; 3 ;) (type $_)
|
||||
call $start:memcpy
|
||||
)
|
||||
(func $null (; 4 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
@ -9,7 +9,7 @@
|
||||
(elem (i32.const 0) $null)
|
||||
(global $memcpy/base i32 (i32.const 8))
|
||||
(global $memcpy/dest (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 32))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 32))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "memcpy" (func $memcpy/memcpy))
|
||||
@ -1208,7 +1208,7 @@
|
||||
end
|
||||
local.get $3
|
||||
)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
(func $start:memcpy (; 2 ;) (type $_)
|
||||
global.get $memcpy/base
|
||||
i64.const 1229782938247303441
|
||||
i64.store
|
||||
@ -1428,6 +1428,9 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
(func $start (; 3 ;) (type $_)
|
||||
call $start:memcpy
|
||||
)
|
||||
(func $null (; 4 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -193,7 +193,7 @@
|
||||
end
|
||||
local.get $3
|
||||
)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
(func $start:memmove (; 2 ;) (type $_)
|
||||
i32.const 8
|
||||
i64.const 1229782938247303441
|
||||
i64.store
|
||||
@ -369,7 +369,10 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
(func $start (; 3 ;) (type $_)
|
||||
call $start:memmove
|
||||
)
|
||||
(func $null (; 4 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
@ -9,7 +9,7 @@
|
||||
(elem (i32.const 0) $null)
|
||||
(global $memmove/base i32 (i32.const 8))
|
||||
(global $memmove/dest (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 32))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 32))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
@ -225,7 +225,7 @@
|
||||
end
|
||||
local.get $3
|
||||
)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
(func $start:memmove (; 2 ;) (type $_)
|
||||
global.get $memmove/base
|
||||
i64.const 1229782938247303441
|
||||
i64.store
|
||||
@ -445,6 +445,9 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
(func $start (; 3 ;) (type $_)
|
||||
call $start:memmove
|
||||
)
|
||||
(func $null (; 4 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -242,7 +242,7 @@
|
||||
end
|
||||
local.get $3
|
||||
)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
(func $start:memset (; 2 ;) (type $_)
|
||||
i32.const 32
|
||||
global.set $memset/dest
|
||||
global.get $memset/dest
|
||||
@ -338,7 +338,10 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
(func $start (; 3 ;) (type $_)
|
||||
call $start:memset
|
||||
)
|
||||
(func $null (; 4 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
@ -8,7 +8,7 @@
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $memset/dest (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 32))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 32))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
@ -276,8 +276,8 @@
|
||||
end
|
||||
local.get $3
|
||||
)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
global.get $HEAP_BASE
|
||||
(func $start:memset (; 2 ;) (type $_)
|
||||
global.get $~lib/memory/HEAP_BASE
|
||||
global.set $memset/dest
|
||||
global.get $memset/dest
|
||||
i32.const 1
|
||||
@ -378,6 +378,9 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
(func $start (; 3 ;) (type $_)
|
||||
call $start:memset
|
||||
)
|
||||
(func $null (; 4 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
11
tests/compiler/merge.optimized.wat
Normal file
11
tests/compiler/merge.optimized.wat
Normal file
@ -0,0 +1,11 @@
|
||||
(module
|
||||
(type $_ (func))
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $start)
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(func $start (; 0 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
)
|
71
tests/compiler/merge.ts
Normal file
71
tests/compiler/merge.ts
Normal file
@ -0,0 +1,71 @@
|
||||
// variable can be shadowed by a type
|
||||
const globalType: i32 = 2;
|
||||
type globalType = bool;
|
||||
globalType;
|
||||
var globalType_test: globalType;
|
||||
|
||||
type typeGlobal = bool;
|
||||
const typeGlobal: i32 = 3;
|
||||
var typeGlobal_test: typeGlobal;
|
||||
typeGlobal;
|
||||
|
||||
// namespace can be shadowed by a type
|
||||
namespace namespaceType { export function test(): void {} }
|
||||
type namespaceType = i32;
|
||||
namespaceType.test();
|
||||
var namespaceType_test: namespaceType;
|
||||
|
||||
type typeNamespace = i32;
|
||||
namespace typeNamespace { export function test(): void {} }
|
||||
var typeNamespace_test: typeNamespace;
|
||||
typeNamespace.test();
|
||||
|
||||
// function can be shadowed by a type
|
||||
function functionType(): void {}
|
||||
type functionType = i32;
|
||||
functionType();
|
||||
var functionType_test: functionType;
|
||||
|
||||
type typeFunction = i32;
|
||||
function typeFunction(): void {}
|
||||
var typeFunction_test: typeFunction;
|
||||
typeFunction();
|
||||
|
||||
// class can join with namespace
|
||||
class classNamespace { static test1(): void {} }
|
||||
namespace classNamespace { export function test2(): void {} }
|
||||
classNamespace.test1();
|
||||
classNamespace.test2();
|
||||
|
||||
namespace namespaceClass { export function test1(): void {} } // TS2434, but possible in AS
|
||||
class namespaceClass { static test2(): void {} }
|
||||
namespaceClass.test1();
|
||||
namespaceClass.test2();
|
||||
|
||||
// function can join with namespace
|
||||
function functionNamespace(): void {}
|
||||
namespace functionNamespace { export function test(): void {} }
|
||||
functionNamespace();
|
||||
functionNamespace.test();
|
||||
|
||||
namespace namespaceFunction { export function test(): void {} } // TS2434, but possible in AS
|
||||
function namespaceFunction(): void {}
|
||||
namespaceFunction.test();
|
||||
namespaceFunction();
|
||||
|
||||
// enum can join with namespace
|
||||
enum enumNamespace { val = 1 }
|
||||
namespace enumNamespace { export function test(): void {} }
|
||||
enumNamespace.val;
|
||||
enumNamespace.test();
|
||||
|
||||
namespace namespaceEnum { export function test(): void {} }
|
||||
enum namespaceEnum { val = 2 }
|
||||
namespaceEnum.test();
|
||||
namespaceEnum.val;
|
||||
|
||||
// namespace can join with namespace
|
||||
namespace namespaceNamespace { export function test1(): void {} }
|
||||
namespace namespaceNamespace { export function test2(): void {} }
|
||||
namespaceNamespace.test1();
|
||||
namespaceNamespace.test2();
|
99
tests/compiler/merge.untouched.wat
Normal file
99
tests/compiler/merge.untouched.wat
Normal file
@ -0,0 +1,99 @@
|
||||
(module
|
||||
(type $_ (func))
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $merge/globalType i32 (i32.const 2))
|
||||
(global $merge/globalType_test (mut i32) (i32.const 0))
|
||||
(global $merge/typeGlobal i32 (i32.const 3))
|
||||
(global $merge/typeGlobal_test (mut i32) (i32.const 0))
|
||||
(global $merge/namespaceType_test (mut i32) (i32.const 0))
|
||||
(global $merge/typeNamespace_test (mut i32) (i32.const 0))
|
||||
(global $merge/functionType_test (mut i32) (i32.const 0))
|
||||
(global $merge/typeFunction_test (mut i32) (i32.const 0))
|
||||
(global $merge/enumNamespace.val (mut i32) (i32.const 1))
|
||||
(global $merge/namespaceEnum.val (mut i32) (i32.const 2))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $merge/namespaceType.test (; 0 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $merge/typeNamespace.test (; 1 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $merge/functionType (; 2 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $merge/typeFunction (; 3 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $merge/classNamespace.test1 (; 4 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $merge/classNamespace.test2 (; 5 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $merge/namespaceClass.test1 (; 6 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $merge/namespaceClass.test2 (; 7 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $merge/functionNamespace (; 8 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $merge/functionNamespace.test (; 9 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $merge/namespaceFunction.test (; 10 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $merge/namespaceFunction (; 11 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $merge/enumNamespace.test (; 12 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $merge/namespaceEnum.test (; 13 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $merge/namespaceNamespace.test1 (; 14 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $merge/namespaceNamespace.test2 (; 15 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $start:merge (; 16 ;) (type $_)
|
||||
global.get $merge/globalType
|
||||
drop
|
||||
global.get $merge/typeGlobal
|
||||
drop
|
||||
call $merge/namespaceType.test
|
||||
call $merge/typeNamespace.test
|
||||
call $merge/functionType
|
||||
call $merge/typeFunction
|
||||
call $merge/classNamespace.test1
|
||||
call $merge/classNamespace.test2
|
||||
call $merge/namespaceClass.test1
|
||||
call $merge/namespaceClass.test2
|
||||
call $merge/functionNamespace
|
||||
call $merge/functionNamespace.test
|
||||
call $merge/namespaceFunction.test
|
||||
call $merge/namespaceFunction
|
||||
global.get $merge/enumNamespace.val
|
||||
drop
|
||||
call $merge/enumNamespace.test
|
||||
call $merge/namespaceEnum.test
|
||||
global.get $merge/namespaceEnum.val
|
||||
drop
|
||||
call $merge/namespaceNamespace.test1
|
||||
call $merge/namespaceNamespace.test2
|
||||
)
|
||||
(func $start (; 17 ;) (type $_)
|
||||
call $start:merge
|
||||
)
|
||||
(func $null (; 18 ;) (type $_)
|
||||
)
|
||||
)
|
@ -4,7 +4,7 @@
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "default" (func $named-export-default/get3))
|
||||
|
@ -4,7 +4,7 @@
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "getValue" (func $named-import-default/getValue))
|
||||
|
@ -2,13 +2,15 @@ namespace Outer {
|
||||
export namespace Inner {
|
||||
export var aVar: i32 = 0;
|
||||
export function aFunc(): i32 { return aVar; }
|
||||
export const enum anEnum { ONE = 1, TWO = 2 }
|
||||
export enum anEnum { ONE = 1, TWO = 2 }
|
||||
export const enum aConstEnum { ONE = 1, TWO = 2 }
|
||||
}
|
||||
}
|
||||
|
||||
Outer.Inner.aVar;
|
||||
Outer.Inner.aFunc();
|
||||
Outer.Inner.anEnum.ONE;
|
||||
Outer.Inner.aConstEnum.TWO;
|
||||
|
||||
const enum Joined { // FIXME: tsc doesn't accept this when 'const'?
|
||||
THREE = 3
|
||||
|
@ -5,10 +5,9 @@
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $namespace/Outer.Inner.aVar (mut i32) (i32.const 0))
|
||||
(global $namespace/Outer.Inner.anEnum.ONE i32 (i32.const 1))
|
||||
(global $namespace/Outer.Inner.anEnum.TWO i32 (i32.const 2))
|
||||
(global $namespace/Joined.THREE i32 (i32.const 3))
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $namespace/Outer.Inner.anEnum.ONE (mut i32) (i32.const 1))
|
||||
(global $namespace/Outer.Inner.anEnum.TWO (mut i32) (i32.const 2))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
@ -16,18 +15,23 @@
|
||||
global.get $namespace/Outer.Inner.aVar
|
||||
)
|
||||
(func $namespace/Joined.anotherFunc (; 1 ;) (type $i) (result i32)
|
||||
global.get $namespace/Joined.THREE
|
||||
i32.const 3
|
||||
)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
(func $start:namespace (; 2 ;) (type $_)
|
||||
global.get $namespace/Outer.Inner.aVar
|
||||
drop
|
||||
call $namespace/Outer.Inner.aFunc
|
||||
drop
|
||||
global.get $namespace/Outer.Inner.anEnum.ONE
|
||||
drop
|
||||
i32.const 2
|
||||
drop
|
||||
call $namespace/Joined.anotherFunc
|
||||
drop
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
(func $start (; 3 ;) (type $_)
|
||||
call $start:namespace
|
||||
)
|
||||
(func $null (; 4 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -5,7 +5,7 @@
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "test" (func $new-without-allocator/test))
|
||||
|
@ -1,13 +1,13 @@
|
||||
(module
|
||||
(type $_ (func))
|
||||
(type $ii (func (param i32) (result i32)))
|
||||
(type $i (func (result i32)))
|
||||
(type $_ (func))
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(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))
|
||||
(global $~argc (mut i32) (i32.const 0))
|
||||
(global $~lib/argc (mut i32) (i32.const 0))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "testVar" (func $nonNullAssertion/testVar))
|
||||
@ -65,13 +65,13 @@
|
||||
)
|
||||
(func $nonNullAssertion/testFn (; 4 ;) (type $ii) (param $0 i32) (result i32)
|
||||
i32.const 0
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
local.get $0
|
||||
call_indirect (type $i)
|
||||
)
|
||||
(func $nonNullAssertion/testObjFn (; 5 ;) (type $ii) (param $0 i32) (result i32)
|
||||
i32.const 0
|
||||
global.set $~argc
|
||||
global.set $~lib/argc
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
call_indirect (type $i)
|
||||
|
@ -1,20 +1,15 @@
|
||||
(module
|
||||
(type $_ (func))
|
||||
(type $ii (func (param i32) (result i32)))
|
||||
(type $iii (func (param i32 i32) (result i32)))
|
||||
(type $i (func (result i32)))
|
||||
(type $_ (func))
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(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))
|
||||
(global $~lib/internal/allocator/AL_MASK i32 (i32.const 7))
|
||||
(global $~lib/internal/allocator/MAX_SIZE_32 i32 (i32.const 1073741824))
|
||||
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
|
||||
(global $~lib/internal/arraybuffer/HEADER_SIZE i32 (i32.const 8))
|
||||
(global $~argc (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/argc (mut i32) (i32.const 0))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "testVar" (func $nonNullAssertion/testVar))
|
||||
@ -30,145 +25,11 @@
|
||||
(export "testObjFn" (func $nonNullAssertion/testObjFn))
|
||||
(export "testObjRet" (func $nonNullAssertion/testObjRet))
|
||||
(start $start)
|
||||
(func $nonNullAssertion/testVar (; 0 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
)
|
||||
(func $nonNullAssertion/testObj (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
)
|
||||
(func $nonNullAssertion/testProp (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
)
|
||||
(func $~lib/array/Array<Foo>#__get (; 3 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $2
|
||||
local.get $1
|
||||
local.get $2
|
||||
i32.load
|
||||
i32.const 2
|
||||
i32.shr_u
|
||||
i32.lt_u
|
||||
if (result i32)
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $1
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $5
|
||||
i32.add
|
||||
i32.load offset=8
|
||||
else
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $nonNullAssertion/testArr (; 4 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.const 0
|
||||
call $~lib/array/Array<Foo>#__get
|
||||
)
|
||||
(func $~lib/array/Array<Foo | null>#__get (; 5 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $2
|
||||
local.get $1
|
||||
local.get $2
|
||||
i32.load
|
||||
i32.const 2
|
||||
i32.shr_u
|
||||
i32.lt_u
|
||||
if (result i32)
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $1
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $5
|
||||
i32.add
|
||||
i32.load offset=8
|
||||
else
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $nonNullAssertion/testElem (; 6 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.const 0
|
||||
call $~lib/array/Array<Foo | null>#__get
|
||||
)
|
||||
(func $nonNullAssertion/testAll (; 7 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.const 0
|
||||
call $~lib/array/Array<Foo | null>#__get
|
||||
i32.load
|
||||
)
|
||||
(func $nonNullAssertion/testAll2 (; 8 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.const 0
|
||||
call $~lib/array/Array<Foo | null>#__get
|
||||
i32.load
|
||||
)
|
||||
(func $nonNullAssertion/testFn (; 9 ;) (type $ii) (param $0 i32) (result i32)
|
||||
i32.const 0
|
||||
global.set $~argc
|
||||
local.get $0
|
||||
call_indirect (type $i)
|
||||
)
|
||||
(func $nonNullAssertion/testFn2 (; 10 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
local.get $0
|
||||
local.set $1
|
||||
i32.const 0
|
||||
global.set $~argc
|
||||
local.get $1
|
||||
call_indirect (type $i)
|
||||
)
|
||||
(func $nonNullAssertion/testRet (; 11 ;) (type $ii) (param $0 i32) (result i32)
|
||||
i32.const 0
|
||||
global.set $~argc
|
||||
local.get $0
|
||||
call_indirect (type $i)
|
||||
)
|
||||
(func $nonNullAssertion/testObjFn (; 12 ;) (type $ii) (param $0 i32) (result i32)
|
||||
i32.const 0
|
||||
global.set $~argc
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
call_indirect (type $i)
|
||||
)
|
||||
(func $nonNullAssertion/testObjRet (; 13 ;) (type $ii) (param $0 i32) (result i32)
|
||||
i32.const 0
|
||||
global.set $~argc
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
call_indirect (type $i)
|
||||
)
|
||||
(func $start (; 14 ;) (type $_)
|
||||
global.get $HEAP_BASE
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
(func $start:~lib/allocator/arena (; 0 ;) (type $_)
|
||||
global.get $~lib/memory/HEAP_BASE
|
||||
i32.const 7
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const 7
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
@ -176,6 +37,146 @@
|
||||
global.get $~lib/allocator/arena/startOffset
|
||||
global.set $~lib/allocator/arena/offset
|
||||
)
|
||||
(func $null (; 15 ;) (type $_)
|
||||
(func $start:nonNullAssertion (; 1 ;) (type $_)
|
||||
call $start:~lib/allocator/arena
|
||||
)
|
||||
(func $nonNullAssertion/testVar (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
)
|
||||
(func $nonNullAssertion/testObj (; 3 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
)
|
||||
(func $nonNullAssertion/testProp (; 4 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
)
|
||||
(func $~lib/array/Array<Foo>#__get (; 5 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $2
|
||||
local.get $1
|
||||
local.get $2
|
||||
i32.load
|
||||
i32.const 2
|
||||
i32.shr_u
|
||||
i32.lt_u
|
||||
if (result i32)
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $1
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $5
|
||||
i32.add
|
||||
i32.load offset=8
|
||||
else
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $nonNullAssertion/testArr (; 6 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.const 0
|
||||
call $~lib/array/Array<Foo>#__get
|
||||
)
|
||||
(func $~lib/array/Array<Foo | null>#__get (; 7 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $2
|
||||
local.get $1
|
||||
local.get $2
|
||||
i32.load
|
||||
i32.const 2
|
||||
i32.shr_u
|
||||
i32.lt_u
|
||||
if (result i32)
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $1
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $5
|
||||
i32.add
|
||||
i32.load offset=8
|
||||
else
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $nonNullAssertion/testElem (; 8 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.const 0
|
||||
call $~lib/array/Array<Foo | null>#__get
|
||||
)
|
||||
(func $nonNullAssertion/testAll (; 9 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.const 0
|
||||
call $~lib/array/Array<Foo | null>#__get
|
||||
i32.load
|
||||
)
|
||||
(func $nonNullAssertion/testAll2 (; 10 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.const 0
|
||||
call $~lib/array/Array<Foo | null>#__get
|
||||
i32.load
|
||||
)
|
||||
(func $nonNullAssertion/testFn (; 11 ;) (type $ii) (param $0 i32) (result i32)
|
||||
i32.const 0
|
||||
global.set $~lib/argc
|
||||
local.get $0
|
||||
call_indirect (type $i)
|
||||
)
|
||||
(func $nonNullAssertion/testFn2 (; 12 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
local.get $0
|
||||
local.set $1
|
||||
i32.const 0
|
||||
global.set $~lib/argc
|
||||
local.get $1
|
||||
call_indirect (type $i)
|
||||
)
|
||||
(func $nonNullAssertion/testRet (; 13 ;) (type $ii) (param $0 i32) (result i32)
|
||||
i32.const 0
|
||||
global.set $~lib/argc
|
||||
local.get $0
|
||||
call_indirect (type $i)
|
||||
)
|
||||
(func $nonNullAssertion/testObjFn (; 14 ;) (type $ii) (param $0 i32) (result i32)
|
||||
i32.const 0
|
||||
global.set $~lib/argc
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
call_indirect (type $i)
|
||||
)
|
||||
(func $nonNullAssertion/testObjRet (; 15 ;) (type $ii) (param $0 i32) (result i32)
|
||||
i32.const 0
|
||||
global.set $~lib/argc
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
call_indirect (type $i)
|
||||
)
|
||||
(func $start (; 16 ;) (type $_)
|
||||
call $start:nonNullAssertion
|
||||
)
|
||||
(func $null (; 17 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -1,4 +1,5 @@
|
||||
(module
|
||||
(type $_ (func))
|
||||
(type $ii (func (param i32) (result i32)))
|
||||
(type $iiii_ (func (param i32 i32 i32 i32)))
|
||||
(type $iii_ (func (param i32 i32 i32)))
|
||||
@ -7,7 +8,6 @@
|
||||
(type $iFi (func (param i32 f64) (result i32)))
|
||||
(type $iIiIiIii (func (param i32 i64 i32 i64 i32 i64 i32) (result i32)))
|
||||
(type $iiii (func (param i32 i32 i32) (result i32)))
|
||||
(type $_ (func))
|
||||
(type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32)))
|
||||
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
|
||||
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
|
||||
@ -2661,7 +2661,7 @@
|
||||
end
|
||||
local.get $1
|
||||
)
|
||||
(func $start (; 15 ;) (type $_)
|
||||
(func $start:number (; 15 ;) (type $_)
|
||||
(local $0 i32)
|
||||
i32.const 2192
|
||||
global.set $~lib/allocator/arena/startOffset
|
||||
@ -2827,7 +2827,10 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 16 ;) (type $_)
|
||||
(func $start (; 16 ;) (type $_)
|
||||
call $start:number
|
||||
)
|
||||
(func $null (; 17 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
@ -1,4 +1,5 @@
|
||||
(module
|
||||
(type $_ (func))
|
||||
(type $ii (func (param i32) (result i32)))
|
||||
(type $iiii_ (func (param i32 i32 i32 i32)))
|
||||
(type $iii_ (func (param i32 i32 i32)))
|
||||
@ -11,7 +12,6 @@
|
||||
(type $iiiii_ (func (param i32 i32 i32 i32 i32)))
|
||||
(type $i_ (func (param i32)))
|
||||
(type $fi (func (param f32) (result i32)))
|
||||
(type $_ (func))
|
||||
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
|
||||
(memory $0 1)
|
||||
(data (i32.const 8) "\01\00\00\000\00")
|
||||
@ -41,44 +41,10 @@
|
||||
(data (i32.const 2176) "\05\00\00\00f\00a\00l\00s\00e\00")
|
||||
(table $0 1 funcref)
|
||||
(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))
|
||||
(global $~lib/internal/allocator/AL_MASK i32 (i32.const 7))
|
||||
(global $~lib/internal/allocator/MAX_SIZE_32 i32 (i32.const 1073741824))
|
||||
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
|
||||
(global $number/a (mut i32) (i32.const 1))
|
||||
(global $ASC_SHRINK_LEVEL i32 (i32.const 0))
|
||||
(global $~lib/internal/string/HEADER_SIZE i32 (i32.const 4))
|
||||
(global $~lib/internal/string/MAX_LENGTH i32 (i32.const 536870910))
|
||||
(global $~lib/internal/arraybuffer/HEADER_SIZE i32 (i32.const 8))
|
||||
(global $~lib/internal/string/CharCode.PLUS i32 (i32.const 43))
|
||||
(global $~lib/internal/string/CharCode.MINUS i32 (i32.const 45))
|
||||
(global $~lib/internal/string/CharCode.DOT i32 (i32.const 46))
|
||||
(global $~lib/internal/string/CharCode._0 i32 (i32.const 48))
|
||||
(global $~lib/internal/string/CharCode._1 i32 (i32.const 49))
|
||||
(global $~lib/internal/string/CharCode._2 i32 (i32.const 50))
|
||||
(global $~lib/internal/string/CharCode._3 i32 (i32.const 51))
|
||||
(global $~lib/internal/string/CharCode._4 i32 (i32.const 52))
|
||||
(global $~lib/internal/string/CharCode._5 i32 (i32.const 53))
|
||||
(global $~lib/internal/string/CharCode._6 i32 (i32.const 54))
|
||||
(global $~lib/internal/string/CharCode._7 i32 (i32.const 55))
|
||||
(global $~lib/internal/string/CharCode._8 i32 (i32.const 56))
|
||||
(global $~lib/internal/string/CharCode._9 i32 (i32.const 57))
|
||||
(global $~lib/internal/string/CharCode.A i32 (i32.const 65))
|
||||
(global $~lib/internal/string/CharCode.B i32 (i32.const 66))
|
||||
(global $~lib/internal/string/CharCode.E i32 (i32.const 69))
|
||||
(global $~lib/internal/string/CharCode.N i32 (i32.const 78))
|
||||
(global $~lib/internal/string/CharCode.O i32 (i32.const 79))
|
||||
(global $~lib/internal/string/CharCode.X i32 (i32.const 88))
|
||||
(global $~lib/internal/string/CharCode.Z i32 (i32.const 90))
|
||||
(global $~lib/internal/string/CharCode.a i32 (i32.const 97))
|
||||
(global $~lib/internal/string/CharCode.b i32 (i32.const 98))
|
||||
(global $~lib/internal/string/CharCode.e i32 (i32.const 101))
|
||||
(global $~lib/internal/string/CharCode.n i32 (i32.const 110))
|
||||
(global $~lib/internal/string/CharCode.o i32 (i32.const 111))
|
||||
(global $~lib/internal/string/CharCode.x i32 (i32.const 120))
|
||||
(global $~lib/internal/string/CharCode.z i32 (i32.const 122))
|
||||
(global $~lib/ASC_SHRINK_LEVEL i32 (i32.const 0))
|
||||
(global $~lib/internal/number/MAX_DOUBLE_LENGTH i32 (i32.const 28))
|
||||
(global $~lib/internal/number/_frc_plus (mut i64) (i64.const 0))
|
||||
(global $~lib/internal/number/_frc_minus (mut i64) (i64.const 0))
|
||||
@ -86,21 +52,31 @@
|
||||
(global $~lib/internal/number/_K (mut i32) (i32.const 0))
|
||||
(global $~lib/internal/number/_frc_pow (mut i64) (i64.const 0))
|
||||
(global $~lib/internal/number/_exp_pow (mut i32) (i32.const 0))
|
||||
(global $NaN f64 (f64.const nan:0x8000000000000))
|
||||
(global $~lib/number/F32.NaN f32 (f32.const nan:0x400000))
|
||||
(global $~lib/builtins/f32.MIN_SAFE_INTEGER f32 (f32.const -16777215))
|
||||
(global $~lib/builtins/f32.MAX_SAFE_INTEGER f32 (f32.const 16777215))
|
||||
(global $Infinity f64 (f64.const inf))
|
||||
(global $~lib/builtins/f32.EPSILON f32 (f32.const 1.1920928955078125e-07))
|
||||
(global $~lib/number/F64.NaN f64 (f64.const nan:0x8000000000000))
|
||||
(global $~lib/builtins/f64.MIN_SAFE_INTEGER f64 (f64.const -9007199254740991))
|
||||
(global $~lib/builtins/f64.MAX_SAFE_INTEGER f64 (f64.const 9007199254740991))
|
||||
(global $~lib/builtins/f64.EPSILON f64 (f64.const 2.220446049250313e-16))
|
||||
(global $HEAP_BASE i32 (i32.const 2192))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 2192))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $~lib/internal/number/decimalCount32 (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $start:~lib/allocator/arena (; 1 ;) (type $_)
|
||||
global.get $~lib/memory/HEAP_BASE
|
||||
i32.const 7
|
||||
i32.add
|
||||
i32.const 7
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
global.set $~lib/allocator/arena/startOffset
|
||||
global.get $~lib/allocator/arena/startOffset
|
||||
global.set $~lib/allocator/arena/offset
|
||||
)
|
||||
(func $~lib/internal/number/decimalCount32 (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
local.get $0
|
||||
i32.const 100000
|
||||
@ -169,7 +145,7 @@
|
||||
unreachable
|
||||
unreachable
|
||||
)
|
||||
(func $~lib/allocator/arena/__memory_allocate (; 2 ;) (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)
|
||||
@ -177,7 +153,7 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $0
|
||||
global.get $~lib/internal/allocator/MAX_SIZE_32
|
||||
i32.const 1073741824
|
||||
i32.gt_u
|
||||
if
|
||||
unreachable
|
||||
@ -194,9 +170,9 @@
|
||||
i32.gt_u
|
||||
select
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const 7
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const 7
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
@ -248,7 +224,7 @@
|
||||
global.set $~lib/allocator/arena/offset
|
||||
local.get $1
|
||||
)
|
||||
(func $~lib/internal/string/allocateUnsafe (; 3 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $~lib/internal/string/allocateUnsafe (; 4 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
local.get $0
|
||||
@ -257,7 +233,7 @@
|
||||
local.tee $1
|
||||
if (result i32)
|
||||
local.get $0
|
||||
global.get $~lib/internal/string/MAX_LENGTH
|
||||
i32.const 536870910
|
||||
i32.le_s
|
||||
else
|
||||
local.get $1
|
||||
@ -272,7 +248,7 @@
|
||||
unreachable
|
||||
end
|
||||
block $~lib/memory/memory.allocate|inlined.0 (result i32)
|
||||
global.get $~lib/internal/string/HEADER_SIZE
|
||||
i32.const 4
|
||||
local.get $0
|
||||
i32.const 1
|
||||
i32.shl
|
||||
@ -288,7 +264,7 @@
|
||||
i32.store
|
||||
local.get $2
|
||||
)
|
||||
(func $~lib/internal/number/utoa32_lut (; 4 ;) (type $iii_) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(func $~lib/internal/number/utoa32_lut (; 5 ;) (type $iii_) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
@ -463,7 +439,7 @@
|
||||
i32.const 1
|
||||
i32.sub
|
||||
local.set $2
|
||||
global.get $~lib/internal/string/CharCode._0
|
||||
i32.const 48
|
||||
local.get $1
|
||||
i32.add
|
||||
local.set $7
|
||||
@ -476,7 +452,7 @@
|
||||
i32.store16 offset=4
|
||||
end
|
||||
)
|
||||
(func $~lib/internal/number/itoa32 (; 5 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $~lib/internal/number/itoa32 (; 6 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
@ -523,21 +499,21 @@
|
||||
local.get $1
|
||||
if
|
||||
local.get $3
|
||||
global.get $~lib/internal/string/CharCode.MINUS
|
||||
i32.const 45
|
||||
i32.store16 offset=4
|
||||
end
|
||||
local.get $3
|
||||
)
|
||||
(func $~lib/internal/number/itoa<i32> (; 6 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $~lib/internal/number/itoa<i32> (; 7 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
call $~lib/internal/number/itoa32
|
||||
return
|
||||
)
|
||||
(func $~lib/number/I32#toString (; 7 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $~lib/number/I32#toString (; 8 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
call $~lib/internal/number/itoa<i32>
|
||||
)
|
||||
(func $~lib/internal/string/compareUnsafe (; 8 ;) (type $iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32)
|
||||
(func $~lib/internal/string/compareUnsafe (; 9 ;) (type $iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(local $7 i32)
|
||||
@ -590,7 +566,7 @@
|
||||
end
|
||||
local.get $5
|
||||
)
|
||||
(func $~lib/string/String.__eq (; 9 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(func $~lib/string/String.__eq (; 10 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
local.get $0
|
||||
@ -634,19 +610,19 @@
|
||||
call $~lib/internal/string/compareUnsafe
|
||||
i32.eqz
|
||||
)
|
||||
(func $~lib/builtins/isFinite<f64> (; 10 ;) (type $Fi) (param $0 f64) (result i32)
|
||||
(func $~lib/builtins/isFinite<f64> (; 11 ;) (type $Fi) (param $0 f64) (result i32)
|
||||
local.get $0
|
||||
local.get $0
|
||||
f64.sub
|
||||
f64.const 0
|
||||
f64.eq
|
||||
)
|
||||
(func $~lib/builtins/isNaN<f64> (; 11 ;) (type $Fi) (param $0 f64) (result i32)
|
||||
(func $~lib/builtins/isNaN<f64> (; 12 ;) (type $Fi) (param $0 f64) (result i32)
|
||||
local.get $0
|
||||
local.get $0
|
||||
f64.ne
|
||||
)
|
||||
(func $~lib/internal/number/genDigits (; 12 ;) (type $iIiIiIii) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32)
|
||||
(func $~lib/internal/number/genDigits (; 13 ;) (type $iIiIiIii) (param $0 i32) (param $1 i64) (param $2 i32) (param $3 i64) (param $4 i32) (param $5 i64) (param $6 i32) (result i32)
|
||||
(local $7 i32)
|
||||
(local $8 i64)
|
||||
(local $9 i64)
|
||||
@ -930,7 +906,7 @@
|
||||
i32.const 1
|
||||
i32.shl
|
||||
i32.add
|
||||
global.get $~lib/internal/string/CharCode._0
|
||||
i32.const 48
|
||||
local.get $17
|
||||
i32.const 65535
|
||||
i32.and
|
||||
@ -1102,7 +1078,7 @@
|
||||
i32.const 1
|
||||
i32.shl
|
||||
i32.add
|
||||
global.get $~lib/internal/string/CharCode._0
|
||||
i32.const 48
|
||||
local.get $19
|
||||
i32.wrap_i64
|
||||
i32.const 65535
|
||||
@ -1239,7 +1215,7 @@
|
||||
end
|
||||
local.get $15
|
||||
)
|
||||
(func $~lib/internal/memory/memcpy (; 13 ;) (type $iii_) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(func $~lib/internal/memory/memcpy (; 14 ;) (type $iii_) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
@ -2440,7 +2416,7 @@
|
||||
i32.store8
|
||||
end
|
||||
)
|
||||
(func $~lib/internal/memory/memmove (; 14 ;) (type $iii_) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(func $~lib/internal/memory/memmove (; 15 ;) (type $iii_) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(local $3 i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
@ -2667,7 +2643,7 @@
|
||||
end
|
||||
end
|
||||
)
|
||||
(func $~lib/internal/number/prettify (; 15 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
(func $~lib/internal/number/prettify (; 16 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
@ -2685,8 +2661,8 @@
|
||||
i32.const 1
|
||||
i32.shl
|
||||
i32.add
|
||||
global.get $~lib/internal/string/CharCode.DOT
|
||||
global.get $~lib/internal/string/CharCode._0
|
||||
i32.const 46
|
||||
i32.const 48
|
||||
i32.const 16
|
||||
i32.shl
|
||||
i32.or
|
||||
@ -2726,7 +2702,7 @@
|
||||
i32.const 1
|
||||
i32.shl
|
||||
i32.add
|
||||
global.get $~lib/internal/string/CharCode._0
|
||||
i32.const 48
|
||||
i32.store16 offset=4
|
||||
local.get $4
|
||||
i32.const 1
|
||||
@ -2742,8 +2718,8 @@
|
||||
i32.const 1
|
||||
i32.shl
|
||||
i32.add
|
||||
global.get $~lib/internal/string/CharCode.DOT
|
||||
global.get $~lib/internal/string/CharCode._0
|
||||
i32.const 46
|
||||
i32.const 48
|
||||
i32.const 16
|
||||
i32.shl
|
||||
i32.or
|
||||
@ -2771,15 +2747,15 @@
|
||||
i32.shl
|
||||
i32.add
|
||||
local.set $4
|
||||
block $memory.copy|inlined.0
|
||||
block $~lib/memory/memory.copy|inlined.0
|
||||
local.get $4
|
||||
global.get $~lib/internal/string/HEADER_SIZE
|
||||
i32.const 4
|
||||
i32.add
|
||||
i32.const 2
|
||||
i32.add
|
||||
local.set $5
|
||||
local.get $4
|
||||
global.get $~lib/internal/string/HEADER_SIZE
|
||||
i32.const 4
|
||||
i32.add
|
||||
local.set $6
|
||||
i32.const 0
|
||||
@ -2798,7 +2774,7 @@
|
||||
i32.const 1
|
||||
i32.shl
|
||||
i32.add
|
||||
global.get $~lib/internal/string/CharCode.DOT
|
||||
i32.const 46
|
||||
i32.store16 offset=4
|
||||
local.get $1
|
||||
i32.const 1
|
||||
@ -2821,9 +2797,9 @@
|
||||
local.get $3
|
||||
i32.sub
|
||||
local.set $4
|
||||
block $memory.copy|inlined.1
|
||||
block $~lib/memory/memory.copy|inlined.1
|
||||
local.get $0
|
||||
global.get $~lib/internal/string/HEADER_SIZE
|
||||
i32.const 4
|
||||
i32.add
|
||||
local.get $4
|
||||
i32.const 1
|
||||
@ -2831,7 +2807,7 @@
|
||||
i32.add
|
||||
local.set $7
|
||||
local.get $0
|
||||
global.get $~lib/internal/string/HEADER_SIZE
|
||||
i32.const 4
|
||||
i32.add
|
||||
local.set $6
|
||||
local.get $1
|
||||
@ -2844,8 +2820,8 @@
|
||||
call $~lib/internal/memory/memmove
|
||||
end
|
||||
local.get $0
|
||||
global.get $~lib/internal/string/CharCode._0
|
||||
global.get $~lib/internal/string/CharCode.DOT
|
||||
i32.const 48
|
||||
i32.const 46
|
||||
i32.const 16
|
||||
i32.shl
|
||||
i32.or
|
||||
@ -2864,7 +2840,7 @@
|
||||
i32.const 1
|
||||
i32.shl
|
||||
i32.add
|
||||
global.get $~lib/internal/string/CharCode._0
|
||||
i32.const 48
|
||||
i32.store16 offset=4
|
||||
local.get $5
|
||||
i32.const 1
|
||||
@ -2885,7 +2861,7 @@
|
||||
i32.eq
|
||||
if
|
||||
local.get $0
|
||||
global.get $~lib/internal/string/CharCode.e
|
||||
i32.const 101
|
||||
i32.store16 offset=6
|
||||
block $~lib/internal/number/genExponent|inlined.0 (result i32)
|
||||
local.get $0
|
||||
@ -2925,8 +2901,8 @@
|
||||
call $~lib/internal/number/utoa32_lut
|
||||
end
|
||||
local.get $4
|
||||
global.get $~lib/internal/string/CharCode.MINUS
|
||||
global.get $~lib/internal/string/CharCode.PLUS
|
||||
i32.const 45
|
||||
i32.const 43
|
||||
local.get $6
|
||||
select
|
||||
i32.store16 offset=4
|
||||
@ -2942,15 +2918,15 @@
|
||||
i32.const 1
|
||||
i32.shl
|
||||
local.set $7
|
||||
block $memory.copy|inlined.2
|
||||
block $~lib/memory/memory.copy|inlined.2
|
||||
local.get $0
|
||||
global.get $~lib/internal/string/HEADER_SIZE
|
||||
i32.const 4
|
||||
i32.add
|
||||
i32.const 4
|
||||
i32.add
|
||||
local.set $6
|
||||
local.get $0
|
||||
global.get $~lib/internal/string/HEADER_SIZE
|
||||
i32.const 4
|
||||
i32.add
|
||||
i32.const 2
|
||||
i32.add
|
||||
@ -2965,12 +2941,12 @@
|
||||
call $~lib/internal/memory/memmove
|
||||
end
|
||||
local.get $0
|
||||
global.get $~lib/internal/string/CharCode.DOT
|
||||
i32.const 46
|
||||
i32.store16 offset=6
|
||||
local.get $0
|
||||
local.get $7
|
||||
i32.add
|
||||
global.get $~lib/internal/string/CharCode.e
|
||||
i32.const 101
|
||||
i32.store16 offset=6
|
||||
local.get $1
|
||||
block $~lib/internal/number/genExponent|inlined.1 (result i32)
|
||||
@ -3013,8 +2989,8 @@
|
||||
call $~lib/internal/number/utoa32_lut
|
||||
end
|
||||
local.get $4
|
||||
global.get $~lib/internal/string/CharCode.MINUS
|
||||
global.get $~lib/internal/string/CharCode.PLUS
|
||||
i32.const 45
|
||||
i32.const 43
|
||||
local.get $6
|
||||
select
|
||||
i32.store16 offset=4
|
||||
@ -3036,7 +3012,7 @@
|
||||
unreachable
|
||||
unreachable
|
||||
)
|
||||
(func $~lib/internal/number/dtoa_core (; 16 ;) (type $iFi) (param $0 i32) (param $1 f64) (result i32)
|
||||
(func $~lib/internal/number/dtoa_core (; 17 ;) (type $iFi) (param $0 i32) (param $1 f64) (result i32)
|
||||
(local $2 i32)
|
||||
(local $3 f64)
|
||||
(local $4 i32)
|
||||
@ -3077,7 +3053,7 @@
|
||||
f64.neg
|
||||
local.set $1
|
||||
local.get $0
|
||||
global.get $~lib/internal/string/CharCode.MINUS
|
||||
i32.const 45
|
||||
i32.store16 offset=4
|
||||
end
|
||||
block $~lib/internal/number/grisu2|inlined.0 (result i32)
|
||||
@ -3513,7 +3489,7 @@
|
||||
local.get $2
|
||||
i32.add
|
||||
)
|
||||
(func $~lib/internal/string/copyUnsafe (; 17 ;) (type $iiiii_) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32)
|
||||
(func $~lib/internal/string/copyUnsafe (; 18 ;) (type $iiiii_) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(local $7 i32)
|
||||
@ -3522,7 +3498,7 @@
|
||||
i32.const 1
|
||||
i32.shl
|
||||
i32.add
|
||||
global.get $~lib/internal/string/HEADER_SIZE
|
||||
i32.const 4
|
||||
i32.add
|
||||
local.set $5
|
||||
local.get $2
|
||||
@ -3530,7 +3506,7 @@
|
||||
i32.const 1
|
||||
i32.shl
|
||||
i32.add
|
||||
global.get $~lib/internal/string/HEADER_SIZE
|
||||
i32.const 4
|
||||
i32.add
|
||||
local.set $6
|
||||
local.get $4
|
||||
@ -3542,7 +3518,7 @@
|
||||
local.get $7
|
||||
call $~lib/internal/memory/memmove
|
||||
)
|
||||
(func $~lib/string/String#substring (; 18 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
(func $~lib/string/String#substring (; 19 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
@ -3652,10 +3628,10 @@
|
||||
call $~lib/internal/string/copyUnsafe
|
||||
local.get $10
|
||||
)
|
||||
(func $~lib/allocator/arena/__memory_free (; 19 ;) (type $i_) (param $0 i32)
|
||||
(func $~lib/allocator/arena/__memory_free (; 20 ;) (type $i_) (param $0 i32)
|
||||
nop
|
||||
)
|
||||
(func $~lib/internal/number/dtoa (; 20 ;) (type $Fi) (param $0 f64) (result i32)
|
||||
(func $~lib/internal/number/dtoa (; 21 ;) (type $Fi) (param $0 f64) (result i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
@ -3721,11 +3697,11 @@
|
||||
end
|
||||
local.get $3
|
||||
)
|
||||
(func $~lib/number/F64#toString (; 21 ;) (type $Fi) (param $0 f64) (result i32)
|
||||
(func $~lib/number/F64#toString (; 22 ;) (type $Fi) (param $0 f64) (result i32)
|
||||
local.get $0
|
||||
call $~lib/internal/number/dtoa
|
||||
)
|
||||
(func $~lib/number/Bool#toString (; 22 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $~lib/number/Bool#toString (; 23 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.const 0
|
||||
i32.ne
|
||||
@ -3735,7 +3711,7 @@
|
||||
i32.const 2176
|
||||
end
|
||||
)
|
||||
(func $~lib/number/F32.isSafeInteger (; 23 ;) (type $fi) (param $0 f32) (result i32)
|
||||
(func $~lib/number/F32.isSafeInteger (; 24 ;) (type $fi) (param $0 f32) (result i32)
|
||||
(local $1 i32)
|
||||
local.get $0
|
||||
f32.abs
|
||||
@ -3751,7 +3727,7 @@
|
||||
local.get $1
|
||||
end
|
||||
)
|
||||
(func $~lib/number/F32.isInteger (; 24 ;) (type $fi) (param $0 f32) (result i32)
|
||||
(func $~lib/number/F32.isInteger (; 25 ;) (type $fi) (param $0 f32) (result i32)
|
||||
(local $1 f32)
|
||||
(local $2 i32)
|
||||
block $~lib/builtins/isFinite<f32>|inlined.0 (result i32)
|
||||
@ -3775,7 +3751,7 @@
|
||||
local.get $2
|
||||
end
|
||||
)
|
||||
(func $~lib/number/F64.isSafeInteger (; 25 ;) (type $Fi) (param $0 f64) (result i32)
|
||||
(func $~lib/number/F64.isSafeInteger (; 26 ;) (type $Fi) (param $0 f64) (result i32)
|
||||
(local $1 i32)
|
||||
local.get $0
|
||||
f64.abs
|
||||
@ -3791,7 +3767,7 @@
|
||||
local.get $1
|
||||
end
|
||||
)
|
||||
(func $~lib/number/F64.isInteger (; 26 ;) (type $Fi) (param $0 f64) (result i32)
|
||||
(func $~lib/number/F64.isInteger (; 27 ;) (type $Fi) (param $0 f64) (result i32)
|
||||
(local $1 f64)
|
||||
(local $2 i32)
|
||||
block $~lib/builtins/isFinite<f64>|inlined.0 (result i32)
|
||||
@ -3815,20 +3791,11 @@
|
||||
local.get $2
|
||||
end
|
||||
)
|
||||
(func $start (; 27 ;) (type $_)
|
||||
(func $start:number (; 28 ;) (type $_)
|
||||
(local $0 i32)
|
||||
(local $1 f32)
|
||||
(local $2 f64)
|
||||
global.get $HEAP_BASE
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
global.set $~lib/allocator/arena/startOffset
|
||||
global.get $~lib/allocator/arena/startOffset
|
||||
global.set $~lib/allocator/arena/offset
|
||||
call $start:~lib/allocator/arena
|
||||
global.get $number/a
|
||||
call $~lib/number/I32#toString
|
||||
i32.const 592
|
||||
@ -4609,6 +4576,9 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 28 ;) (type $_)
|
||||
(func $start (; 29 ;) (type $_)
|
||||
call $start:number
|
||||
)
|
||||
(func $null (; 30 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -1,8 +1,8 @@
|
||||
(module
|
||||
(type $_ (func))
|
||||
(type $ii (func (param i32) (result i32)))
|
||||
(type $i_ (func (param i32)))
|
||||
(type $iiii_ (func (param i32 i32 i32 i32)))
|
||||
(type $_ (func))
|
||||
(type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32)))
|
||||
(type $FUNCSIG$ii (func (param i32) (result i32)))
|
||||
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
|
||||
@ -174,7 +174,7 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $start (; 5 ;) (type $_)
|
||||
(func $start:object-literal (; 5 ;) (type $_)
|
||||
(local $0 i32)
|
||||
i32.const 80
|
||||
global.set $~lib/allocator/arena/startOffset
|
||||
@ -225,7 +225,10 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 6 ;) (type $_)
|
||||
(func $start (; 6 ;) (type $_)
|
||||
call $start:object-literal
|
||||
)
|
||||
(func $null (; 7 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
@ -1,28 +1,35 @@
|
||||
(module
|
||||
(type $_ (func))
|
||||
(type $ii (func (param i32) (result i32)))
|
||||
(type $i_ (func (param i32)))
|
||||
(type $iiii_ (func (param i32 i32 i32 i32)))
|
||||
(type $iii (func (param i32 i32) (result i32)))
|
||||
(type $iiiiii (func (param i32 i32 i32 i32 i32) (result i32)))
|
||||
(type $_ (func))
|
||||
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
|
||||
(memory $0 1)
|
||||
(data (i32.const 8) "\0b\00\00\00h\00e\00l\00l\00o\00 \00w\00o\00r\00l\00d\00")
|
||||
(data (i32.const 40) "\11\00\00\00o\00b\00j\00e\00c\00t\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s\00")
|
||||
(table $0 1 funcref)
|
||||
(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))
|
||||
(global $~lib/internal/allocator/AL_MASK i32 (i32.const 7))
|
||||
(global $~lib/internal/allocator/MAX_SIZE_32 i32 (i32.const 1073741824))
|
||||
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
|
||||
(global $~lib/internal/string/HEADER_SIZE i32 (i32.const 4))
|
||||
(global $HEAP_BASE i32 (i32.const 80))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 80))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $~lib/allocator/arena/__memory_allocate (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $start:~lib/allocator/arena (; 1 ;) (type $_)
|
||||
global.get $~lib/memory/HEAP_BASE
|
||||
i32.const 7
|
||||
i32.add
|
||||
i32.const 7
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
global.set $~lib/allocator/arena/startOffset
|
||||
global.get $~lib/allocator/arena/startOffset
|
||||
global.set $~lib/allocator/arena/offset
|
||||
)
|
||||
(func $~lib/allocator/arena/__memory_allocate (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
@ -30,7 +37,7 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $0
|
||||
global.get $~lib/internal/allocator/MAX_SIZE_32
|
||||
i32.const 1073741824
|
||||
i32.gt_u
|
||||
if
|
||||
unreachable
|
||||
@ -47,9 +54,9 @@
|
||||
i32.gt_u
|
||||
select
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const 7
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const 7
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
@ -101,12 +108,12 @@
|
||||
global.set $~lib/allocator/arena/offset
|
||||
local.get $1
|
||||
)
|
||||
(func $~lib/memory/memory.allocate (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $~lib/memory/memory.allocate (; 3 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
call $~lib/allocator/arena/__memory_allocate
|
||||
return
|
||||
)
|
||||
(func $~lib/internal/string/compareUnsafe (; 3 ;) (type $iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32)
|
||||
(func $~lib/internal/string/compareUnsafe (; 4 ;) (type $iiiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(local $7 i32)
|
||||
@ -159,7 +166,7 @@
|
||||
end
|
||||
local.get $5
|
||||
)
|
||||
(func $~lib/string/String.__eq (; 4 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(func $~lib/string/String.__eq (; 5 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
local.get $0
|
||||
@ -203,7 +210,7 @@
|
||||
call $~lib/internal/string/compareUnsafe
|
||||
i32.eqz
|
||||
)
|
||||
(func $object-literal/bar (; 5 ;) (type $i_) (param $0 i32)
|
||||
(func $object-literal/bar (; 6 ;) (type $i_) (param $0 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
i32.const 1
|
||||
@ -231,7 +238,7 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $object-literal/bar2 (; 6 ;) (type $i_) (param $0 i32)
|
||||
(func $object-literal/bar2 (; 7 ;) (type $i_) (param $0 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
i32.const 2
|
||||
@ -246,7 +253,7 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $object-literal/Foo2#test (; 7 ;) (type $i_) (param $0 i32)
|
||||
(func $object-literal/Foo2#test (; 8 ;) (type $i_) (param $0 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
i32.const 3
|
||||
@ -261,20 +268,11 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $start (; 8 ;) (type $_)
|
||||
(func $start:object-literal (; 9 ;) (type $_)
|
||||
(local $0 i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
global.get $HEAP_BASE
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
global.set $~lib/allocator/arena/startOffset
|
||||
global.get $~lib/allocator/arena/startOffset
|
||||
global.set $~lib/allocator/arena/offset
|
||||
call $start:~lib/allocator/arena
|
||||
block (result i32)
|
||||
i32.const 8
|
||||
call $~lib/memory/memory.allocate
|
||||
@ -309,6 +307,9 @@
|
||||
end
|
||||
call $object-literal/Foo2#test
|
||||
)
|
||||
(func $null (; 9 ;) (type $_)
|
||||
(func $start (; 10 ;) (type $_)
|
||||
call $start:object-literal
|
||||
)
|
||||
(func $null (; 11 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -1,20 +1,16 @@
|
||||
(module
|
||||
(type $ii (func (param i32) (result i32)))
|
||||
(type $_ (func))
|
||||
(type $iiii (func (param i32 i32 i32) (result i32)))
|
||||
(type $iFFF (func (param i32 f64 f64) (result f64)))
|
||||
(type $_ (func))
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(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))
|
||||
(global $~lib/internal/allocator/AL_MASK i32 (i32.const 7))
|
||||
(global $~lib/internal/allocator/MAX_SIZE_32 i32 (i32.const 1073741824))
|
||||
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
|
||||
(global $optional-typeparameters/tConcrete (mut i32) (i32.const 0))
|
||||
(global $optional-typeparameters/tDerived (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
@ -24,7 +20,19 @@
|
||||
(func $optional-typeparameters/testDerived<i32,i32> (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
)
|
||||
(func $~lib/allocator/arena/__memory_allocate (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $start:~lib/allocator/arena (; 2 ;) (type $_)
|
||||
global.get $~lib/memory/HEAP_BASE
|
||||
i32.const 7
|
||||
i32.add
|
||||
i32.const 7
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
global.set $~lib/allocator/arena/startOffset
|
||||
global.get $~lib/allocator/arena/startOffset
|
||||
global.set $~lib/allocator/arena/offset
|
||||
)
|
||||
(func $~lib/allocator/arena/__memory_allocate (; 3 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
@ -32,7 +40,7 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $0
|
||||
global.get $~lib/internal/allocator/MAX_SIZE_32
|
||||
i32.const 1073741824
|
||||
i32.gt_u
|
||||
if
|
||||
unreachable
|
||||
@ -49,9 +57,9 @@
|
||||
i32.gt_u
|
||||
select
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const 7
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const 7
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
@ -103,12 +111,12 @@
|
||||
global.set $~lib/allocator/arena/offset
|
||||
local.get $1
|
||||
)
|
||||
(func $~lib/memory/memory.allocate (; 3 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $~lib/memory/memory.allocate (; 4 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
call $~lib/allocator/arena/__memory_allocate
|
||||
return
|
||||
)
|
||||
(func $optional-typeparameters/TestConcrete<i32,i32>#constructor (; 4 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $optional-typeparameters/TestConcrete<i32,i32>#constructor (; 5 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
if
|
||||
@ -118,12 +126,12 @@
|
||||
end
|
||||
local.get $0
|
||||
)
|
||||
(func $optional-typeparameters/TestConcrete<i32,i32>#test<i32> (; 5 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
(func $optional-typeparameters/TestConcrete<i32,i32>#test<i32> (; 6 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
local.get $1
|
||||
local.get $2
|
||||
i32.add
|
||||
)
|
||||
(func $optional-typeparameters/TestDerived<f64,f64>#constructor (; 6 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $optional-typeparameters/TestDerived<f64,f64>#constructor (; 7 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
if
|
||||
@ -133,28 +141,19 @@
|
||||
end
|
||||
local.get $0
|
||||
)
|
||||
(func $optional-typeparameters/TestDerived<f64,f64>#test<f64> (; 7 ;) (type $iFFF) (param $0 i32) (param $1 f64) (param $2 f64) (result f64)
|
||||
(func $optional-typeparameters/TestDerived<f64,f64>#test<f64> (; 8 ;) (type $iFFF) (param $0 i32) (param $1 f64) (param $2 f64) (result f64)
|
||||
local.get $1
|
||||
local.get $2
|
||||
f64.add
|
||||
)
|
||||
(func $start (; 8 ;) (type $_)
|
||||
(func $start:optional-typeparameters (; 9 ;) (type $_)
|
||||
i32.const 1
|
||||
call $optional-typeparameters/testConcrete<i32,i32>
|
||||
drop
|
||||
i32.const 2
|
||||
call $optional-typeparameters/testDerived<i32,i32>
|
||||
drop
|
||||
global.get $HEAP_BASE
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
global.set $~lib/allocator/arena/startOffset
|
||||
global.get $~lib/allocator/arena/startOffset
|
||||
global.set $~lib/allocator/arena/offset
|
||||
call $start:~lib/allocator/arena
|
||||
i32.const 0
|
||||
call $optional-typeparameters/TestConcrete<i32,i32>#constructor
|
||||
global.set $optional-typeparameters/tConcrete
|
||||
@ -172,6 +171,9 @@
|
||||
call $optional-typeparameters/TestDerived<f64,f64>#test<f64>
|
||||
drop
|
||||
)
|
||||
(func $null (; 9 ;) (type $_)
|
||||
(func $start (; 10 ;) (type $_)
|
||||
call $start:optional-typeparameters
|
||||
)
|
||||
(func $null (; 11 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -6,11 +6,11 @@
|
||||
(data (i32.const 8) "\0b\00\00\00o\00v\00e\00r\00f\00l\00o\00w\00.\00t\00s\00")
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $HEAP_BASE i32 (i32.const 36))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 36))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start (; 1 ;) (type $_)
|
||||
(func $start:overflow (; 1 ;) (type $_)
|
||||
(local $0 i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
@ -755,6 +755,9 @@
|
||||
end
|
||||
end
|
||||
)
|
||||
(func $null (; 2 ;) (type $_)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
call $start:overflow
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -13,7 +13,7 @@
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start (; 1 ;) (type $_)
|
||||
(func $start:portable-conversions (; 1 ;) (type $_)
|
||||
global.get $portable-conversions/i
|
||||
i32.const 255
|
||||
i32.and
|
||||
@ -614,7 +614,10 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 2 ;) (type $_)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
call $start:portable-conversions
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
@ -10,11 +10,11 @@
|
||||
(global $portable-conversions/I (mut i64) (i64.const 1))
|
||||
(global $portable-conversions/f (mut f32) (f32.const 1))
|
||||
(global $portable-conversions/F (mut f64) (f64.const 1))
|
||||
(global $HEAP_BASE i32 (i32.const 60))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 60))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start (; 1 ;) (type $_)
|
||||
(func $start:portable-conversions (; 1 ;) (type $_)
|
||||
global.get $portable-conversions/i
|
||||
i32.const 24
|
||||
i32.shl
|
||||
@ -636,6 +636,9 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 2 ;) (type $_)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
call $start:portable-conversions
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -4,7 +4,7 @@
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "fib" (func $recursive/fib))
|
||||
|
@ -3,7 +3,7 @@
|
||||
(type $_ (func))
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $export/ns.two)
|
||||
(elem (i32.const 0) $export/ns.one)
|
||||
(global $export/a i32 (i32.const 1))
|
||||
(global $export/b i32 (i32.const 2))
|
||||
(global $export/c i32 (i32.const 3))
|
||||
@ -19,23 +19,23 @@
|
||||
(export "rerenamed_c" (global $export/c))
|
||||
(export "renamed_add" (func $export/add))
|
||||
(export "rerenamed_sub" (func $export/mul))
|
||||
(export "renamed_ns.two" (func $export/ns.two))
|
||||
(export "renamed_ns.two" (func $export/ns.one))
|
||||
(func $export/add (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.add
|
||||
)
|
||||
(func $export/sub (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.sub
|
||||
)
|
||||
(func $export/mul (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(func $export/mul (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.mul
|
||||
)
|
||||
(func $export/ns.two (; 3 ;) (type $_)
|
||||
(func $export/sub (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.sub
|
||||
)
|
||||
(func $export/ns.one (; 3 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
@ -7,7 +7,7 @@
|
||||
(global $export/a i32 (i32.const 1))
|
||||
(global $export/b i32 (i32.const 2))
|
||||
(global $export/c i32 (i32.const 3))
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "add" (func $export/add))
|
||||
@ -27,20 +27,12 @@
|
||||
local.get $1
|
||||
i32.add
|
||||
)
|
||||
(func $export/sub (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.sub
|
||||
)
|
||||
(func $export/mul (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(func $export/mul (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.mul
|
||||
)
|
||||
(func $export/ns.two (; 3 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $start (; 4 ;) (type $_)
|
||||
(func $start:reexport (; 2 ;) (type $_)
|
||||
i32.const 1
|
||||
i32.const 2
|
||||
call $export/add
|
||||
@ -50,6 +42,20 @@
|
||||
i32.add
|
||||
drop
|
||||
)
|
||||
(func $null (; 5 ;) (type $_)
|
||||
(func $export/sub (; 3 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.sub
|
||||
)
|
||||
(func $export/ns.one (; 4 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $export/ns.two (; 5 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
(func $start (; 6 ;) (type $_)
|
||||
call $start:reexport
|
||||
)
|
||||
(func $null (; 7 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
@ -7,7 +7,7 @@
|
||||
(global $export/a i32 (i32.const 1))
|
||||
(global $export/b i32 (i32.const 2))
|
||||
(global $export/c i32 (i32.const 3))
|
||||
(global $HEAP_BASE i32 (i32.const 8))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "a" (global $export/a))
|
||||
@ -25,7 +25,7 @@
|
||||
local.get $1
|
||||
i32.mul
|
||||
)
|
||||
(func $start (; 2 ;) (type $_)
|
||||
(func $start:reexport (; 2 ;) (type $_)
|
||||
i32.const 1
|
||||
i32.const 2
|
||||
call $export/add
|
||||
@ -35,6 +35,12 @@
|
||||
i32.add
|
||||
drop
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
(func $start:rereexport (; 3 ;) (type $_)
|
||||
call $start:reexport
|
||||
)
|
||||
(func $start (; 4 ;) (type $_)
|
||||
call $start:rereexport
|
||||
)
|
||||
(func $null (; 5 ;) (type $_)
|
||||
)
|
||||
)
|
||||
|
26
tests/compiler/resolve-nested.optimized.wat
Normal file
26
tests/compiler/resolve-nested.optimized.wat
Normal file
@ -0,0 +1,26 @@
|
||||
(module
|
||||
(type $iiiiii_ (func (param i32 i32 i32 i32 i32 i32)))
|
||||
(type $iiiii_ (func (param i32 i32 i32 i32 i32)))
|
||||
(type $iii_ (func (param i32 i32 i32)))
|
||||
(type $_ (func))
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "Outer.Inner.evenInner" (func $resolve-nested/Outer.Inner.evenInner))
|
||||
(export "Outer.inner" (func $resolve-nested/Outer.inner))
|
||||
(export "outer" (func $resolve-nested/outer))
|
||||
(func $resolve-nested/Outer.Inner.evenInner (; 0 ;) (type $iiiiii_) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32)
|
||||
nop
|
||||
)
|
||||
(func $resolve-nested/Outer.inner (; 1 ;) (type $iiiii_) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32)
|
||||
nop
|
||||
)
|
||||
(func $resolve-nested/outer (; 2 ;) (type $iii_) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
nop
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
nop
|
||||
)
|
||||
)
|
41
tests/compiler/resolve-nested.ts
Normal file
41
tests/compiler/resolve-nested.ts
Normal file
@ -0,0 +1,41 @@
|
||||
class OuterClass {}
|
||||
export namespace Outer {
|
||||
export class InnerClass {}
|
||||
export namespace Inner {
|
||||
export class EvenInnerClass {}
|
||||
var a: OuterClass;
|
||||
var b: InnerClass;
|
||||
var c: EvenInnerClass;
|
||||
var d: Outer.InnerClass;
|
||||
var e: Outer.Inner.EvenInnerClass;
|
||||
var f: Inner.EvenInnerClass;
|
||||
export function evenInner(
|
||||
a: OuterClass,
|
||||
b: InnerClass,
|
||||
c: EvenInnerClass,
|
||||
d: Outer.InnerClass,
|
||||
e: Outer.Inner.EvenInnerClass,
|
||||
f: Inner.EvenInnerClass
|
||||
): void {}
|
||||
}
|
||||
var a: OuterClass;
|
||||
var b: InnerClass;
|
||||
var c: Inner.EvenInnerClass;
|
||||
var d: Outer.InnerClass;
|
||||
var e: Outer.Inner.EvenInnerClass;
|
||||
export function inner(
|
||||
a: OuterClass,
|
||||
b: InnerClass,
|
||||
c: Inner.EvenInnerClass,
|
||||
d: Outer.InnerClass,
|
||||
e: Outer.Inner.EvenInnerClass
|
||||
): void {}
|
||||
}
|
||||
var a: OuterClass;
|
||||
var b: Outer.InnerClass;
|
||||
var c: Outer.Inner.EvenInnerClass;
|
||||
export function outer(
|
||||
a: OuterClass,
|
||||
b: Outer.InnerClass,
|
||||
c: Outer.Inner.EvenInnerClass
|
||||
): void {}
|
40
tests/compiler/resolve-nested.untouched.wat
Normal file
40
tests/compiler/resolve-nested.untouched.wat
Normal file
@ -0,0 +1,40 @@
|
||||
(module
|
||||
(type $iiiiii_ (func (param i32 i32 i32 i32 i32 i32)))
|
||||
(type $iiiii_ (func (param i32 i32 i32 i32 i32)))
|
||||
(type $iii_ (func (param i32 i32 i32)))
|
||||
(type $_ (func))
|
||||
(memory $0 0)
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $resolve-nested/Outer.Inner.a (mut i32) (i32.const 0))
|
||||
(global $resolve-nested/Outer.Inner.b (mut i32) (i32.const 0))
|
||||
(global $resolve-nested/Outer.Inner.c (mut i32) (i32.const 0))
|
||||
(global $resolve-nested/Outer.Inner.d (mut i32) (i32.const 0))
|
||||
(global $resolve-nested/Outer.Inner.e (mut i32) (i32.const 0))
|
||||
(global $resolve-nested/Outer.Inner.f (mut i32) (i32.const 0))
|
||||
(global $resolve-nested/Outer.a (mut i32) (i32.const 0))
|
||||
(global $resolve-nested/Outer.b (mut i32) (i32.const 0))
|
||||
(global $resolve-nested/Outer.c (mut i32) (i32.const 0))
|
||||
(global $resolve-nested/Outer.d (mut i32) (i32.const 0))
|
||||
(global $resolve-nested/Outer.e (mut i32) (i32.const 0))
|
||||
(global $resolve-nested/a (mut i32) (i32.const 0))
|
||||
(global $resolve-nested/b (mut i32) (i32.const 0))
|
||||
(global $resolve-nested/c (mut i32) (i32.const 0))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 8))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "Outer.Inner.evenInner" (func $resolve-nested/Outer.Inner.evenInner))
|
||||
(export "Outer.inner" (func $resolve-nested/Outer.inner))
|
||||
(export "outer" (func $resolve-nested/outer))
|
||||
(func $resolve-nested/Outer.Inner.evenInner (; 0 ;) (type $iiiiii_) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (param $5 i32)
|
||||
nop
|
||||
)
|
||||
(func $resolve-nested/Outer.inner (; 1 ;) (type $iiiii_) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32)
|
||||
nop
|
||||
)
|
||||
(func $resolve-nested/outer (; 2 ;) (type $iii_) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
nop
|
||||
)
|
||||
(func $null (; 3 ;) (type $_)
|
||||
)
|
||||
)
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user