mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-28 06:01:51 +00:00
Rework constructor handling (#446)
This commit is contained in:
@ -102,23 +102,19 @@
|
||||
return
|
||||
)
|
||||
(func $call-super/A#constructor (; 3 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
get_local $0
|
||||
if (result i32)
|
||||
block (result i32)
|
||||
get_local $0
|
||||
else
|
||||
block (result i32)
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 4
|
||||
call $~lib/memory/memory.allocate
|
||||
set_local $1
|
||||
get_local $1
|
||||
i32.const 1
|
||||
i32.store
|
||||
get_local $1
|
||||
set_local $0
|
||||
end
|
||||
tee_local $0
|
||||
get_local $0
|
||||
i32.const 1
|
||||
i32.store
|
||||
get_local $0
|
||||
end
|
||||
tee_local $0
|
||||
i32.load
|
||||
i32.const 1
|
||||
i32.eq
|
||||
@ -126,7 +122,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 6
|
||||
i32.const 8
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -134,22 +130,19 @@
|
||||
get_local $0
|
||||
)
|
||||
(func $call-super/B#constructor (; 4 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
block (result i32)
|
||||
get_local $0
|
||||
if (result i32)
|
||||
get_local $0
|
||||
else
|
||||
i32.const 8
|
||||
call $~lib/memory/memory.allocate
|
||||
set_local $1
|
||||
get_local $1
|
||||
i32.const 1
|
||||
i32.store
|
||||
get_local $1
|
||||
i32.const 2
|
||||
i32.store offset=4
|
||||
get_local $1
|
||||
end
|
||||
call $call-super/A#constructor
|
||||
set_local $0
|
||||
get_local $0
|
||||
i32.const 2
|
||||
i32.store offset=4
|
||||
get_local $0
|
||||
i32.load
|
||||
i32.const 1
|
||||
i32.eq
|
||||
@ -157,7 +150,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 15
|
||||
i32.const 17
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -170,7 +163,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 16
|
||||
i32.const 18
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -190,7 +183,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 22
|
||||
i32.const 24
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -203,28 +196,39 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 23
|
||||
i32.const 25
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $call-super/D#constructor (; 6 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
block (result i32)
|
||||
(func $call-super/C#constructor (; 6 ;) (type $ii) (param $0 i32) (result i32)
|
||||
get_local $0
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 4
|
||||
call $~lib/memory/memory.allocate
|
||||
set_local $0
|
||||
end
|
||||
get_local $0
|
||||
i32.const 1
|
||||
i32.store
|
||||
get_local $0
|
||||
)
|
||||
(func $call-super/D#constructor (; 7 ;) (type $ii) (param $0 i32) (result i32)
|
||||
get_local $0
|
||||
if (result i32)
|
||||
get_local $0
|
||||
else
|
||||
i32.const 8
|
||||
call $~lib/memory/memory.allocate
|
||||
set_local $1
|
||||
get_local $1
|
||||
i32.const 1
|
||||
i32.store
|
||||
get_local $1
|
||||
i32.const 2
|
||||
i32.store offset=4
|
||||
get_local $1
|
||||
end
|
||||
call $call-super/C#constructor
|
||||
set_local $0
|
||||
get_local $0
|
||||
i32.const 2
|
||||
i32.store offset=4
|
||||
get_local $0
|
||||
i32.load
|
||||
i32.const 1
|
||||
i32.eq
|
||||
@ -232,7 +236,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 36
|
||||
i32.const 40
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -245,14 +249,14 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 37
|
||||
i32.const 41
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
get_local $0
|
||||
)
|
||||
(func $call-super/test2 (; 7 ;) (type $v)
|
||||
(func $call-super/test2 (; 8 ;) (type $v)
|
||||
(local $0 i32)
|
||||
i32.const 0
|
||||
call $call-super/D#constructor
|
||||
@ -265,7 +269,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 43
|
||||
i32.const 47
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -278,30 +282,26 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 44
|
||||
i32.const 48
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $call-super/E#constructor (; 8 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
get_local $0
|
||||
if (result i32)
|
||||
(func $call-super/E#constructor (; 9 ;) (type $ii) (param $0 i32) (result i32)
|
||||
block (result i32)
|
||||
get_local $0
|
||||
else
|
||||
block (result i32)
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 4
|
||||
call $~lib/memory/memory.allocate
|
||||
set_local $1
|
||||
get_local $1
|
||||
i32.const 1
|
||||
i32.store
|
||||
get_local $1
|
||||
set_local $0
|
||||
end
|
||||
tee_local $0
|
||||
get_local $0
|
||||
i32.const 1
|
||||
i32.store
|
||||
get_local $0
|
||||
end
|
||||
tee_local $0
|
||||
i32.load
|
||||
i32.const 1
|
||||
i32.eq
|
||||
@ -309,17 +309,33 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 52
|
||||
i32.const 58
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
get_local $0
|
||||
)
|
||||
(func $call-super/test3 (; 9 ;) (type $v)
|
||||
(func $call-super/F#constructor (; 10 ;) (type $ii) (param $0 i32) (result i32)
|
||||
get_local $0
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 8
|
||||
call $~lib/memory/memory.allocate
|
||||
set_local $0
|
||||
end
|
||||
get_local $0
|
||||
call $call-super/E#constructor
|
||||
set_local $0
|
||||
get_local $0
|
||||
i32.const 2
|
||||
i32.store offset=4
|
||||
get_local $0
|
||||
)
|
||||
(func $call-super/test3 (; 11 ;) (type $v)
|
||||
(local $0 i32)
|
||||
i32.const 0
|
||||
call $call-super/E#constructor
|
||||
call $call-super/F#constructor
|
||||
set_local $0
|
||||
get_local $0
|
||||
i32.load
|
||||
@ -329,13 +345,148 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 62
|
||||
i32.const 68
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
get_local $0
|
||||
i32.load offset=4
|
||||
i32.const 2
|
||||
i32.eq
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 69
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $start (; 10 ;) (type $v)
|
||||
(func $call-super/G#constructor (; 12 ;) (type $ii) (param $0 i32) (result i32)
|
||||
get_local $0
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 4
|
||||
call $~lib/memory/memory.allocate
|
||||
set_local $0
|
||||
end
|
||||
get_local $0
|
||||
i32.const 1
|
||||
i32.store
|
||||
get_local $0
|
||||
)
|
||||
(func $call-super/H#constructor (; 13 ;) (type $ii) (param $0 i32) (result i32)
|
||||
get_local $0
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 8
|
||||
call $~lib/memory/memory.allocate
|
||||
set_local $0
|
||||
end
|
||||
get_local $0
|
||||
call $call-super/G#constructor
|
||||
set_local $0
|
||||
get_local $0
|
||||
i32.const 2
|
||||
i32.store offset=4
|
||||
get_local $0
|
||||
)
|
||||
(func $call-super/test4 (; 14 ;) (type $v)
|
||||
(local $0 i32)
|
||||
i32.const 0
|
||||
call $call-super/H#constructor
|
||||
set_local $0
|
||||
get_local $0
|
||||
i32.load
|
||||
i32.const 1
|
||||
i32.eq
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 86
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
get_local $0
|
||||
i32.load offset=4
|
||||
i32.const 2
|
||||
i32.eq
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 87
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $call-super/I#constructor (; 15 ;) (type $ii) (param $0 i32) (result i32)
|
||||
get_local $0
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 4
|
||||
call $~lib/memory/memory.allocate
|
||||
set_local $0
|
||||
end
|
||||
get_local $0
|
||||
i32.const 1
|
||||
i32.store
|
||||
get_local $0
|
||||
)
|
||||
(func $call-super/J#constructor (; 16 ;) (type $ii) (param $0 i32) (result i32)
|
||||
get_local $0
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 8
|
||||
call $~lib/memory/memory.allocate
|
||||
set_local $0
|
||||
end
|
||||
get_local $0
|
||||
call $call-super/I#constructor
|
||||
set_local $0
|
||||
get_local $0
|
||||
i32.const 2
|
||||
i32.store offset=4
|
||||
get_local $0
|
||||
)
|
||||
(func $call-super/test5 (; 17 ;) (type $v)
|
||||
(local $0 i32)
|
||||
i32.const 0
|
||||
call $call-super/J#constructor
|
||||
set_local $0
|
||||
get_local $0
|
||||
i32.load
|
||||
i32.const 1
|
||||
i32.eq
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 106
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
get_local $0
|
||||
i32.load offset=4
|
||||
i32.const 2
|
||||
i32.eq
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 107
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $start (; 18 ;) (type $v)
|
||||
get_global $HEAP_BASE
|
||||
get_global $~lib/internal/allocator/AL_MASK
|
||||
i32.add
|
||||
@ -349,7 +500,9 @@
|
||||
call $call-super/test1
|
||||
call $call-super/test2
|
||||
call $call-super/test3
|
||||
call $call-super/test4
|
||||
call $call-super/test5
|
||||
)
|
||||
(func $null (; 11 ;) (type $v)
|
||||
(func $null (; 19 ;) (type $v)
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user