Rename lib prefix to '~lib' (parens aren't valid); Add built-in alignof<T>; Prepare for ArrayBufferView

This commit is contained in:
dcodeIO
2018-04-02 19:05:26 +02:00
parent 3b50720603
commit 06198a3723
51 changed files with 2286 additions and 2209 deletions

View File

@ -1,8 +1,8 @@
(module
(type $ii (func (param i32) (result i32)))
(type $v (func))
(global "$(lib)/allocator/arena/startOffset" (mut i32) (i32.const 0))
(global "$(lib)/allocator/arena/offset" (mut i32) (i32.const 0))
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
(global $std/constructor/emptyCtor (mut i32) (i32.const 0))
(global $std/constructor/emptyCtorWithFieldInit (mut i32) (i32.const 0))
(global $std/constructor/emptyCtorWithFieldNoInit (mut i32) (i32.const 0))
@ -18,7 +18,7 @@
(memory $0 1)
(export "memory" (memory $0))
(start $start)
(func "$(lib)/allocator/arena/allocate_memory" (; 0 ;) (type $ii) (param $0 i32) (result i32)
(func $~lib/allocator/arena/allocate_memory (; 0 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@ -38,7 +38,7 @@
(i32.add
(i32.add
(tee_local $1
(get_global "$(lib)/allocator/arena/offset")
(get_global $~lib/allocator/arena/offset)
)
(get_local $0)
)
@ -95,7 +95,7 @@
)
)
)
(set_global "$(lib)/allocator/arena/offset"
(set_global $~lib/allocator/arena/offset
(get_local $2)
)
(get_local $1)
@ -104,7 +104,7 @@
(if (result i32)
(get_local $0)
(get_local $0)
(call "$(lib)/allocator/arena/allocate_memory"
(call $~lib/allocator/arena/allocate_memory
(i32.const 0)
)
)
@ -117,7 +117,7 @@
(block (result i32)
(i32.store
(tee_local $1
(call "$(lib)/allocator/arena/allocate_memory"
(call $~lib/allocator/arena/allocate_memory
(i32.const 4)
)
)
@ -135,7 +135,7 @@
(block (result i32)
(i32.store
(tee_local $1
(call "$(lib)/allocator/arena/allocate_memory"
(call $~lib/allocator/arena/allocate_memory
(i32.const 4)
)
)
@ -146,7 +146,7 @@
)
)
(func $std/constructor/CtorReturns#constructor (; 4 ;) (type $ii) (param $0 i32) (result i32)
(call "$(lib)/allocator/arena/allocate_memory"
(call $~lib/allocator/arena/allocate_memory
(i32.const 0)
)
)
@ -154,7 +154,7 @@
(if
(get_global $std/constructor/b)
(return
(call "$(lib)/allocator/arena/allocate_memory"
(call $~lib/allocator/arena/allocate_memory
(i32.const 0)
)
)
@ -162,7 +162,7 @@
(if (result i32)
(get_local $0)
(get_local $0)
(call "$(lib)/allocator/arena/allocate_memory"
(call $~lib/allocator/arena/allocate_memory
(i32.const 0)
)
)
@ -175,7 +175,7 @@
(get_local $0)
)
(set_local $0
(call "$(lib)/allocator/arena/allocate_memory"
(call $~lib/allocator/arena/allocate_memory
(i32.const 0)
)
)
@ -184,14 +184,14 @@
(if (result i32)
(get_local $0)
(get_local $0)
(call "$(lib)/allocator/arena/allocate_memory"
(call $~lib/allocator/arena/allocate_memory
(i32.const 0)
)
)
)
(func $start (; 7 ;) (type $v)
(local $0 i32)
(set_global "$(lib)/allocator/arena/startOffset"
(set_global $~lib/allocator/arena/startOffset
(i32.and
(i32.add
(get_global $HEAP_BASE)
@ -200,8 +200,8 @@
(i32.const -8)
)
)
(set_global "$(lib)/allocator/arena/offset"
(get_global "$(lib)/allocator/arena/startOffset")
(set_global $~lib/allocator/arena/offset
(get_global $~lib/allocator/arena/startOffset)
)
(set_global $std/constructor/emptyCtor
(call $std/constructor/EmptyCtor#constructor
@ -219,7 +219,7 @@
)
)
(set_global $std/constructor/none
(call "$(lib)/allocator/arena/allocate_memory"
(call $~lib/allocator/arena/allocate_memory
(i32.const 0)
)
)
@ -227,7 +227,7 @@
(block (result i32)
(i32.store
(tee_local $0
(call "$(lib)/allocator/arena/allocate_memory"
(call $~lib/allocator/arena/allocate_memory
(i32.const 4)
)
)
@ -240,7 +240,7 @@
(block (result i32)
(i32.store
(tee_local $0
(call "$(lib)/allocator/arena/allocate_memory"
(call $~lib/allocator/arena/allocate_memory
(i32.const 4)
)
)