mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-12 22:41:27 +00:00
Use stack IR when emitting text format (#312)
This commit is contained in:
@ -2,11 +2,11 @@
|
||||
(type $ii (func (param i32) (result i32)))
|
||||
(type $iiiiv (func (param i32 i32 i32 i32)))
|
||||
(type $v (func))
|
||||
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
|
||||
(memory $0 1)
|
||||
(data (i32.const 8) "\05\00\00\00i\00f\00.\00t\00s")
|
||||
(table 1 anyfunc)
|
||||
(table $0 1 anyfunc)
|
||||
(elem (i32.const 0) $null)
|
||||
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "ifThenElse" (func $if/ifThenElse))
|
||||
@ -14,133 +14,104 @@
|
||||
(export "ifThenElseBlock" (func $if/ifThenElse))
|
||||
(export "ifAlwaysReturns" (func $if/ifAlwaysReturns))
|
||||
(start $start)
|
||||
(func $if/ifThenElse (; 1 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
|
||||
(if (result i32)
|
||||
(get_local $0)
|
||||
(i32.const 1)
|
||||
(i32.const 0)
|
||||
)
|
||||
(func $if/ifThenElse (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
get_local $0
|
||||
if (result i32)
|
||||
i32.const 1
|
||||
else
|
||||
i32.const 0
|
||||
end
|
||||
)
|
||||
(func $if/ifThen (; 2 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
|
||||
(if
|
||||
(get_local $0)
|
||||
(return
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
(func $if/ifThen (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
get_local $0
|
||||
if
|
||||
i32.const 1
|
||||
return
|
||||
end
|
||||
i32.const 0
|
||||
)
|
||||
(func $if/ifAlwaysReturns (; 3 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
|
||||
(if (result i32)
|
||||
(get_local $0)
|
||||
(i32.const 1)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 37)
|
||||
(i32.const 4)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(func $if/ifAlwaysReturns (; 3 ;) (type $ii) (param $0 i32) (result i32)
|
||||
get_local $0
|
||||
if (result i32)
|
||||
i32.const 1
|
||||
else
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 37
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $start (; 4 ;) (; has Stack IR ;) (type $v)
|
||||
(if
|
||||
(call $if/ifThenElse
|
||||
(i32.const 0)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 8)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.ne
|
||||
(call $if/ifThenElse
|
||||
(i32.const 1)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 9)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(call $if/ifThen
|
||||
(i32.const 0)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 17)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.ne
|
||||
(call $if/ifThen
|
||||
(i32.const 1)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 18)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(call $if/ifThenElse
|
||||
(i32.const 0)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 30)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.ne
|
||||
(call $if/ifThenElse
|
||||
(i32.const 1)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 31)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(func $start (; 4 ;) (type $v)
|
||||
i32.const 0
|
||||
call $if/ifThenElse
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 8
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i32.const 1
|
||||
call $if/ifThenElse
|
||||
i32.const 1
|
||||
i32.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 9
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i32.const 0
|
||||
call $if/ifThen
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 17
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i32.const 1
|
||||
call $if/ifThen
|
||||
i32.const 1
|
||||
i32.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 18
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i32.const 0
|
||||
call $if/ifThenElse
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 30
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i32.const 1
|
||||
call $if/ifThenElse
|
||||
i32.const 1
|
||||
i32.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 31
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 5 ;) (; has Stack IR ;) (type $v)
|
||||
(nop)
|
||||
(func $null (; 5 ;) (type $v)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user