assemblyscript/tests/compiler/std/arraybuffer.untouched.wat

2217 lines
38 KiB
Plaintext
Raw Normal View History

(module
(type $iiii (func (param i32 i32 i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $ii (func (param i32) (result i32)))
(type $iiiv (func (param i32 i32 i32)))
(type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\13\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00")
(data (i32.const 56) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00")
(data (i32.const 120) "\12\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00")
(table $0 1 anyfunc)
(elem (i32.const 0) $null)
(global $~lib/internal/allocator/AL_BITS i32 (i32.const 3))
(global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8))
(global $~lib/internal/allocator/AL_MASK i32 (i32.const 7))
(global $~lib/internal/allocator/MAX_SIZE_32 i32 (i32.const 1073741824))
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
(global $~lib/internal/arraybuffer/HEADER_SIZE i32 (i32.const 8))
(global $~lib/internal/arraybuffer/MAX_BLENGTH i32 (i32.const 1073741816))
(global $std/arraybuffer/buffer (mut i32) (i32.const 0))
(global $~argc (mut i32) (i32.const 0))
(global $std/arraybuffer/sliced (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 160))
(export "memory" (memory $0))
(export "table" (table $0))
(start $start)
(func $~lib/internal/arraybuffer/computeSize (; 1 ;) (type $ii) (param $0 i32) (result i32)
i32.const 1
i32.const 32
get_local $0
get_global $~lib/internal/arraybuffer/HEADER_SIZE
i32.add
i32.const 1
i32.sub
i32.clz
i32.sub
i32.shl
)
(func $~lib/allocator/arena/__memory_allocate (; 2 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
get_local $0
get_global $~lib/internal/allocator/MAX_SIZE_32
i32.gt_u
if
unreachable
end
get_global $~lib/allocator/arena/offset
set_local $1
get_local $1
get_local $0
tee_local $2
i32.const 1
tee_local $3
get_local $2
get_local $3
i32.gt_u
select
i32.add
get_global $~lib/internal/allocator/AL_MASK
i32.add
get_global $~lib/internal/allocator/AL_MASK
i32.const -1
i32.xor
i32.and
set_local $4
current_memory
set_local $5
get_local $4
get_local $5
i32.const 16
i32.shl
i32.gt_u
if
get_local $4
get_local $1
i32.sub
i32.const 65535
i32.add
i32.const 65535
i32.const -1
i32.xor
i32.and
i32.const 16
i32.shr_u
set_local $2
get_local $5
tee_local $3
get_local $2
tee_local $6
get_local $3
get_local $6
i32.gt_s
select
set_local $3
get_local $3
grow_memory
i32.const 0
i32.lt_s
if
get_local $2
grow_memory
i32.const 0
i32.lt_s
if
unreachable
end
end
end
get_local $4
set_global $~lib/allocator/arena/offset
get_local $1
)
2018-08-02 18:23:02 +02:00
(func $~lib/internal/arraybuffer/allocateUnsafe (; 3 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
2018-08-02 18:23:02 +02:00
(local $2 i32)
get_local $0
get_global $~lib/internal/arraybuffer/MAX_BLENGTH
i32.le_u
i32.eqz
if
i32.const 0
i32.const 56
i32.const 23
i32.const 2
call $~lib/env/abort
unreachable
end
block $~lib/memory/memory.allocate|inlined.0 (result i32)
get_local $0
call $~lib/internal/arraybuffer/computeSize
set_local $2
get_local $2
call $~lib/allocator/arena/__memory_allocate
br $~lib/memory/memory.allocate|inlined.0
end
set_local $1
get_local $1
get_local $0
i32.store
get_local $1
)
2018-08-02 18:23:02 +02:00
(func $~lib/internal/memory/memset (; 4 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i64)
get_local $2
i32.eqz
if
return
end
get_local $0
get_local $1
i32.store8
get_local $0
get_local $2
i32.add
i32.const 1
i32.sub
get_local $1
i32.store8
get_local $2
i32.const 2
i32.le_u
if
return
end
get_local $0
i32.const 1
i32.add
get_local $1
i32.store8
get_local $0
i32.const 2
i32.add
get_local $1
i32.store8
get_local $0
get_local $2
i32.add
i32.const 2
i32.sub
get_local $1
i32.store8
get_local $0
get_local $2
i32.add
i32.const 3
i32.sub
get_local $1
i32.store8
get_local $2
i32.const 6
i32.le_u
if
return
end
get_local $0
i32.const 3
i32.add
get_local $1
i32.store8
get_local $0
get_local $2
i32.add
i32.const 4
i32.sub
get_local $1
i32.store8
get_local $2
i32.const 8
i32.le_u
if
return
end
i32.const 0
get_local $0
i32.sub
i32.const 3
i32.and
set_local $3
get_local $0
get_local $3
i32.add
set_local $0
get_local $2
get_local $3
i32.sub
set_local $2
get_local $2
i32.const -4
i32.and
set_local $2
i32.const -1
i32.const 255
i32.div_u
get_local $1
i32.const 255
i32.and
i32.mul
set_local $4
get_local $0
get_local $4
i32.store
get_local $0
get_local $2
i32.add
i32.const 4
i32.sub
get_local $4
i32.store
get_local $2
i32.const 8
i32.le_u
if
return
end
get_local $0
i32.const 4
i32.add
get_local $4
i32.store
get_local $0
i32.const 8
i32.add
get_local $4
i32.store
get_local $0
get_local $2
i32.add
i32.const 12
i32.sub
get_local $4
i32.store
get_local $0
get_local $2
i32.add
i32.const 8
i32.sub
get_local $4
i32.store
get_local $2
i32.const 24
i32.le_u
if
return
end
get_local $0
i32.const 12
i32.add
get_local $4
i32.store
get_local $0
i32.const 16
i32.add
get_local $4
i32.store
get_local $0
i32.const 20
i32.add
get_local $4
i32.store
get_local $0
i32.const 24
i32.add
get_local $4
i32.store
get_local $0
get_local $2
i32.add
i32.const 28
i32.sub
get_local $4
i32.store
get_local $0
get_local $2
i32.add
i32.const 24
i32.sub
get_local $4
i32.store
get_local $0
get_local $2
i32.add
i32.const 20
i32.sub
get_local $4
i32.store
get_local $0
get_local $2
i32.add
i32.const 16
i32.sub
get_local $4
i32.store
i32.const 24
get_local $0
i32.const 4
i32.and
i32.add
set_local $3
get_local $0
get_local $3
i32.add
set_local $0
get_local $2
get_local $3
i32.sub
set_local $2
get_local $4
i64.extend_u/i32
get_local $4
i64.extend_u/i32
i64.const 32
i64.shl
i64.or
set_local $5
block $break|0
loop $continue|0
get_local $2
i32.const 32
i32.ge_u
if
block
get_local $0
get_local $5
i64.store
get_local $0
i32.const 8
i32.add
get_local $5
i64.store
get_local $0
i32.const 16
i32.add
get_local $5
i64.store
get_local $0
i32.const 24
i32.add
get_local $5
i64.store
get_local $2
i32.const 32
i32.sub
set_local $2
get_local $0
i32.const 32
i32.add
set_local $0
end
br $continue|0
end
end
end
)
2018-08-02 18:23:02 +02:00
(func $~lib/arraybuffer/ArrayBuffer#constructor (; 5 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
2018-08-02 18:23:02 +02:00
(local $4 i32)
(local $5 i32)
get_local $1
get_global $~lib/internal/arraybuffer/MAX_BLENGTH
i32.gt_u
if
i32.const 0
i32.const 8
i32.const 16
i32.const 40
call $~lib/env/abort
unreachable
end
get_local $1
call $~lib/internal/arraybuffer/allocateUnsafe
set_local $3
get_local $2
i32.const 1
i32.and
i32.eqz
if
get_local $3
get_global $~lib/internal/arraybuffer/HEADER_SIZE
i32.add
set_local $4
i32.const 0
set_local $5
get_local $4
get_local $5
get_local $1
call $~lib/internal/memory/memset
end
get_local $3
)
2018-08-02 18:23:02 +02:00
(func $~lib/internal/memory/memcpy (; 6 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
block $break|0
loop $continue|0
get_local $2
if (result i32)
get_local $1
i32.const 3
i32.and
else
get_local $2
end
if
block
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
get_local $2
i32.const 1
i32.sub
set_local $2
end
br $continue|0
end
end
end
get_local $0
i32.const 3
i32.and
i32.const 0
i32.eq
if
block $break|1
loop $continue|1
get_local $2
i32.const 16
i32.ge_u
if
block
get_local $0
get_local $1
i32.load
i32.store
get_local $0
i32.const 4
i32.add
get_local $1
i32.const 4
i32.add
i32.load
i32.store
get_local $0
i32.const 8
i32.add
get_local $1
i32.const 8
i32.add
i32.load
i32.store
get_local $0
i32.const 12
i32.add
get_local $1
i32.const 12
i32.add
i32.load
i32.store
get_local $1
i32.const 16
i32.add
set_local $1
get_local $0
i32.const 16
i32.add
set_local $0
get_local $2
i32.const 16
i32.sub
set_local $2
end
br $continue|1
end
end
end
get_local $2
i32.const 8
i32.and
if
get_local $0
get_local $1
i32.load
i32.store
get_local $0
i32.const 4
i32.add
get_local $1
i32.const 4
i32.add
i32.load
i32.store
get_local $0
i32.const 8
i32.add
set_local $0
get_local $1
i32.const 8
i32.add
set_local $1
end
get_local $2
i32.const 4
i32.and
if
get_local $0
get_local $1
i32.load
i32.store
get_local $0
i32.const 4
i32.add
set_local $0
get_local $1
i32.const 4
i32.add
set_local $1
end
get_local $2
i32.const 2
i32.and
if
get_local $0
get_local $1
i32.load16_u
i32.store16
get_local $0
i32.const 2
i32.add
set_local $0
get_local $1
i32.const 2
i32.add
set_local $1
end
get_local $2
i32.const 1
i32.and
if
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
end
return
end
get_local $2
i32.const 32
i32.ge_u
if
block $break|2
block $case2|2
block $case1|2
block $case0|2
get_local $0
i32.const 3
i32.and
set_local $5
get_local $5
i32.const 1
i32.eq
br_if $case0|2
get_local $5
i32.const 2
i32.eq
br_if $case1|2
get_local $5
i32.const 3
i32.eq
br_if $case2|2
br $break|2
end
block
get_local $1
i32.load
set_local $3
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
get_local $2
i32.const 3
i32.sub
set_local $2
block $break|3
loop $continue|3
get_local $2
i32.const 17
i32.ge_u
if
block
get_local $1
i32.const 1
i32.add
i32.load
set_local $4
get_local $0
get_local $3
i32.const 24
i32.shr_u
get_local $4
i32.const 8
i32.shl
i32.or
i32.store
get_local $1
i32.const 5
i32.add
i32.load
set_local $3
get_local $0
i32.const 4
i32.add
get_local $4
i32.const 24
i32.shr_u
get_local $3
i32.const 8
i32.shl
i32.or
i32.store
get_local $1
i32.const 9
i32.add
i32.load
set_local $4
get_local $0
i32.const 8
i32.add
get_local $3
i32.const 24
i32.shr_u
get_local $4
i32.const 8
i32.shl
i32.or
i32.store
get_local $1
i32.const 13
i32.add
i32.load
set_local $3
get_local $0
i32.const 12
i32.add
get_local $4
i32.const 24
i32.shr_u
get_local $3
i32.const 8
i32.shl
i32.or
i32.store
get_local $1
i32.const 16
i32.add
set_local $1
get_local $0
i32.const 16
i32.add
set_local $0
get_local $2
i32.const 16
i32.sub
set_local $2
end
br $continue|3
end
end
end
br $break|2
unreachable
end
unreachable
end
block
get_local $1
i32.load
set_local $3
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
get_local $2
i32.const 2
i32.sub
set_local $2
block $break|4
loop $continue|4
get_local $2
i32.const 18
i32.ge_u
if
block
get_local $1
i32.const 2
i32.add
i32.load
set_local $4
get_local $0
get_local $3
i32.const 16
i32.shr_u
get_local $4
i32.const 16
i32.shl
i32.or
i32.store
get_local $1
i32.const 6
i32.add
i32.load
set_local $3
get_local $0
i32.const 4
i32.add
get_local $4
i32.const 16
i32.shr_u
get_local $3
i32.const 16
i32.shl
i32.or
i32.store
get_local $1
i32.const 10
i32.add
i32.load
set_local $4
get_local $0
i32.const 8
i32.add
get_local $3
i32.const 16
i32.shr_u
get_local $4
i32.const 16
i32.shl
i32.or
i32.store
get_local $1
i32.const 14
i32.add
i32.load
set_local $3
get_local $0
i32.const 12
i32.add
get_local $4
i32.const 16
i32.shr_u
get_local $3
i32.const 16
i32.shl
i32.or
i32.store
get_local $1
i32.const 16
i32.add
set_local $1
get_local $0
i32.const 16
i32.add
set_local $0
get_local $2
i32.const 16
i32.sub
set_local $2
end
br $continue|4
end
end
end
br $break|2
unreachable
end
unreachable
end
block
get_local $1
i32.load
set_local $3
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
get_local $2
i32.const 1
i32.sub
set_local $2
block $break|5
loop $continue|5
get_local $2
i32.const 19
i32.ge_u
if
block
get_local $1
i32.const 3
i32.add
i32.load
set_local $4
get_local $0
get_local $3
i32.const 8
i32.shr_u
get_local $4
i32.const 24
i32.shl
i32.or
i32.store
get_local $1
i32.const 7
i32.add
i32.load
set_local $3
get_local $0
i32.const 4
i32.add
get_local $4
i32.const 8
i32.shr_u
get_local $3
i32.const 24
i32.shl
i32.or
i32.store
get_local $1
i32.const 11
i32.add
i32.load
set_local $4
get_local $0
i32.const 8
i32.add
get_local $3
i32.const 8
i32.shr_u
get_local $4
i32.const 24
i32.shl
i32.or
i32.store
get_local $1
i32.const 15
i32.add
i32.load
set_local $3
get_local $0
i32.const 12
i32.add
get_local $4
i32.const 8
i32.shr_u
get_local $3
i32.const 24
i32.shl
i32.or
i32.store
get_local $1
i32.const 16
i32.add
set_local $1
get_local $0
i32.const 16
i32.add
set_local $0
get_local $2
i32.const 16
i32.sub
set_local $2
end
br $continue|5
end
end
end
br $break|2
unreachable
end
unreachable
end
end
get_local $2
i32.const 16
i32.and
if
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
end
get_local $2
i32.const 8
i32.and
if
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
end
get_local $2
i32.const 4
i32.and
if
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
end
get_local $2
i32.const 2
i32.and
if
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
end
get_local $2
i32.const 1
i32.and
if
block (result i32)
get_local $0
tee_local $5
i32.const 1
i32.add
set_local $0
get_local $5
end
block (result i32)
get_local $1
tee_local $5
i32.const 1
i32.add
set_local $1
get_local $5
end
i32.load8_u
i32.store8
end
)
2018-08-02 18:23:02 +02:00
(func $~lib/internal/memory/memmove (; 7 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
get_local $0
get_local $1
i32.eq
if
return
end
get_local $1
get_local $2
i32.add
get_local $0
i32.le_u
tee_local $3
if (result i32)
get_local $3
else
get_local $0
get_local $2
i32.add
get_local $1
i32.le_u
end
if
get_local $0
get_local $1
get_local $2
call $~lib/internal/memory/memcpy
return
end
get_local $0
get_local $1
i32.lt_u
if
get_local $1
i32.const 7
i32.and
get_local $0
i32.const 7
i32.and
i32.eq
if
block $break|0
loop $continue|0
get_local $0
i32.const 7
i32.and
if
block
get_local $2
i32.eqz
if
return
end
get_local $2
i32.const 1
i32.sub
set_local $2
block (result i32)
get_local $0
tee_local $3
i32.const 1
i32.add
set_local $0
get_local $3
end
block (result i32)
get_local $1
tee_local $3
i32.const 1
i32.add
set_local $1
get_local $3
end
i32.load8_u
i32.store8
end
br $continue|0
end
end
end
block $break|1
loop $continue|1
get_local $2
i32.const 8
i32.ge_u
if
block
get_local $0
get_local $1
i64.load
i64.store
get_local $2
i32.const 8
i32.sub
set_local $2
get_local $0
i32.const 8
i32.add
set_local $0
get_local $1
i32.const 8
i32.add
set_local $1
end
br $continue|1
end
end
end
end
block $break|2
loop $continue|2
get_local $2
if
block
block (result i32)
get_local $0
tee_local $3
i32.const 1
i32.add
set_local $0
get_local $3
end
block (result i32)
get_local $1
tee_local $3
i32.const 1
i32.add
set_local $1
get_local $3
end
i32.load8_u
i32.store8
get_local $2
i32.const 1
i32.sub
set_local $2
end
br $continue|2
end
end
end
else
get_local $1
i32.const 7
i32.and
get_local $0
i32.const 7
i32.and
i32.eq
if
block $break|3
loop $continue|3
get_local $0
get_local $2
i32.add
i32.const 7
i32.and
if
block
get_local $2
i32.eqz
if
return
end
get_local $0
get_local $2
i32.const 1
i32.sub
tee_local $2
i32.add
get_local $1
get_local $2
i32.add
i32.load8_u
i32.store8
end
br $continue|3
end
end
end
block $break|4
loop $continue|4
get_local $2
i32.const 8
i32.ge_u
if
block
get_local $2
i32.const 8
i32.sub
set_local $2
get_local $0
get_local $2
i32.add
get_local $1
get_local $2
i32.add
i64.load
i64.store
end
br $continue|4
end
end
end
end
block $break|5
loop $continue|5
get_local $2
if
get_local $0
get_local $2
i32.const 1
i32.sub
tee_local $2
i32.add
get_local $1
get_local $2
i32.add
i32.load8_u
i32.store8
br $continue|5
end
end
end
end
)
2018-08-02 18:23:02 +02:00
(func $~lib/arraybuffer/ArrayBuffer#slice (; 8 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
get_local $0
i32.load
set_local $3
get_local $1
i32.const 0
i32.lt_s
if
get_local $3
get_local $1
i32.add
tee_local $4
i32.const 0
tee_local $5
get_local $4
get_local $5
i32.gt_s
select
set_local $1
else
get_local $1
tee_local $4
get_local $3
tee_local $5
get_local $4
get_local $5
i32.lt_s
select
set_local $1
end
get_local $2
i32.const 0
i32.lt_s
if
get_local $3
get_local $2
i32.add
tee_local $4
i32.const 0
tee_local $5
get_local $4
get_local $5
i32.gt_s
select
set_local $2
else
get_local $2
tee_local $4
get_local $3
tee_local $5
get_local $4
get_local $5
i32.lt_s
select
set_local $2
end
get_local $2
get_local $1
i32.sub
tee_local $4
i32.const 0
tee_local $5
get_local $4
get_local $5
i32.gt_s
select
set_local $6
get_local $6
call $~lib/internal/arraybuffer/allocateUnsafe
set_local $7
block $~lib/memory/memory.copy|inlined.0
get_local $7
get_global $~lib/internal/arraybuffer/HEADER_SIZE
i32.add
set_local $4
get_local $0
get_global $~lib/internal/arraybuffer/HEADER_SIZE
i32.add
get_local $1
i32.add
set_local $5
get_local $4
get_local $5
get_local $6
call $~lib/internal/memory/memmove
end
get_local $7
)
2018-08-02 18:23:02 +02:00
(func $~lib/arraybuffer/ArrayBuffer#slice|trampoline (; 9 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
block $2of2
block $1of2
block $0of2
block $outOfRange
get_global $~argc
br_table $0of2 $1of2 $2of2 $outOfRange
end
unreachable
end
i32.const 0
set_local $1
end
get_global $~lib/internal/arraybuffer/MAX_BLENGTH
set_local $2
end
get_local $0
get_local $1
get_local $2
call $~lib/arraybuffer/ArrayBuffer#slice
)
(func $~lib/arraybuffer/ArrayBuffer#get:data (; 10 ;) (type $ii) (param $0 i32) (result i32)
get_local $0
get_global $~lib/internal/arraybuffer/HEADER_SIZE
i32.add
)
(func $start (; 11 ;) (type $v)
get_global $HEAP_BASE
get_global $~lib/internal/allocator/AL_MASK
i32.add
get_global $~lib/internal/allocator/AL_MASK
i32.const -1
i32.xor
i32.and
set_global $~lib/allocator/arena/startOffset
get_global $~lib/allocator/arena/startOffset
set_global $~lib/allocator/arena/offset
i32.const 0
i32.const 8
i32.const 0
call $~lib/arraybuffer/ArrayBuffer#constructor
set_global $std/arraybuffer/buffer
get_global $std/arraybuffer/buffer
i32.load
i32.const 8
i32.eq
i32.eqz
if
i32.const 0
i32.const 120
i32.const 5
i32.const 0
call $~lib/env/abort
unreachable
end
block (result i32)
i32.const 0
set_global $~argc
get_global $std/arraybuffer/buffer
i32.const 0
i32.const 0
call $~lib/arraybuffer/ArrayBuffer#slice|trampoline
end
set_global $std/arraybuffer/sliced
get_global $std/arraybuffer/sliced
i32.load
i32.const 8
i32.eq
i32.eqz
if
i32.const 0
i32.const 120
i32.const 9
i32.const 0
call $~lib/env/abort
unreachable
end
get_global $std/arraybuffer/sliced
call $~lib/arraybuffer/ArrayBuffer#get:data
get_global $std/arraybuffer/buffer
call $~lib/arraybuffer/ArrayBuffer#get:data
i32.ne
i32.eqz
if
i32.const 0
i32.const 120
i32.const 10
i32.const 0
call $~lib/env/abort
unreachable
end
get_global $std/arraybuffer/sliced
get_global $std/arraybuffer/buffer
i32.ne
i32.eqz
if
i32.const 0
i32.const 120
i32.const 11
i32.const 0
call $~lib/env/abort
unreachable
end
block (result i32)
i32.const 1
set_global $~argc
get_global $std/arraybuffer/buffer
i32.const 1
i32.const 0
call $~lib/arraybuffer/ArrayBuffer#slice|trampoline
end
set_global $std/arraybuffer/sliced
get_global $std/arraybuffer/sliced
i32.load
i32.const 7
i32.eq
i32.eqz
if
i32.const 0
i32.const 120
i32.const 15
i32.const 0
call $~lib/env/abort
unreachable
end
block (result i32)
i32.const 1
set_global $~argc
get_global $std/arraybuffer/buffer
i32.const -1
i32.const 0
call $~lib/arraybuffer/ArrayBuffer#slice|trampoline
end
set_global $std/arraybuffer/sliced
get_global $std/arraybuffer/sliced
i32.load
i32.const 1
i32.eq
i32.eqz
if
i32.const 0
i32.const 120
i32.const 19
i32.const 0
call $~lib/env/abort
unreachable
end
get_global $std/arraybuffer/buffer
i32.const 1
i32.const 3
call $~lib/arraybuffer/ArrayBuffer#slice
set_global $std/arraybuffer/sliced
get_global $std/arraybuffer/sliced
i32.load
i32.const 2
i32.eq
i32.eqz
if
i32.const 0
i32.const 120
i32.const 23
i32.const 0
call $~lib/env/abort
unreachable
end
get_global $std/arraybuffer/buffer
i32.const 1
i32.const -1
call $~lib/arraybuffer/ArrayBuffer#slice
set_global $std/arraybuffer/sliced
get_global $std/arraybuffer/sliced
i32.load
i32.const 6
i32.eq
i32.eqz
if
i32.const 0
i32.const 120
i32.const 27
i32.const 0
call $~lib/env/abort
unreachable
end
get_global $std/arraybuffer/buffer
i32.const -3
i32.const -1
call $~lib/arraybuffer/ArrayBuffer#slice
set_global $std/arraybuffer/sliced
get_global $std/arraybuffer/sliced
i32.load
i32.const 2
i32.eq
i32.eqz
if
i32.const 0
i32.const 120
i32.const 31
i32.const 0
call $~lib/env/abort
unreachable
end
get_global $std/arraybuffer/buffer
i32.const -4
i32.const 42
call $~lib/arraybuffer/ArrayBuffer#slice
set_global $std/arraybuffer/sliced
get_global $std/arraybuffer/sliced
i32.load
i32.const 4
i32.eq
i32.eqz
if
i32.const 0
i32.const 120
i32.const 35
i32.const 0
call $~lib/env/abort
unreachable
end
block (result i32)
i32.const 1
set_global $~argc
get_global $std/arraybuffer/buffer
i32.const 42
i32.const 0
call $~lib/arraybuffer/ArrayBuffer#slice|trampoline
end
set_global $std/arraybuffer/sliced
get_global $std/arraybuffer/sliced
i32.load
i32.const 0
i32.eq
i32.eqz
if
i32.const 0
i32.const 120
i32.const 39
i32.const 0
call $~lib/env/abort
unreachable
end
get_global $std/arraybuffer/sliced
i32.const 0
i32.ne
i32.eqz
if
i32.const 0
i32.const 120
i32.const 40
i32.const 0
call $~lib/env/abort
unreachable
end
)
(func $null (; 12 ;) (type $v)
)
)