mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-04-28 16:32:15 +00:00
385 lines
7.8 KiB
Plaintext
385 lines
7.8 KiB
Plaintext
(module
|
|
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
|
|
(type $FUNCSIG$ii (func (param i32) (result i32)))
|
|
(type $FUNCSIG$vi (func (param i32)))
|
|
(type $FUNCSIG$v (func))
|
|
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
|
|
(type $FUNCSIG$viii (func (param i32 i32 i32)))
|
|
(type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32)))
|
|
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
|
|
(memory $0 1)
|
|
(data (i32.const 8) "\1e\00\00\00\01\00\00\00\01\00\00\00\1e\00\00\00N\00o\00t\00 \00i\00m\00p\00l\00e\00m\00e\00n\00t\00e\00d")
|
|
(data (i32.const 56) "\1c\00\00\00\01\00\00\00\01\00\00\00\1c\00\00\00~\00l\00i\00b\00/\00m\00e\00m\00o\00r\00y\00.\00t\00s")
|
|
(data (i32.const 104) "\03\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08")
|
|
(global $~lib/rt/stub/startOffset (mut i32) (i32.const 0))
|
|
(global $~lib/rt/stub/offset (mut i32) (i32.const 0))
|
|
(global $~lib/rt/RTTI_BASE i32 (i32.const 104))
|
|
(export "memory" (memory $0))
|
|
(export "__alloc" (func $~lib/rt/stub/__alloc))
|
|
(export "__retain" (func $~lib/rt/stub/__retain))
|
|
(export "__release" (func $~lib/rt/stub/__release))
|
|
(export "__collect" (func $~lib/rt/stub/__collect))
|
|
(export "__rtti" (global $~lib/rt/RTTI_BASE))
|
|
(export "memory.copy" (func $~lib/memory/memory.copy))
|
|
(export "memory.init" (func $~lib/memory/memory.init))
|
|
(export "memory.drop" (func $~lib/memory/memory.drop))
|
|
(export "memory.repeat" (func $~lib/memory/memory.repeat))
|
|
(export "memory.compare" (func $~lib/memory/memory.compare))
|
|
(export "__free" (func $~lib/rt/stub/__release))
|
|
(export "__reset" (func $~lib/rt/stub/__reset))
|
|
(start $start)
|
|
(func $~lib/rt/stub/__alloc (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
|
(local $2 i32)
|
|
(local $3 i32)
|
|
(local $4 i32)
|
|
(local $5 i32)
|
|
local.get $0
|
|
i32.const 1073741808
|
|
i32.gt_u
|
|
if
|
|
unreachable
|
|
end
|
|
global.get $~lib/rt/stub/offset
|
|
i32.const 16
|
|
i32.add
|
|
local.tee $3
|
|
local.get $0
|
|
i32.const 1
|
|
local.get $0
|
|
i32.const 1
|
|
i32.gt_u
|
|
select
|
|
i32.add
|
|
i32.const 15
|
|
i32.add
|
|
i32.const -16
|
|
i32.and
|
|
local.tee $2
|
|
memory.size
|
|
local.tee $4
|
|
i32.const 16
|
|
i32.shl
|
|
i32.gt_u
|
|
if
|
|
local.get $4
|
|
local.get $2
|
|
local.get $3
|
|
i32.sub
|
|
i32.const 65535
|
|
i32.add
|
|
i32.const -65536
|
|
i32.and
|
|
i32.const 16
|
|
i32.shr_u
|
|
local.tee $5
|
|
local.get $4
|
|
local.get $5
|
|
i32.gt_s
|
|
select
|
|
memory.grow
|
|
i32.const 0
|
|
i32.lt_s
|
|
if
|
|
local.get $5
|
|
memory.grow
|
|
i32.const 0
|
|
i32.lt_s
|
|
if
|
|
unreachable
|
|
end
|
|
end
|
|
end
|
|
local.get $2
|
|
global.set $~lib/rt/stub/offset
|
|
local.get $3
|
|
i32.const 16
|
|
i32.sub
|
|
local.tee $2
|
|
local.get $1
|
|
i32.store offset=8
|
|
local.get $2
|
|
local.get $0
|
|
i32.store offset=12
|
|
local.get $3
|
|
)
|
|
(func $~lib/rt/stub/__retain (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
|
local.get $0
|
|
)
|
|
(func $~lib/rt/stub/__release (; 3 ;) (type $FUNCSIG$vi) (param $0 i32)
|
|
nop
|
|
)
|
|
(func $~lib/rt/stub/__collect (; 4 ;) (type $FUNCSIG$v)
|
|
nop
|
|
)
|
|
(func $~lib/memory/memory.init (; 5 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32)
|
|
i32.const 24
|
|
i32.const 72
|
|
i32.const 35
|
|
i32.const 4
|
|
call $~lib/builtins/abort
|
|
unreachable
|
|
)
|
|
(func $~lib/memory/memory.drop (; 6 ;) (type $FUNCSIG$vi) (param $0 i32)
|
|
i32.const 24
|
|
i32.const 72
|
|
i32.const 42
|
|
i32.const 4
|
|
call $~lib/builtins/abort
|
|
unreachable
|
|
)
|
|
(func $~lib/memory/memory.copy (; 7 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
|
|
(local $3 i32)
|
|
(local $4 i32)
|
|
block $~lib/util/memory/memmove|inlined.0
|
|
local.get $2
|
|
local.set $3
|
|
local.get $0
|
|
local.get $1
|
|
i32.eq
|
|
br_if $~lib/util/memory/memmove|inlined.0
|
|
local.get $0
|
|
local.get $1
|
|
i32.lt_u
|
|
if
|
|
local.get $1
|
|
i32.const 7
|
|
i32.and
|
|
local.get $0
|
|
i32.const 7
|
|
i32.and
|
|
i32.eq
|
|
if
|
|
loop $continue|0
|
|
local.get $0
|
|
i32.const 7
|
|
i32.and
|
|
if
|
|
local.get $3
|
|
i32.eqz
|
|
br_if $~lib/util/memory/memmove|inlined.0
|
|
local.get $3
|
|
i32.const 1
|
|
i32.sub
|
|
local.set $3
|
|
local.get $0
|
|
local.tee $2
|
|
i32.const 1
|
|
i32.add
|
|
local.set $0
|
|
local.get $1
|
|
local.tee $4
|
|
i32.const 1
|
|
i32.add
|
|
local.set $1
|
|
local.get $2
|
|
local.get $4
|
|
i32.load8_u
|
|
i32.store8
|
|
br $continue|0
|
|
end
|
|
end
|
|
loop $continue|1
|
|
local.get $3
|
|
i32.const 8
|
|
i32.ge_u
|
|
if
|
|
local.get $0
|
|
local.get $1
|
|
i64.load
|
|
i64.store
|
|
local.get $3
|
|
i32.const 8
|
|
i32.sub
|
|
local.set $3
|
|
local.get $0
|
|
i32.const 8
|
|
i32.add
|
|
local.set $0
|
|
local.get $1
|
|
i32.const 8
|
|
i32.add
|
|
local.set $1
|
|
br $continue|1
|
|
end
|
|
end
|
|
end
|
|
loop $continue|2
|
|
local.get $3
|
|
if
|
|
local.get $0
|
|
local.tee $2
|
|
i32.const 1
|
|
i32.add
|
|
local.set $0
|
|
local.get $1
|
|
local.tee $4
|
|
i32.const 1
|
|
i32.add
|
|
local.set $1
|
|
local.get $2
|
|
local.get $4
|
|
i32.load8_u
|
|
i32.store8
|
|
local.get $3
|
|
i32.const 1
|
|
i32.sub
|
|
local.set $3
|
|
br $continue|2
|
|
end
|
|
end
|
|
else
|
|
local.get $1
|
|
i32.const 7
|
|
i32.and
|
|
local.get $0
|
|
i32.const 7
|
|
i32.and
|
|
i32.eq
|
|
if
|
|
loop $continue|3
|
|
local.get $0
|
|
local.get $3
|
|
i32.add
|
|
i32.const 7
|
|
i32.and
|
|
if
|
|
local.get $3
|
|
i32.eqz
|
|
br_if $~lib/util/memory/memmove|inlined.0
|
|
local.get $0
|
|
local.get $3
|
|
i32.const 1
|
|
i32.sub
|
|
local.tee $3
|
|
i32.add
|
|
local.get $1
|
|
local.get $3
|
|
i32.add
|
|
i32.load8_u
|
|
i32.store8
|
|
br $continue|3
|
|
end
|
|
end
|
|
loop $continue|4
|
|
local.get $3
|
|
i32.const 8
|
|
i32.ge_u
|
|
if
|
|
local.get $0
|
|
local.get $3
|
|
i32.const 8
|
|
i32.sub
|
|
local.tee $3
|
|
i32.add
|
|
local.get $1
|
|
local.get $3
|
|
i32.add
|
|
i64.load
|
|
i64.store
|
|
br $continue|4
|
|
end
|
|
end
|
|
end
|
|
loop $continue|5
|
|
local.get $3
|
|
if
|
|
local.get $0
|
|
local.get $3
|
|
i32.const 1
|
|
i32.sub
|
|
local.tee $3
|
|
i32.add
|
|
local.get $1
|
|
local.get $3
|
|
i32.add
|
|
i32.load8_u
|
|
i32.store8
|
|
br $continue|5
|
|
end
|
|
end
|
|
end
|
|
end
|
|
)
|
|
(func $~lib/memory/memory.repeat (; 8 ;) (type $FUNCSIG$viiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32)
|
|
(local $4 i32)
|
|
local.get $2
|
|
local.get $3
|
|
i32.mul
|
|
local.set $3
|
|
loop $continue|0
|
|
local.get $4
|
|
local.get $3
|
|
i32.lt_u
|
|
if
|
|
local.get $0
|
|
local.get $4
|
|
i32.add
|
|
local.get $1
|
|
local.get $2
|
|
call $~lib/memory/memory.copy
|
|
local.get $2
|
|
local.get $4
|
|
i32.add
|
|
local.set $4
|
|
br $continue|0
|
|
end
|
|
end
|
|
)
|
|
(func $~lib/memory/memory.compare (; 9 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
|
local.get $0
|
|
local.get $1
|
|
i32.eq
|
|
if (result i32)
|
|
i32.const 0
|
|
else
|
|
loop $continue|0
|
|
local.get $2
|
|
if (result i32)
|
|
local.get $0
|
|
i32.load8_u
|
|
local.get $1
|
|
i32.load8_u
|
|
i32.eq
|
|
else
|
|
i32.const 0
|
|
end
|
|
if
|
|
local.get $2
|
|
i32.const 1
|
|
i32.sub
|
|
local.set $2
|
|
local.get $0
|
|
i32.const 1
|
|
i32.add
|
|
local.set $0
|
|
local.get $1
|
|
i32.const 1
|
|
i32.add
|
|
local.set $1
|
|
br $continue|0
|
|
end
|
|
end
|
|
local.get $2
|
|
if (result i32)
|
|
local.get $0
|
|
i32.load8_u
|
|
local.get $1
|
|
i32.load8_u
|
|
i32.sub
|
|
else
|
|
i32.const 0
|
|
end
|
|
end
|
|
)
|
|
(func $~lib/rt/stub/__reset (; 10 ;) (type $FUNCSIG$v)
|
|
global.get $~lib/rt/stub/startOffset
|
|
global.set $~lib/rt/stub/offset
|
|
)
|
|
(func $start (; 11 ;) (type $FUNCSIG$v)
|
|
i32.const 144
|
|
global.set $~lib/rt/stub/startOffset
|
|
global.get $~lib/rt/stub/startOffset
|
|
global.set $~lib/rt/stub/offset
|
|
)
|
|
)
|