mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-04-30 01:12:16 +00:00
inline single-use implementations
This commit is contained in:
parent
3a60638f72
commit
d3ca06b7ce
@ -10,7 +10,7 @@ var startOffset: usize = (HEAP_BASE + AL_MASK) & ~AL_MASK;
|
|||||||
var offset: usize = startOffset;
|
var offset: usize = startOffset;
|
||||||
|
|
||||||
// @ts-ignore: decorator
|
// @ts-ignore: decorator
|
||||||
@unsafe @global
|
@unsafe @global @inline
|
||||||
function __memory_allocate(size: usize): usize {
|
function __memory_allocate(size: usize): usize {
|
||||||
if (size > MAX_SIZE_32) unreachable();
|
if (size > MAX_SIZE_32) unreachable();
|
||||||
var ptr = offset;
|
var ptr = offset;
|
||||||
@ -30,12 +30,12 @@ function __memory_allocate(size: usize): usize {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore: decorator
|
// @ts-ignore: decorator
|
||||||
@unsafe @global
|
@unsafe @global @inline
|
||||||
function __memory_free(ptr: usize): void {
|
function __memory_free(ptr: usize): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore: decorator
|
// @ts-ignore: decorator
|
||||||
@unsafe @global
|
@unsafe @global @inline
|
||||||
function __memory_reset(): void {
|
function __memory_reset(): void {
|
||||||
offset = startOffset;
|
offset = startOffset;
|
||||||
}
|
}
|
||||||
|
@ -7,13 +7,13 @@ declare function _malloc(size: usize): usize;
|
|||||||
declare function _free(ptr: usize): void;
|
declare function _free(ptr: usize): void;
|
||||||
|
|
||||||
// @ts-ignore: decorator
|
// @ts-ignore: decorator
|
||||||
@unsafe @global
|
@unsafe @global @inline
|
||||||
function __memory_allocate(size: usize): usize {
|
function __memory_allocate(size: usize): usize {
|
||||||
return _malloc(size);
|
return _malloc(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore: decorator
|
// @ts-ignore: decorator
|
||||||
@unsafe @global
|
@unsafe @global @inline
|
||||||
function __memory_free(ptr: usize): void {
|
function __memory_free(ptr: usize): void {
|
||||||
_free(ptr);
|
_free(ptr);
|
||||||
}
|
}
|
||||||
|
@ -7,13 +7,13 @@ declare function malloc(size: usize): usize;
|
|||||||
declare function free(ptr: usize): void;
|
declare function free(ptr: usize): void;
|
||||||
|
|
||||||
// @ts-ignore: decorator
|
// @ts-ignore: decorator
|
||||||
@unsafe @global
|
@unsafe @global @inline
|
||||||
function __memory_allocate(size: usize): usize {
|
function __memory_allocate(size: usize): usize {
|
||||||
return malloc(size);
|
return malloc(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore: decorator
|
// @ts-ignore: decorator
|
||||||
@unsafe @global
|
@unsafe @global @inline
|
||||||
function __memory_free(ptr: usize): void {
|
function __memory_free(ptr: usize): void {
|
||||||
free(ptr);
|
free(ptr);
|
||||||
}
|
}
|
||||||
|
@ -423,7 +423,7 @@ var ROOT: Root = changetype<Root>(0);
|
|||||||
|
|
||||||
/** Allocates a chunk of memory. */
|
/** Allocates a chunk of memory. */
|
||||||
// @ts-ignore: decorator
|
// @ts-ignore: decorator
|
||||||
@unsafe @global
|
@unsafe @global @inline
|
||||||
function __memory_allocate(size: usize): usize {
|
function __memory_allocate(size: usize): usize {
|
||||||
// initialize if necessary
|
// initialize if necessary
|
||||||
var root = ROOT;
|
var root = ROOT;
|
||||||
@ -473,7 +473,7 @@ function __memory_allocate(size: usize): usize {
|
|||||||
|
|
||||||
/** Frees the chunk of memory at the specified address. */
|
/** Frees the chunk of memory at the specified address. */
|
||||||
// @ts-ignore: decorator
|
// @ts-ignore: decorator
|
||||||
@unsafe @global
|
@unsafe @global @inline
|
||||||
function __memory_free(data: usize): void {
|
function __memory_free(data: usize): void {
|
||||||
if (data) {
|
if (data) {
|
||||||
let root = ROOT;
|
let root = ROOT;
|
||||||
|
@ -141,6 +141,8 @@ export function memcpy(dest: usize, src: usize, n: usize): void { // see: musl/s
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-ignore: decorator
|
||||||
|
@inline
|
||||||
export function memmove(dest: usize, src: usize, n: usize): void { // see: musl/src/string/memmove.c
|
export function memmove(dest: usize, src: usize, n: usize): void { // see: musl/src/string/memmove.c
|
||||||
if (dest === src) return;
|
if (dest === src) return;
|
||||||
if (src + n <= dest || dest + n <= src) {
|
if (src + n <= dest || dest + n <= src) {
|
||||||
@ -182,6 +184,8 @@ export function memmove(dest: usize, src: usize, n: usize): void { // see: musl/
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-ignore: decorator
|
||||||
|
@inline
|
||||||
export function memset(dest: usize, c: u8, n: usize): void { // see: musl/src/string/memset
|
export function memset(dest: usize, c: u8, n: usize): void { // see: musl/src/string/memset
|
||||||
|
|
||||||
// fill head and tail with minimal branching
|
// fill head and tail with minimal branching
|
||||||
@ -242,6 +246,8 @@ export function memset(dest: usize, c: u8, n: usize): void { // see: musl/src/st
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-ignore: decorator
|
||||||
|
@inline
|
||||||
export function memcmp(vl: usize, vr: usize, n: usize): i32 { // see: musl/src/string/memcmp.c
|
export function memcmp(vl: usize, vr: usize, n: usize): i32 { // see: musl/src/string/memcmp.c
|
||||||
if (vl == vr) return 0;
|
if (vl == vr) return 0;
|
||||||
while (n != 0 && load<u8>(vl) == load<u8>(vr)) {
|
while (n != 0 && load<u8>(vl) == load<u8>(vr)) {
|
||||||
|
@ -994,29 +994,30 @@
|
|||||||
i32.const 8
|
i32.const 8
|
||||||
i32.add
|
i32.add
|
||||||
)
|
)
|
||||||
(func $~lib/allocator/tlsf/__memory_allocate (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
(func $~lib/memory/memory.allocate (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||||
(local $1 i32)
|
(local $1 i32)
|
||||||
(local $2 i32)
|
(local $2 i32)
|
||||||
(local $3 i32)
|
(local $3 i32)
|
||||||
(local $4 i32)
|
local.get $0
|
||||||
|
local.set $2
|
||||||
global.get $~lib/allocator/tlsf/ROOT
|
global.get $~lib/allocator/tlsf/ROOT
|
||||||
local.tee $3
|
local.tee $3
|
||||||
i32.eqz
|
i32.eqz
|
||||||
if
|
if
|
||||||
i32.const 1
|
i32.const 1
|
||||||
current_memory
|
current_memory
|
||||||
local.tee $4
|
|
||||||
i32.gt_s
|
|
||||||
local.tee $1
|
local.tee $1
|
||||||
|
i32.gt_s
|
||||||
|
local.tee $0
|
||||||
if (result i32)
|
if (result i32)
|
||||||
i32.const 1
|
i32.const 1
|
||||||
local.get $4
|
local.get $1
|
||||||
i32.sub
|
i32.sub
|
||||||
grow_memory
|
grow_memory
|
||||||
i32.const 0
|
i32.const 0
|
||||||
i32.lt_s
|
i32.lt_s
|
||||||
else
|
else
|
||||||
local.get $1
|
local.get $0
|
||||||
end
|
end
|
||||||
if
|
if
|
||||||
unreachable
|
unreachable
|
||||||
@ -1032,39 +1033,39 @@
|
|||||||
i32.const 0
|
i32.const 0
|
||||||
i32.store
|
i32.store
|
||||||
i32.const 0
|
i32.const 0
|
||||||
local.set $1
|
local.set $0
|
||||||
loop $repeat|0
|
loop $repeat|0
|
||||||
local.get $1
|
local.get $0
|
||||||
i32.const 22
|
i32.const 22
|
||||||
i32.lt_u
|
i32.lt_u
|
||||||
if
|
if
|
||||||
i32.const 216
|
i32.const 216
|
||||||
local.get $1
|
local.get $0
|
||||||
i32.const 0
|
i32.const 0
|
||||||
call $~lib/allocator/tlsf/Root#setSLMap
|
call $~lib/allocator/tlsf/Root#setSLMap
|
||||||
i32.const 0
|
i32.const 0
|
||||||
local.set $2
|
local.set $1
|
||||||
loop $repeat|1
|
loop $repeat|1
|
||||||
local.get $2
|
local.get $1
|
||||||
i32.const 32
|
i32.const 32
|
||||||
i32.lt_u
|
i32.lt_u
|
||||||
if
|
if
|
||||||
i32.const 216
|
i32.const 216
|
||||||
|
local.get $0
|
||||||
local.get $1
|
local.get $1
|
||||||
local.get $2
|
|
||||||
i32.const 0
|
i32.const 0
|
||||||
call $~lib/allocator/tlsf/Root#setHead
|
call $~lib/allocator/tlsf/Root#setHead
|
||||||
local.get $2
|
|
||||||
i32.const 1
|
|
||||||
i32.add
|
|
||||||
local.set $2
|
|
||||||
br $repeat|1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local.get $1
|
local.get $1
|
||||||
i32.const 1
|
i32.const 1
|
||||||
i32.add
|
i32.add
|
||||||
local.set $1
|
local.set $1
|
||||||
|
br $repeat|1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local.get $0
|
||||||
|
i32.const 1
|
||||||
|
i32.add
|
||||||
|
local.set $0
|
||||||
br $repeat|0
|
br $repeat|0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -1075,50 +1076,48 @@
|
|||||||
i32.shl
|
i32.shl
|
||||||
call $~lib/allocator/tlsf/Root#addMemory
|
call $~lib/allocator/tlsf/Root#addMemory
|
||||||
end
|
end
|
||||||
local.get $0
|
local.get $2
|
||||||
i32.const 1073741824
|
i32.const 1073741824
|
||||||
i32.gt_u
|
i32.gt_u
|
||||||
if
|
if
|
||||||
unreachable
|
unreachable
|
||||||
end
|
end
|
||||||
block (result i32)
|
|
||||||
local.get $3
|
local.get $3
|
||||||
local.get $0
|
local.get $2
|
||||||
i32.const 7
|
i32.const 7
|
||||||
i32.add
|
i32.add
|
||||||
i32.const -8
|
i32.const -8
|
||||||
i32.and
|
i32.and
|
||||||
local.tee $2
|
local.tee $0
|
||||||
i32.const 16
|
i32.const 16
|
||||||
local.get $2
|
local.get $0
|
||||||
i32.const 16
|
i32.const 16
|
||||||
i32.gt_u
|
i32.gt_u
|
||||||
select
|
select
|
||||||
local.tee $0
|
local.tee $2
|
||||||
call $~lib/allocator/tlsf/Root#search
|
call $~lib/allocator/tlsf/Root#search
|
||||||
local.tee $1
|
local.tee $0
|
||||||
i32.eqz
|
i32.eqz
|
||||||
if
|
if
|
||||||
current_memory
|
current_memory
|
||||||
local.tee $2
|
local.tee $1
|
||||||
local.get $0
|
local.get $2
|
||||||
i32.const 65535
|
i32.const 65535
|
||||||
i32.add
|
i32.add
|
||||||
i32.const -65536
|
i32.const -65536
|
||||||
i32.and
|
i32.and
|
||||||
i32.const 16
|
i32.const 16
|
||||||
i32.shr_u
|
i32.shr_u
|
||||||
local.tee $4
|
local.tee $0
|
||||||
local.tee $1
|
|
||||||
local.get $2
|
|
||||||
local.get $1
|
local.get $1
|
||||||
|
local.get $0
|
||||||
i32.gt_s
|
i32.gt_s
|
||||||
select
|
select
|
||||||
grow_memory
|
grow_memory
|
||||||
i32.const 0
|
i32.const 0
|
||||||
i32.lt_s
|
i32.lt_s
|
||||||
if
|
if
|
||||||
local.get $4
|
local.get $0
|
||||||
grow_memory
|
grow_memory
|
||||||
i32.const 0
|
i32.const 0
|
||||||
i32.lt_s
|
i32.lt_s
|
||||||
@ -1127,7 +1126,7 @@
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
local.get $3
|
local.get $3
|
||||||
local.get $2
|
local.get $1
|
||||||
i32.const 16
|
i32.const 16
|
||||||
i32.shl
|
i32.shl
|
||||||
current_memory
|
current_memory
|
||||||
@ -1135,12 +1134,11 @@
|
|||||||
i32.shl
|
i32.shl
|
||||||
call $~lib/allocator/tlsf/Root#addMemory
|
call $~lib/allocator/tlsf/Root#addMemory
|
||||||
local.get $3
|
local.get $3
|
||||||
local.get $0
|
|
||||||
call $~lib/allocator/tlsf/Root#search
|
|
||||||
local.tee $2
|
|
||||||
if (result i32)
|
|
||||||
local.get $2
|
local.get $2
|
||||||
else
|
call $~lib/allocator/tlsf/Root#search
|
||||||
|
local.tee $0
|
||||||
|
i32.eqz
|
||||||
|
if
|
||||||
i32.const 0
|
i32.const 0
|
||||||
i32.const 16
|
i32.const 16
|
||||||
i32.const 467
|
i32.const 467
|
||||||
@ -1148,15 +1146,13 @@
|
|||||||
call $~lib/env/abort
|
call $~lib/env/abort
|
||||||
unreachable
|
unreachable
|
||||||
end
|
end
|
||||||
local.set $1
|
|
||||||
end
|
end
|
||||||
local.get $1
|
local.get $0
|
||||||
i32.load
|
i32.load
|
||||||
i32.const -4
|
i32.const -4
|
||||||
i32.and
|
i32.and
|
||||||
local.get $0
|
local.get $2
|
||||||
i32.lt_u
|
i32.lt_u
|
||||||
end
|
|
||||||
if
|
if
|
||||||
i32.const 0
|
i32.const 0
|
||||||
i32.const 16
|
i32.const 16
|
||||||
@ -1166,8 +1162,8 @@
|
|||||||
unreachable
|
unreachable
|
||||||
end
|
end
|
||||||
local.get $3
|
local.get $3
|
||||||
local.get $1
|
|
||||||
local.get $0
|
local.get $0
|
||||||
|
local.get $2
|
||||||
call $~lib/allocator/tlsf/Root#use
|
call $~lib/allocator/tlsf/Root#use
|
||||||
)
|
)
|
||||||
(func $~lib/runtime/runtime.alloc (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
(func $~lib/runtime/runtime.alloc (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||||
@ -1180,7 +1176,7 @@
|
|||||||
i32.clz
|
i32.clz
|
||||||
i32.sub
|
i32.sub
|
||||||
i32.shl
|
i32.shl
|
||||||
call $~lib/allocator/tlsf/__memory_allocate
|
call $~lib/memory/memory.allocate
|
||||||
local.tee $1
|
local.tee $1
|
||||||
i32.const -1520547049
|
i32.const -1520547049
|
||||||
i32.store
|
i32.store
|
||||||
@ -2094,98 +2090,98 @@
|
|||||||
i32.store8
|
i32.store8
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
(func $~lib/util/memory/memmove (; 19 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
|
(func $~lib/memory/memory.copy (; 19 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||||
(local $3 i32)
|
(local $3 i32)
|
||||||
(local $4 i32)
|
(local $4 i32)
|
||||||
local.get $0
|
block $~lib/util/memory/memmove|inlined.0
|
||||||
local.get $1
|
|
||||||
i32.eq
|
|
||||||
if
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local.get $1
|
|
||||||
local.get $2
|
local.get $2
|
||||||
i32.add
|
local.set $3
|
||||||
|
local.get $1
|
||||||
local.get $0
|
local.get $0
|
||||||
|
local.tee $2
|
||||||
|
i32.eq
|
||||||
|
br_if $~lib/util/memory/memmove|inlined.0
|
||||||
|
local.get $1
|
||||||
|
local.get $3
|
||||||
|
i32.add
|
||||||
|
local.get $2
|
||||||
i32.le_u
|
i32.le_u
|
||||||
local.tee $3
|
local.tee $0
|
||||||
i32.eqz
|
i32.eqz
|
||||||
if
|
if
|
||||||
local.get $0
|
|
||||||
local.get $2
|
local.get $2
|
||||||
|
local.get $3
|
||||||
i32.add
|
i32.add
|
||||||
local.get $1
|
local.get $1
|
||||||
i32.le_u
|
i32.le_u
|
||||||
local.set $3
|
local.set $0
|
||||||
end
|
end
|
||||||
local.get $3
|
local.get $0
|
||||||
if
|
if
|
||||||
local.get $0
|
|
||||||
local.get $1
|
|
||||||
local.get $2
|
local.get $2
|
||||||
|
local.get $1
|
||||||
|
local.get $3
|
||||||
call $~lib/util/memory/memcpy
|
call $~lib/util/memory/memcpy
|
||||||
return
|
br $~lib/util/memory/memmove|inlined.0
|
||||||
end
|
end
|
||||||
local.get $0
|
local.get $2
|
||||||
local.get $1
|
local.get $1
|
||||||
i32.lt_u
|
i32.lt_u
|
||||||
if
|
if
|
||||||
local.get $1
|
local.get $1
|
||||||
i32.const 7
|
i32.const 7
|
||||||
i32.and
|
i32.and
|
||||||
local.get $0
|
local.get $2
|
||||||
i32.const 7
|
i32.const 7
|
||||||
i32.and
|
i32.and
|
||||||
i32.eq
|
i32.eq
|
||||||
if
|
if
|
||||||
loop $continue|0
|
loop $continue|0
|
||||||
local.get $0
|
local.get $2
|
||||||
i32.const 7
|
i32.const 7
|
||||||
i32.and
|
i32.and
|
||||||
if
|
if
|
||||||
local.get $2
|
local.get $3
|
||||||
i32.eqz
|
i32.eqz
|
||||||
if
|
br_if $~lib/util/memory/memmove|inlined.0
|
||||||
return
|
local.get $3
|
||||||
end
|
|
||||||
local.get $2
|
|
||||||
i32.const 1
|
i32.const 1
|
||||||
i32.sub
|
i32.sub
|
||||||
local.set $2
|
local.set $3
|
||||||
local.get $0
|
local.get $2
|
||||||
local.tee $4
|
local.tee $4
|
||||||
i32.const 1
|
i32.const 1
|
||||||
i32.add
|
i32.add
|
||||||
local.set $0
|
local.set $2
|
||||||
local.get $1
|
local.get $1
|
||||||
local.tee $3
|
local.tee $0
|
||||||
i32.const 1
|
i32.const 1
|
||||||
i32.add
|
i32.add
|
||||||
local.set $1
|
local.set $1
|
||||||
local.get $4
|
local.get $4
|
||||||
local.get $3
|
local.get $0
|
||||||
i32.load8_u
|
i32.load8_u
|
||||||
i32.store8
|
i32.store8
|
||||||
br $continue|0
|
br $continue|0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
loop $continue|1
|
loop $continue|1
|
||||||
local.get $2
|
local.get $3
|
||||||
i32.const 8
|
i32.const 8
|
||||||
i32.ge_u
|
i32.ge_u
|
||||||
if
|
if
|
||||||
local.get $0
|
local.get $2
|
||||||
local.get $1
|
local.get $1
|
||||||
i64.load
|
i64.load
|
||||||
i64.store
|
i64.store
|
||||||
local.get $2
|
local.get $3
|
||||||
i32.const 8
|
i32.const 8
|
||||||
i32.sub
|
i32.sub
|
||||||
local.set $2
|
local.set $3
|
||||||
local.get $0
|
local.get $2
|
||||||
i32.const 8
|
i32.const 8
|
||||||
i32.add
|
i32.add
|
||||||
local.set $0
|
local.set $2
|
||||||
local.get $1
|
local.get $1
|
||||||
i32.const 8
|
i32.const 8
|
||||||
i32.add
|
i32.add
|
||||||
@ -2195,26 +2191,26 @@
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
loop $continue|2
|
loop $continue|2
|
||||||
local.get $2
|
local.get $3
|
||||||
if
|
if
|
||||||
local.get $0
|
local.get $2
|
||||||
local.tee $4
|
local.tee $4
|
||||||
i32.const 1
|
i32.const 1
|
||||||
i32.add
|
i32.add
|
||||||
local.set $0
|
local.set $2
|
||||||
local.get $1
|
local.get $1
|
||||||
local.tee $3
|
local.tee $0
|
||||||
i32.const 1
|
i32.const 1
|
||||||
i32.add
|
i32.add
|
||||||
local.set $1
|
local.set $1
|
||||||
local.get $4
|
local.get $4
|
||||||
local.get $3
|
local.get $0
|
||||||
i32.load8_u
|
i32.load8_u
|
||||||
i32.store8
|
i32.store8
|
||||||
local.get $2
|
local.get $3
|
||||||
i32.const 1
|
i32.const 1
|
||||||
i32.sub
|
i32.sub
|
||||||
local.set $2
|
local.set $3
|
||||||
br $continue|2
|
br $continue|2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -2222,31 +2218,29 @@
|
|||||||
local.get $1
|
local.get $1
|
||||||
i32.const 7
|
i32.const 7
|
||||||
i32.and
|
i32.and
|
||||||
local.get $0
|
local.get $2
|
||||||
i32.const 7
|
i32.const 7
|
||||||
i32.and
|
i32.and
|
||||||
i32.eq
|
i32.eq
|
||||||
if
|
if
|
||||||
loop $continue|3
|
loop $continue|3
|
||||||
local.get $0
|
|
||||||
local.get $2
|
local.get $2
|
||||||
|
local.get $3
|
||||||
i32.add
|
i32.add
|
||||||
i32.const 7
|
i32.const 7
|
||||||
i32.and
|
i32.and
|
||||||
if
|
if
|
||||||
local.get $2
|
local.get $3
|
||||||
i32.eqz
|
i32.eqz
|
||||||
if
|
br_if $~lib/util/memory/memmove|inlined.0
|
||||||
return
|
local.get $3
|
||||||
end
|
|
||||||
local.get $2
|
|
||||||
i32.const 1
|
i32.const 1
|
||||||
i32.sub
|
i32.sub
|
||||||
local.tee $2
|
local.tee $3
|
||||||
local.get $0
|
local.get $2
|
||||||
i32.add
|
i32.add
|
||||||
local.get $1
|
local.get $1
|
||||||
local.get $2
|
local.get $3
|
||||||
i32.add
|
i32.add
|
||||||
i32.load8_u
|
i32.load8_u
|
||||||
i32.store8
|
i32.store8
|
||||||
@ -2254,18 +2248,18 @@
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
loop $continue|4
|
loop $continue|4
|
||||||
local.get $2
|
local.get $3
|
||||||
i32.const 8
|
i32.const 8
|
||||||
i32.ge_u
|
i32.ge_u
|
||||||
if
|
if
|
||||||
local.get $2
|
local.get $3
|
||||||
i32.const 8
|
i32.const 8
|
||||||
i32.sub
|
i32.sub
|
||||||
local.tee $2
|
local.tee $3
|
||||||
local.get $0
|
local.get $2
|
||||||
i32.add
|
i32.add
|
||||||
local.get $1
|
local.get $1
|
||||||
local.get $2
|
local.get $3
|
||||||
i32.add
|
i32.add
|
||||||
i64.load
|
i64.load
|
||||||
i64.store
|
i64.store
|
||||||
@ -2274,16 +2268,16 @@
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
loop $continue|5
|
loop $continue|5
|
||||||
local.get $2
|
local.get $3
|
||||||
if
|
if
|
||||||
local.get $2
|
local.get $3
|
||||||
i32.const 1
|
i32.const 1
|
||||||
i32.sub
|
i32.sub
|
||||||
local.tee $2
|
local.tee $3
|
||||||
local.get $0
|
local.get $2
|
||||||
i32.add
|
i32.add
|
||||||
local.get $1
|
local.get $1
|
||||||
local.get $2
|
local.get $3
|
||||||
i32.add
|
i32.add
|
||||||
i32.load8_u
|
i32.load8_u
|
||||||
i32.store8
|
i32.store8
|
||||||
@ -2291,14 +2285,14 @@
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
)
|
)
|
||||||
(func $~lib/util/memory/memset (; 20 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
|
(func $~lib/memory/memory.fill (; 20 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
|
||||||
(local $2 i32)
|
(local $2 i32)
|
||||||
|
block $~lib/util/memory/memset|inlined.0
|
||||||
local.get $1
|
local.get $1
|
||||||
i32.eqz
|
i32.eqz
|
||||||
if
|
br_if $~lib/util/memory/memset|inlined.0
|
||||||
return
|
|
||||||
end
|
|
||||||
local.get $0
|
local.get $0
|
||||||
i32.const 0
|
i32.const 0
|
||||||
i32.store8
|
i32.store8
|
||||||
@ -2312,9 +2306,7 @@
|
|||||||
local.get $1
|
local.get $1
|
||||||
i32.const 2
|
i32.const 2
|
||||||
i32.le_u
|
i32.le_u
|
||||||
if
|
br_if $~lib/util/memory/memset|inlined.0
|
||||||
return
|
|
||||||
end
|
|
||||||
local.get $0
|
local.get $0
|
||||||
i32.const 1
|
i32.const 1
|
||||||
i32.add
|
i32.add
|
||||||
@ -2341,9 +2333,7 @@
|
|||||||
local.get $1
|
local.get $1
|
||||||
i32.const 6
|
i32.const 6
|
||||||
i32.le_u
|
i32.le_u
|
||||||
if
|
br_if $~lib/util/memory/memset|inlined.0
|
||||||
return
|
|
||||||
end
|
|
||||||
local.get $0
|
local.get $0
|
||||||
i32.const 3
|
i32.const 3
|
||||||
i32.add
|
i32.add
|
||||||
@ -2359,23 +2349,23 @@
|
|||||||
local.get $1
|
local.get $1
|
||||||
i32.const 8
|
i32.const 8
|
||||||
i32.le_u
|
i32.le_u
|
||||||
if
|
br_if $~lib/util/memory/memset|inlined.0
|
||||||
return
|
local.get $1
|
||||||
end
|
|
||||||
i32.const 0
|
i32.const 0
|
||||||
local.get $0
|
local.get $0
|
||||||
i32.sub
|
i32.sub
|
||||||
i32.const 3
|
i32.const 3
|
||||||
i32.and
|
i32.and
|
||||||
local.tee $2
|
local.tee $2
|
||||||
|
i32.sub
|
||||||
|
local.set $1
|
||||||
local.get $0
|
local.get $0
|
||||||
|
local.get $2
|
||||||
i32.add
|
i32.add
|
||||||
local.tee $0
|
local.tee $0
|
||||||
i32.const 0
|
i32.const 0
|
||||||
i32.store
|
i32.store
|
||||||
local.get $1
|
local.get $1
|
||||||
local.get $2
|
|
||||||
i32.sub
|
|
||||||
i32.const -4
|
i32.const -4
|
||||||
i32.and
|
i32.and
|
||||||
local.tee $1
|
local.tee $1
|
||||||
@ -2388,9 +2378,7 @@
|
|||||||
local.get $1
|
local.get $1
|
||||||
i32.const 8
|
i32.const 8
|
||||||
i32.le_u
|
i32.le_u
|
||||||
if
|
br_if $~lib/util/memory/memset|inlined.0
|
||||||
return
|
|
||||||
end
|
|
||||||
local.get $0
|
local.get $0
|
||||||
i32.const 4
|
i32.const 4
|
||||||
i32.add
|
i32.add
|
||||||
@ -2417,9 +2405,7 @@
|
|||||||
local.get $1
|
local.get $1
|
||||||
i32.const 24
|
i32.const 24
|
||||||
i32.le_u
|
i32.le_u
|
||||||
if
|
br_if $~lib/util/memory/memset|inlined.0
|
||||||
return
|
|
||||||
end
|
|
||||||
local.get $0
|
local.get $0
|
||||||
i32.const 12
|
i32.const 12
|
||||||
i32.add
|
i32.add
|
||||||
@ -2510,13 +2496,9 @@
|
|||||||
br $continue|0
|
br $continue|0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
)
|
)
|
||||||
(func $~lib/memory/memory.fill (; 21 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
|
(func $~lib/memory/memory.free (; 21 ;) (type $FUNCSIG$vi) (param $0 i32)
|
||||||
local.get $0
|
|
||||||
local.get $1
|
|
||||||
call $~lib/util/memory/memset
|
|
||||||
)
|
|
||||||
(func $~lib/allocator/tlsf/__memory_free (; 22 ;) (type $FUNCSIG$vi) (param $0 i32)
|
|
||||||
(local $1 i32)
|
(local $1 i32)
|
||||||
(local $2 i32)
|
(local $2 i32)
|
||||||
(local $3 i32)
|
(local $3 i32)
|
||||||
@ -2554,7 +2536,7 @@
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
(func $~lib/runtime/runtime.realloc (; 23 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
(func $~lib/runtime/runtime.realloc (; 22 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||||
(local $2 i32)
|
(local $2 i32)
|
||||||
(local $3 i32)
|
(local $3 i32)
|
||||||
(local $4 i32)
|
(local $4 i32)
|
||||||
@ -2593,7 +2575,7 @@
|
|||||||
i32.lt_u
|
i32.lt_u
|
||||||
if
|
if
|
||||||
local.get $4
|
local.get $4
|
||||||
call $~lib/allocator/tlsf/__memory_allocate
|
call $~lib/memory/memory.allocate
|
||||||
local.tee $5
|
local.tee $5
|
||||||
local.get $3
|
local.get $3
|
||||||
i32.load
|
i32.load
|
||||||
@ -2610,7 +2592,7 @@
|
|||||||
local.tee $4
|
local.tee $4
|
||||||
local.get $0
|
local.get $0
|
||||||
local.get $2
|
local.get $2
|
||||||
call $~lib/util/memory/memmove
|
call $~lib/memory/memory.copy
|
||||||
local.get $2
|
local.get $2
|
||||||
local.get $4
|
local.get $4
|
||||||
i32.add
|
i32.add
|
||||||
@ -2635,7 +2617,7 @@
|
|||||||
unreachable
|
unreachable
|
||||||
end
|
end
|
||||||
local.get $3
|
local.get $3
|
||||||
call $~lib/allocator/tlsf/__memory_free
|
call $~lib/memory/memory.free
|
||||||
else
|
else
|
||||||
local.get $0
|
local.get $0
|
||||||
global.set $std/runtime/register_ref
|
global.set $std/runtime/register_ref
|
||||||
@ -2659,7 +2641,7 @@
|
|||||||
i32.store offset=4
|
i32.store offset=4
|
||||||
local.get $0
|
local.get $0
|
||||||
)
|
)
|
||||||
(func $~lib/runtime/runtime.unrefUnregistered (; 24 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
(func $~lib/runtime/runtime.unrefUnregistered (; 23 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||||
local.get $0
|
local.get $0
|
||||||
i32.const 232
|
i32.const 232
|
||||||
i32.lt_u
|
i32.lt_u
|
||||||
@ -2688,7 +2670,7 @@
|
|||||||
end
|
end
|
||||||
local.get $0
|
local.get $0
|
||||||
)
|
)
|
||||||
(func $start:std/runtime (; 25 ;) (type $FUNCSIG$v)
|
(func $start:std/runtime (; 24 ;) (type $FUNCSIG$v)
|
||||||
(local $0 i32)
|
(local $0 i32)
|
||||||
(local $1 i32)
|
(local $1 i32)
|
||||||
(local $2 i32)
|
(local $2 i32)
|
||||||
@ -2705,20 +2687,20 @@
|
|||||||
i32.clz
|
i32.clz
|
||||||
i32.sub
|
i32.sub
|
||||||
i32.shl
|
i32.shl
|
||||||
local.tee $2
|
local.tee $1
|
||||||
i32.const 0
|
i32.const 0
|
||||||
i32.ne
|
i32.ne
|
||||||
local.tee $1
|
local.tee $2
|
||||||
if
|
if (result i32)
|
||||||
local.get $2
|
local.get $1
|
||||||
i32.const 1
|
i32.const 1
|
||||||
i32.sub
|
i32.sub
|
||||||
local.get $2
|
local.get $1
|
||||||
i32.and
|
i32.and
|
||||||
i32.eqz
|
i32.eqz
|
||||||
local.set $1
|
else
|
||||||
|
local.get $2
|
||||||
end
|
end
|
||||||
local.get $1
|
|
||||||
if
|
if
|
||||||
local.get $0
|
local.get $0
|
||||||
i32.const 1
|
i32.const 1
|
||||||
@ -2746,7 +2728,6 @@
|
|||||||
i32.const 1
|
i32.const 1
|
||||||
i32.const 32
|
i32.const 32
|
||||||
global.get $std/runtime/barrier2
|
global.get $std/runtime/barrier2
|
||||||
local.tee $1
|
|
||||||
i32.const 16
|
i32.const 16
|
||||||
i32.add
|
i32.add
|
||||||
i32.clz
|
i32.clz
|
||||||
@ -2754,7 +2735,7 @@
|
|||||||
i32.shl
|
i32.shl
|
||||||
i32.const 1
|
i32.const 1
|
||||||
i32.const 32
|
i32.const 32
|
||||||
local.get $1
|
global.get $std/runtime/barrier2
|
||||||
i32.const 15
|
i32.const 15
|
||||||
i32.add
|
i32.add
|
||||||
i32.clz
|
i32.clz
|
||||||
@ -2777,7 +2758,6 @@
|
|||||||
i32.const 1
|
i32.const 1
|
||||||
i32.const 32
|
i32.const 32
|
||||||
global.get $std/runtime/barrier3
|
global.get $std/runtime/barrier3
|
||||||
local.tee $1
|
|
||||||
i32.const 16
|
i32.const 16
|
||||||
i32.add
|
i32.add
|
||||||
i32.clz
|
i32.clz
|
||||||
@ -2785,7 +2765,7 @@
|
|||||||
i32.shl
|
i32.shl
|
||||||
i32.const 1
|
i32.const 1
|
||||||
i32.const 32
|
i32.const 32
|
||||||
local.get $1
|
global.get $std/runtime/barrier3
|
||||||
i32.const 15
|
i32.const 15
|
||||||
i32.add
|
i32.add
|
||||||
i32.clz
|
i32.clz
|
||||||
@ -2917,7 +2897,7 @@
|
|||||||
end
|
end
|
||||||
global.get $std/runtime/ref2
|
global.get $std/runtime/ref2
|
||||||
call $~lib/runtime/runtime.unrefUnregistered
|
call $~lib/runtime/runtime.unrefUnregistered
|
||||||
call $~lib/allocator/tlsf/__memory_free
|
call $~lib/memory/memory.free
|
||||||
global.get $std/runtime/barrier2
|
global.get $std/runtime/barrier2
|
||||||
call $~lib/runtime/runtime.alloc
|
call $~lib/runtime/runtime.alloc
|
||||||
global.set $std/runtime/ref3
|
global.set $std/runtime/ref3
|
||||||
@ -3015,10 +2995,10 @@
|
|||||||
unreachable
|
unreachable
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
(func $start (; 26 ;) (type $FUNCSIG$v)
|
(func $start (; 25 ;) (type $FUNCSIG$v)
|
||||||
call $start:std/runtime
|
call $start:std/runtime
|
||||||
)
|
)
|
||||||
(func $null (; 27 ;) (type $FUNCSIG$v)
|
(func $null (; 26 ;) (type $FUNCSIG$v)
|
||||||
nop
|
nop
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user