mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-15 16:01:30 +00:00
Use stack IR when emitting text format (#312)
This commit is contained in:
@ -3,11 +3,11 @@
|
||||
(type $iiiiv (func (param i32 i32 i32 i32)))
|
||||
(type $v (func))
|
||||
(type $i (func (result i32)))
|
||||
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
|
||||
(memory $0 1)
|
||||
(data (i32.const 8) "\16\00\00\00f\00u\00n\00c\00t\00i\00o\00n\00-\00e\00x\00p\00r\00e\00s\00s\00i\00o\00n\00.\00t\00s")
|
||||
(table 5 anyfunc)
|
||||
(table $0 5 anyfunc)
|
||||
(elem (i32.const 0) $start~someName|3 $start~anonymous|1 $start~anonymous|1 $start~someName|3 $start~anonymous|4)
|
||||
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
|
||||
(global $function-expression/f1 (mut i32) (i32.const 1))
|
||||
(global $~argc (mut i32) (i32.const 0))
|
||||
(global $function-expression/f2 (mut i32) (i32.const 2))
|
||||
@ -16,83 +16,63 @@
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start~anonymous|1 (; 1 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
|
||||
(get_local $0)
|
||||
(func $start~anonymous|1 (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
get_local $0
|
||||
)
|
||||
(func $start~someName|3 (; 2 ;) (; has Stack IR ;) (type $v)
|
||||
(nop)
|
||||
(func $start~someName|3 (; 2 ;) (type $v)
|
||||
nop
|
||||
)
|
||||
(func $start~anonymous|4 (; 3 ;) (; has Stack IR ;) (type $i) (result i32)
|
||||
(i32.const 1)
|
||||
(func $start~anonymous|4 (; 3 ;) (type $i) (result i32)
|
||||
i32.const 1
|
||||
)
|
||||
(func $start (; 4 ;) (; has Stack IR ;) (type $v)
|
||||
(set_global $~argc
|
||||
(i32.const 1)
|
||||
)
|
||||
(if
|
||||
(i32.ne
|
||||
(call_indirect (type $ii)
|
||||
(i32.const 1)
|
||||
(get_global $function-expression/f1)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 4)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(set_global $~argc
|
||||
(i32.const 1)
|
||||
)
|
||||
(if
|
||||
(i32.ne
|
||||
(call_indirect (type $ii)
|
||||
(i32.const 2)
|
||||
(get_global $function-expression/f2)
|
||||
)
|
||||
(i32.const 2)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 9)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(set_global $~argc
|
||||
(i32.const 0)
|
||||
)
|
||||
(call_indirect (type $v)
|
||||
(get_global $function-expression/f3)
|
||||
)
|
||||
(set_global $~argc
|
||||
(i32.const 0)
|
||||
)
|
||||
(if
|
||||
(i32.ne
|
||||
(call_indirect (type $i)
|
||||
(get_global $function-expression/f4)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 16)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(func $start (; 4 ;) (type $v)
|
||||
i32.const 1
|
||||
set_global $~argc
|
||||
i32.const 1
|
||||
get_global $function-expression/f1
|
||||
call_indirect (type $ii)
|
||||
i32.const 1
|
||||
i32.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 4
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i32.const 1
|
||||
set_global $~argc
|
||||
i32.const 2
|
||||
get_global $function-expression/f2
|
||||
call_indirect (type $ii)
|
||||
i32.const 2
|
||||
i32.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 9
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i32.const 0
|
||||
set_global $~argc
|
||||
get_global $function-expression/f3
|
||||
call_indirect (type $v)
|
||||
i32.const 0
|
||||
set_global $~argc
|
||||
get_global $function-expression/f4
|
||||
call_indirect (type $i)
|
||||
i32.const 1
|
||||
i32.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 16
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user