assemblyscript/tests/compiler/gc/global-init.untouched.wat

330 lines
7.4 KiB
Plaintext
Raw Normal View History

2019-03-27 14:43:35 +01:00
(module
(type $FUNCSIG$ii (func (param i32) (result i32)))
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
2019-04-02 16:18:44 +02:00
(type $FUNCSIG$vi (func (param i32)))
2019-03-27 14:43:35 +01:00
(type $FUNCSIG$viiddddd (func (param i32 i32 f64 f64 f64 f64 f64)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(import "env" "trace" (func $~lib/env/trace (param i32 i32 f64 f64 f64 f64 f64)))
(memory $0 1)
(data (i32.const 8) "\02\00\00\00\1e\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s\00")
(data (i32.const 56) "\02\00\00\00\16\00\00\00\00\00\00\00\00\00\00\00g\00c\00.\00r\00e\00g\00i\00s\00t\00e\00r\00")
(data (i32.const 96) "\02\00\00\00\"\00\00\00\00\00\00\00\00\00\00\00g\00c\00/\00g\00l\00o\00b\00a\00l\00-\00i\00n\00i\00t\00.\00t\00s\00")
2019-04-02 16:18:44 +02:00
(table $0 1 funcref)
(elem (i32.const 0) $null)
2019-03-27 14:43:35 +01:00
(global $gc/_dummy/collect_count (mut i32) (i32.const 0))
(global $gc/_dummy/register_count (mut i32) (i32.const 0))
(global $gc/_dummy/register_ref (mut i32) (i32.const 0))
(global $gc/_dummy/link_count (mut i32) (i32.const 0))
(global $gc/_dummy/link_ref (mut i32) (i32.const 0))
(global $gc/_dummy/link_parentRef (mut i32) (i32.const 0))
(global $gc/_dummy/unlink_count (mut i32) (i32.const 0))
(global $gc/_dummy/unlink_ref (mut i32) (i32.const 0))
(global $gc/_dummy/unlink_parentRef (mut i32) (i32.const 0))
2019-04-02 10:12:57 +02:00
(global $gc/_dummy/mark_count (mut i32) (i32.const 0))
(global $gc/_dummy/mark_ref (mut i32) (i32.const 0))
(global $~lib/util/runtime/HEADER_SIZE i32 (i32.const 16))
2019-03-27 14:43:35 +01:00
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
2019-04-02 10:12:57 +02:00
(global $~lib/util/runtime/HEADER_MAGIC i32 (i32.const -1520547049))
2019-03-27 14:43:35 +01:00
(global $~lib/ASC_NO_ASSERT i32 (i32.const 0))
(global $gc/global-init/global (mut i32) (i32.const 0))
(global $~lib/started (mut i32) (i32.const 0))
(global $~lib/memory/HEAP_BASE i32 (i32.const 148))
(global $~lib/capabilities i32 (i32.const 2))
(export "memory" (memory $0))
(export "table" (table $0))
(export "main" (func $gc/global-init/main))
(export ".capabilities" (global $~lib/capabilities))
2019-04-01 22:23:11 +02:00
(func $~lib/runtime/runtime.adjust (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
2019-03-27 14:43:35 +01:00
i32.const 1
i32.const 32
local.get $0
2019-04-02 10:12:57 +02:00
global.get $~lib/util/runtime/HEADER_SIZE
2019-03-27 14:43:35 +01:00
i32.add
i32.const 1
i32.sub
i32.clz
i32.sub
i32.shl
)
2019-03-27 17:21:52 +01:00
(func $~lib/allocator/arena/__mem_allocate (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
2019-03-27 14:43:35 +01:00
(local $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
2019-03-27 17:21:52 +01:00
local.get $0
i32.const 1073741824
i32.gt_u
if
unreachable
end
global.get $~lib/allocator/arena/offset
local.set $1
local.get $1
local.get $0
local.tee $2
i32.const 1
local.tee $3
local.get $2
local.get $3
i32.gt_u
select
i32.add
i32.const 7
i32.add
i32.const 7
i32.const -1
i32.xor
i32.and
local.set $4
current_memory
local.set $5
local.get $4
local.get $5
i32.const 16
i32.shl
i32.gt_u
if
2019-03-27 14:43:35 +01:00
local.get $4
2019-03-27 17:21:52 +01:00
local.get $1
i32.sub
i32.const 65535
2019-03-27 14:43:35 +01:00
i32.add
2019-03-27 17:21:52 +01:00
i32.const 65535
2019-03-27 14:43:35 +01:00
i32.const -1
i32.xor
i32.and
2019-03-27 17:21:52 +01:00
i32.const 16
i32.shr_u
local.set $2
local.get $5
local.tee $3
local.get $2
local.tee $6
local.get $3
local.get $6
i32.gt_s
select
2019-03-27 14:43:35 +01:00
local.set $3
local.get $3
2019-03-27 17:21:52 +01:00
grow_memory
i32.const 0
i32.lt_s
2019-03-27 14:43:35 +01:00
if
local.get $2
grow_memory
i32.const 0
i32.lt_s
if
2019-03-27 17:21:52 +01:00
unreachable
2019-03-27 14:43:35 +01:00
end
end
end
2019-03-27 17:21:52 +01:00
local.get $4
global.set $~lib/allocator/arena/offset
local.get $1
)
(func $~lib/memory/memory.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
call $~lib/allocator/arena/__mem_allocate
2019-03-27 14:43:35 +01:00
return
)
2019-04-01 22:23:11 +02:00
(func $~lib/runtime/runtime.allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
2019-03-27 14:43:35 +01:00
(local $1 i32)
local.get $0
2019-04-01 22:23:11 +02:00
call $~lib/runtime/runtime.adjust
2019-03-27 14:43:35 +01:00
call $~lib/memory/memory.allocate
local.set $1
local.get $1
2019-04-02 10:12:57 +02:00
global.get $~lib/util/runtime/HEADER_MAGIC
2019-03-27 14:43:35 +01:00
i32.store
local.get $1
local.get $0
i32.store offset=4
local.get $1
i32.const 0
i32.store offset=8
local.get $1
i32.const 0
i32.store offset=12
local.get $1
2019-04-02 10:12:57 +02:00
global.get $~lib/util/runtime/HEADER_SIZE
2019-03-27 14:43:35 +01:00
i32.add
)
2019-04-02 16:18:44 +02:00
(func $gc/_dummy/__ref_register (; 6 ;) (type $FUNCSIG$vi) (param $0 i32)
2019-03-27 14:43:35 +01:00
i32.const 72
i32.const 1
local.get $0
f64.convert_i32_u
f64.const 0
f64.const 0
f64.const 0
f64.const 0
call $~lib/env/trace
global.get $gc/_dummy/register_count
i32.const 1
i32.add
global.set $gc/_dummy/register_count
local.get $0
global.set $gc/_dummy/register_ref
)
2019-04-02 16:18:44 +02:00
(func $~lib/runtime/runtime.register (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
2019-03-27 14:43:35 +01:00
(local $2 i32)
local.get $0
global.get $~lib/memory/HEAP_BASE
i32.gt_u
i32.eqz
if
i32.const 0
i32.const 24
2019-04-03 00:26:41 +02:00
i32.const 123
2019-04-01 22:23:11 +02:00
i32.const 6
2019-03-27 14:43:35 +01:00
call $~lib/env/abort
unreachable
end
local.get $0
2019-04-02 10:12:57 +02:00
global.get $~lib/util/runtime/HEADER_SIZE
2019-03-27 14:43:35 +01:00
i32.sub
local.set $2
local.get $2
i32.load
2019-04-02 10:12:57 +02:00
global.get $~lib/util/runtime/HEADER_MAGIC
2019-03-27 14:43:35 +01:00
i32.eq
i32.eqz
if
i32.const 0
i32.const 24
2019-04-03 00:26:41 +02:00
i32.const 125
2019-04-01 22:23:11 +02:00
i32.const 6
2019-03-27 14:43:35 +01:00
call $~lib/env/abort
unreachable
end
local.get $2
local.get $1
i32.store
local.get $0
call $gc/_dummy/__ref_register
local.get $0
)
2019-04-02 16:18:44 +02:00
(func $gc/global-init/Ref#constructor (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
2019-03-27 14:43:35 +01:00
local.get $0
i32.eqz
if
i32.const 0
2019-04-01 22:23:11 +02:00
call $~lib/runtime/runtime.allocate
2019-03-27 14:43:35 +01:00
i32.const 1
2019-04-01 22:23:11 +02:00
call $~lib/runtime/runtime.register
2019-03-27 14:43:35 +01:00
local.set $0
end
local.get $0
)
2019-04-02 16:18:44 +02:00
(func $start:gc/global-init (; 9 ;) (type $FUNCSIG$v)
2019-03-27 14:43:35 +01:00
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
i32.const 0
call $gc/global-init/Ref#constructor
global.set $gc/global-init/global
global.get $gc/_dummy/register_count
i32.const 1
i32.eq
i32.eqz
if
i32.const 0
i32.const 112
2019-03-31 21:58:42 +02:00
i32.const 10
2019-03-27 14:43:35 +01:00
i32.const 0
call $~lib/env/abort
unreachable
end
global.get $gc/_dummy/link_count
i32.const 0
i32.eq
i32.eqz
if
i32.const 0
i32.const 112
2019-03-31 21:58:42 +02:00
i32.const 11
2019-03-27 14:43:35 +01:00
i32.const 0
call $~lib/env/abort
unreachable
end
global.get $gc/_dummy/unlink_count
i32.const 0
i32.eq
i32.eqz
if
i32.const 0
i32.const 112
2019-03-31 21:58:42 +02:00
i32.const 12
2019-03-27 14:43:35 +01:00
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 0
call $gc/global-init/Ref#constructor
global.set $gc/global-init/global
global.get $gc/_dummy/register_count
i32.const 2
i32.eq
i32.eqz
if
i32.const 0
i32.const 112
2019-03-31 21:58:42 +02:00
i32.const 15
2019-03-27 14:43:35 +01:00
i32.const 0
call $~lib/env/abort
unreachable
end
global.get $gc/_dummy/link_count
i32.const 0
i32.eq
i32.eqz
if
i32.const 0
i32.const 112
2019-03-31 21:58:42 +02:00
i32.const 16
2019-03-27 14:43:35 +01:00
i32.const 0
call $~lib/env/abort
unreachable
end
global.get $gc/_dummy/unlink_count
i32.const 0
i32.eq
i32.eqz
if
i32.const 0
i32.const 112
2019-03-31 21:58:42 +02:00
i32.const 17
2019-03-27 14:43:35 +01:00
i32.const 0
call $~lib/env/abort
unreachable
end
)
2019-04-02 16:18:44 +02:00
(func $gc/global-init/main (; 10 ;) (type $FUNCSIG$v)
2019-03-27 14:43:35 +01:00
global.get $~lib/started
i32.eqz
if
call $start
i32.const 1
global.set $~lib/started
end
)
2019-04-02 16:18:44 +02:00
(func $start (; 11 ;) (type $FUNCSIG$v)
2019-03-27 14:43:35 +01:00
call $start:gc/global-init
)
2019-04-02 16:18:44 +02:00
(func $null (; 12 ;) (type $FUNCSIG$v)
2019-03-27 14:43:35 +01:00
)
)