mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-04-25 15:12:12 +00:00
183 lines
4.7 KiB
Plaintext
183 lines
4.7 KiB
Plaintext
(module
|
|
(type $FUNCSIG$v (func))
|
|
(type $FUNCSIG$ii (func (param i32) (result i32)))
|
|
(type $FUNCSIG$iii (func (param i32 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 $~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))
|
|
(export "testObj" (func $nonNullAssertion/testObj))
|
|
(export "testProp" (func $nonNullAssertion/testProp))
|
|
(export "testArr" (func $nonNullAssertion/testArr))
|
|
(export "testElem" (func $nonNullAssertion/testElem))
|
|
(export "testAll" (func $nonNullAssertion/testAll))
|
|
(export "testAll2" (func $nonNullAssertion/testAll2))
|
|
(export "testFn" (func $nonNullAssertion/testFn))
|
|
(export "testFn2" (func $nonNullAssertion/testFn2))
|
|
(export "testRet" (func $nonNullAssertion/testRet))
|
|
(export "testObjFn" (func $nonNullAssertion/testObjFn))
|
|
(export "testObjRet" (func $nonNullAssertion/testObjRet))
|
|
(start $start)
|
|
(func $start:~lib/allocator/arena (; 0 ;) (type $FUNCSIG$v)
|
|
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:nonNullAssertion (; 1 ;) (type $FUNCSIG$v)
|
|
call $start:~lib/allocator/arena
|
|
)
|
|
(func $nonNullAssertion/testVar (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
|
local.get $0
|
|
)
|
|
(func $nonNullAssertion/testObj (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
|
local.get $0
|
|
i32.load
|
|
)
|
|
(func $nonNullAssertion/testProp (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
|
local.get $0
|
|
i32.load
|
|
)
|
|
(func $~lib/array/Array<Foo>#__get (; 5 ;) (type $FUNCSIG$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 $FUNCSIG$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 $FUNCSIG$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 $FUNCSIG$ii) (param $0 i32) (result i32)
|
|
local.get $0
|
|
i32.const 0
|
|
call $~lib/array/Array<Foo | null>#__get
|
|
)
|
|
(func $nonNullAssertion/testAll (; 9 ;) (type $FUNCSIG$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 $FUNCSIG$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 $FUNCSIG$ii) (param $0 i32) (result i32)
|
|
i32.const 0
|
|
global.set $~lib/argc
|
|
local.get $0
|
|
call_indirect (type $FUNCSIG$i)
|
|
)
|
|
(func $nonNullAssertion/testFn2 (; 12 ;) (type $FUNCSIG$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 $FUNCSIG$i)
|
|
)
|
|
(func $nonNullAssertion/testRet (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
|
i32.const 0
|
|
global.set $~lib/argc
|
|
local.get $0
|
|
call_indirect (type $FUNCSIG$i)
|
|
)
|
|
(func $nonNullAssertion/testObjFn (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
|
i32.const 0
|
|
global.set $~lib/argc
|
|
local.get $0
|
|
i32.load offset=4
|
|
call_indirect (type $FUNCSIG$i)
|
|
)
|
|
(func $nonNullAssertion/testObjRet (; 15 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
|
i32.const 0
|
|
global.set $~lib/argc
|
|
local.get $0
|
|
i32.load offset=4
|
|
call_indirect (type $FUNCSIG$i)
|
|
)
|
|
(func $start (; 16 ;) (type $FUNCSIG$v)
|
|
call $start:nonNullAssertion
|
|
)
|
|
(func $null (; 17 ;) (type $FUNCSIG$v)
|
|
)
|
|
)
|