2019-05-15 21:17:41 +02:00
|
|
|
(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))
|
2019-05-20 23:10:06 +02:00
|
|
|
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
|
|
|
|
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
|
2019-05-15 21:17:41 +02:00
|
|
|
(memory $0 1)
|
2019-05-20 23:10:06 +02:00
|
|
|
(data (i32.const 8) "$\00\00\00\01\00\00\00\10\00\00\00$\00\00\00I\00n\00d\00e\00x\00 \00o\00u\00t\00 \00o\00f\00 \00r\00a\00n\00g\00e\00")
|
|
|
|
(data (i32.const 64) "\"\00\00\00\01\00\00\00\10\00\00\00\"\00\00\00~\00l\00i\00b\00/\00r\00t\00/\00c\00o\00m\00m\00o\00n\00.\00t\00s\00")
|
|
|
|
(data (i32.const 120) "\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 $~lib/rt/stub/startOffset (mut i32) (i32.const 0))
|
|
|
|
(global $~lib/rt/stub/offset (mut i32) (i32.const 0))
|
|
|
|
(global $~lib/builtins/RTTI_BASE i32 (i32.const 120))
|
|
|
|
(global $~lib/builtins/HEAP_BASE i32 (i32.const 256))
|
2019-05-15 21:17:41 +02:00
|
|
|
(export "memory" (memory $0))
|
2019-05-20 23:10:06 +02:00
|
|
|
(export "__alloc" (func $~lib/rt/stub/__alloc))
|
|
|
|
(export "__realloc" (func $~lib/rt/stub/__realloc))
|
|
|
|
(export "__free" (func $~lib/rt/stub/__free))
|
|
|
|
(export "__retain" (func $~lib/rt/stub/__retain))
|
|
|
|
(export "__release" (func $~lib/rt/stub/__release))
|
|
|
|
(export "__collect" (func $~lib/rt/stub/__collect))
|
2019-05-15 21:17:41 +02:00
|
|
|
(export "__instanceof" (func $~lib/rt/common/__instanceof))
|
|
|
|
(export "__typeinfo" (func $~lib/rt/common/__typeinfo))
|
|
|
|
(start $start)
|
2019-05-20 23:10:06 +02:00
|
|
|
(func $~lib/rt/stub/__alloc (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
2019-05-15 21:17:41 +02:00
|
|
|
(local $2 i32)
|
|
|
|
(local $3 i32)
|
|
|
|
(local $4 i32)
|
|
|
|
(local $5 i32)
|
2019-05-20 23:10:06 +02:00
|
|
|
(local $6 i32)
|
|
|
|
(local $7 i32)
|
|
|
|
(local $8 i32)
|
2019-05-15 21:17:41 +02:00
|
|
|
local.get $0
|
|
|
|
i32.const 1073741808
|
|
|
|
i32.gt_u
|
|
|
|
if
|
|
|
|
unreachable
|
|
|
|
end
|
2019-05-20 23:10:06 +02:00
|
|
|
global.get $~lib/rt/stub/offset
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.const 16
|
|
|
|
i32.add
|
2019-05-20 23:10:06 +02:00
|
|
|
local.set $2
|
|
|
|
local.get $2
|
2019-05-15 21:17:41 +02:00
|
|
|
local.get $0
|
2019-05-20 23:10:06 +02:00
|
|
|
local.tee $3
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.const 1
|
2019-05-20 23:10:06 +02:00
|
|
|
local.tee $4
|
|
|
|
local.get $3
|
|
|
|
local.get $4
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.gt_u
|
|
|
|
select
|
|
|
|
i32.add
|
|
|
|
i32.const 15
|
|
|
|
i32.add
|
2019-05-20 23:10:06 +02:00
|
|
|
i32.const 15
|
|
|
|
i32.const -1
|
|
|
|
i32.xor
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.and
|
2019-05-20 23:10:06 +02:00
|
|
|
local.set $5
|
2019-05-15 21:17:41 +02:00
|
|
|
current_memory
|
2019-05-20 23:10:06 +02:00
|
|
|
local.set $6
|
|
|
|
local.get $5
|
|
|
|
local.get $6
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.const 16
|
|
|
|
i32.shl
|
|
|
|
i32.gt_u
|
|
|
|
if
|
2019-05-20 23:10:06 +02:00
|
|
|
local.get $5
|
2019-05-15 21:17:41 +02:00
|
|
|
local.get $2
|
|
|
|
i32.sub
|
|
|
|
i32.const 65535
|
|
|
|
i32.add
|
2019-05-20 23:10:06 +02:00
|
|
|
i32.const 65535
|
|
|
|
i32.const -1
|
|
|
|
i32.xor
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.and
|
|
|
|
i32.const 16
|
|
|
|
i32.shr_u
|
2019-05-20 23:10:06 +02:00
|
|
|
local.set $3
|
|
|
|
local.get $6
|
|
|
|
local.tee $4
|
|
|
|
local.get $3
|
|
|
|
local.tee $7
|
2019-05-15 21:17:41 +02:00
|
|
|
local.get $4
|
2019-05-20 23:10:06 +02:00
|
|
|
local.get $7
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.gt_s
|
|
|
|
select
|
2019-05-20 23:10:06 +02:00
|
|
|
local.set $4
|
|
|
|
local.get $4
|
2019-05-15 21:17:41 +02:00
|
|
|
grow_memory
|
|
|
|
i32.const 0
|
|
|
|
i32.lt_s
|
|
|
|
if
|
2019-05-20 23:10:06 +02:00
|
|
|
local.get $3
|
2019-05-15 21:17:41 +02:00
|
|
|
grow_memory
|
|
|
|
i32.const 0
|
|
|
|
i32.lt_s
|
|
|
|
if
|
|
|
|
unreachable
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2019-05-20 23:10:06 +02:00
|
|
|
local.get $5
|
|
|
|
global.set $~lib/rt/stub/offset
|
2019-05-15 21:17:41 +02:00
|
|
|
local.get $2
|
|
|
|
i32.const 16
|
|
|
|
i32.sub
|
2019-05-20 23:10:06 +02:00
|
|
|
local.set $8
|
|
|
|
local.get $8
|
2019-05-15 21:17:41 +02:00
|
|
|
local.get $1
|
|
|
|
i32.store offset=8
|
2019-05-20 23:10:06 +02:00
|
|
|
local.get $8
|
2019-05-15 21:17:41 +02:00
|
|
|
local.get $0
|
|
|
|
i32.store offset=12
|
2019-05-20 23:10:06 +02:00
|
|
|
local.get $2
|
2019-05-15 21:17:41 +02:00
|
|
|
)
|
2019-05-20 23:10:06 +02:00
|
|
|
(func $~lib/memory/memory.copy (; 2 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
|
2019-05-15 21:17:41 +02:00
|
|
|
(local $3 i32)
|
|
|
|
(local $4 i32)
|
2019-05-20 23:10:06 +02:00
|
|
|
(local $5 i32)
|
|
|
|
(local $6 i32)
|
2019-05-15 21:17:41 +02:00
|
|
|
block $~lib/util/memory/memmove|inlined.0
|
|
|
|
local.get $0
|
2019-05-20 23:10:06 +02:00
|
|
|
local.set $5
|
2019-05-15 21:17:41 +02:00
|
|
|
local.get $1
|
2019-05-20 23:10:06 +02:00
|
|
|
local.set $4
|
|
|
|
local.get $2
|
|
|
|
local.set $3
|
|
|
|
local.get $5
|
|
|
|
local.get $4
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.eq
|
2019-05-20 23:10:06 +02:00
|
|
|
if
|
|
|
|
br $~lib/util/memory/memmove|inlined.0
|
|
|
|
end
|
|
|
|
local.get $5
|
|
|
|
local.get $4
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.lt_u
|
|
|
|
if
|
2019-05-20 23:10:06 +02:00
|
|
|
local.get $4
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.const 7
|
|
|
|
i32.and
|
2019-05-20 23:10:06 +02:00
|
|
|
local.get $5
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.const 7
|
|
|
|
i32.and
|
|
|
|
i32.eq
|
|
|
|
if
|
2019-05-20 23:10:06 +02:00
|
|
|
block $break|0
|
|
|
|
loop $continue|0
|
|
|
|
local.get $5
|
|
|
|
i32.const 7
|
|
|
|
i32.and
|
|
|
|
if
|
|
|
|
local.get $3
|
|
|
|
i32.eqz
|
|
|
|
if
|
|
|
|
br $~lib/util/memory/memmove|inlined.0
|
|
|
|
end
|
|
|
|
local.get $3
|
|
|
|
i32.const 1
|
|
|
|
i32.sub
|
|
|
|
local.set $3
|
|
|
|
block (result i32)
|
|
|
|
local.get $5
|
|
|
|
local.tee $6
|
|
|
|
i32.const 1
|
|
|
|
i32.add
|
|
|
|
local.set $5
|
|
|
|
local.get $6
|
|
|
|
end
|
|
|
|
block (result i32)
|
|
|
|
local.get $4
|
|
|
|
local.tee $6
|
|
|
|
i32.const 1
|
|
|
|
i32.add
|
|
|
|
local.set $4
|
|
|
|
local.get $6
|
|
|
|
end
|
|
|
|
i32.load8_u
|
|
|
|
i32.store8
|
|
|
|
br $continue|0
|
|
|
|
end
|
2019-05-15 21:17:41 +02:00
|
|
|
end
|
|
|
|
end
|
2019-05-20 23:10:06 +02:00
|
|
|
block $break|1
|
|
|
|
loop $continue|1
|
|
|
|
local.get $3
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.const 8
|
2019-05-20 23:10:06 +02:00
|
|
|
i32.ge_u
|
|
|
|
if
|
|
|
|
local.get $5
|
|
|
|
local.get $4
|
|
|
|
i64.load
|
|
|
|
i64.store
|
|
|
|
local.get $3
|
|
|
|
i32.const 8
|
|
|
|
i32.sub
|
|
|
|
local.set $3
|
|
|
|
local.get $5
|
|
|
|
i32.const 8
|
|
|
|
i32.add
|
|
|
|
local.set $5
|
|
|
|
local.get $4
|
|
|
|
i32.const 8
|
|
|
|
i32.add
|
|
|
|
local.set $4
|
|
|
|
br $continue|1
|
|
|
|
end
|
2019-05-15 21:17:41 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2019-05-20 23:10:06 +02:00
|
|
|
block $break|2
|
|
|
|
loop $continue|2
|
2019-05-15 21:17:41 +02:00
|
|
|
local.get $3
|
2019-05-20 23:10:06 +02:00
|
|
|
if
|
|
|
|
block (result i32)
|
|
|
|
local.get $5
|
|
|
|
local.tee $6
|
|
|
|
i32.const 1
|
|
|
|
i32.add
|
|
|
|
local.set $5
|
|
|
|
local.get $6
|
|
|
|
end
|
|
|
|
block (result i32)
|
|
|
|
local.get $4
|
|
|
|
local.tee $6
|
|
|
|
i32.const 1
|
|
|
|
i32.add
|
|
|
|
local.set $4
|
|
|
|
local.get $6
|
|
|
|
end
|
|
|
|
i32.load8_u
|
|
|
|
i32.store8
|
|
|
|
local.get $3
|
|
|
|
i32.const 1
|
|
|
|
i32.sub
|
|
|
|
local.set $3
|
|
|
|
br $continue|2
|
|
|
|
end
|
2019-05-15 21:17:41 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
else
|
2019-05-20 23:10:06 +02:00
|
|
|
local.get $4
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.const 7
|
|
|
|
i32.and
|
2019-05-20 23:10:06 +02:00
|
|
|
local.get $5
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.const 7
|
|
|
|
i32.and
|
|
|
|
i32.eq
|
|
|
|
if
|
2019-05-20 23:10:06 +02:00
|
|
|
block $break|3
|
|
|
|
loop $continue|3
|
|
|
|
local.get $5
|
|
|
|
local.get $3
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.add
|
2019-05-20 23:10:06 +02:00
|
|
|
i32.const 7
|
|
|
|
i32.and
|
|
|
|
if
|
|
|
|
local.get $3
|
|
|
|
i32.eqz
|
|
|
|
if
|
|
|
|
br $~lib/util/memory/memmove|inlined.0
|
|
|
|
end
|
|
|
|
local.get $5
|
|
|
|
local.get $3
|
|
|
|
i32.const 1
|
|
|
|
i32.sub
|
|
|
|
local.tee $3
|
|
|
|
i32.add
|
|
|
|
local.get $4
|
|
|
|
local.get $3
|
|
|
|
i32.add
|
|
|
|
i32.load8_u
|
|
|
|
i32.store8
|
|
|
|
br $continue|3
|
|
|
|
end
|
2019-05-15 21:17:41 +02:00
|
|
|
end
|
|
|
|
end
|
2019-05-20 23:10:06 +02:00
|
|
|
block $break|4
|
|
|
|
loop $continue|4
|
|
|
|
local.get $3
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.const 8
|
2019-05-20 23:10:06 +02:00
|
|
|
i32.ge_u
|
|
|
|
if
|
|
|
|
local.get $3
|
|
|
|
i32.const 8
|
|
|
|
i32.sub
|
|
|
|
local.set $3
|
|
|
|
local.get $5
|
|
|
|
local.get $3
|
|
|
|
i32.add
|
|
|
|
local.get $4
|
|
|
|
local.get $3
|
|
|
|
i32.add
|
|
|
|
i64.load
|
|
|
|
i64.store
|
|
|
|
br $continue|4
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
block $break|5
|
|
|
|
loop $continue|5
|
|
|
|
local.get $3
|
|
|
|
if
|
|
|
|
local.get $5
|
|
|
|
local.get $3
|
|
|
|
i32.const 1
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.sub
|
2019-05-20 23:10:06 +02:00
|
|
|
local.tee $3
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.add
|
2019-05-20 23:10:06 +02:00
|
|
|
local.get $4
|
|
|
|
local.get $3
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.add
|
2019-05-20 23:10:06 +02:00
|
|
|
i32.load8_u
|
|
|
|
i32.store8
|
|
|
|
br $continue|5
|
2019-05-15 21:17:41 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
)
|
2019-05-20 23:10:06 +02:00
|
|
|
(func $~lib/rt/stub/__realloc (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
2019-05-15 21:17:41 +02:00
|
|
|
(local $2 i32)
|
|
|
|
(local $3 i32)
|
2019-05-20 23:10:06 +02:00
|
|
|
(local $4 i32)
|
2019-05-15 21:17:41 +02:00
|
|
|
local.get $0
|
|
|
|
i32.const 16
|
|
|
|
i32.sub
|
2019-05-20 23:10:06 +02:00
|
|
|
local.set $2
|
|
|
|
local.get $2
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.load offset=12
|
2019-05-20 23:10:06 +02:00
|
|
|
local.set $3
|
|
|
|
local.get $1
|
|
|
|
local.get $3
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.gt_u
|
|
|
|
if
|
|
|
|
local.get $1
|
|
|
|
local.get $2
|
|
|
|
i32.load offset=8
|
2019-05-20 23:10:06 +02:00
|
|
|
call $~lib/rt/stub/__alloc
|
|
|
|
local.set $4
|
|
|
|
local.get $4
|
2019-05-15 21:17:41 +02:00
|
|
|
local.get $0
|
|
|
|
local.get $3
|
|
|
|
call $~lib/memory/memory.copy
|
2019-05-20 23:10:06 +02:00
|
|
|
local.get $4
|
2019-05-15 21:17:41 +02:00
|
|
|
local.set $0
|
|
|
|
else
|
|
|
|
local.get $2
|
|
|
|
local.get $1
|
|
|
|
i32.store offset=12
|
|
|
|
end
|
|
|
|
local.get $0
|
|
|
|
)
|
2019-05-20 23:10:06 +02:00
|
|
|
(func $~lib/rt/stub/__free (; 4 ;) (type $FUNCSIG$vi) (param $0 i32)
|
2019-05-15 21:17:41 +02:00
|
|
|
nop
|
|
|
|
)
|
2019-05-20 23:10:06 +02:00
|
|
|
(func $~lib/rt/stub/__retain (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
2019-05-15 21:17:41 +02:00
|
|
|
local.get $0
|
|
|
|
)
|
2019-05-20 23:10:06 +02:00
|
|
|
(func $~lib/rt/stub/__release (; 6 ;) (type $FUNCSIG$vi) (param $0 i32)
|
|
|
|
nop
|
|
|
|
)
|
|
|
|
(func $~lib/rt/stub/__collect (; 7 ;) (type $FUNCSIG$v)
|
2019-05-15 21:17:41 +02:00
|
|
|
nop
|
|
|
|
)
|
2019-05-20 23:10:06 +02:00
|
|
|
(func $~lib/rt/common/__instanceof (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
|
|
|
(local $2 i32)
|
|
|
|
(local $3 i32)
|
2019-05-15 21:17:41 +02:00
|
|
|
local.get $0
|
|
|
|
i32.const 16
|
|
|
|
i32.sub
|
|
|
|
i32.load offset=8
|
2019-05-20 23:10:06 +02:00
|
|
|
local.set $2
|
|
|
|
global.get $~lib/builtins/RTTI_BASE
|
|
|
|
local.set $3
|
|
|
|
local.get $2
|
2019-05-15 21:17:41 +02:00
|
|
|
if (result i32)
|
2019-05-20 23:10:06 +02:00
|
|
|
local.get $2
|
|
|
|
local.get $3
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.load
|
|
|
|
i32.le_u
|
|
|
|
else
|
|
|
|
i32.const 0
|
|
|
|
end
|
|
|
|
if
|
|
|
|
loop $continue|0
|
2019-05-20 23:10:06 +02:00
|
|
|
local.get $2
|
2019-05-15 21:17:41 +02:00
|
|
|
local.get $1
|
|
|
|
i32.eq
|
|
|
|
if
|
|
|
|
i32.const 1
|
|
|
|
return
|
|
|
|
end
|
2019-05-20 23:10:06 +02:00
|
|
|
local.get $3
|
|
|
|
local.get $2
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.const 8
|
2019-05-20 23:10:06 +02:00
|
|
|
i32.mul
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.add
|
|
|
|
i32.load offset=4
|
2019-05-20 23:10:06 +02:00
|
|
|
local.tee $2
|
2019-05-15 21:17:41 +02:00
|
|
|
br_if $continue|0
|
|
|
|
end
|
|
|
|
end
|
|
|
|
i32.const 0
|
|
|
|
)
|
2019-05-20 23:10:06 +02:00
|
|
|
(func $~lib/rt/common/__typeinfo (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
|
|
|
(local $1 i32)
|
|
|
|
global.get $~lib/builtins/RTTI_BASE
|
|
|
|
local.set $1
|
2019-05-15 21:17:41 +02:00
|
|
|
local.get $0
|
2019-05-20 23:10:06 +02:00
|
|
|
i32.eqz
|
2019-05-15 21:17:41 +02:00
|
|
|
if (result i32)
|
2019-05-20 23:10:06 +02:00
|
|
|
i32.const 1
|
|
|
|
else
|
2019-05-15 21:17:41 +02:00
|
|
|
local.get $0
|
2019-05-20 23:10:06 +02:00
|
|
|
local.get $1
|
2019-05-15 21:17:41 +02:00
|
|
|
i32.load
|
|
|
|
i32.gt_u
|
|
|
|
end
|
2019-05-20 23:10:06 +02:00
|
|
|
if
|
|
|
|
i32.const 24
|
|
|
|
i32.const 80
|
|
|
|
i32.const 55
|
|
|
|
i32.const 34
|
|
|
|
call $~lib/builtins/abort
|
2019-05-15 21:17:41 +02:00
|
|
|
unreachable
|
|
|
|
end
|
2019-05-20 23:10:06 +02:00
|
|
|
local.get $1
|
|
|
|
local.get $0
|
|
|
|
i32.const 8
|
|
|
|
i32.mul
|
|
|
|
i32.add
|
|
|
|
i32.load
|
|
|
|
)
|
|
|
|
(func $start (; 10 ;) (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 $~lib/rt/stub/startOffset
|
|
|
|
global.get $~lib/rt/stub/startOffset
|
|
|
|
global.set $~lib/rt/stub/offset
|
2019-05-15 21:17:41 +02:00
|
|
|
)
|
2019-05-20 23:10:06 +02:00
|
|
|
(func $null (; 11 ;) (type $FUNCSIG$v)
|
2019-05-15 21:17:41 +02:00
|
|
|
)
|
|
|
|
)
|