mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-30 07:02:24 +00:00
Use stack IR when emitting text format (#312)
This commit is contained in:
@ -6,328 +6,219 @@
|
||||
(data (i32.const 16) "\01\00\00\00a")
|
||||
(data (i32.const 24) "\02\00\00\00a\00b")
|
||||
(data (i32.const 32) "\03\00\00\00a\00b\00c")
|
||||
(table 1 anyfunc)
|
||||
(table $0 1 anyfunc)
|
||||
(elem (i32.const 0) $null)
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $~lib/internal/hash/hashStr (; 0 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $~lib/internal/hash/hashStr (; 0 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(set_local $2
|
||||
(i32.const -2128831035)
|
||||
)
|
||||
(block $break|0
|
||||
(set_local $3
|
||||
(i32.shl
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(loop $repeat|0
|
||||
(br_if $break|0
|
||||
(i32.ge_u
|
||||
(get_local $1)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
(set_local $2
|
||||
(i32.mul
|
||||
(i32.xor
|
||||
(get_local $2)
|
||||
(i32.load8_u offset=4
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 16777619)
|
||||
)
|
||||
)
|
||||
(set_local $1
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(br $repeat|0)
|
||||
)
|
||||
)
|
||||
(get_local $2)
|
||||
i32.const -2128831035
|
||||
set_local $2
|
||||
block $break|0
|
||||
get_local $0
|
||||
i32.load
|
||||
i32.const 1
|
||||
i32.shl
|
||||
set_local $3
|
||||
loop $repeat|0
|
||||
get_local $1
|
||||
get_local $3
|
||||
i32.ge_u
|
||||
br_if $break|0
|
||||
get_local $2
|
||||
get_local $0
|
||||
get_local $1
|
||||
i32.add
|
||||
i32.load8_u offset=4
|
||||
i32.xor
|
||||
i32.const 16777619
|
||||
i32.mul
|
||||
set_local $2
|
||||
get_local $1
|
||||
i32.const 1
|
||||
i32.add
|
||||
set_local $1
|
||||
br $repeat|0
|
||||
unreachable
|
||||
end
|
||||
unreachable
|
||||
end
|
||||
get_local $2
|
||||
)
|
||||
(func $std/hash/check (; 1 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
|
||||
(i32.const 1)
|
||||
(func $std/hash/check (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
i32.const 1
|
||||
)
|
||||
(func $~lib/internal/hash/hash32 (; 2 ;) (; has Stack IR ;) (type $ii) (param $0 i32) (result i32)
|
||||
(i32.mul
|
||||
(i32.xor
|
||||
(i32.mul
|
||||
(i32.xor
|
||||
(i32.mul
|
||||
(i32.xor
|
||||
(i32.mul
|
||||
(i32.xor
|
||||
(i32.and
|
||||
(get_local $0)
|
||||
(i32.const 255)
|
||||
)
|
||||
(i32.const -2128831035)
|
||||
)
|
||||
(i32.const 16777619)
|
||||
)
|
||||
(i32.and
|
||||
(i32.shr_u
|
||||
(get_local $0)
|
||||
(i32.const 8)
|
||||
)
|
||||
(i32.const 255)
|
||||
)
|
||||
)
|
||||
(i32.const 16777619)
|
||||
)
|
||||
(i32.and
|
||||
(i32.shr_u
|
||||
(get_local $0)
|
||||
(i32.const 16)
|
||||
)
|
||||
(i32.const 255)
|
||||
)
|
||||
)
|
||||
(i32.const 16777619)
|
||||
)
|
||||
(i32.shr_u
|
||||
(get_local $0)
|
||||
(i32.const 24)
|
||||
)
|
||||
)
|
||||
(i32.const 16777619)
|
||||
)
|
||||
(func $~lib/internal/hash/hash32 (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
get_local $0
|
||||
i32.const 255
|
||||
i32.and
|
||||
i32.const -2128831035
|
||||
i32.xor
|
||||
i32.const 16777619
|
||||
i32.mul
|
||||
get_local $0
|
||||
i32.const 8
|
||||
i32.shr_u
|
||||
i32.const 255
|
||||
i32.and
|
||||
i32.xor
|
||||
i32.const 16777619
|
||||
i32.mul
|
||||
get_local $0
|
||||
i32.const 16
|
||||
i32.shr_u
|
||||
i32.const 255
|
||||
i32.and
|
||||
i32.xor
|
||||
i32.const 16777619
|
||||
i32.mul
|
||||
get_local $0
|
||||
i32.const 24
|
||||
i32.shr_u
|
||||
i32.xor
|
||||
i32.const 16777619
|
||||
i32.mul
|
||||
)
|
||||
(func $~lib/internal/hash/hash64 (; 3 ;) (; has Stack IR ;) (type $Ii) (param $0 i64) (result i32)
|
||||
(func $~lib/internal/hash/hash64 (; 3 ;) (type $Ii) (param $0 i64) (result i32)
|
||||
(local $1 i32)
|
||||
(i32.mul
|
||||
(i32.xor
|
||||
(i32.mul
|
||||
(i32.xor
|
||||
(i32.mul
|
||||
(i32.xor
|
||||
(i32.mul
|
||||
(i32.xor
|
||||
(i32.mul
|
||||
(i32.xor
|
||||
(i32.mul
|
||||
(i32.xor
|
||||
(i32.mul
|
||||
(i32.xor
|
||||
(i32.mul
|
||||
(i32.xor
|
||||
(i32.and
|
||||
(tee_local $1
|
||||
(i32.wrap/i64
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(i32.const 255)
|
||||
)
|
||||
(i32.const -2128831035)
|
||||
)
|
||||
(i32.const 16777619)
|
||||
)
|
||||
(i32.and
|
||||
(i32.shr_u
|
||||
(get_local $1)
|
||||
(i32.const 8)
|
||||
)
|
||||
(i32.const 255)
|
||||
)
|
||||
)
|
||||
(i32.const 16777619)
|
||||
)
|
||||
(i32.and
|
||||
(i32.shr_u
|
||||
(get_local $1)
|
||||
(i32.const 16)
|
||||
)
|
||||
(i32.const 255)
|
||||
)
|
||||
)
|
||||
(i32.const 16777619)
|
||||
)
|
||||
(i32.shr_u
|
||||
(get_local $1)
|
||||
(i32.const 24)
|
||||
)
|
||||
)
|
||||
(i32.const 16777619)
|
||||
)
|
||||
(i32.and
|
||||
(tee_local $1
|
||||
(i32.wrap/i64
|
||||
(i64.shr_u
|
||||
(get_local $0)
|
||||
(i64.const 32)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.const 255)
|
||||
)
|
||||
)
|
||||
(i32.const 16777619)
|
||||
)
|
||||
(i32.and
|
||||
(i32.shr_u
|
||||
(get_local $1)
|
||||
(i32.const 8)
|
||||
)
|
||||
(i32.const 255)
|
||||
)
|
||||
)
|
||||
(i32.const 16777619)
|
||||
)
|
||||
(i32.and
|
||||
(i32.shr_u
|
||||
(get_local $1)
|
||||
(i32.const 16)
|
||||
)
|
||||
(i32.const 255)
|
||||
)
|
||||
)
|
||||
(i32.const 16777619)
|
||||
)
|
||||
(i32.shr_u
|
||||
(get_local $1)
|
||||
(i32.const 24)
|
||||
)
|
||||
)
|
||||
(i32.const 16777619)
|
||||
)
|
||||
get_local $0
|
||||
i32.wrap/i64
|
||||
tee_local $1
|
||||
i32.const 255
|
||||
i32.and
|
||||
i32.const -2128831035
|
||||
i32.xor
|
||||
i32.const 16777619
|
||||
i32.mul
|
||||
get_local $1
|
||||
i32.const 8
|
||||
i32.shr_u
|
||||
i32.const 255
|
||||
i32.and
|
||||
i32.xor
|
||||
i32.const 16777619
|
||||
i32.mul
|
||||
get_local $1
|
||||
i32.const 16
|
||||
i32.shr_u
|
||||
i32.const 255
|
||||
i32.and
|
||||
i32.xor
|
||||
i32.const 16777619
|
||||
i32.mul
|
||||
get_local $1
|
||||
i32.const 24
|
||||
i32.shr_u
|
||||
i32.xor
|
||||
i32.const 16777619
|
||||
i32.mul
|
||||
get_local $0
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
i32.wrap/i64
|
||||
tee_local $1
|
||||
i32.const 255
|
||||
i32.and
|
||||
i32.xor
|
||||
i32.const 16777619
|
||||
i32.mul
|
||||
get_local $1
|
||||
i32.const 8
|
||||
i32.shr_u
|
||||
i32.const 255
|
||||
i32.and
|
||||
i32.xor
|
||||
i32.const 16777619
|
||||
i32.mul
|
||||
get_local $1
|
||||
i32.const 16
|
||||
i32.shr_u
|
||||
i32.const 255
|
||||
i32.and
|
||||
i32.xor
|
||||
i32.const 16777619
|
||||
i32.mul
|
||||
get_local $1
|
||||
i32.const 24
|
||||
i32.shr_u
|
||||
i32.xor
|
||||
i32.const 16777619
|
||||
i32.mul
|
||||
)
|
||||
(func $start (; 4 ;) (; has Stack IR ;) (type $v)
|
||||
(drop
|
||||
(call $std/hash/check
|
||||
(call $~lib/internal/hash/hashStr
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(drop
|
||||
(call $std/hash/check
|
||||
(call $~lib/internal/hash/hashStr
|
||||
(i32.const 8)
|
||||
)
|
||||
)
|
||||
)
|
||||
(drop
|
||||
(call $std/hash/check
|
||||
(call $~lib/internal/hash/hashStr
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
)
|
||||
(drop
|
||||
(call $std/hash/check
|
||||
(call $~lib/internal/hash/hashStr
|
||||
(i32.const 24)
|
||||
)
|
||||
)
|
||||
)
|
||||
(drop
|
||||
(call $std/hash/check
|
||||
(call $~lib/internal/hash/hashStr
|
||||
(i32.const 32)
|
||||
)
|
||||
)
|
||||
)
|
||||
(drop
|
||||
(call $std/hash/check
|
||||
(call $~lib/internal/hash/hash32
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(drop
|
||||
(call $std/hash/check
|
||||
(call $~lib/internal/hash/hash32
|
||||
(i32.const 1065353216)
|
||||
)
|
||||
)
|
||||
)
|
||||
(drop
|
||||
(call $std/hash/check
|
||||
(call $~lib/internal/hash/hash32
|
||||
(i32.const 1066192077)
|
||||
)
|
||||
)
|
||||
)
|
||||
(drop
|
||||
(call $std/hash/check
|
||||
(call $~lib/internal/hash/hash32
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(drop
|
||||
(call $std/hash/check
|
||||
(call $~lib/internal/hash/hash32
|
||||
(i32.const 2139095040)
|
||||
)
|
||||
)
|
||||
)
|
||||
(drop
|
||||
(call $std/hash/check
|
||||
(call $~lib/internal/hash/hash32
|
||||
(i32.const 2143289344)
|
||||
)
|
||||
)
|
||||
)
|
||||
(drop
|
||||
(call $std/hash/check
|
||||
(call $~lib/internal/hash/hash64
|
||||
(i64.const 0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(drop
|
||||
(call $std/hash/check
|
||||
(call $~lib/internal/hash/hash64
|
||||
(i64.const 4607182418800017408)
|
||||
)
|
||||
)
|
||||
)
|
||||
(drop
|
||||
(call $std/hash/check
|
||||
(call $~lib/internal/hash/hash64
|
||||
(i64.const 4607632778762754458)
|
||||
)
|
||||
)
|
||||
)
|
||||
(drop
|
||||
(call $std/hash/check
|
||||
(call $~lib/internal/hash/hash64
|
||||
(i64.const 0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(drop
|
||||
(call $std/hash/check
|
||||
(call $~lib/internal/hash/hash64
|
||||
(i64.const 9218868437227405312)
|
||||
)
|
||||
)
|
||||
)
|
||||
(drop
|
||||
(call $std/hash/check
|
||||
(call $~lib/internal/hash/hash64
|
||||
(i64.const 9221120237041090560)
|
||||
)
|
||||
)
|
||||
)
|
||||
(func $start (; 4 ;) (type $v)
|
||||
i32.const 0
|
||||
call $~lib/internal/hash/hashStr
|
||||
call $std/hash/check
|
||||
drop
|
||||
i32.const 8
|
||||
call $~lib/internal/hash/hashStr
|
||||
call $std/hash/check
|
||||
drop
|
||||
i32.const 16
|
||||
call $~lib/internal/hash/hashStr
|
||||
call $std/hash/check
|
||||
drop
|
||||
i32.const 24
|
||||
call $~lib/internal/hash/hashStr
|
||||
call $std/hash/check
|
||||
drop
|
||||
i32.const 32
|
||||
call $~lib/internal/hash/hashStr
|
||||
call $std/hash/check
|
||||
drop
|
||||
i32.const 0
|
||||
call $~lib/internal/hash/hash32
|
||||
call $std/hash/check
|
||||
drop
|
||||
i32.const 1065353216
|
||||
call $~lib/internal/hash/hash32
|
||||
call $std/hash/check
|
||||
drop
|
||||
i32.const 1066192077
|
||||
call $~lib/internal/hash/hash32
|
||||
call $std/hash/check
|
||||
drop
|
||||
i32.const 0
|
||||
call $~lib/internal/hash/hash32
|
||||
call $std/hash/check
|
||||
drop
|
||||
i32.const 2139095040
|
||||
call $~lib/internal/hash/hash32
|
||||
call $std/hash/check
|
||||
drop
|
||||
i32.const 2143289344
|
||||
call $~lib/internal/hash/hash32
|
||||
call $std/hash/check
|
||||
drop
|
||||
i64.const 0
|
||||
call $~lib/internal/hash/hash64
|
||||
call $std/hash/check
|
||||
drop
|
||||
i64.const 4607182418800017408
|
||||
call $~lib/internal/hash/hash64
|
||||
call $std/hash/check
|
||||
drop
|
||||
i64.const 4607632778762754458
|
||||
call $~lib/internal/hash/hash64
|
||||
call $std/hash/check
|
||||
drop
|
||||
i64.const 0
|
||||
call $~lib/internal/hash/hash64
|
||||
call $std/hash/check
|
||||
drop
|
||||
i64.const 9218868437227405312
|
||||
call $~lib/internal/hash/hash64
|
||||
call $std/hash/check
|
||||
drop
|
||||
i64.const 9221120237041090560
|
||||
call $~lib/internal/hash/hash64
|
||||
call $std/hash/check
|
||||
drop
|
||||
)
|
||||
(func $null (; 5 ;) (; has Stack IR ;) (type $v)
|
||||
(nop)
|
||||
(func $null (; 5 ;) (type $v)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user