Implement function types / indirect calls / trampolines (#39)

This commit is contained in:
Daniel Wirtz
2018-03-12 14:06:39 +01:00
committed by GitHub
parent 5d5f458ab1
commit 423533c6b0
67 changed files with 7499 additions and 5763 deletions

View File

@ -49,6 +49,7 @@
)
(func $start (; 3 ;) (type $v)
(local $0 i32)
(local $1 i32)
(set_global $std/carray/arr
(get_global $HEAP_BASE)
)
@ -199,14 +200,19 @@
(if
(block (result i32)
(call "$(lib)/array/CArray#__set"
(get_global $std/carray/arr)
(i32.const 3)
(tee_local $0
(i32.const 9000)
(get_global $std/carray/arr)
)
(tee_local $1
(i32.const 3)
)
(i32.const 9000)
)
(i32.ne
(get_local $0)
(call "$(lib)/array/CArray#__get"
(get_local $0)
(get_local $1)
)
(i32.const 9000)
)
)