Rework constructor handling (#446)

This commit is contained in:
Daniel Wirtz
2019-02-02 16:03:21 +01:00
committed by GitHub
parent 75328f3feb
commit 2131c51932
30 changed files with 3308 additions and 2809 deletions

View File

@ -12,18 +12,23 @@
(func $~lib/memory/memory.allocate (; 0 ;) (type $ii) (param $0 i32) (result i32)
unreachable
)
(func $new-without-allocator/test (; 1 ;) (type $i) (result i32)
(local $0 i32)
(local $1 i32)
block (result i32)
(func $new-without-allocator/A#constructor (; 1 ;) (type $ii) (param $0 i32) (result i32)
get_local $0
i32.eqz
if
i32.const 0
call $~lib/memory/memory.allocate
set_local $0
get_local $0
end
set_local $1
get_local $0
)
(func $new-without-allocator/test (; 2 ;) (type $i) (result i32)
(local $0 i32)
i32.const 0
call $new-without-allocator/A#constructor
set_local $0
i32.const 3
)
(func $null (; 2 ;) (type $v)
(func $null (; 3 ;) (type $v)
)
)