refactor into stdlib

This commit is contained in:
dcode
2019-04-18 11:51:07 +02:00
parent ffdda4b695
commit 8216cf3361
14 changed files with 1378 additions and 1466 deletions

View File

@ -1,4 +1,4 @@
import "../../../runtime/assembly/index";
import "rt";
import { memory as builtin_memory } from "memory";
export namespace memory {

View File

@ -1,22 +1,21 @@
(module
(type $FUNCSIG$ii (func (param i32) (result i32)))
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$v (func))
(type $FUNCSIG$vii (func (param i32 i32)))
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$viii (func (param i32 i32 i32)))
(type $FUNCSIG$vi (func (param i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\10\00\00\00>")
(data (i32.const 24) ".\00.\00/\00.\00.\00/\00r\00u\00n\00t\00i\00m\00e\00/\00a\00s\00s\00e\00m\00b\00l\00y\00/\00i\00n\00d\00e\00x\00.\00t\00s")
(global $../../runtime/assembly/index/ROOT (mut i32) (i32.const 0))
(data (i32.const 8) "\10\00\00\00\1e")
(data (i32.const 24) "~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s")
(global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0))
(export "memory" (memory $0))
(export "memory.allocate" (func $assembly/index/memory.allocate))
(export "memory.free" (func $assembly/index/memory.free))
(export "memory.fill" (func $assembly/index/memory.fill))
(func $../../runtime/assembly/index/removeBlock (; 1 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/rt/tlsf/removeBlock (; 1 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -132,7 +131,7 @@
end
end
)
(func $../../runtime/assembly/index/insertBlock (; 2 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/rt/tlsf/insertBlock (; 2 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -171,7 +170,7 @@
if
local.get $0
local.get $4
call $../../runtime/assembly/index/removeBlock
call $~lib/rt/tlsf/removeBlock
local.get $1
local.get $2
i32.const 3
@ -218,7 +217,7 @@
if
local.get $0
local.get $3
call $../../runtime/assembly/index/removeBlock
call $~lib/rt/tlsf/removeBlock
local.get $3
local.get $6
i32.const 3
@ -330,7 +329,7 @@
i32.or
i32.store offset=4
)
(func $../../runtime/assembly/index/addMemory (; 3 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
(func $~lib/rt/tlsf/addMemory (; 3 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
local.get $2
block (result i32)
@ -392,14 +391,14 @@
i32.store offset=1568
local.get $0
local.get $1
call $../../runtime/assembly/index/insertBlock
call $~lib/rt/tlsf/insertBlock
)
(func $../../runtime/assembly/index/initialize (; 4 ;) (type $FUNCSIG$i) (result i32)
(func $~lib/rt/tlsf/initializeRoot (; 4 ;) (type $FUNCSIG$v)
(local $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
i32.const 96
i32.const 64
local.tee $3
i32.const 67107
i32.add
@ -486,10 +485,11 @@
current_memory
i32.const 16
i32.shl
call $../../runtime/assembly/index/addMemory
call $~lib/rt/tlsf/addMemory
local.get $0
global.set $~lib/rt/tlsf/ROOT
)
(func $../../runtime/assembly/index/prepareSize (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(func $~lib/rt/tlsf/prepareSize (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
local.get $0
i32.const 1073741824
@ -497,7 +497,7 @@
if
i32.const 0
i32.const 24
i32.const 466
i32.const 436
i32.const 29
call $~lib/builtins/abort
unreachable
@ -515,7 +515,7 @@
i32.gt_u
select
)
(func $../../runtime/assembly/index/searchBlock (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/rt/tlsf/searchBlock (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
local.get $0
local.get $1
@ -616,7 +616,7 @@
end
end
)
(func $../../runtime/assembly/index/growMemory (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/rt/tlsf/growMemory (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -655,9 +655,9 @@
current_memory
i32.const 16
i32.shl
call $../../runtime/assembly/index/addMemory
call $~lib/rt/tlsf/addMemory
)
(func $../../runtime/assembly/index/prepareBlock (; 8 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
(func $~lib/rt/tlsf/prepareBlock (; 8 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(local $4 i32)
local.get $1
@ -692,7 +692,7 @@
i32.store
local.get $0
local.get $1
call $../../runtime/assembly/index/insertBlock
call $~lib/rt/tlsf/insertBlock
else
local.get $1
local.get $3
@ -721,23 +721,23 @@
i32.store
end
)
(func $../../runtime/assembly/index/allocateBlock (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/rt/tlsf/allocateBlock (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
local.get $0
local.get $1
call $../../runtime/assembly/index/prepareSize
call $~lib/rt/tlsf/prepareSize
local.tee $3
call $../../runtime/assembly/index/searchBlock
call $~lib/rt/tlsf/searchBlock
local.tee $2
i32.eqz
if
local.get $0
local.get $3
call $../../runtime/assembly/index/growMemory
call $~lib/rt/tlsf/growMemory
local.get $0
local.get $3
call $../../runtime/assembly/index/searchBlock
call $~lib/rt/tlsf/searchBlock
local.set $2
end
local.get $2
@ -751,26 +751,25 @@
i32.store offset=12
local.get $0
local.get $2
call $../../runtime/assembly/index/removeBlock
call $~lib/rt/tlsf/removeBlock
local.get $0
local.get $2
local.get $3
call $../../runtime/assembly/index/prepareBlock
call $~lib/rt/tlsf/prepareBlock
local.get $2
)
(func $assembly/index/memory.allocate (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
global.get $../../runtime/assembly/index/ROOT
global.get $~lib/rt/tlsf/ROOT
local.tee $1
i32.eqz
if
call $../../runtime/assembly/index/initialize
local.tee $1
global.set $../../runtime/assembly/index/ROOT
if (result i32)
local.get $1
else
call $~lib/rt/tlsf/initializeRoot
global.get $~lib/rt/tlsf/ROOT
end
local.get $1
local.get $0
call $../../runtime/assembly/index/allocateBlock
call $~lib/rt/tlsf/allocateBlock
i32.const 16
i32.add
)
@ -784,9 +783,9 @@
i32.const 1
i32.or
i32.store
global.get $../../runtime/assembly/index/ROOT
global.get $~lib/rt/tlsf/ROOT
local.get $0
call $../../runtime/assembly/index/insertBlock
call $~lib/rt/tlsf/insertBlock
)
(func $~lib/memory/memory.fill (; 12 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i64)

View File

@ -1,26 +1,26 @@
(module
(type $FUNCSIG$ii (func (param i32) (result i32)))
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$v (func))
(type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32)))
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$vii (func (param i32 i32)))
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $FUNCSIG$viii (func (param i32 i32 i32)))
(type $FUNCSIG$vi (func (param i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\10\00\00\00>\00\00\00\00\00\00\00\00\00\00\00.\00.\00/\00.\00.\00/\00r\00u\00n\00t\00i\00m\00e\00/\00a\00s\00s\00e\00m\00b\00l\00y\00/\00i\00n\00d\00e\00x\00.\00t\00s\00")
(data (i32.const 8) "\10\00\00\00\1e\00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00t\00l\00s\00f\00.\00t\00s\00")
(data (i32.const 56) "\10\00\00\00 \00\00\00\00\00\00\00\00\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00i\00n\00d\00e\00x\00.\00t\00s\00")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $../../runtime/assembly/index/ROOT (mut i32) (i32.const 0))
(global $../../runtime/assembly/index/ACYCLIC_FLAG i32 (i32.const 0))
(global $~lib/memory/HEAP_BASE i32 (i32.const 88))
(global $~lib/rt/pure/ACYCLIC_FLAG i32 (i32.const 0))
(global $~lib/rt/tlsf/ROOT (mut i32) (i32.const 0))
(global $~lib/memory/HEAP_BASE i32 (i32.const 104))
(export "memory" (memory $0))
(export "memory.allocate" (func $assembly/index/memory.allocate))
(export "memory.free" (func $assembly/index/memory.free))
(export "memory.fill" (func $assembly/index/memory.fill))
(func $../../runtime/assembly/index/removeBlock (; 1 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/rt/tlsf/removeBlock (; 1 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -41,7 +41,7 @@
if
i32.const 0
i32.const 24
i32.const 276
i32.const 265
i32.const 13
call $~lib/builtins/abort
unreachable
@ -66,7 +66,7 @@
if
i32.const 0
i32.const 24
i32.const 278
i32.const 267
i32.const 13
call $~lib/builtins/abort
unreachable
@ -118,7 +118,7 @@
if
i32.const 0
i32.const 24
i32.const 291
i32.const 280
i32.const 13
call $~lib/builtins/abort
unreachable
@ -142,7 +142,7 @@
i32.store offset=16
end
local.get $1
block $../../runtime/assembly/index/GETHEAD|inlined.1 (result i32)
block $~lib/rt/tlsf/GETHEAD|inlined.1 (result i32)
local.get $0
local.set $10
local.get $4
@ -162,7 +162,7 @@
end
i32.eq
if
block $../../runtime/assembly/index/SETHEAD|inlined.1
block $~lib/rt/tlsf/SETHEAD|inlined.1
local.get $0
local.set $11
local.get $4
@ -186,7 +186,7 @@
local.get $7
i32.eqz
if
block $../../runtime/assembly/index/GETSL|inlined.0 (result i32)
block $~lib/rt/tlsf/GETSL|inlined.0 (result i32)
local.get $0
local.set $9
local.get $4
@ -199,7 +199,7 @@
i32.load offset=4
end
local.set $8
block $../../runtime/assembly/index/SETSL|inlined.1
block $~lib/rt/tlsf/SETSL|inlined.1
local.get $0
local.set $11
local.get $4
@ -238,7 +238,7 @@
end
end
)
(func $../../runtime/assembly/index/insertBlock (; 2 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/rt/tlsf/insertBlock (; 2 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -256,7 +256,7 @@
if
i32.const 0
i32.const 24
i32.const 204
i32.const 193
i32.const 13
call $~lib/builtins/abort
unreachable
@ -271,12 +271,12 @@
if
i32.const 0
i32.const 24
i32.const 206
i32.const 195
i32.const 13
call $~lib/builtins/abort
unreachable
end
block $../../runtime/assembly/index/GETRIGHT|inlined.0 (result i32)
block $~lib/rt/tlsf/GETRIGHT|inlined.0 (result i32)
local.get $1
local.set $3
local.get $3
@ -318,7 +318,7 @@
if
local.get $0
local.get $4
call $../../runtime/assembly/index/removeBlock
call $~lib/rt/tlsf/removeBlock
local.get $1
local.get $2
i32.const 3
@ -327,7 +327,7 @@
i32.or
local.tee $2
i32.store
block $../../runtime/assembly/index/GETRIGHT|inlined.1 (result i32)
block $~lib/rt/tlsf/GETRIGHT|inlined.1 (result i32)
local.get $1
local.set $6
local.get $6
@ -351,7 +351,7 @@
i32.const 2
i32.and
if
block $../../runtime/assembly/index/GETFREELEFT|inlined.0 (result i32)
block $~lib/rt/tlsf/GETFREELEFT|inlined.0 (result i32)
local.get $1
local.set $3
local.get $3
@ -370,7 +370,7 @@
if
i32.const 0
i32.const 24
i32.const 227
i32.const 216
i32.const 15
call $~lib/builtins/abort
unreachable
@ -395,7 +395,7 @@
if
local.get $0
local.get $3
call $../../runtime/assembly/index/removeBlock
call $~lib/rt/tlsf/removeBlock
local.get $3
local.get $6
i32.const 3
@ -433,7 +433,7 @@
if
i32.const 0
i32.const 24
i32.const 242
i32.const 231
i32.const 13
call $~lib/builtins/abort
unreachable
@ -449,7 +449,7 @@
if
i32.const 0
i32.const 24
i32.const 243
i32.const 232
i32.const 13
call $~lib/builtins/abort
unreachable
@ -506,12 +506,12 @@
if
i32.const 0
i32.const 24
i32.const 259
i32.const 248
i32.const 13
call $~lib/builtins/abort
unreachable
end
block $../../runtime/assembly/index/GETHEAD|inlined.2 (result i32)
block $~lib/rt/tlsf/GETHEAD|inlined.2 (result i32)
local.get $0
local.set $3
local.get $9
@ -542,7 +542,7 @@
local.get $1
i32.store offset=16
end
block $../../runtime/assembly/index/SETHEAD|inlined.2
block $~lib/rt/tlsf/SETHEAD|inlined.2
local.get $0
local.set $12
local.get $9
@ -571,8 +571,8 @@
i32.shl
i32.or
i32.store
block $../../runtime/assembly/index/SETSL|inlined.2
block $../../runtime/assembly/index/GETSL|inlined.1 (result i32)
block $~lib/rt/tlsf/SETSL|inlined.2
block $~lib/rt/tlsf/GETSL|inlined.1 (result i32)
local.get $0
local.set $13
local.get $9
@ -598,7 +598,7 @@
i32.store offset=4
end
)
(func $../../runtime/assembly/index/addMemory (; 3 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func $~lib/rt/tlsf/addMemory (; 3 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@ -629,12 +629,12 @@
if
i32.const 0
i32.const 24
i32.const 385
i32.const 374
i32.const 4
call $~lib/builtins/abort
unreachable
end
block $../../runtime/assembly/index/GETTAIL|inlined.0 (result i32)
block $~lib/rt/tlsf/GETTAIL|inlined.0 (result i32)
local.get $0
local.set $3
local.get $3
@ -654,7 +654,7 @@
if
i32.const 0
i32.const 24
i32.const 395
i32.const 384
i32.const 15
call $~lib/builtins/abort
unreachable
@ -685,7 +685,7 @@
if
i32.const 0
i32.const 24
i32.const 407
i32.const 396
i32.const 4
call $~lib/builtins/abort
unreachable
@ -740,7 +740,7 @@
i32.const 2
i32.or
i32.store
block $../../runtime/assembly/index/SETTAIL|inlined.1
block $~lib/rt/tlsf/SETTAIL|inlined.1
local.get $0
local.set $9
local.get $4
@ -751,10 +751,10 @@
end
local.get $0
local.get $8
call $../../runtime/assembly/index/insertBlock
call $~lib/rt/tlsf/insertBlock
i32.const 1
)
(func $../../runtime/assembly/index/initialize (; 4 ;) (type $FUNCSIG$i) (result i32)
(func $~lib/rt/tlsf/initializeRoot (; 4 ;) (type $FUNCSIG$v)
(local $0 i32)
(local $1 i32)
(local $2 i32)
@ -808,7 +808,7 @@
local.get $3
i32.const 0
i32.store
block $../../runtime/assembly/index/SETTAIL|inlined.0
block $~lib/rt/tlsf/SETTAIL|inlined.0
local.get $3
local.set $5
i32.const 0
@ -827,7 +827,7 @@
i32.eqz
br_if $break|0
block
block $../../runtime/assembly/index/SETSL|inlined.0
block $~lib/rt/tlsf/SETSL|inlined.0
local.get $3
local.set $7
local.get $4
@ -851,7 +851,7 @@
i32.lt_u
i32.eqz
br_if $break|1
block $../../runtime/assembly/index/SETHEAD|inlined.0
block $~lib/rt/tlsf/SETHEAD|inlined.0
local.get $3
local.set $9
local.get $4
@ -904,11 +904,12 @@
current_memory
i32.const 16
i32.shl
call $../../runtime/assembly/index/addMemory
call $~lib/rt/tlsf/addMemory
drop
local.get $3
global.set $~lib/rt/tlsf/ROOT
)
(func $../../runtime/assembly/index/prepareSize (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(func $~lib/rt/tlsf/prepareSize (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
local.get $0
@ -917,7 +918,7 @@
if
i32.const 0
i32.const 24
i32.const 466
i32.const 436
i32.const 29
call $~lib/builtins/abort
unreachable
@ -937,7 +938,7 @@
i32.gt_u
select
)
(func $../../runtime/assembly/index/searchBlock (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/rt/tlsf/searchBlock (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -1011,12 +1012,12 @@
if
i32.const 0
i32.const 24
i32.const 337
i32.const 326
i32.const 13
call $~lib/builtins/abort
unreachable
end
block $../../runtime/assembly/index/GETSL|inlined.2 (result i32)
block $~lib/rt/tlsf/GETSL|inlined.2 (result i32)
local.get $0
local.set $5
local.get $2
@ -1058,7 +1059,7 @@
local.get $4
i32.ctz
local.set $2
block $../../runtime/assembly/index/GETSL|inlined.3 (result i32)
block $~lib/rt/tlsf/GETSL|inlined.3 (result i32)
local.get $0
local.set $8
local.get $2
@ -1076,12 +1077,12 @@
if
i32.const 0
i32.const 24
i32.const 350
i32.const 339
i32.const 17
call $~lib/builtins/abort
unreachable
end
block $../../runtime/assembly/index/GETHEAD|inlined.3 (result i32)
block $~lib/rt/tlsf/GETHEAD|inlined.3 (result i32)
local.get $0
local.set $9
local.get $2
@ -1103,7 +1104,7 @@
local.set $7
end
else
block $../../runtime/assembly/index/GETHEAD|inlined.4 (result i32)
block $~lib/rt/tlsf/GETHEAD|inlined.4 (result i32)
local.get $0
local.set $8
local.get $2
@ -1126,7 +1127,7 @@
end
local.get $7
)
(func $../../runtime/assembly/index/growMemory (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/rt/tlsf/growMemory (; 7 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -1176,10 +1177,10 @@
local.get $7
i32.const 16
i32.shl
call $../../runtime/assembly/index/addMemory
call $~lib/rt/tlsf/addMemory
drop
)
(func $../../runtime/assembly/index/prepareBlock (; 8 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
(func $~lib/rt/tlsf/prepareBlock (; 8 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@ -1194,7 +1195,7 @@
if
i32.const 0
i32.const 24
i32.const 364
i32.const 353
i32.const 13
call $~lib/builtins/abort
unreachable
@ -1235,7 +1236,7 @@
i32.store
local.get $0
local.get $5
call $../../runtime/assembly/index/insertBlock
call $~lib/rt/tlsf/insertBlock
else
local.get $1
local.get $3
@ -1244,7 +1245,7 @@
i32.xor
i32.and
i32.store
block $../../runtime/assembly/index/GETRIGHT|inlined.3 (result i32)
block $~lib/rt/tlsf/GETRIGHT|inlined.3 (result i32)
local.get $1
local.set $5
local.get $5
@ -1258,7 +1259,7 @@
i32.and
i32.add
end
block $../../runtime/assembly/index/GETRIGHT|inlined.2 (result i32)
block $~lib/rt/tlsf/GETRIGHT|inlined.2 (result i32)
local.get $1
local.set $5
local.get $5
@ -1280,32 +1281,32 @@
i32.store
end
)
(func $../../runtime/assembly/index/allocateBlock (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/rt/tlsf/allocateBlock (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
local.get $1
call $../../runtime/assembly/index/prepareSize
call $~lib/rt/tlsf/prepareSize
local.set $2
local.get $0
local.get $2
call $../../runtime/assembly/index/searchBlock
call $~lib/rt/tlsf/searchBlock
local.set $3
local.get $3
i32.eqz
if
local.get $0
local.get $2
call $../../runtime/assembly/index/growMemory
call $~lib/rt/tlsf/growMemory
local.get $0
local.get $2
call $../../runtime/assembly/index/searchBlock
call $~lib/rt/tlsf/searchBlock
local.set $3
local.get $3
i32.eqz
if
i32.const 0
i32.const 24
i32.const 477
i32.const 466
i32.const 15
call $~lib/builtins/abort
unreachable
@ -1323,7 +1324,7 @@
if
i32.const 0
i32.const 24
i32.const 479
i32.const 468
i32.const 13
call $~lib/builtins/abort
unreachable
@ -1339,35 +1340,35 @@
i32.store offset=12
local.get $0
local.get $3
call $../../runtime/assembly/index/removeBlock
call $~lib/rt/tlsf/removeBlock
local.get $0
local.get $3
local.get $2
call $../../runtime/assembly/index/prepareBlock
call $~lib/rt/tlsf/prepareBlock
local.get $3
)
(func $../../runtime/assembly/index/__mm_allocate (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(func $~lib/rt/index/__mm_allocate (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
global.get $../../runtime/assembly/index/ROOT
global.get $~lib/rt/tlsf/ROOT
local.set $1
local.get $1
i32.eqz
if
call $../../runtime/assembly/index/initialize
local.tee $1
global.set $../../runtime/assembly/index/ROOT
call $~lib/rt/tlsf/initializeRoot
global.get $~lib/rt/tlsf/ROOT
local.set $1
end
local.get $1
local.get $0
call $../../runtime/assembly/index/allocateBlock
call $~lib/rt/tlsf/allocateBlock
i32.const 16
i32.add
)
(func $assembly/index/memory.allocate (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
call $../../runtime/assembly/index/__mm_allocate
call $~lib/rt/index/__mm_allocate
)
(func $../../runtime/assembly/index/freeBlock (; 12 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(func $~lib/rt/tlsf/freeBlock (; 12 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
local.get $1
i32.load
@ -1380,7 +1381,7 @@
if
i32.const 0
i32.const 24
i32.const 530
i32.const 519
i32.const 2
call $~lib/builtins/abort
unreachable
@ -1392,15 +1393,15 @@
i32.store
local.get $0
local.get $1
call $../../runtime/assembly/index/insertBlock
call $~lib/rt/tlsf/insertBlock
)
(func $../../runtime/assembly/index/__mm_free (; 13 ;) (type $FUNCSIG$vi) (param $0 i32)
global.get $../../runtime/assembly/index/ROOT
(func $~lib/rt/index/__mm_free (; 13 ;) (type $FUNCSIG$vi) (param $0 i32)
global.get $~lib/rt/tlsf/ROOT
i32.eqz
if
i32.const 0
i32.const 24
i32.const 556
i32.const 72
i32.const 29
i32.const 13
call $~lib/builtins/abort
unreachable
@ -1419,21 +1420,21 @@
i32.eqz
if
i32.const 0
i32.const 24
i32.const 557
i32.const 72
i32.const 30
i32.const 2
call $~lib/builtins/abort
unreachable
end
global.get $../../runtime/assembly/index/ROOT
global.get $~lib/rt/tlsf/ROOT
local.get $0
i32.const 16
i32.sub
call $../../runtime/assembly/index/freeBlock
call $~lib/rt/tlsf/freeBlock
)
(func $assembly/index/memory.free (; 14 ;) (type $FUNCSIG$vi) (param $0 i32)
local.get $0
call $../../runtime/assembly/index/__mm_free
call $~lib/rt/index/__mm_free
)
(func $~lib/memory/memory.fill (; 15 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)