Initial GC integration (#196)

This commit is contained in:
Daniel Wirtz
2018-08-02 18:23:02 +02:00
committed by GitHub
parent 671121bf70
commit dc0f271fc2
139 changed files with 7370 additions and 5016 deletions

View File

@ -285,14 +285,7 @@
)
(i32.const 0)
)
(func $~lib/memory/memory.allocate (; 3 ;) (type $ii) (param $0 i32) (result i32)
(return
(call $~lib/allocator/arena/__memory_allocate
(get_local $0)
)
)
)
(func $~lib/string/String#toUTF8 (; 4 ;) (type $ii) (param $0 i32) (result i32)
(func $~lib/string/String#toUTF8 (; 3 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@ -300,39 +293,46 @@
(local $5 i32)
(local $6 i32)
(local $7 i32)
(set_local $1
(call $~lib/memory/memory.allocate
(call $~lib/string/String#get:lengthUTF8
(get_local $0)
(set_local $2
(block $~lib/memory/memory.allocate|inlined.0 (result i32)
(set_local $1
(call $~lib/string/String#get:lengthUTF8
(get_local $0)
)
)
(br $~lib/memory/memory.allocate|inlined.0
(call $~lib/allocator/arena/__memory_allocate
(get_local $1)
)
)
)
)
(set_local $2
(set_local $3
(i32.const 0)
)
(set_local $3
(set_local $4
(i32.load
(get_local $0)
)
)
(set_local $4
(set_local $5
(i32.const 0)
)
(block $break|0
(loop $continue|0
(if
(i32.lt_u
(get_local $2)
(get_local $3)
(get_local $4)
)
(block
(block
(set_local $5
(set_local $1
(i32.load16_u offset=4
(i32.add
(get_local $0)
(i32.shl
(get_local $2)
(get_local $3)
(i32.const 1)
)
)
@ -340,47 +340,47 @@
)
(if
(i32.lt_u
(get_local $5)
(get_local $1)
(i32.const 128)
)
(block
(i32.store8
(i32.add
(get_local $1)
(get_local $4)
(get_local $2)
(get_local $5)
)
(get_local $5)
(get_local $1)
)
(set_local $4
(set_local $5
(i32.add
(get_local $4)
(get_local $5)
(i32.const 1)
)
)
(set_local $2
(set_local $3
(i32.add
(get_local $2)
(get_local $3)
(i32.const 1)
)
)
)
(if
(i32.lt_u
(get_local $5)
(get_local $1)
(i32.const 2048)
)
(block
(set_local $6
(i32.add
(get_local $1)
(get_local $4)
(get_local $2)
(get_local $5)
)
)
(i32.store8
(get_local $6)
(i32.or
(i32.shr_u
(get_local $5)
(get_local $1)
(i32.const 6)
)
(i32.const 192)
@ -390,21 +390,21 @@
(get_local $6)
(i32.or
(i32.and
(get_local $5)
(get_local $1)
(i32.const 63)
)
(i32.const 128)
)
)
(set_local $4
(set_local $5
(i32.add
(get_local $4)
(get_local $5)
(i32.const 2)
)
)
(set_local $2
(set_local $3
(i32.add
(get_local $2)
(get_local $3)
(i32.const 1)
)
)
@ -412,8 +412,8 @@
(block
(set_local $6
(i32.add
(get_local $1)
(get_local $4)
(get_local $2)
(get_local $5)
)
)
(if
@ -421,7 +421,7 @@
(tee_local $7
(i32.eq
(i32.and
(get_local $5)
(get_local $1)
(i32.const 64512)
)
(i32.const 55296)
@ -429,10 +429,10 @@
)
(i32.lt_u
(i32.add
(get_local $2)
(get_local $3)
(i32.const 1)
)
(get_local $3)
(get_local $4)
)
(get_local $7)
)
@ -443,7 +443,7 @@
(get_local $0)
(i32.shl
(i32.add
(get_local $2)
(get_local $3)
(i32.const 1)
)
(i32.const 1)
@ -460,13 +460,13 @@
(i32.const 56320)
)
(block
(set_local $5
(set_local $1
(i32.add
(i32.add
(i32.const 65536)
(i32.shl
(i32.and
(get_local $5)
(get_local $1)
(i32.const 1023)
)
(i32.const 10)
@ -482,7 +482,7 @@
(get_local $6)
(i32.or
(i32.shr_u
(get_local $5)
(get_local $1)
(i32.const 18)
)
(i32.const 240)
@ -493,7 +493,7 @@
(i32.or
(i32.and
(i32.shr_u
(get_local $5)
(get_local $1)
(i32.const 12)
)
(i32.const 63)
@ -506,7 +506,7 @@
(i32.or
(i32.and
(i32.shr_u
(get_local $5)
(get_local $1)
(i32.const 6)
)
(i32.const 63)
@ -518,21 +518,21 @@
(get_local $6)
(i32.or
(i32.and
(get_local $5)
(get_local $1)
(i32.const 63)
)
(i32.const 128)
)
)
(set_local $4
(set_local $5
(i32.add
(get_local $4)
(get_local $5)
(i32.const 4)
)
)
(set_local $2
(set_local $3
(i32.add
(get_local $2)
(get_local $3)
(i32.const 2)
)
)
@ -545,7 +545,7 @@
(get_local $6)
(i32.or
(i32.shr_u
(get_local $5)
(get_local $1)
(i32.const 12)
)
(i32.const 224)
@ -556,7 +556,7 @@
(i32.or
(i32.and
(i32.shr_u
(get_local $5)
(get_local $1)
(i32.const 6)
)
(i32.const 63)
@ -568,21 +568,21 @@
(get_local $6)
(i32.or
(i32.and
(get_local $5)
(get_local $1)
(i32.const 63)
)
(i32.const 128)
)
)
(set_local $4
(set_local $5
(i32.add
(get_local $4)
(get_local $5)
(i32.const 3)
)
)
(set_local $2
(set_local $3
(i32.add
(get_local $2)
(get_local $3)
(i32.const 1)
)
)
@ -597,23 +597,18 @@
)
(i32.store8
(i32.add
(get_local $1)
(get_local $4)
(get_local $2)
(get_local $5)
)
(i32.const 0)
)
(get_local $1)
(get_local $2)
)
(func $~lib/allocator/arena/__memory_free (; 5 ;) (type $iv) (param $0 i32)
(func $~lib/allocator/arena/__memory_free (; 4 ;) (type $iv) (param $0 i32)
(nop)
)
(func $~lib/memory/memory.free (; 6 ;) (type $iv) (param $0 i32)
(call $~lib/allocator/arena/__memory_free
(get_local $0)
)
(return)
)
(func $start (; 7 ;) (type $v)
(func $start (; 5 ;) (type $v)
(local $0 i32)
(set_global $~lib/allocator/arena/startOffset
(i32.and
(i32.add
@ -865,8 +860,16 @@
(unreachable)
)
)
(call $~lib/memory/memory.free
(get_global $std/string-utf8/ptr)
(block $~lib/memory/memory.free|inlined.0
(set_local $0
(get_global $std/string-utf8/ptr)
)
(block
(call $~lib/allocator/arena/__memory_free
(get_local $0)
)
(br $~lib/memory/memory.free|inlined.0)
)
)
)
)