Rework static memory segment creation; Fix stdlib gc hooks not marking own fields; Align everything to 8 bytes that might be touched by GC

This commit is contained in:
dcodeIO
2018-08-04 00:36:59 +02:00
parent 61de7cf962
commit 631478c7c9
61 changed files with 11944 additions and 5286 deletions

View File

@ -12,8 +12,8 @@
(global $std/arraybuffer/sliced (mut i32) (i32.const 0))
(memory $0 1)
(data (i32.const 8) "\13\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s")
(data (i32.const 52) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s")
(data (i32.const 112) "\12\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s")
(data (i32.const 56) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s")
(data (i32.const 120) "\12\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s")
(export "memory" (memory $0))
(start $start)
(func $~lib/internal/arraybuffer/computeSize (; 1 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
@ -35,86 +35,85 @@
(local $2 i32)
(local $3 i32)
(if
(get_local $0)
(block
(i32.gt_u
(get_local $0)
(i32.const 1073741824)
)
(unreachable)
)
(if
(i32.gt_u
(tee_local $2
(i32.and
(i32.add
(i32.add
(tee_local $1
(get_global $~lib/allocator/arena/offset)
)
(select
(get_local $0)
(i32.const 1)
(i32.gt_u
(get_local $0)
(i32.const 1)
)
)
)
(i32.const 7)
)
(i32.const -8)
)
)
(i32.shl
(tee_local $3
(current_memory)
)
(i32.const 16)
)
)
(if
(i32.lt_s
(grow_memory
(select
(get_local $3)
(tee_local $0
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $2)
(get_local $1)
)
(i32.const 65535)
)
(i32.const -65536)
)
(i32.const 16)
)
)
(i32.gt_s
(get_local $3)
(get_local $0)
)
)
)
(i32.const 0)
)
(if
(i32.gt_u
(get_local $0)
(i32.const 1073741824)
(i32.lt_s
(grow_memory
(get_local $0)
)
(i32.const 0)
)
(unreachable)
)
(if
(i32.gt_u
(tee_local $0
(i32.and
(i32.add
(i32.add
(tee_local $1
(get_global $~lib/allocator/arena/offset)
)
(get_local $0)
)
(i32.const 7)
)
(i32.const -8)
)
)
(i32.shl
(tee_local $2
(current_memory)
)
(i32.const 16)
)
)
(if
(i32.lt_s
(grow_memory
(select
(get_local $2)
(tee_local $3
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $0)
(get_local $1)
)
(i32.const 65535)
)
(i32.const -65536)
)
(i32.const 16)
)
)
(i32.gt_s
(get_local $2)
(get_local $3)
)
)
)
(i32.const 0)
)
(if
(i32.lt_s
(grow_memory
(get_local $3)
)
(i32.const 0)
)
(unreachable)
)
)
)
(set_global $~lib/allocator/arena/offset
(get_local $0)
)
(return
(get_local $1)
)
)
)
(i32.const 0)
(set_global $~lib/allocator/arena/offset
(get_local $2)
)
(get_local $1)
)
(func $~lib/internal/arraybuffer/allocateUnsafe (; 3 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
@ -126,7 +125,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 52)
(i32.const 56)
(i32.const 23)
(i32.const 2)
)
@ -2325,7 +2324,7 @@
)
(func $start (; 10 ;) (; has Stack IR ;) (type $v)
(set_global $~lib/allocator/arena/startOffset
(i32.const 152)
(i32.const 160)
)
(set_global $~lib/allocator/arena/offset
(get_global $~lib/allocator/arena/startOffset)
@ -2347,7 +2346,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 5)
(i32.const 0)
)
@ -2374,7 +2373,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 9)
(i32.const 0)
)
@ -2389,7 +2388,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 10)
(i32.const 0)
)
@ -2416,7 +2415,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 14)
(i32.const 0)
)
@ -2443,7 +2442,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 18)
(i32.const 0)
)
@ -2467,7 +2466,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 22)
(i32.const 0)
)
@ -2491,7 +2490,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 26)
(i32.const 0)
)
@ -2515,7 +2514,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 30)
(i32.const 0)
)
@ -2539,7 +2538,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 34)
(i32.const 0)
)
@ -2563,7 +2562,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 38)
(i32.const 0)
)
@ -2577,7 +2576,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 112)
(i32.const 120)
(i32.const 39)
(i32.const 0)
)