Suppress some unnecessary blocks and nops; Fix compilation of always 'break'ing 'do's

This commit is contained in:
dcodeIO
2018-05-06 05:46:35 +02:00
parent 2f8f477ab0
commit 25a1f6230a
45 changed files with 1318 additions and 1642 deletions

View File

@ -135,8 +135,7 @@
)
(func $std/constructor/EmptyCtor#constructor (; 1 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(block
)
(nop)
(tee_local $0
(if (result i32)
(get_local $0)
@ -156,8 +155,7 @@
)
(func $std/constructor/EmptyCtorWithFieldInit#constructor (; 2 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(block
)
(nop)
(tee_local $0
(if (result i32)
(get_local $0)
@ -181,8 +179,7 @@
)
(func $std/constructor/EmptyCtorWithFieldNoInit#constructor (; 3 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(block
)
(nop)
(tee_local $0
(if (result i32)
(get_local $0)
@ -213,13 +210,11 @@
)
(func $std/constructor/CtorConditionallyReturns#constructor (; 5 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(block
(if
(get_global $std/constructor/b)
(return
(call $~lib/allocator/arena/allocate_memory
(i32.const 0)
)
(if
(get_global $std/constructor/b)
(return
(call $~lib/allocator/arena/allocate_memory
(i32.const 0)
)
)
)
@ -242,7 +237,30 @@
)
(func $std/constructor/CtorAllocates#constructor (; 6 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(block
(drop
(tee_local $0
(if (result i32)
(get_local $0)
(get_local $0)
(tee_local $0
(block (result i32)
(set_local $1
(call $~lib/allocator/arena/allocate_memory
(i32.const 0)
)
)
(get_local $1)
)
)
)
)
)
(get_local $0)
)
(func $std/constructor/CtorConditionallyAllocates#constructor (; 7 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(if
(get_global $std/constructor/b)
(drop
(tee_local $0
(if (result i32)
@ -262,33 +280,6 @@
)
)
)
(get_local $0)
)
(func $std/constructor/CtorConditionallyAllocates#constructor (; 7 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(block
(if
(get_global $std/constructor/b)
(drop
(tee_local $0
(if (result i32)
(get_local $0)
(get_local $0)
(tee_local $0
(block (result i32)
(set_local $1
(call $~lib/allocator/arena/allocate_memory
(i32.const 0)
)
)
(get_local $1)
)
)
)
)
)
)
)
(tee_local $0
(if (result i32)
(get_local $0)