Avoid trampolines where optional arguments are constant literals, see #102; Fix temporary local flags not being cleared; Fix inlined temporary locals not being free'd; Fix inlined flows not breaking after returns; Allow changetype of u32s, i.e. function pointers

This commit is contained in:
dcodeIO
2018-05-11 16:31:56 +02:00
parent ef9b43740d
commit e415377cda
35 changed files with 3424 additions and 4059 deletions

View File

@ -11,12 +11,6 @@
(local $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
(local $8 i32)
(block
(set_local $0
(i32.const 127)
@ -301,12 +295,12 @@
)
)
(block
(set_local $2
(set_local $1
(i32.const 32767)
)
(set_local $2
(set_local $1
(i32.add
(get_local $2)
(get_local $1)
(i32.const 1)
)
)
@ -315,7 +309,7 @@
(i32.eq
(i32.shr_s
(i32.shl
(get_local $2)
(get_local $1)
(i32.const 16)
)
(i32.const 16)
@ -333,9 +327,9 @@
(unreachable)
)
)
(set_local $2
(set_local $1
(i32.sub
(get_local $2)
(get_local $1)
(i32.const 1)
)
)
@ -344,7 +338,7 @@
(i32.eq
(i32.shr_s
(i32.shl
(get_local $2)
(get_local $1)
(i32.const 16)
)
(i32.const 16)
@ -362,18 +356,18 @@
(unreachable)
)
)
(set_local $3
(set_local $0
(block (result i32)
(set_local $4
(get_local $2)
)
(set_local $2
(get_local $1)
)
(set_local $1
(i32.add
(get_local $4)
(get_local $2)
(i32.const 1)
)
)
(get_local $4)
(get_local $2)
)
)
(if
@ -381,7 +375,7 @@
(i32.eq
(i32.shr_s
(i32.shl
(get_local $2)
(get_local $1)
(i32.const 16)
)
(i32.const 16)
@ -399,18 +393,18 @@
(unreachable)
)
)
(set_local $3
(set_local $0
(block (result i32)
(set_local $4
(get_local $2)
)
(set_local $2
(get_local $1)
)
(set_local $1
(i32.sub
(get_local $4)
(get_local $2)
(i32.const 1)
)
)
(get_local $4)
(get_local $2)
)
)
(if
@ -418,7 +412,7 @@
(i32.eq
(i32.shr_s
(i32.shl
(get_local $2)
(get_local $1)
(i32.const 16)
)
(i32.const 16)
@ -436,9 +430,9 @@
(unreachable)
)
)
(set_local $2
(set_local $1
(i32.add
(get_local $2)
(get_local $1)
(i32.const 1)
)
)
@ -447,7 +441,7 @@
(i32.eq
(i32.shr_s
(i32.shl
(get_local $2)
(get_local $1)
(i32.const 16)
)
(i32.const 16)
@ -465,9 +459,9 @@
(unreachable)
)
)
(set_local $2
(set_local $1
(i32.sub
(get_local $2)
(get_local $1)
(i32.const 1)
)
)
@ -476,7 +470,7 @@
(i32.eq
(i32.shr_s
(i32.shl
(get_local $2)
(get_local $1)
(i32.const 16)
)
(i32.const 16)
@ -494,10 +488,10 @@
(unreachable)
)
)
(set_local $3
(tee_local $2
(set_local $0
(tee_local $1
(i32.add
(get_local $2)
(get_local $1)
(i32.const 1)
)
)
@ -507,7 +501,7 @@
(i32.eq
(i32.shr_s
(i32.shl
(get_local $2)
(get_local $1)
(i32.const 16)
)
(i32.const 16)
@ -525,10 +519,10 @@
(unreachable)
)
)
(set_local $3
(tee_local $2
(set_local $0
(tee_local $1
(i32.sub
(get_local $2)
(get_local $1)
(i32.const 1)
)
)
@ -538,7 +532,7 @@
(i32.eq
(i32.shr_s
(i32.shl
(get_local $2)
(get_local $1)
(i32.const 16)
)
(i32.const 16)
@ -562,7 +556,7 @@
(i32.shr_s
(i32.shl
(i32.add
(get_local $2)
(get_local $1)
(i32.const 1)
)
(i32.const 16)
@ -584,12 +578,12 @@
)
)
(block
(set_local $4
(set_local $0
(i32.const 0)
)
(set_local $4
(set_local $0
(i32.sub
(get_local $4)
(get_local $0)
(i32.const 1)
)
)
@ -597,7 +591,7 @@
(i32.eqz
(i32.eq
(i32.and
(get_local $4)
(get_local $0)
(i32.const 255)
)
(i32.const 255)
@ -613,9 +607,9 @@
(unreachable)
)
)
(set_local $4
(set_local $0
(i32.add
(get_local $4)
(get_local $0)
(i32.const 1)
)
)
@ -623,7 +617,7 @@
(i32.eqz
(i32.eq
(i32.and
(get_local $4)
(get_local $0)
(i32.const 255)
)
(i32.const 0)
@ -639,25 +633,25 @@
(unreachable)
)
)
(set_local $5
(set_local $1
(block (result i32)
(set_local $6
(get_local $4)
(set_local $2
(get_local $0)
)
(set_local $4
(set_local $0
(i32.sub
(get_local $6)
(get_local $2)
(i32.const 1)
)
)
(get_local $6)
(get_local $2)
)
)
(if
(i32.eqz
(i32.eq
(i32.and
(get_local $4)
(get_local $0)
(i32.const 255)
)
(i32.const 255)
@ -673,25 +667,25 @@
(unreachable)
)
)
(set_local $5
(set_local $1
(block (result i32)
(set_local $6
(get_local $4)
(set_local $2
(get_local $0)
)
(set_local $4
(set_local $0
(i32.add
(get_local $6)
(get_local $2)
(i32.const 1)
)
)
(get_local $6)
(get_local $2)
)
)
(if
(i32.eqz
(i32.eq
(i32.and
(get_local $4)
(get_local $0)
(i32.const 255)
)
(i32.const 0)
@ -707,9 +701,9 @@
(unreachable)
)
)
(set_local $4
(set_local $0
(i32.sub
(get_local $4)
(get_local $0)
(i32.const 1)
)
)
@ -717,7 +711,7 @@
(i32.eqz
(i32.eq
(i32.and
(get_local $4)
(get_local $0)
(i32.const 255)
)
(i32.const 255)
@ -733,9 +727,9 @@
(unreachable)
)
)
(set_local $4
(set_local $0
(i32.add
(get_local $4)
(get_local $0)
(i32.const 1)
)
)
@ -743,7 +737,7 @@
(i32.eqz
(i32.eq
(i32.and
(get_local $4)
(get_local $0)
(i32.const 255)
)
(i32.const 0)
@ -759,10 +753,10 @@
(unreachable)
)
)
(set_local $5
(tee_local $4
(set_local $1
(tee_local $0
(i32.sub
(get_local $4)
(get_local $0)
(i32.const 1)
)
)
@ -771,7 +765,7 @@
(i32.eqz
(i32.eq
(i32.and
(get_local $4)
(get_local $0)
(i32.const 255)
)
(i32.const 255)
@ -787,10 +781,10 @@
(unreachable)
)
)
(set_local $5
(tee_local $4
(set_local $1
(tee_local $0
(i32.add
(get_local $4)
(get_local $0)
(i32.const 1)
)
)
@ -799,7 +793,7 @@
(i32.eqz
(i32.eq
(i32.and
(get_local $4)
(get_local $0)
(i32.const 255)
)
(i32.const 0)
@ -820,7 +814,7 @@
(i32.eq
(i32.and
(i32.sub
(get_local $4)
(get_local $0)
(i32.const 1)
)
(i32.const 255)
@ -840,12 +834,12 @@
)
)
(block
(set_local $6
(set_local $1
(i32.const 0)
)
(set_local $6
(set_local $1
(i32.sub
(get_local $6)
(get_local $1)
(i32.const 1)
)
)
@ -853,7 +847,7 @@
(i32.eqz
(i32.eq
(i32.and
(get_local $6)
(get_local $1)
(i32.const 65535)
)
(i32.const 65535)
@ -869,9 +863,9 @@
(unreachable)
)
)
(set_local $6
(set_local $1
(i32.add
(get_local $6)
(get_local $1)
(i32.const 1)
)
)
@ -879,7 +873,7 @@
(i32.eqz
(i32.eq
(i32.and
(get_local $6)
(get_local $1)
(i32.const 65535)
)
(i32.const 0)
@ -895,25 +889,25 @@
(unreachable)
)
)
(set_local $7
(set_local $0
(block (result i32)
(set_local $8
(get_local $6)
(set_local $2
(get_local $1)
)
(set_local $6
(set_local $1
(i32.sub
(get_local $8)
(get_local $2)
(i32.const 1)
)
)
(get_local $8)
(get_local $2)
)
)
(if
(i32.eqz
(i32.eq
(i32.and
(get_local $6)
(get_local $1)
(i32.const 65535)
)
(i32.const 65535)
@ -929,25 +923,25 @@
(unreachable)
)
)
(set_local $7
(set_local $0
(block (result i32)
(set_local $8
(get_local $6)
(set_local $2
(get_local $1)
)
(set_local $6
(set_local $1
(i32.add
(get_local $8)
(get_local $2)
(i32.const 1)
)
)
(get_local $8)
(get_local $2)
)
)
(if
(i32.eqz
(i32.eq
(i32.and
(get_local $6)
(get_local $1)
(i32.const 65535)
)
(i32.const 0)
@ -963,9 +957,9 @@
(unreachable)
)
)
(set_local $6
(set_local $1
(i32.sub
(get_local $6)
(get_local $1)
(i32.const 1)
)
)
@ -973,7 +967,7 @@
(i32.eqz
(i32.eq
(i32.and
(get_local $6)
(get_local $1)
(i32.const 65535)
)
(i32.const 65535)
@ -989,9 +983,9 @@
(unreachable)
)
)
(set_local $6
(set_local $1
(i32.add
(get_local $6)
(get_local $1)
(i32.const 1)
)
)
@ -999,7 +993,7 @@
(i32.eqz
(i32.eq
(i32.and
(get_local $6)
(get_local $1)
(i32.const 65535)
)
(i32.const 0)
@ -1015,10 +1009,10 @@
(unreachable)
)
)
(set_local $7
(tee_local $6
(set_local $0
(tee_local $1
(i32.sub
(get_local $6)
(get_local $1)
(i32.const 1)
)
)
@ -1027,7 +1021,7 @@
(i32.eqz
(i32.eq
(i32.and
(get_local $6)
(get_local $1)
(i32.const 65535)
)
(i32.const 65535)
@ -1043,10 +1037,10 @@
(unreachable)
)
)
(set_local $7
(tee_local $6
(set_local $0
(tee_local $1
(i32.add
(get_local $6)
(get_local $1)
(i32.const 1)
)
)
@ -1055,7 +1049,7 @@
(i32.eqz
(i32.eq
(i32.and
(get_local $6)
(get_local $1)
(i32.const 65535)
)
(i32.const 0)
@ -1076,7 +1070,7 @@
(i32.eq
(i32.and
(i32.sub
(get_local $6)
(get_local $1)
(i32.const 1)
)
(i32.const 65535)