Support indirect calls with omitted arguments

This commit is contained in:
dcodeIO
2018-03-24 09:46:22 +01:00
parent 664f2a1c0d
commit 19a616dd96
18 changed files with 1084 additions and 531 deletions

View File

@ -6,13 +6,13 @@
(type $iiiv (func (param i32 i32 i32)))
(type $iv (func (param i32)))
(type $iiii (func (param i32 i32 i32) (result i32)))
(type $iiiii (func (param i32 i32 i32 i32) (result i32)))
(type $v (func))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
(global "$(lib)/allocator/arena/startOffset" (mut i32) (i32.const 0))
(global "$(lib)/allocator/arena/offset" (mut i32) (i32.const 0))
(global $std/array/arr (mut i32) (i32.const 0))
(global $std/array/i (mut i32) (i32.const 0))
(global $argumentCount (mut i32) (i32.const 0))
(global $std/array/includes (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 64))
(memory $0 1)
@ -2839,14 +2839,14 @@
)
(i32.const -1)
)
(func "$(lib)/array/Array<i32>#indexOf|trampoline" (; 15 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(block $N=1
(block $N=0
(block $N=invalid
(br_table $N=0 $N=1 $N=invalid
(func "$(lib)/array/Array<i32>#indexOf|trampoline" (; 15 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(block $1of1
(block $0of1
(block $oob
(br_table $0of1 $1of1 $oob
(i32.sub
(get_local $3)
(i32.const 2)
(get_global $argumentCount)
(i32.const 1)
)
)
)
@ -2950,14 +2950,14 @@
)
(i32.const 0)
)
(func "$(lib)/array/Array<i32>#includes|trampoline" (; 17 ;) (type $iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(block $N=1
(block $N=0
(block $N=invalid
(br_table $N=0 $N=1 $N=invalid
(func "$(lib)/array/Array<i32>#includes|trampoline" (; 17 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(block $1of1
(block $0of1
(block $oob
(br_table $0of1 $1of1 $oob
(i32.sub
(get_local $3)
(i32.const 2)
(get_global $argumentCount)
(i32.const 1)
)
)
)
@ -4039,11 +4039,15 @@
)
)
(set_global $std/array/i
(call "$(lib)/array/Array<i32>#indexOf|trampoline"
(get_global $std/array/arr)
(i32.const 44)
(i32.const 0)
(i32.const 2)
(block (result i32)
(set_global $argumentCount
(i32.const 1)
)
(call "$(lib)/array/Array<i32>#indexOf|trampoline"
(get_global $std/array/arr)
(i32.const 44)
(i32.const 0)
)
)
)
(if
@ -4059,11 +4063,15 @@
)
)
(set_global $std/array/i
(call "$(lib)/array/Array<i32>#indexOf|trampoline"
(get_global $std/array/arr)
(i32.const 42)
(i32.const 0)
(i32.const 2)
(block (result i32)
(set_global $argumentCount
(i32.const 1)
)
(call "$(lib)/array/Array<i32>#indexOf|trampoline"
(get_global $std/array/arr)
(i32.const 42)
(i32.const 0)
)
)
)
(if
@ -4082,11 +4090,15 @@
)
)
(set_global $std/array/i
(call "$(lib)/array/Array<i32>#indexOf|trampoline"
(get_global $std/array/arr)
(i32.const 45)
(i32.const 0)
(i32.const 2)
(block (result i32)
(set_global $argumentCount
(i32.const 1)
)
(call "$(lib)/array/Array<i32>#indexOf|trampoline"
(get_global $std/array/arr)
(i32.const 45)
(i32.const 0)
)
)
)
(if
@ -4259,11 +4271,15 @@
)
)
(set_global $std/array/includes
(call "$(lib)/array/Array<i32>#includes|trampoline"
(get_global $std/array/arr)
(i32.const 44)
(i32.const 0)
(i32.const 2)
(block (result i32)
(set_global $argumentCount
(i32.const 1)
)
(call "$(lib)/array/Array<i32>#includes|trampoline"
(get_global $std/array/arr)
(i32.const 44)
(i32.const 0)
)
)
)
(if
@ -4282,11 +4298,15 @@
)
)
(set_global $std/array/includes
(call "$(lib)/array/Array<i32>#includes|trampoline"
(get_global $std/array/arr)
(i32.const 42)
(i32.const 0)
(i32.const 2)
(block (result i32)
(set_global $argumentCount
(i32.const 1)
)
(call "$(lib)/array/Array<i32>#includes|trampoline"
(get_global $std/array/arr)
(i32.const 42)
(i32.const 0)
)
)
)
(if
@ -4305,11 +4325,15 @@
)
)
(set_global $std/array/includes
(call "$(lib)/array/Array<i32>#includes|trampoline"
(get_global $std/array/arr)
(i32.const 45)
(i32.const 0)
(i32.const 2)
(block (result i32)
(set_global $argumentCount
(i32.const 1)
)
(call "$(lib)/array/Array<i32>#includes|trampoline"
(get_global $std/array/arr)
(i32.const 45)
(i32.const 0)
)
)
)
(if