use gc interface directly, document

This commit is contained in:
dcode
2019-03-26 23:35:08 +01:00
parent 7c0dc66849
commit 3146f8f9e0
95 changed files with 17360 additions and 13504 deletions

View File

@ -1,7 +1,6 @@
(module
(type $FUNCSIG$ii (func (param i32) (result i32)))
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $FUNCSIG$vi (func (param i32)))
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32)))
(type $FUNCSIG$didd (func (param i32 f64 f64) (result f64)))
@ -11,7 +10,6 @@
(data (i32.const 8) "\02\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s\00")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $~lib/runtime/GC_IMPLEMENTED i32 (i32.const 0))
(global $~lib/runtime/HEADER_SIZE i32 (i32.const 8))
(global $~lib/runtime/HEADER_MAGIC i32 (i32.const -1520547049))
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
@ -126,7 +124,7 @@
end
return
)
(func $~lib/runtime/doAllocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(func $~lib/runtime/allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
local.get $0
call $~lib/runtime/ADJUSTOBLOCK
@ -142,7 +140,8 @@
global.get $~lib/runtime/HEADER_SIZE
i32.add
)
(func $~lib/runtime/assertUnregistered (; 6 ;) (type $FUNCSIG$vi) (param $0 i32)
(func $~lib/runtime/register (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
local.get $0
global.get $~lib/memory/HEAP_BASE
i32.gt_u
@ -150,14 +149,16 @@
if
i32.const 0
i32.const 16
i32.const 313
i32.const 2
i32.const 161
i32.const 4
call $~lib/env/abort
unreachable
end
local.get $0
global.get $~lib/runtime/HEADER_SIZE
i32.sub
local.set $2
local.get $2
i32.load
global.get $~lib/runtime/HEADER_MAGIC
i32.eq
@ -165,23 +166,17 @@
if
i32.const 0
i32.const 16
i32.const 314
i32.const 2
i32.const 163
i32.const 4
call $~lib/env/abort
unreachable
end
)
(func $~lib/runtime/doRegister (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
call $~lib/runtime/assertUnregistered
local.get $0
global.get $~lib/runtime/HEADER_SIZE
i32.sub
local.get $2
local.get $1
i32.store
local.get $0
)
(func $optional-typeparameters/TestConcrete<i32,i32>#constructor (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(func $optional-typeparameters/TestConcrete<i32,i32>#constructor (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
local.get $0
i32.eqz
@ -191,23 +186,23 @@
i32.const 0
local.set $1
local.get $1
call $~lib/runtime/doAllocate
call $~lib/runtime/allocate
end
local.set $1
local.get $1
i32.const 1
call $~lib/runtime/doRegister
call $~lib/runtime/register
end
local.set $0
end
local.get $0
)
(func $optional-typeparameters/TestConcrete<i32,i32>#test<i32> (; 9 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func $optional-typeparameters/TestConcrete<i32,i32>#test<i32> (; 8 ;) (type $FUNCSIG$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 (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(func $optional-typeparameters/TestDerived<f64,f64>#constructor (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
local.get $0
i32.eqz
@ -217,23 +212,23 @@
i32.const 0
local.set $1
local.get $1
call $~lib/runtime/doAllocate
call $~lib/runtime/allocate
end
local.set $1
local.get $1
i32.const 3
call $~lib/runtime/doRegister
call $~lib/runtime/register
end
local.set $0
end
local.get $0
)
(func $optional-typeparameters/TestDerived<f64,f64>#test<f64> (; 11 ;) (type $FUNCSIG$didd) (param $0 i32) (param $1 f64) (param $2 f64) (result f64)
(func $optional-typeparameters/TestDerived<f64,f64>#test<f64> (; 10 ;) (type $FUNCSIG$didd) (param $0 i32) (param $1 f64) (param $2 f64) (result f64)
local.get $1
local.get $2
f64.add
)
(func $start:optional-typeparameters (; 12 ;) (type $FUNCSIG$v)
(func $start:optional-typeparameters (; 11 ;) (type $FUNCSIG$v)
i32.const 1
call $optional-typeparameters/testConcrete<i32,i32>
drop
@ -267,9 +262,9 @@
call $optional-typeparameters/TestDerived<f64,f64>#test<f64>
drop
)
(func $start (; 13 ;) (type $FUNCSIG$v)
(func $start (; 12 ;) (type $FUNCSIG$v)
call $start:optional-typeparameters
)
(func $null (; 14 ;) (type $FUNCSIG$v)
(func $null (; 13 ;) (type $FUNCSIG$v)
)
)