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

@ -14,15 +14,19 @@
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
(memory $0 1)
(data (i32.const 8) "\10\00\00\00\02\00\00\00\08\00\00\00\00\00\00\00\01\00\00\00\02")
(data (i32.const 32) "(\00\00\00\02\00\00\00\10\00\00\00\00\00\00\00\03\00\00\00\00\00\00\00\04")
(data (i32.const 72) "P\00\00\00\02\00\00\00\08")
(data (i32.const 90) "\c0?\00\00 @")
(data (i32.const 96) "h\00\00\00\02\00\00\00\10")
(data (i32.const 118) "\f4?\00\00\00\00\00\00\02@")
(data (i32.const 8) "\08\00\00\00\00\00\00\00\01\00\00\00\02")
(data (i32.const 24) "\08\00\00\00\02")
(data (i32.const 32) "\10\00\00\00\00\00\00\00\03\00\00\00\00\00\00\00\04")
(data (i32.const 64) " \00\00\00\02")
(data (i32.const 72) "\08")
(data (i32.const 82) "\c0?\00\00 @")
(data (i32.const 88) "H\00\00\00\02")
(data (i32.const 96) "\10")
(data (i32.const 110) "\f4?\00\00\00\00\00\00\02@")
(data (i32.const 128) "`\00\00\00\02")
(data (i32.const 136) "\13\00\00\00s\00t\00d\00/\00s\00t\00a\00t\00i\00c\00-\00a\00r\00r\00a\00y\00.\00t\00s")
(data (i32.const 180) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s")
(data (i32.const 212) "\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 184) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s")
(data (i32.const 216) "\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")
(export "memory" (memory $0))
(start $start)
(func $~lib/array/Array<i32>#get:length (; 1 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
@ -408,86 +412,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 (; 6 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
@ -499,7 +502,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 212)
(i32.const 216)
(i32.const 23)
(i32.const 2)
)
@ -2217,7 +2220,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 212)
(i32.const 216)
(i32.const 37)
(i32.const 4)
)
@ -2304,7 +2307,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 212)
(i32.const 216)
(i32.const 61)
(i32.const 4)
)
@ -2346,7 +2349,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 180)
(i32.const 184)
(i32.const 86)
(i32.const 41)
)
@ -2440,7 +2443,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 180)
(i32.const 184)
(i32.const 86)
(i32.const 41)
)
@ -2534,7 +2537,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 180)
(i32.const 184)
(i32.const 86)
(i32.const 41)
)
@ -2628,7 +2631,7 @@
(block
(call $~lib/env/abort
(i32.const 0)
(i32.const 180)
(i32.const 184)
(i32.const 86)
(i32.const 41)
)
@ -2671,7 +2674,7 @@
)
(func $start (; 17 ;) (; has Stack IR ;) (type $v)
(set_global $~lib/allocator/arena/startOffset
(i32.const 272)
(i32.const 280)
)
(set_global $~lib/allocator/arena/offset
(get_global $~lib/allocator/arena/startOffset)
@ -2679,7 +2682,7 @@
(if
(i32.ne
(call $~lib/array/Array<i32>#get:length
(i32.const 8)
(i32.const 24)
)
(i32.const 2)
)
@ -2696,7 +2699,7 @@
(if
(i32.ne
(call $~lib/array/Array<i32>#__get
(i32.const 8)
(i32.const 24)
(i32.const 0)
)
(i32.const 1)
@ -2714,7 +2717,7 @@
(if
(i32.ne
(call $~lib/array/Array<i32>#__get
(i32.const 8)
(i32.const 24)
(i32.const 1)
)
(i32.const 2)
@ -2730,14 +2733,14 @@
)
)
(call $~lib/array/Array<i32>#__set
(i32.const 8)
(i32.const 24)
(i32.const 0)
(i32.const 2)
)
(if
(i32.ne
(call $~lib/array/Array<i32>#__get
(i32.const 8)
(i32.const 24)
(i32.const 0)
)
(i32.const 2)
@ -2755,7 +2758,7 @@
(if
(i32.ne
(call $~lib/array/Array<i32>#get:length
(i32.const 32)
(i32.const 64)
)
(i32.const 2)
)
@ -2772,7 +2775,7 @@
(if
(i64.ne
(call $~lib/array/Array<i64>#__get
(i32.const 32)
(i32.const 64)
(i32.const 0)
)
(i64.const 3)
@ -2790,7 +2793,7 @@
(if
(i64.ne
(call $~lib/array/Array<i64>#__get
(i32.const 32)
(i32.const 64)
(i32.const 1)
)
(i64.const 4)
@ -2806,14 +2809,14 @@
)
)
(call $~lib/array/Array<i64>#__set
(i32.const 32)
(i32.const 64)
(i32.const 0)
(i64.const 4)
)
(if
(i64.ne
(call $~lib/array/Array<i64>#__get
(i32.const 32)
(i32.const 64)
(i32.const 0)
)
(i64.const 4)
@ -2831,7 +2834,7 @@
(if
(i32.ne
(call $~lib/array/Array<i32>#get:length
(i32.const 72)
(i32.const 88)
)
(i32.const 2)
)
@ -2848,7 +2851,7 @@
(if
(f32.ne
(call $~lib/array/Array<f32>#__get
(i32.const 72)
(i32.const 88)
(i32.const 0)
)
(f32.const 1.5)
@ -2866,7 +2869,7 @@
(if
(f32.ne
(call $~lib/array/Array<f32>#__get
(i32.const 72)
(i32.const 88)
(i32.const 1)
)
(f32.const 2.5)
@ -2882,14 +2885,14 @@
)
)
(call $~lib/array/Array<f32>#__set
(i32.const 72)
(i32.const 88)
(i32.const 0)
(f32.const 2.5)
)
(if
(f32.ne
(call $~lib/array/Array<f32>#__get
(i32.const 72)
(i32.const 88)
(i32.const 0)
)
(f32.const 2.5)
@ -2907,7 +2910,7 @@
(if
(i32.ne
(call $~lib/array/Array<i32>#get:length
(i32.const 96)
(i32.const 128)
)
(i32.const 2)
)
@ -2924,7 +2927,7 @@
(if
(f64.ne
(call $~lib/array/Array<f64>#__get
(i32.const 96)
(i32.const 128)
(i32.const 0)
)
(f64.const 1.25)
@ -2942,7 +2945,7 @@
(if
(f64.ne
(call $~lib/array/Array<f64>#__get
(i32.const 96)
(i32.const 128)
(i32.const 1)
)
(f64.const 2.25)
@ -2958,14 +2961,14 @@
)
)
(call $~lib/array/Array<f64>#__set
(i32.const 96)
(i32.const 128)
(i32.const 0)
(f64.const 2.25)
)
(if
(f64.ne
(call $~lib/array/Array<f64>#__get
(i32.const 96)
(i32.const 128)
(i32.const 0)
)
(f64.const 2.25)