mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-04-25 15:12:12 +00:00
Release on shrink/zero on grow in std/array, managed copyWithin
This commit is contained in:
parent
b7ca4baf42
commit
3229b71d91
@ -35,8 +35,6 @@ export class Array<T> extends ArrayBufferView {
|
||||
// length is modified in a way that a null value would exist. Otherwise, the compiler wouldn't be
|
||||
// able to guarantee type-safety anymore. For lack of a better word, such an array is "holey".
|
||||
|
||||
// Also note that capacity, not length, indicates the actual retained contents.
|
||||
|
||||
private length_: i32;
|
||||
|
||||
static isArray<U>(value: U): bool {
|
||||
@ -69,14 +67,23 @@ export class Array<T> extends ArrayBufferView {
|
||||
return this.length_;
|
||||
}
|
||||
|
||||
set length(length: i32) {
|
||||
set length(newLength: i32) {
|
||||
var oldLength = this.length_;
|
||||
if (isReference<T>()) {
|
||||
if (!isNullable<T>()) {
|
||||
if (<u32>length > <u32>this.length_) throw new Error(E_HOLEYARRAY);
|
||||
if (<u32>newLength > <u32>oldLength) throw new Error(E_HOLEYARRAY);
|
||||
}
|
||||
}
|
||||
ensureSize(changetype<usize>(this), length, alignof<T>());
|
||||
this.length_ = length;
|
||||
ensureSize(changetype<usize>(this), newLength, alignof<T>());
|
||||
if (isManaged<T>()) { // release no longer used refs
|
||||
if (oldLength > newLength) {
|
||||
let dataStart = this.dataStart;
|
||||
do __release(load<usize>(dataStart + (<usize>--oldLength << alignof<T>())));
|
||||
while (oldLength > newLength);
|
||||
// no need to zero memory on shrink -> is zeroed on grow
|
||||
}
|
||||
}
|
||||
this.length_ = newLength;
|
||||
}
|
||||
|
||||
every(fn: (value: T, index: i32, array: Array<T>) => bool): bool {
|
||||
@ -195,12 +202,7 @@ export class Array<T> extends ArrayBufferView {
|
||||
var newLength = length + 1;
|
||||
ensureSize(changetype<usize>(this), newLength, alignof<T>());
|
||||
if (isManaged<T>()) {
|
||||
let offset = this.dataStart + (<usize>length << alignof<T>());
|
||||
let oldRef: usize = load<usize>(offset);
|
||||
if (changetype<usize>(value) != oldRef) {
|
||||
store<usize>(offset, __retain(changetype<usize>(value)));
|
||||
__release(oldRef);
|
||||
}
|
||||
store<usize>(this.dataStart + (<usize>length << alignof<T>()), __retain(changetype<usize>(value)));
|
||||
} else {
|
||||
store<T>(this.dataStart + (<usize>length << alignof<T>()), value);
|
||||
}
|
||||
@ -247,23 +249,35 @@ export class Array<T> extends ArrayBufferView {
|
||||
var count = min(last - from, len - to);
|
||||
|
||||
if (isManaged<T>()) {
|
||||
// TODO: retain/release + consider intersection, only releasing what's removed
|
||||
ERROR("not implemented");
|
||||
} else {
|
||||
if (from < to && to < (from + count)) {
|
||||
if (from < to && to < (from + count)) { // right to left
|
||||
from += count - 1;
|
||||
to += count - 1;
|
||||
while (count) {
|
||||
store<T>(dataStart + (<usize>to << alignof<T>()), load<T>(dataStart + (<usize>from << alignof<T>())));
|
||||
let oldRef: usize = load<usize>(dataStart + (<usize>to << alignof<T>()));
|
||||
let newRef: usize = load<usize>(dataStart + (<usize>from << alignof<T>()));
|
||||
if (newRef != oldRef) {
|
||||
store<usize>(dataStart + (<usize>to << alignof<T>()), __retain(newRef));
|
||||
__release(oldRef);
|
||||
}
|
||||
--from, --to, --count;
|
||||
}
|
||||
} else {
|
||||
memory.copy(
|
||||
dataStart + (<usize>to << alignof<T>()),
|
||||
dataStart + (<usize>from << alignof<T>()),
|
||||
<usize>count << alignof<T>()
|
||||
);
|
||||
} else { // left to right
|
||||
while (count) {
|
||||
let oldRef: usize = load<usize>(dataStart + (<usize>to << alignof<T>()));
|
||||
let newRef: usize = load<usize>(dataStart + (<usize>from << alignof<T>()));
|
||||
if (newRef != oldRef) {
|
||||
store<usize>(dataStart + (<usize>to << alignof<T>()), __retain(newRef));
|
||||
__release(oldRef);
|
||||
}
|
||||
++from, ++to, --count;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
memory.copy( // is memmove
|
||||
dataStart + (<usize>to << alignof<T>()),
|
||||
dataStart + (<usize>from << alignof<T>()),
|
||||
<usize>count << alignof<T>()
|
||||
);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@ -273,7 +287,7 @@ export class Array<T> extends ArrayBufferView {
|
||||
if (length < 1) throw new RangeError(E_EMPTYARRAY);
|
||||
var element = load<T>(this.dataStart + (<usize>(--length) << alignof<T>()));
|
||||
this.length_ = length;
|
||||
return element;
|
||||
return element; // no need to retain -> is moved
|
||||
}
|
||||
|
||||
forEach(fn: (value: T, index: i32, array: Array<T>) => void): void {
|
||||
@ -345,7 +359,7 @@ export class Array<T> extends ArrayBufferView {
|
||||
<T>null
|
||||
);
|
||||
this.length_ = lastIndex;
|
||||
return element;
|
||||
return element; // no need to retain -> is moved
|
||||
}
|
||||
|
||||
some(fn: (value: T, index: i32, array: Array<T>) => bool): bool {
|
||||
@ -408,7 +422,7 @@ export class Array<T> extends ArrayBufferView {
|
||||
store<usize>(resultStart + (<usize>i << alignof<T>()),
|
||||
load<usize>(thisBase + (<usize>i << alignof<T>()))
|
||||
);
|
||||
// element is moved, so refcount doesn't change
|
||||
// no need to retain -> is moved
|
||||
}
|
||||
} else {
|
||||
memory.copy(
|
||||
@ -713,7 +727,7 @@ export class Array<T> extends ArrayBufferView {
|
||||
@unsafe private __visit_impl(cookie: u32): void {
|
||||
if (isManaged<T>()) {
|
||||
let cur = this.dataStart;
|
||||
let end = cur + <usize>this.dataLength;
|
||||
let end = cur + (<usize>this.length_ << alignof<T>());
|
||||
while (cur < end) {
|
||||
let val = load<usize>(cur);
|
||||
if (val) __visit(val, cookie);
|
||||
|
@ -64,7 +64,7 @@
|
||||
if
|
||||
i32.const 24
|
||||
i32.const 136
|
||||
i32.const 99
|
||||
i32.const 106
|
||||
i32.const 45
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -78,7 +78,7 @@
|
||||
if
|
||||
i32.const 184
|
||||
i32.const 136
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -105,7 +105,7 @@
|
||||
if
|
||||
i32.const 184
|
||||
i32.const 136
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
|
@ -106,7 +106,7 @@
|
||||
if
|
||||
i32.const 24
|
||||
i32.const 136
|
||||
i32.const 99
|
||||
i32.const 106
|
||||
i32.const 45
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -120,7 +120,7 @@
|
||||
if
|
||||
i32.const 184
|
||||
i32.const 136
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -168,7 +168,7 @@
|
||||
if
|
||||
i32.const 184
|
||||
i32.const 136
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
|
@ -2015,7 +2015,7 @@
|
||||
if
|
||||
i32.const 424
|
||||
i32.const 376
|
||||
i32.const 273
|
||||
i32.const 287
|
||||
i32.const 20
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -2038,7 +2038,6 @@
|
||||
(func $~lib/array/Array<~lib/string/String>#push (; 32 ;) (type $FUNCSIG$vi) (param $0 i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
i32.const 584
|
||||
call $~lib/rt/pure/__retain
|
||||
drop
|
||||
@ -2056,19 +2055,9 @@
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.tee $1
|
||||
i32.load
|
||||
local.tee $3
|
||||
i32.const 584
|
||||
i32.ne
|
||||
if
|
||||
local.get $1
|
||||
i32.const 584
|
||||
call $~lib/rt/pure/__retain
|
||||
i32.store
|
||||
local.get $3
|
||||
call $~lib/rt/pure/__release
|
||||
end
|
||||
call $~lib/rt/pure/__retain
|
||||
i32.store
|
||||
local.get $0
|
||||
local.get $2
|
||||
i32.store offset=12
|
||||
@ -2738,7 +2727,9 @@
|
||||
i32.load offset=4
|
||||
local.tee $2
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.load offset=12
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.set $0
|
||||
loop $continue|0
|
||||
|
@ -3782,7 +3782,7 @@
|
||||
if
|
||||
i32.const 424
|
||||
i32.const 376
|
||||
i32.const 273
|
||||
i32.const 287
|
||||
i32.const 20
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -3824,7 +3824,7 @@
|
||||
if
|
||||
i32.const 472
|
||||
i32.const 376
|
||||
i32.const 58
|
||||
i32.const 56
|
||||
i32.const 20
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -3855,7 +3855,7 @@
|
||||
if
|
||||
i32.const 472
|
||||
i32.const 376
|
||||
i32.const 58
|
||||
i32.const 56
|
||||
i32.const 20
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -3869,7 +3869,6 @@
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
local.get $1
|
||||
call $~lib/rt/pure/__retain
|
||||
drop
|
||||
@ -3890,29 +3889,17 @@
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.set $4
|
||||
local.get $4
|
||||
i32.load
|
||||
local.set $5
|
||||
local.get $1
|
||||
local.get $5
|
||||
i32.ne
|
||||
if
|
||||
local.get $4
|
||||
local.get $1
|
||||
call $~lib/rt/pure/__retain
|
||||
i32.store
|
||||
local.get $5
|
||||
call $~lib/rt/pure/__release
|
||||
end
|
||||
call $~lib/rt/pure/__retain
|
||||
i32.store
|
||||
local.get $0
|
||||
local.get $3
|
||||
i32.store offset=12
|
||||
local.get $3
|
||||
local.set $5
|
||||
local.set $4
|
||||
local.get $1
|
||||
call $~lib/rt/pure/__release
|
||||
local.get $5
|
||||
local.get $4
|
||||
)
|
||||
(func $~lib/string/String#get:length (; 37 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
@ -4728,7 +4715,9 @@
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.load offset=12
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.set $3
|
||||
block $break|0
|
||||
@ -4764,7 +4753,9 @@
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.load offset=12
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.set $3
|
||||
block $break|0
|
||||
|
@ -26,7 +26,7 @@
|
||||
if
|
||||
i32.const 24
|
||||
i32.const 136
|
||||
i32.const 99
|
||||
i32.const 106
|
||||
i32.const 45
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -40,7 +40,7 @@
|
||||
if
|
||||
i32.const 184
|
||||
i32.const 136
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -63,7 +63,7 @@
|
||||
if
|
||||
i32.const 184
|
||||
i32.const 136
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
|
@ -43,7 +43,7 @@
|
||||
if
|
||||
i32.const 24
|
||||
i32.const 136
|
||||
i32.const 99
|
||||
i32.const 106
|
||||
i32.const 45
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -57,7 +57,7 @@
|
||||
if
|
||||
i32.const 184
|
||||
i32.const 136
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -85,7 +85,7 @@
|
||||
if
|
||||
i32.const 184
|
||||
i32.const 136
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -134,7 +134,7 @@
|
||||
if
|
||||
i32.const 24
|
||||
i32.const 136
|
||||
i32.const 99
|
||||
i32.const 106
|
||||
i32.const 45
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -148,7 +148,7 @@
|
||||
if
|
||||
i32.const 184
|
||||
i32.const 136
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -374,7 +374,7 @@
|
||||
if
|
||||
i32.const 24
|
||||
i32.const 136
|
||||
i32.const 99
|
||||
i32.const 106
|
||||
i32.const 45
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -388,7 +388,7 @@
|
||||
if
|
||||
i32.const 184
|
||||
i32.const 136
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
|
@ -47,7 +47,7 @@
|
||||
if
|
||||
i32.const 136
|
||||
i32.const 192
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -68,7 +68,7 @@
|
||||
if
|
||||
i32.const 136
|
||||
i32.const 192
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -2170,7 +2170,9 @@
|
||||
i32.load offset=4
|
||||
local.tee $2
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.load offset=12
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.set $0
|
||||
loop $continue|0
|
||||
|
@ -70,7 +70,7 @@
|
||||
if
|
||||
i32.const 136
|
||||
i32.const 192
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -102,7 +102,7 @@
|
||||
if
|
||||
i32.const 136
|
||||
i32.const 192
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -4009,7 +4009,9 @@
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.load offset=12
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.set $3
|
||||
block $break|0
|
||||
@ -4045,7 +4047,9 @@
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.load offset=12
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.set $3
|
||||
block $break|0
|
||||
|
@ -2367,7 +2367,7 @@
|
||||
if
|
||||
i32.const 176
|
||||
i32.const 488
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -2521,7 +2521,7 @@
|
||||
if
|
||||
i32.const 176
|
||||
i32.const 488
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -2858,7 +2858,7 @@
|
||||
if
|
||||
i32.const 872
|
||||
i32.const 488
|
||||
i32.const 273
|
||||
i32.const 287
|
||||
i32.const 20
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -2905,7 +2905,7 @@
|
||||
call $~lib/rt/pure/__release
|
||||
i32.const 272
|
||||
i32.const 488
|
||||
i32.const 215
|
||||
i32.const 217
|
||||
i32.const 59
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -2942,9 +2942,6 @@
|
||||
(func $~lib/array/Array<i32>#copyWithin (; 50 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $0
|
||||
i32.load offset=12
|
||||
@ -2954,6 +2951,9 @@
|
||||
i32.lt_s
|
||||
select
|
||||
local.set $3
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
local.tee $5
|
||||
local.get $1
|
||||
i32.const 0
|
||||
i32.lt_s
|
||||
@ -2975,7 +2975,10 @@
|
||||
i32.lt_s
|
||||
select
|
||||
end
|
||||
local.set $1
|
||||
local.tee $1
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $2
|
||||
i32.const 0
|
||||
i32.lt_s
|
||||
@ -2997,7 +3000,11 @@
|
||||
i32.lt_s
|
||||
select
|
||||
end
|
||||
local.set $2
|
||||
local.tee $2
|
||||
i32.const 2
|
||||
i32.shl
|
||||
local.get $5
|
||||
i32.add
|
||||
local.get $3
|
||||
i32.const 0
|
||||
i32.lt_s
|
||||
@ -3021,84 +3028,18 @@
|
||||
end
|
||||
local.get $2
|
||||
i32.sub
|
||||
local.tee $3
|
||||
local.tee $2
|
||||
local.get $4
|
||||
local.get $1
|
||||
i32.sub
|
||||
local.tee $4
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.lt_s
|
||||
select
|
||||
local.set $3
|
||||
local.get $1
|
||||
local.get $2
|
||||
local.get $3
|
||||
i32.add
|
||||
i32.lt_s
|
||||
i32.const 0
|
||||
local.tee $1
|
||||
local.get $2
|
||||
local.get $1
|
||||
i32.lt_s
|
||||
select
|
||||
if
|
||||
local.get $3
|
||||
i32.const 1
|
||||
i32.sub
|
||||
local.tee $4
|
||||
local.get $2
|
||||
i32.add
|
||||
local.set $2
|
||||
local.get $1
|
||||
local.get $4
|
||||
i32.add
|
||||
local.set $1
|
||||
loop $continue|0
|
||||
local.get $3
|
||||
if
|
||||
local.get $1
|
||||
i32.const 2
|
||||
i32.shl
|
||||
local.get $5
|
||||
i32.add
|
||||
local.get $2
|
||||
i32.const 2
|
||||
i32.shl
|
||||
local.get $5
|
||||
i32.add
|
||||
i32.load
|
||||
i32.store
|
||||
local.get $2
|
||||
i32.const 1
|
||||
i32.sub
|
||||
local.set $2
|
||||
local.get $1
|
||||
i32.const 1
|
||||
i32.sub
|
||||
local.set $1
|
||||
local.get $3
|
||||
i32.const 1
|
||||
i32.sub
|
||||
local.set $3
|
||||
br $continue|0
|
||||
end
|
||||
end
|
||||
else
|
||||
local.get $1
|
||||
i32.const 2
|
||||
i32.shl
|
||||
local.get $5
|
||||
i32.add
|
||||
local.get $2
|
||||
i32.const 2
|
||||
i32.shl
|
||||
local.get $5
|
||||
i32.add
|
||||
local.get $3
|
||||
i32.const 2
|
||||
i32.shl
|
||||
call $~lib/memory/memory.copy
|
||||
end
|
||||
i32.const 2
|
||||
i32.shl
|
||||
call $~lib/memory/memory.copy
|
||||
local.get $0
|
||||
call $~lib/rt/pure/__retain
|
||||
)
|
||||
@ -3144,7 +3085,7 @@
|
||||
if
|
||||
i32.const 872
|
||||
i32.const 488
|
||||
i32.const 334
|
||||
i32.const 348
|
||||
i32.const 20
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -3985,7 +3926,7 @@
|
||||
if
|
||||
i32.const 176
|
||||
i32.const 488
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -5397,7 +5338,7 @@
|
||||
if
|
||||
i32.const 176
|
||||
i32.const 488
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -5911,7 +5852,7 @@
|
||||
if
|
||||
i32.const 272
|
||||
i32.const 488
|
||||
i32.const 47
|
||||
i32.const 45
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -6187,7 +6128,7 @@
|
||||
call $~lib/rt/pure/__release
|
||||
i32.const 4040
|
||||
i32.const 488
|
||||
i32.const 114
|
||||
i32.const 121
|
||||
i32.const 38
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -6443,7 +6384,7 @@
|
||||
if
|
||||
i32.const 4040
|
||||
i32.const 488
|
||||
i32.const 99
|
||||
i32.const 106
|
||||
i32.const 45
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -6457,7 +6398,7 @@
|
||||
if
|
||||
i32.const 176
|
||||
i32.const 488
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -6636,7 +6577,7 @@
|
||||
if
|
||||
i32.const 176
|
||||
i32.const 488
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -17031,7 +16972,9 @@
|
||||
i32.load offset=4
|
||||
local.tee $2
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.load offset=12
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.set $0
|
||||
loop $continue|0
|
||||
|
@ -4243,7 +4243,7 @@
|
||||
if
|
||||
i32.const 176
|
||||
i32.const 488
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -4448,7 +4448,7 @@
|
||||
if
|
||||
i32.const 176
|
||||
i32.const 488
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -4856,7 +4856,7 @@
|
||||
if
|
||||
i32.const 176
|
||||
i32.const 488
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -4877,7 +4877,7 @@
|
||||
if
|
||||
i32.const 872
|
||||
i32.const 488
|
||||
i32.const 273
|
||||
i32.const 287
|
||||
i32.const 20
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -4933,7 +4933,7 @@
|
||||
block
|
||||
i32.const 272
|
||||
i32.const 488
|
||||
i32.const 215
|
||||
i32.const 217
|
||||
i32.const 59
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -5087,79 +5087,20 @@
|
||||
i32.lt_s
|
||||
select
|
||||
local.set $11
|
||||
local.get $9
|
||||
local.get $4
|
||||
local.get $8
|
||||
i32.lt_s
|
||||
if (result i32)
|
||||
local.get $8
|
||||
local.get $9
|
||||
local.get $11
|
||||
i32.add
|
||||
i32.lt_s
|
||||
else
|
||||
i32.const 0
|
||||
end
|
||||
if
|
||||
local.get $9
|
||||
local.get $11
|
||||
i32.const 1
|
||||
i32.sub
|
||||
i32.add
|
||||
local.set $9
|
||||
local.get $8
|
||||
local.get $11
|
||||
i32.const 1
|
||||
i32.sub
|
||||
i32.add
|
||||
local.set $8
|
||||
block $break|0
|
||||
loop $continue|0
|
||||
local.get $11
|
||||
if
|
||||
local.get $4
|
||||
local.get $8
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $4
|
||||
local.get $9
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
i32.load
|
||||
i32.store
|
||||
local.get $9
|
||||
i32.const 1
|
||||
i32.sub
|
||||
local.set $9
|
||||
local.get $8
|
||||
i32.const 1
|
||||
i32.sub
|
||||
local.set $8
|
||||
local.get $11
|
||||
i32.const 1
|
||||
i32.sub
|
||||
local.set $11
|
||||
br $continue|0
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
local.get $4
|
||||
local.get $8
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $4
|
||||
local.get $9
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $11
|
||||
i32.const 2
|
||||
i32.shl
|
||||
call $~lib/memory/memory.copy
|
||||
end
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $4
|
||||
local.get $9
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $11
|
||||
i32.const 2
|
||||
i32.shl
|
||||
call $~lib/memory/memory.copy
|
||||
local.get $0
|
||||
call $~lib/rt/pure/__retain
|
||||
)
|
||||
@ -5296,7 +5237,7 @@
|
||||
if
|
||||
i32.const 872
|
||||
i32.const 488
|
||||
i32.const 334
|
||||
i32.const 348
|
||||
i32.const 20
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -6337,7 +6278,7 @@
|
||||
if
|
||||
i32.const 176
|
||||
i32.const 488
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -8288,7 +8229,7 @@
|
||||
if
|
||||
i32.const 176
|
||||
i32.const 488
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -9390,7 +9331,7 @@
|
||||
if
|
||||
i32.const 272
|
||||
i32.const 488
|
||||
i32.const 47
|
||||
i32.const 45
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -9669,7 +9610,7 @@
|
||||
if
|
||||
i32.const 272
|
||||
i32.const 488
|
||||
i32.const 47
|
||||
i32.const 45
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -9739,7 +9680,7 @@
|
||||
block
|
||||
i32.const 4040
|
||||
i32.const 488
|
||||
i32.const 114
|
||||
i32.const 121
|
||||
i32.const 38
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -10033,7 +9974,7 @@
|
||||
if
|
||||
i32.const 4040
|
||||
i32.const 488
|
||||
i32.const 99
|
||||
i32.const 106
|
||||
i32.const 45
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -10047,7 +9988,7 @@
|
||||
if
|
||||
i32.const 176
|
||||
i32.const 488
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -10161,7 +10102,7 @@
|
||||
if
|
||||
i32.const 272
|
||||
i32.const 488
|
||||
i32.const 47
|
||||
i32.const 45
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -10246,7 +10187,7 @@
|
||||
block
|
||||
i32.const 4040
|
||||
i32.const 488
|
||||
i32.const 114
|
||||
i32.const 121
|
||||
i32.const 38
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -10534,7 +10475,7 @@
|
||||
if
|
||||
i32.const 4040
|
||||
i32.const 488
|
||||
i32.const 99
|
||||
i32.const 106
|
||||
i32.const 45
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -10548,7 +10489,7 @@
|
||||
if
|
||||
i32.const 176
|
||||
i32.const 488
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -10853,7 +10794,7 @@
|
||||
if
|
||||
i32.const 176
|
||||
i32.const 488
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -11356,7 +11297,7 @@
|
||||
if
|
||||
i32.const 272
|
||||
i32.const 488
|
||||
i32.const 47
|
||||
i32.const 45
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -11632,7 +11573,7 @@
|
||||
block
|
||||
i32.const 4040
|
||||
i32.const 488
|
||||
i32.const 114
|
||||
i32.const 121
|
||||
i32.const 38
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -11898,7 +11839,7 @@
|
||||
if
|
||||
i32.const 4040
|
||||
i32.const 488
|
||||
i32.const 99
|
||||
i32.const 106
|
||||
i32.const 45
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -11912,7 +11853,7 @@
|
||||
if
|
||||
i32.const 176
|
||||
i32.const 488
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -24186,7 +24127,9 @@
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.load offset=12
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.set $3
|
||||
block $break|0
|
||||
@ -24222,7 +24165,9 @@
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.load offset=12
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.set $3
|
||||
block $break|0
|
||||
@ -24258,7 +24203,9 @@
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.load offset=12
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.set $3
|
||||
block $break|0
|
||||
@ -24294,7 +24241,9 @@
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.load offset=12
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.set $3
|
||||
block $break|0
|
||||
@ -24339,7 +24288,9 @@
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.load offset=12
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.set $3
|
||||
block $break|0
|
||||
@ -24384,7 +24335,9 @@
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.load offset=12
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.set $3
|
||||
block $break|0
|
||||
@ -24420,7 +24373,9 @@
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.load offset=12
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.set $3
|
||||
block $break|0
|
||||
@ -24456,7 +24411,9 @@
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.load offset=12
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.set $3
|
||||
block $break|0
|
||||
|
@ -37,7 +37,7 @@
|
||||
if
|
||||
i32.const 320
|
||||
i32.const 376
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -624,7 +624,7 @@
|
||||
if
|
||||
i32.const 320
|
||||
i32.const 376
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -668,7 +668,7 @@
|
||||
if
|
||||
i32.const 320
|
||||
i32.const 376
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -712,7 +712,7 @@
|
||||
if
|
||||
i32.const 320
|
||||
i32.const 376
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
|
@ -59,7 +59,7 @@
|
||||
if
|
||||
i32.const 320
|
||||
i32.const 376
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -1999,7 +1999,7 @@
|
||||
if
|
||||
i32.const 320
|
||||
i32.const 376
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -2067,7 +2067,7 @@
|
||||
if
|
||||
i32.const 320
|
||||
i32.const 376
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -2135,7 +2135,7 @@
|
||||
if
|
||||
i32.const 320
|
||||
i32.const 376
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
|
@ -3751,7 +3751,6 @@
|
||||
(func $~lib/array/Array<~lib/string/String>#push (; 57 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
local.get $1
|
||||
call $~lib/rt/pure/__retain
|
||||
drop
|
||||
@ -3769,19 +3768,9 @@
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.tee $2
|
||||
i32.load
|
||||
local.tee $4
|
||||
local.get $1
|
||||
i32.ne
|
||||
if
|
||||
local.get $2
|
||||
local.get $1
|
||||
call $~lib/rt/pure/__retain
|
||||
i32.store
|
||||
local.get $4
|
||||
call $~lib/rt/pure/__release
|
||||
end
|
||||
call $~lib/rt/pure/__retain
|
||||
i32.store
|
||||
local.get $0
|
||||
local.get $3
|
||||
i32.store offset=12
|
||||
@ -4018,7 +4007,7 @@
|
||||
if
|
||||
i32.const 2296
|
||||
i32.const 2248
|
||||
i32.const 99
|
||||
i32.const 106
|
||||
i32.const 45
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -4032,7 +4021,7 @@
|
||||
if
|
||||
i32.const 232
|
||||
i32.const 2248
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -9166,7 +9155,9 @@
|
||||
i32.load offset=4
|
||||
local.tee $2
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.load offset=12
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.set $0
|
||||
loop $continue|0
|
||||
|
@ -5943,7 +5943,6 @@
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
local.get $1
|
||||
call $~lib/rt/pure/__retain
|
||||
drop
|
||||
@ -5964,29 +5963,17 @@
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.set $4
|
||||
local.get $4
|
||||
i32.load
|
||||
local.set $5
|
||||
local.get $1
|
||||
local.get $5
|
||||
i32.ne
|
||||
if
|
||||
local.get $4
|
||||
local.get $1
|
||||
call $~lib/rt/pure/__retain
|
||||
i32.store
|
||||
local.get $5
|
||||
call $~lib/rt/pure/__release
|
||||
end
|
||||
call $~lib/rt/pure/__retain
|
||||
i32.store
|
||||
local.get $0
|
||||
local.get $3
|
||||
i32.store offset=12
|
||||
local.get $3
|
||||
local.set $5
|
||||
local.set $4
|
||||
local.get $1
|
||||
call $~lib/rt/pure/__release
|
||||
local.get $5
|
||||
local.get $4
|
||||
)
|
||||
(func $~lib/string/String#split (; 61 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
(local $3 i32)
|
||||
@ -6331,7 +6318,7 @@
|
||||
if
|
||||
i32.const 2296
|
||||
i32.const 2248
|
||||
i32.const 99
|
||||
i32.const 106
|
||||
i32.const 45
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -6345,7 +6332,7 @@
|
||||
if
|
||||
i32.const 232
|
||||
i32.const 2248
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -12448,7 +12435,9 @@
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.load offset=12
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.set $3
|
||||
block $break|0
|
||||
|
@ -3354,7 +3354,7 @@
|
||||
if
|
||||
i32.const 336
|
||||
i32.const 512
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -3605,7 +3605,7 @@
|
||||
if
|
||||
i32.const 336
|
||||
i32.const 512
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
|
@ -5439,7 +5439,7 @@
|
||||
if
|
||||
i32.const 336
|
||||
i32.const 512
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
@ -5766,7 +5766,7 @@
|
||||
if
|
||||
i32.const 336
|
||||
i32.const 512
|
||||
i32.const 102
|
||||
i32.const 109
|
||||
i32.const 61
|
||||
call $~lib/builtins/abort
|
||||
unreachable
|
||||
|
Loading…
x
Reference in New Issue
Block a user