assemblyscript/tests/compiler/std/array-literal.optimized.wat

637 lines
13 KiB
Plaintext
Raw Normal View History

2018-04-23 22:49:04 +02:00
(module
2019-03-30 13:58:20 +01:00
(type $FUNCSIG$vii (func (param i32 i32)))
(type $FUNCSIG$vi (func (param i32)))
(type $FUNCSIG$ii (func (param i32) (result i32)))
2019-03-16 07:26:33 +01:00
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $FUNCSIG$v (func))
(type $FUNCSIG$i (func (result i32)))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
2018-04-23 22:49:04 +02:00
(memory $0 1)
2019-03-26 23:35:08 +01:00
(data (i32.const 8) "\01\00\00\00\03")
(data (i32.const 25) "\01\02")
(data (i32.const 32) "\02\00\00\00\10")
(data (i32.const 48) "\18\00\00\00\18\00\00\00\03\00\00\00\03")
2019-03-30 13:58:20 +01:00
(data (i32.const 64) "\04\00\00\00(")
2019-03-26 23:35:08 +01:00
(data (i32.const 80) "s\00t\00d\00/\00a\00r\00r\00a\00y\00-\00l\00i\00t\00e\00r\00a\00l\00.\00t\00s")
2019-03-30 13:58:20 +01:00
(data (i32.const 120) "\04\00\00\00\1a")
2019-03-26 23:35:08 +01:00
(data (i32.const 136) "~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s")
(data (i32.const 168) "\01\00\00\00\0c")
(data (i32.const 188) "\01\00\00\00\02")
2019-03-30 13:58:20 +01:00
(data (i32.const 200) "\05\00\00\00\10")
2019-03-26 23:35:08 +01:00
(data (i32.const 216) "\b8\00\00\00\b8\00\00\00\0c\00\00\00\03")
(data (i32.const 232) "\01")
2019-03-30 13:58:20 +01:00
(data (i32.const 248) "\05\00\00\00\10")
2019-03-26 23:35:08 +01:00
(data (i32.const 264) "\f8\00\00\00\f8")
2019-03-30 13:58:20 +01:00
(data (i32.const 280) "\04\00\00\00\1e")
2019-03-26 23:35:08 +01:00
(data (i32.const 296) "~\00l\00i\00b\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s")
2019-03-30 13:58:20 +01:00
(table $0 13 funcref)
(elem (i32.const 0) $null $~lib/arraybuffer/ArrayBuffer~iterate $~lib/array/Array<i8>~iterate $~lib/array/Array<i8>~iterate $~lib/arraybuffer/ArrayBuffer~iterate $~lib/array/Array<i8>~iterate $~lib/array/Array<i8>~iterate $~lib/arraybuffer/ArrayBuffer~iterate $~lib/array/Array<std/array-literal/Ref>~iterate $~lib/array/Array<std/array-literal/Ref>~iterate $~lib/arraybuffer/ArrayBuffer~iterate $~lib/array/Array<std/array-literal/Ref>~iterate $~lib/array/Array<std/array-literal/Ref>~iterate)
(global $~lib/argc (mut i32) (i32.const 0))
2019-03-26 23:35:08 +01:00
(global $std/array-literal/emptyArrayI32 (mut i32) (i32.const 264))
2019-03-16 07:26:33 +01:00
(global $std/array-literal/i (mut i32) (i32.const 0))
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
(global $std/array-literal/dynamicArrayI8 (mut i32) (i32.const 0))
(global $std/array-literal/dynamicArrayI32 (mut i32) (i32.const 0))
(global $std/array-literal/dynamicArrayRef (mut i32) (i32.const 0))
(global $std/array-literal/dynamicArrayRefWithCtor (mut i32) (i32.const 0))
2019-03-26 23:35:08 +01:00
(global $~lib/capabilities i32 (i32.const 2))
2018-04-23 22:49:04 +02:00
(export "memory" (memory $0))
(export "table" (table $0))
2019-03-26 23:35:08 +01:00
(export ".capabilities" (global $~lib/capabilities))
2018-04-23 22:49:04 +02:00
(start $start)
2019-03-30 13:58:20 +01:00
(func $~lib/arraybuffer/ArrayBuffer~iterate (; 1 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
nop
)
(func $~lib/array/Array<i8>~iterate (; 2 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
i32.const 1
global.set $~lib/argc
local.get $0
i32.load
local.get $1
call_indirect (type $FUNCSIG$vi)
)
(func $~lib/array/Array<i8>#__get (; 3 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
2019-03-18 16:09:49 +01:00
local.get $1
local.get $0
i32.load offset=8
i32.ge_u
if
i32.const 0
2019-03-26 23:35:08 +01:00
i32.const 136
i32.const 98
2019-03-18 16:09:49 +01:00
i32.const 61
call $~lib/env/abort
unreachable
end
local.get $0
i32.load offset=4
2019-03-26 23:35:08 +01:00
local.get $1
2019-03-18 16:09:49 +01:00
i32.add
i32.load8_s
)
2019-03-30 13:58:20 +01:00
(func $~lib/array/Array<i32>#__get (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
2019-03-18 16:09:49 +01:00
local.get $1
local.get $0
i32.load offset=8
i32.const 2
i32.shr_u
i32.ge_u
if
i32.const 0
2019-03-26 23:35:08 +01:00
i32.const 136
i32.const 98
2019-03-18 16:09:49 +01:00
i32.const 61
call $~lib/env/abort
unreachable
end
local.get $0
i32.load offset=4
local.get $1
i32.const 2
i32.shl
i32.add
i32.load
)
2019-03-30 13:58:20 +01:00
(func $~lib/allocator/arena/__mem_allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
2018-04-23 22:49:04 +02:00
(local $1 i32)
(local $2 i32)
(local $3 i32)
local.get $0
i32.const 1073741824
i32.gt_u
if
unreachable
end
global.get $~lib/allocator/arena/offset
local.tee $1
local.get $0
i32.const 1
local.get $0
i32.const 1
i32.gt_u
select
i32.add
i32.const 7
i32.add
i32.const -8
i32.and
2019-03-16 07:26:33 +01:00
local.tee $0
current_memory
2019-03-16 07:26:33 +01:00
local.tee $2
i32.const 16
i32.shl
i32.gt_u
if
local.get $2
2019-03-16 07:26:33 +01:00
local.get $0
local.get $1
i32.sub
i32.const 65535
i32.add
i32.const -65536
i32.and
i32.const 16
i32.shr_u
2019-03-16 07:26:33 +01:00
local.tee $3
local.get $2
local.get $3
i32.gt_s
select
grow_memory
i32.const 0
i32.lt_s
if
2019-03-16 07:26:33 +01:00
local.get $3
grow_memory
i32.const 0
i32.lt_s
if
unreachable
end
end
end
2019-03-16 07:26:33 +01:00
local.get $0
global.set $~lib/allocator/arena/offset
local.get $1
2018-04-23 22:49:04 +02:00
)
2019-03-30 13:58:20 +01:00
(func $~lib/runtime/allocate (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
2018-04-23 22:49:04 +02:00
(local $1 i32)
i32.const 1
i32.const 32
local.get $0
2019-03-26 23:35:08 +01:00
i32.const 15
i32.add
i32.clz
i32.sub
i32.shl
2019-03-27 17:21:52 +01:00
call $~lib/allocator/arena/__mem_allocate
local.tee $1
2019-03-16 07:26:33 +01:00
i32.const -1520547049
i32.store
local.get $1
2019-03-16 07:26:33 +01:00
local.get $0
i32.store offset=4
local.get $1
2019-03-26 23:35:08 +01:00
i32.const 0
i32.store offset=8
local.get $1
i32.const 0
i32.store offset=12
local.get $1
i32.const 16
2019-03-16 07:26:33 +01:00
i32.add
2018-04-23 22:49:04 +02:00
)
2019-03-30 13:58:20 +01:00
(func $~lib/runtime/register (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
2019-03-26 23:35:08 +01:00
(local $2 i32)
local.get $0
2019-03-26 23:35:08 +01:00
i32.const 328
i32.le_u
if
2019-03-16 07:26:33 +01:00
i32.const 0
2019-03-26 23:35:08 +01:00
i32.const 296
2019-03-27 17:21:52 +01:00
i32.const 149
2019-03-26 23:35:08 +01:00
i32.const 4
call $~lib/env/abort
unreachable
2019-03-16 07:26:33 +01:00
end
local.get $0
2019-03-26 23:35:08 +01:00
i32.const 16
i32.sub
2019-03-26 23:35:08 +01:00
local.tee $2
i32.load
i32.const -1520547049
i32.ne
if
2019-03-16 07:26:33 +01:00
i32.const 0
2019-03-26 23:35:08 +01:00
i32.const 296
2019-03-27 17:21:52 +01:00
i32.const 151
2019-03-26 23:35:08 +01:00
i32.const 4
call $~lib/env/abort
unreachable
end
2019-03-26 23:35:08 +01:00
local.get $2
2019-03-16 07:26:33 +01:00
local.get $1
i32.store
local.get $0
2019-03-16 07:26:33 +01:00
)
2019-03-30 13:58:20 +01:00
(func $~lib/runtime/makeArray (; 8 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
2019-03-26 23:35:08 +01:00
(local $3 i32)
i32.const 16
2019-03-26 23:35:08 +01:00
call $~lib/runtime/allocate
local.get $0
2019-03-26 23:35:08 +01:00
call $~lib/runtime/register
2019-03-27 16:10:59 +01:00
local.set $0
i32.const 3
2019-03-16 07:26:33 +01:00
local.get $1
i32.shl
local.tee $1
2019-03-26 23:35:08 +01:00
call $~lib/runtime/allocate
i32.const 1
2019-03-26 23:35:08 +01:00
call $~lib/runtime/register
local.tee $2
2019-03-26 23:35:08 +01:00
local.tee $3
local.get $0
2019-03-26 23:35:08 +01:00
i32.load
i32.ne
drop
local.get $0
2019-03-27 16:10:59 +01:00
local.get $3
2019-03-26 23:35:08 +01:00
i32.store
local.get $0
local.get $2
i32.store offset=4
local.get $0
local.get $1
i32.store offset=8
local.get $0
i32.const 3
i32.store offset=12
local.get $0
2018-08-02 18:23:02 +02:00
)
2019-03-30 13:58:20 +01:00
(func $std/array-literal/Ref#constructor (; 9 ;) (type $FUNCSIG$i) (result i32)
i32.const 0
2019-03-26 23:35:08 +01:00
call $~lib/runtime/allocate
2019-03-30 13:58:20 +01:00
i32.const 7
2019-03-26 23:35:08 +01:00
call $~lib/runtime/register
2019-03-16 07:26:33 +01:00
)
2019-03-30 13:58:20 +01:00
(func $~lib/array/Array<std/array-literal/Ref>~iterate (; 10 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
(local $3 i32)
i32.const 1
global.set $~lib/argc
local.get $0
i32.load
local.get $1
call_indirect (type $FUNCSIG$vi)
local.get $0
i32.load offset=4
local.tee $2
local.get $0
i32.load offset=8
i32.add
local.set $0
loop $continue|0
local.get $2
local.get $0
i32.lt_u
if
local.get $2
i32.load
local.set $3
i32.const 1
global.set $~lib/argc
local.get $3
local.get $1
call_indirect (type $FUNCSIG$vi)
local.get $2
i32.const 4
i32.add
local.set $2
br $continue|0
end
end
)
(func $std/array-literal/RefWithCtor#constructor (; 11 ;) (type $FUNCSIG$i) (result i32)
i32.const 0
2019-03-26 23:35:08 +01:00
call $~lib/runtime/allocate
2019-03-30 13:58:20 +01:00
i32.const 10
2019-03-26 23:35:08 +01:00
call $~lib/runtime/register
2018-04-23 22:49:04 +02:00
)
2019-03-30 13:58:20 +01:00
(func $start:std/array-literal (; 12 ;) (type $FUNCSIG$v)
2018-04-23 22:49:04 +02:00
(local $0 i32)
(local $1 i32)
(local $2 i32)
2019-03-26 23:35:08 +01:00
i32.const 60
i32.load
i32.const 3
i32.ne
if
i32.const 0
2019-03-26 23:35:08 +01:00
i32.const 80
i32.const 5
i32.const 0
call $~lib/env/abort
unreachable
end
2019-03-26 23:35:08 +01:00
i32.const 48
2019-03-17 12:25:54 +01:00
i32.const 0
2019-03-18 16:09:49 +01:00
call $~lib/array/Array<i8>#__get
if
i32.const 0
2019-03-26 23:35:08 +01:00
i32.const 80
i32.const 6
i32.const 0
call $~lib/env/abort
unreachable
end
2019-03-26 23:35:08 +01:00
i32.const 48
2019-03-17 12:25:54 +01:00
i32.const 1
2019-03-18 16:09:49 +01:00
call $~lib/array/Array<i8>#__get
i32.const 1
i32.ne
if
i32.const 0
2019-03-26 23:35:08 +01:00
i32.const 80
i32.const 7
i32.const 0
call $~lib/env/abort
unreachable
end
2019-03-26 23:35:08 +01:00
i32.const 48
2019-03-17 12:25:54 +01:00
i32.const 2
2019-03-18 16:09:49 +01:00
call $~lib/array/Array<i8>#__get
i32.const 2
i32.ne
if
i32.const 0
2019-03-26 23:35:08 +01:00
i32.const 80
i32.const 8
i32.const 0
call $~lib/env/abort
unreachable
end
2019-03-26 23:35:08 +01:00
i32.const 228
i32.load
i32.const 3
i32.ne
if
i32.const 0
2019-03-26 23:35:08 +01:00
i32.const 80
i32.const 11
i32.const 0
call $~lib/env/abort
unreachable
end
2019-03-26 23:35:08 +01:00
i32.const 216
2019-03-17 12:25:54 +01:00
i32.const 0
2019-03-18 16:09:49 +01:00
call $~lib/array/Array<i32>#__get
if
i32.const 0
2019-03-26 23:35:08 +01:00
i32.const 80
i32.const 12
i32.const 0
call $~lib/env/abort
unreachable
end
2019-03-26 23:35:08 +01:00
i32.const 216
2019-03-18 16:09:49 +01:00
i32.const 1
call $~lib/array/Array<i32>#__get
i32.const 1
i32.ne
if
i32.const 0
2019-03-26 23:35:08 +01:00
i32.const 80
i32.const 13
i32.const 0
call $~lib/env/abort
unreachable
end
2019-03-26 23:35:08 +01:00
i32.const 216
2019-03-18 16:09:49 +01:00
i32.const 2
call $~lib/array/Array<i32>#__get
i32.const 2
i32.ne
if
i32.const 0
2019-03-26 23:35:08 +01:00
i32.const 80
i32.const 14
i32.const 0
call $~lib/env/abort
unreachable
end
global.get $std/array-literal/emptyArrayI32
2019-03-16 07:26:33 +01:00
i32.load offset=12
if
i32.const 0
2019-03-26 23:35:08 +01:00
i32.const 80
i32.const 17
i32.const 0
call $~lib/env/abort
unreachable
end
2019-03-26 23:35:08 +01:00
i32.const 328
2019-03-16 07:26:33 +01:00
global.set $~lib/allocator/arena/startOffset
global.get $~lib/allocator/arena/startOffset
global.set $~lib/allocator/arena/offset
i32.const 2
i32.const 0
2019-03-26 23:35:08 +01:00
call $~lib/runtime/makeArray
local.tee $2
2019-03-27 16:10:59 +01:00
i32.load offset=4
2019-03-26 23:35:08 +01:00
local.tee $0
global.get $std/array-literal/i
local.tee $1
i32.store8
local.get $1
i32.const 1
i32.add
2019-03-27 16:10:59 +01:00
local.tee $1
global.set $std/array-literal/i
2019-03-26 23:35:08 +01:00
local.get $0
local.get $1
2019-03-26 23:35:08 +01:00
i32.store8 offset=1
global.get $std/array-literal/i
i32.const 1
i32.add
2019-03-27 16:10:59 +01:00
local.tee $1
global.set $std/array-literal/i
local.get $0
2019-03-26 23:35:08 +01:00
local.get $1
2019-03-27 16:10:59 +01:00
i32.store8 offset=2
local.get $2
global.set $std/array-literal/dynamicArrayI8
global.get $std/array-literal/dynamicArrayI8
2019-03-16 07:26:33 +01:00
i32.load offset=12
i32.const 3
i32.ne
if
i32.const 0
2019-03-26 23:35:08 +01:00
i32.const 80
i32.const 22
i32.const 0
call $~lib/env/abort
unreachable
end
global.get $std/array-literal/dynamicArrayI8
2019-03-17 12:25:54 +01:00
i32.const 0
2019-03-18 16:09:49 +01:00
call $~lib/array/Array<i8>#__get
if
i32.const 0
2019-03-26 23:35:08 +01:00
i32.const 80
i32.const 23
i32.const 0
call $~lib/env/abort
unreachable
end
global.get $std/array-literal/dynamicArrayI8
2019-03-17 12:25:54 +01:00
i32.const 1
2019-03-18 16:09:49 +01:00
call $~lib/array/Array<i8>#__get
i32.const 1
i32.ne
if
i32.const 0
2019-03-26 23:35:08 +01:00
i32.const 80
i32.const 24
i32.const 0
call $~lib/env/abort
unreachable
end
global.get $std/array-literal/dynamicArrayI8
2019-03-17 12:25:54 +01:00
i32.const 2
2019-03-18 16:09:49 +01:00
call $~lib/array/Array<i8>#__get
i32.const 2
i32.ne
if
i32.const 0
2019-03-26 23:35:08 +01:00
i32.const 80
i32.const 25
i32.const 0
call $~lib/env/abort
unreachable
end
i32.const 0
global.set $std/array-literal/i
2019-03-30 13:58:20 +01:00
i32.const 5
2019-03-16 07:26:33 +01:00
i32.const 2
2019-03-26 23:35:08 +01:00
call $~lib/runtime/makeArray
local.tee $2
i32.load offset=4
2019-03-26 23:35:08 +01:00
local.tee $0
global.get $std/array-literal/i
local.tee $1
i32.store
local.get $1
i32.const 1
i32.add
2019-03-27 16:10:59 +01:00
local.tee $1
global.set $std/array-literal/i
local.get $0
local.get $1
i32.store offset=4
2019-03-26 23:35:08 +01:00
global.get $std/array-literal/i
i32.const 1
i32.add
2019-03-27 16:10:59 +01:00
local.tee $1
global.set $std/array-literal/i
local.get $0
2019-03-27 16:10:59 +01:00
local.get $1
i32.store offset=8
2019-03-26 23:35:08 +01:00
local.get $2
global.set $std/array-literal/dynamicArrayI32
global.get $std/array-literal/dynamicArrayI32
2019-03-16 07:26:33 +01:00
i32.load offset=12
i32.const 3
i32.ne
if
i32.const 0
2019-03-26 23:35:08 +01:00
i32.const 80
i32.const 30
i32.const 0
call $~lib/env/abort
unreachable
end
global.get $std/array-literal/dynamicArrayI32
2019-03-17 12:25:54 +01:00
i32.const 0
2019-03-18 16:09:49 +01:00
call $~lib/array/Array<i32>#__get
if
i32.const 0
2019-03-26 23:35:08 +01:00
i32.const 80
i32.const 31
i32.const 0
call $~lib/env/abort
unreachable
end
global.get $std/array-literal/dynamicArrayI32
2019-03-18 16:09:49 +01:00
i32.const 1
call $~lib/array/Array<i32>#__get
i32.const 1
i32.ne
if
i32.const 0
2019-03-26 23:35:08 +01:00
i32.const 80
i32.const 32
i32.const 0
call $~lib/env/abort
unreachable
end
global.get $std/array-literal/dynamicArrayI32
2019-03-18 16:09:49 +01:00
i32.const 2
call $~lib/array/Array<i32>#__get
i32.const 2
i32.ne
if
i32.const 0
2019-03-26 23:35:08 +01:00
i32.const 80
i32.const 33
i32.const 0
call $~lib/env/abort
unreachable
end
2019-03-30 13:58:20 +01:00
i32.const 8
2019-03-16 07:26:33 +01:00
i32.const 2
2019-03-26 23:35:08 +01:00
call $~lib/runtime/makeArray
local.tee $2
2019-03-27 16:10:59 +01:00
i32.load offset=4
local.tee $0
2019-03-16 07:26:33 +01:00
call $std/array-literal/Ref#constructor
i32.store
local.get $0
2019-03-16 07:26:33 +01:00
call $std/array-literal/Ref#constructor
i32.store offset=4
local.get $0
2019-03-16 07:26:33 +01:00
call $std/array-literal/Ref#constructor
i32.store offset=8
2019-03-27 16:10:59 +01:00
local.get $2
global.set $std/array-literal/dynamicArrayRef
global.get $std/array-literal/dynamicArrayRef
2019-03-16 07:26:33 +01:00
i32.load offset=12
i32.const 3
i32.ne
if
i32.const 0
2019-03-26 23:35:08 +01:00
i32.const 80
i32.const 37
i32.const 0
call $~lib/env/abort
unreachable
end
2019-03-30 13:58:20 +01:00
i32.const 11
2019-03-16 07:26:33 +01:00
i32.const 2
2019-03-26 23:35:08 +01:00
call $~lib/runtime/makeArray
local.tee $2
i32.load offset=4
2019-03-27 16:10:59 +01:00
local.tee $0
2019-03-16 07:26:33 +01:00
call $std/array-literal/RefWithCtor#constructor
i32.store
local.get $0
2019-03-16 07:26:33 +01:00
call $std/array-literal/RefWithCtor#constructor
i32.store offset=4
local.get $0
2019-03-16 07:26:33 +01:00
call $std/array-literal/RefWithCtor#constructor
i32.store offset=8
2019-03-26 23:35:08 +01:00
local.get $2
global.set $std/array-literal/dynamicArrayRefWithCtor
global.get $std/array-literal/dynamicArrayRefWithCtor
2019-03-16 07:26:33 +01:00
i32.load offset=12
i32.const 3
i32.ne
if
i32.const 0
2019-03-26 23:35:08 +01:00
i32.const 80
i32.const 41
i32.const 0
call $~lib/env/abort
unreachable
end
2018-04-23 22:49:04 +02:00
)
2019-03-30 13:58:20 +01:00
(func $start (; 13 ;) (type $FUNCSIG$v)
call $start:std/array-literal
)
2019-03-30 13:58:20 +01:00
(func $null (; 14 ;) (type $FUNCSIG$v)
nop
)
2018-04-23 22:49:04 +02:00
)