2018-12-07 14:33:32 +01:00
|
|
|
(module
|
2019-03-01 00:01:23 +01:00
|
|
|
(type $FUNCSIG$v (func))
|
2019-06-05 23:15:39 +02:00
|
|
|
(type $FUNCSIG$ii (func (param i32) (result i32)))
|
2018-12-07 14:33:32 +01:00
|
|
|
(memory $0 0)
|
2019-06-05 23:15:39 +02:00
|
|
|
(global $~lib/rt/stub/startOffset (mut i32) (i32.const 0))
|
|
|
|
(global $~lib/rt/stub/offset (mut i32) (i32.const 0))
|
2018-12-07 14:33:32 +01:00
|
|
|
(global $optional-typeparameters/tConcrete (mut i32) (i32.const 0))
|
|
|
|
(global $optional-typeparameters/tDerived (mut i32) (i32.const 0))
|
|
|
|
(export "memory" (memory $0))
|
|
|
|
(start $start)
|
2019-06-05 23:15:39 +02:00
|
|
|
(func $~lib/rt/stub/__alloc (; 0 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
2018-12-07 14:33:32 +01:00
|
|
|
(local $1 i32)
|
|
|
|
(local $2 i32)
|
|
|
|
(local $3 i32)
|
2019-06-05 23:15:39 +02:00
|
|
|
(local $4 i32)
|
|
|
|
global.get $~lib/rt/stub/offset
|
|
|
|
i32.const 16
|
|
|
|
i32.add
|
|
|
|
local.tee $2
|
|
|
|
i32.const 16
|
2018-12-07 14:33:32 +01:00
|
|
|
i32.add
|
2019-06-05 23:15:39 +02:00
|
|
|
i32.const -16
|
2018-12-07 14:33:32 +01:00
|
|
|
i32.and
|
2019-02-28 18:26:04 +01:00
|
|
|
local.tee $1
|
2019-06-05 23:15:39 +02:00
|
|
|
memory.size
|
|
|
|
local.tee $3
|
2018-12-07 14:33:32 +01:00
|
|
|
i32.const 16
|
|
|
|
i32.shl
|
|
|
|
i32.gt_u
|
|
|
|
if
|
2019-06-05 23:15:39 +02:00
|
|
|
local.get $3
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $1
|
2019-06-05 23:15:39 +02:00
|
|
|
local.get $2
|
2018-12-07 14:33:32 +01:00
|
|
|
i32.sub
|
|
|
|
i32.const 65535
|
|
|
|
i32.add
|
|
|
|
i32.const -65536
|
|
|
|
i32.and
|
|
|
|
i32.const 16
|
|
|
|
i32.shr_u
|
2019-06-05 23:15:39 +02:00
|
|
|
local.tee $4
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $3
|
2019-06-05 23:15:39 +02:00
|
|
|
local.get $4
|
2018-12-07 14:33:32 +01:00
|
|
|
i32.gt_s
|
|
|
|
select
|
2019-06-05 23:15:39 +02:00
|
|
|
memory.grow
|
2018-12-07 14:33:32 +01:00
|
|
|
i32.const 0
|
|
|
|
i32.lt_s
|
|
|
|
if
|
2019-06-05 23:15:39 +02:00
|
|
|
local.get $4
|
|
|
|
memory.grow
|
2018-12-07 14:33:32 +01:00
|
|
|
i32.const 0
|
|
|
|
i32.lt_s
|
|
|
|
if
|
|
|
|
unreachable
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $1
|
2019-06-05 23:15:39 +02:00
|
|
|
global.set $~lib/rt/stub/offset
|
|
|
|
local.get $2
|
|
|
|
i32.const 16
|
|
|
|
i32.sub
|
|
|
|
local.tee $1
|
2019-02-28 18:26:04 +01:00
|
|
|
local.get $0
|
2019-06-05 23:15:39 +02:00
|
|
|
i32.store offset=8
|
|
|
|
local.get $1
|
|
|
|
i32.const 0
|
|
|
|
i32.store offset=12
|
|
|
|
local.get $2
|
2018-12-07 14:33:32 +01:00
|
|
|
)
|
2019-03-01 00:01:23 +01:00
|
|
|
(func $start (; 1 ;) (type $FUNCSIG$v)
|
2019-06-05 23:15:39 +02:00
|
|
|
i32.const 16
|
|
|
|
global.set $~lib/rt/stub/startOffset
|
|
|
|
global.get $~lib/rt/stub/startOffset
|
|
|
|
global.set $~lib/rt/stub/offset
|
|
|
|
i32.const 3
|
|
|
|
call $~lib/rt/stub/__alloc
|
2019-02-05 17:12:10 +01:00
|
|
|
global.set $optional-typeparameters/tConcrete
|
2019-06-05 23:15:39 +02:00
|
|
|
i32.const 4
|
|
|
|
call $~lib/rt/stub/__alloc
|
2019-02-05 17:12:10 +01:00
|
|
|
global.set $optional-typeparameters/tDerived
|
2018-12-07 14:33:32 +01:00
|
|
|
)
|
2019-03-01 00:01:23 +01:00
|
|
|
(func $null (; 2 ;) (type $FUNCSIG$v)
|
2018-12-07 14:33:32 +01:00
|
|
|
nop
|
|
|
|
)
|
|
|
|
)
|