assemblyscript/tests/compiler/runtime-stub.untouched.wat

441 lines
8.4 KiB
Plaintext
Raw Normal View History

(module
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $FUNCSIG$viii (func (param i32 i32 i32)))
(type $FUNCSIG$vi (func (param i32)))
(type $FUNCSIG$ii (func (param i32) (result i32)))
(type $FUNCSIG$v (func))
(memory $0 1)
(data (i32.const 8) "\10\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $stub/startOffset (mut i32) (i32.const 0))
(global $stub/offset (mut i32) (i32.const 0))
(global $~lib/builtins/RTTI_BASE i32 (i32.const 8))
(global $~lib/builtins/HEAP_BASE i32 (i32.const 144))
(export "memory" (memory $0))
(export "__alloc" (func $stub/__alloc))
(export "__realloc" (func $stub/__realloc))
(export "__free" (func $stub/__free))
(export "__retain" (func $stub/__retain))
(export "__release" (func $stub/__release))
(export "__collect" (func $stub/__collect))
(export "__instanceof" (func $~lib/rt/common/__instanceof))
(export "__typeinfo" (func $~lib/rt/common/__typeinfo))
(start $start)
(func $stub/__alloc (; 0 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
(local $8 i32)
local.get $0
i32.const 1073741808
i32.gt_u
if
unreachable
end
global.get $stub/offset
i32.const 16
i32.add
local.set $2
local.get $2
local.get $0
local.tee $3
i32.const 1
local.tee $4
local.get $3
local.get $4
i32.gt_u
select
i32.add
i32.const 15
i32.add
i32.const 15
i32.const -1
i32.xor
i32.and
local.set $5
current_memory
local.set $6
local.get $5
local.get $6
i32.const 16
i32.shl
i32.gt_u
if
local.get $5
local.get $2
i32.sub
i32.const 65535
i32.add
i32.const 65535
i32.const -1
i32.xor
i32.and
i32.const 16
i32.shr_u
local.set $3
local.get $6
local.tee $4
local.get $3
local.tee $7
local.get $4
local.get $7
i32.gt_s
select
local.set $4
local.get $4
grow_memory
i32.const 0
i32.lt_s
if
local.get $3
grow_memory
i32.const 0
i32.lt_s
if
unreachable
end
end
end
local.get $5
global.set $stub/offset
local.get $2
i32.const 16
i32.sub
local.set $8
local.get $8
local.get $1
i32.store offset=8
local.get $8
local.get $0
i32.store offset=12
local.get $2
)
(func $~lib/memory/memory.copy (; 1 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
block $~lib/util/memory/memmove|inlined.0
local.get $0
local.get $1
i32.eq
if
br $~lib/util/memory/memmove|inlined.0
end
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
block $break|0
loop $continue|0
local.get $0
i32.const 7
i32.and
if
local.get $2
i32.eqz
if
br $~lib/util/memory/memmove|inlined.0
end
local.get $2
i32.const 1
i32.sub
local.set $2
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
br $continue|0
end
end
end
block $break|1
loop $continue|1
local.get $2
i32.const 8
i32.ge_u
if
local.get $0
local.get $1
i64.load
i64.store
local.get $2
i32.const 8
i32.sub
local.set $2
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
end
block $break|2
loop $continue|2
local.get $2
if
block (result i32)
local.get $0
local.tee $5
i32.const 1
i32.add
local.set $0
local.get $5
end
block (result i32)
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $5
end
i32.load8_u
i32.store8
local.get $2
i32.const 1
i32.sub
local.set $2
br $continue|2
end
end
end
else
local.get $1
i32.const 7
i32.and
local.get $0
i32.const 7
i32.and
i32.eq
if
block $break|3
loop $continue|3
local.get $0
local.get $2
i32.add
i32.const 7
i32.and
if
local.get $2
i32.eqz
if
br $~lib/util/memory/memmove|inlined.0
end
local.get $0
local.get $2
i32.const 1
i32.sub
local.tee $2
i32.add
local.get $1
local.get $2
i32.add
i32.load8_u
i32.store8
br $continue|3
end
end
end
block $break|4
loop $continue|4
local.get $2
i32.const 8
i32.ge_u
if
local.get $2
i32.const 8
i32.sub
local.set $2
local.get $0
local.get $2
i32.add
local.get $1
local.get $2
i32.add
i64.load
i64.store
br $continue|4
end
end
end
end
block $break|5
loop $continue|5
local.get $2
if
local.get $0
local.get $2
i32.const 1
i32.sub
local.tee $2
i32.add
local.get $1
local.get $2
i32.add
i32.load8_u
i32.store8
br $continue|5
end
end
end
end
end
)
(func $stub/__realloc (; 2 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
local.get $0
i32.const 16
i32.sub
local.set $2
local.get $2
i32.load offset=12
local.set $3
local.get $1
local.get $3
i32.gt_u
if
local.get $1
local.get $2
i32.load offset=8
call $stub/__alloc
local.set $4
local.get $4
local.get $0
local.get $3
call $~lib/memory/memory.copy
local.get $4
local.set $0
else
local.get $2
local.get $1
i32.store offset=12
end
local.get $0
)
(func $stub/__free (; 3 ;) (type $FUNCSIG$vi) (param $0 i32)
nop
)
(func $stub/__retain (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
)
(func $stub/__release (; 5 ;) (type $FUNCSIG$vi) (param $0 i32)
nop
)
(func $stub/__collect (; 6 ;) (type $FUNCSIG$v)
nop
)
(func $~lib/rt/common/__instanceof (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
local.get $0
i32.const 16
i32.sub
i32.load offset=8
local.set $2
global.get $~lib/builtins/RTTI_BASE
local.set $3
local.get $2
if (result i32)
local.get $2
local.get $3
i32.load
i32.le_u
else
i32.const 0
end
if
loop $continue|0
local.get $2
local.get $1
i32.eq
if
i32.const 1
return
end
local.get $3
local.get $2
i32.const 8
i32.mul
i32.add
i32.load offset=4
local.tee $2
br_if $continue|0
end
end
i32.const 0
)
(func $~lib/rt/common/__typeinfo (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
global.get $~lib/builtins/RTTI_BASE
local.set $1
local.get $0
i32.eqz
if (result i32)
i32.const 1
else
local.get $0
local.get $1
i32.load
i32.gt_u
end
if (result i32)
unreachable
else
local.get $1
local.get $0
i32.const 8
i32.mul
i32.add
i32.load
end
)
(func $start (; 9 ;) (type $FUNCSIG$v)
global.get $~lib/builtins/HEAP_BASE
i32.const 15
i32.add
i32.const 15
i32.const -1
i32.xor
i32.and
global.set $stub/startOffset
global.get $stub/startOffset
global.set $stub/offset
)
(func $null (; 10 ;) (type $FUNCSIG$v)
)
)