Fix functional Array & String methods and avoid buffer caching (#415)

This commit is contained in:
Max Graey 2019-01-17 02:34:09 +02:00 committed by Daniel Wirtz
parent df3b2befd7
commit 54b02c287c
11 changed files with 933 additions and 936 deletions

View File

@ -72,17 +72,15 @@ export class Array<T> {
}
every(callbackfn: (element: T, index: i32, array: Array<T>) => bool): bool {
var buffer = this.buffer_;
for (let index = 0, toIndex = this.length_; index < min(toIndex, this.length_); ++index) {
if (!callbackfn(LOAD<T>(buffer, index), index, this)) return false;
for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) {
if (!callbackfn(LOAD<T>(this.buffer_, index), index, this)) return false;
}
return true;
}
findIndex(predicate: (element: T, index: i32, array: Array<T>) => bool): i32 {
var buffer = this.buffer_;
for (let index = 0, toIndex = this.length_; index < min(toIndex, this.length_); ++index) {
if (predicate(LOAD<T>(buffer, index), index, this)) return index;
for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) {
if (predicate(LOAD<T>(this.buffer_, index), index, this)) return index;
}
return -1;
}
@ -193,7 +191,7 @@ export class Array<T> {
concat(items: Array<T>): Array<T> {
var thisLen = this.length_;
var otherLen = items === null ? 0 : items.length_;
var otherLen = select(0, items.length_, items === null);
var outLen = thisLen + otherLen;
var out = new Array<T>(outLen);
@ -250,27 +248,25 @@ export class Array<T> {
}
forEach(callbackfn: (value: T, index: i32, array: Array<T>) => void): void {
for (let index = 0, toIndex = this.length_; index < toIndex && index < this.length_; ++index) {
for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) {
callbackfn(LOAD<T>(this.buffer_, index), index, this);
}
}
map<U>(callbackfn: (value: T, index: i32, array: Array<T>) => U): Array<U> {
var buffer = this.buffer_;
var length = this.length_;
var result = new Array<U>(length);
var resultBuffer = result.buffer_;
var buffer = result.buffer_;
for (let index = 0; index < min(length, this.length_); ++index) {
STORE<U>(resultBuffer, index, callbackfn(LOAD<T>(buffer, index), index, this));
STORE<U>(buffer, index, callbackfn(LOAD<T>(this.buffer_, index), index, this));
}
return result;
}
filter(callbackfn: (value: T, index: i32, array: Array<T>) => bool): Array<T> {
var buffer = this.buffer_;
var result = new Array<T>();
for (let index = 0, toIndex = this.length_; index < min(toIndex, this.length_); ++index) {
let value = LOAD<T>(buffer, index);
for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) {
let value = LOAD<T>(this.buffer_, index);
if (callbackfn(value, index, this)) result.push(value);
}
return result;
@ -281,9 +277,8 @@ export class Array<T> {
initialValue: U
): U {
var accum = initialValue;
var buffer = this.buffer_;
for (let index = 0, toIndex = this.length_; index < min(toIndex, this.length_); ++index) {
accum = callbackfn(accum, LOAD<T>(buffer, index), index, this);
for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) {
accum = callbackfn(accum, LOAD<T>(this.buffer_, index), index, this);
}
return accum;
}
@ -293,9 +288,8 @@ export class Array<T> {
initialValue: U
): U {
var accum = initialValue;
var buffer = this.buffer_;
for (let index: i32 = this.length_ - 1; index >= 0; --index) {
accum = callbackfn(accum, LOAD<T>(buffer, index), index, this);
for (let index = this.length_ - 1; index >= 0; --index) {
accum = callbackfn(accum, LOAD<T>(this.buffer_, index), index, this);
}
return accum;
}
@ -317,9 +311,8 @@ export class Array<T> {
}
some(callbackfn: (element: T, index: i32, array: Array<T>) => bool): bool {
var buffer = this.buffer_;
for (let index = 0, toIndex = this.length_; index < min(toIndex, this.length_); ++index) {
if (callbackfn(LOAD<T>(buffer, index), index, this)) return true;
for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) {
if (callbackfn(LOAD<T>(this.buffer_, index), index, this)) return true;
}
return false;
}
@ -348,20 +341,16 @@ export class Array<T> {
}
slice(begin: i32 = 0, end: i32 = i32.MAX_VALUE): Array<T> {
var length = this.length_;
if (begin < 0) begin = max(length + begin, 0);
else if (begin > length) begin = length;
if (end < 0) end = length + end; // no need to clamp
else if (end > length) end = length;
if (end < begin) end = begin; // ^
var newLength = end - begin;
assert(newLength >= 0);
var sliced = new Array<T>(newLength);
if (newLength) {
var len = this.length_;
begin = begin < 0 ? max(begin + len, 0) : min(begin, len);
end = end < 0 ? max(end + len, 0) : min(end, len);
len = end - begin;
var sliced = new Array<T>(len);
if (len) {
memory.copy(
changetype<usize>(sliced.buffer_) + HEADER_SIZE,
changetype<usize>(this.buffer_) + HEADER_SIZE + (<usize>begin << alignof<T>()),
<usize>newLength << alignof<T>()
<usize>len << alignof<T>()
);
}
return sliced;
@ -430,9 +419,8 @@ export class Array<T> {
var sepLen = separator.length;
var hasSeparator = sepLen != 0;
if (value instanceof bool) {
if (!lastIndex) {
return select<string>("true", "false", LOAD<T,bool>(buffer, 0));
}
if (!lastIndex) return select<string>("true", "false", LOAD<T,bool>(buffer, 0));
let valueLen = 5; // max possible length of element len("false")
let estLen = (valueLen + sepLen) * lastIndex + valueLen;
let result = allocateUnsafeString(estLen);
@ -459,9 +447,8 @@ export class Array<T> {
}
return out;
} else if (isInteger<T>()) {
if (!lastIndex) {
return changetype<string>(itoa<T>(LOAD<T>(buffer, 0)));
}
if (!lastIndex) return changetype<string>(itoa<T>(LOAD<T>(buffer, 0)));
const valueLen = (sizeof<T>() <= 4 ? 10 : 20) + <i32>isSigned<T>();
let estLen = (valueLen + sepLen) * lastIndex + valueLen;
let result = allocateUnsafeString(estLen);
@ -483,9 +470,8 @@ export class Array<T> {
}
return out;
} else if (isFloat<T>()) {
if (!lastIndex) {
return changetype<string>(dtoa(LOAD<T,f64>(buffer, 0)));
}
if (!lastIndex) return changetype<string>(dtoa(LOAD<T,f64>(buffer, 0)));
const valueLen = MAX_DOUBLE_LENGTH;
let estLen = (valueLen + sepLen) * lastIndex + valueLen;
let result = allocateUnsafeString(estLen);
@ -507,9 +493,8 @@ export class Array<T> {
}
return out;
} else if (isString<T>()) {
if (!lastIndex) {
return LOAD<string>(buffer, 0);
}
if (!lastIndex) return LOAD<string>(buffer, 0);
let estLen = 0;
for (let i = 0, len = lastIndex + 1; i < len; ++i) {
estLen += LOAD<string>(buffer, i).length;

View File

@ -451,7 +451,9 @@ export class String {
}
return result;
} else if (!length) {
return <String[]>[changetype<String>("")];
let result = new Array<String>(1);
unchecked(result[0] = changetype<String>(""));
return result;
}
var result = new Array<String>();
var end = 0, start = 0, i = 0;
@ -467,7 +469,11 @@ export class String {
if (++i == limit) return result;
start = end + sepLen;
}
if (!start) return <String[]>[this];
if (!start) {
let result = new Array<String>(1);
unchecked(result[0] = this);
return result;
}
var len = length - start;
if (len > 0) {
let out = allocateUnsafe(len);

View File

@ -2315,7 +2315,7 @@
if
i32.const 0
i32.const 8
i32.const 184
i32.const 182
i32.const 42
call $~lib/env/abort
unreachable
@ -2352,7 +2352,7 @@
if
i32.const 0
i32.const 8
i32.const 246
i32.const 244
i32.const 20
call $~lib/env/abort
unreachable
@ -2381,12 +2381,10 @@
i32.load offset=4
tee_local $2
get_local $1
if (result i32)
get_local $1
i32.load offset=4
else
i32.const 0
end
i32.load offset=4
i32.const 0
get_local $1
select
tee_local $4
i32.add
call $~lib/array/Array<i32>#constructor
@ -2648,7 +2646,7 @@
if
i32.const 0
i32.const 8
i32.const 334
i32.const 327
i32.const 42
call $~lib/env/abort
unreachable
@ -2702,7 +2700,7 @@
if
i32.const 0
i32.const 8
i32.const 305
i32.const 299
i32.const 20
call $~lib/env/abort
unreachable
@ -2992,7 +2990,7 @@
if
i32.const 0
i32.const 8
i32.const 109
i32.const 107
i32.const 41
call $~lib/env/abort
unreachable
@ -3028,10 +3026,6 @@
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
get_local $0
i32.load
set_local $4
get_local $0
i32.load offset=4
set_local $3
@ -3041,16 +3035,17 @@
get_local $3
get_local $0
i32.load offset=4
tee_local $5
tee_local $4
get_local $3
get_local $5
get_local $4
i32.lt_s
select
i32.ge_s
br_if $break|0
i32.const 3
set_global $~argc
get_local $4
get_local $0
i32.load
get_local $2
i32.const 2
i32.shl
@ -3111,10 +3106,6 @@
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
get_local $0
i32.load
set_local $4
get_local $0
i32.load offset=4
set_local $3
@ -3124,16 +3115,17 @@
get_local $3
get_local $0
i32.load offset=4
tee_local $5
tee_local $4
get_local $3
get_local $5
get_local $4
i32.lt_s
select
i32.ge_s
br_if $break|0
i32.const 3
set_global $~argc
get_local $4
get_local $0
i32.load
get_local $2
i32.const 2
i32.shl
@ -3194,10 +3186,6 @@
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
get_local $0
i32.load
set_local $4
get_local $0
i32.load offset=4
set_local $3
@ -3207,16 +3195,17 @@
get_local $3
get_local $0
i32.load offset=4
tee_local $5
tee_local $4
get_local $3
get_local $5
get_local $4
i32.lt_s
select
i32.ge_s
br_if $break|0
i32.const 3
set_global $~argc
get_local $4
get_local $0
i32.load
get_local $2
i32.const 2
i32.shl
@ -3281,21 +3270,18 @@
block $break|0
get_local $0
i32.load offset=4
set_local $4
set_local $3
loop $repeat|0
get_local $2
get_local $3
get_local $0
i32.load offset=4
tee_local $4
get_local $3
get_local $4
i32.lt_s
tee_local $3
if
get_local $2
get_local $0
i32.load offset=4
i32.lt_s
set_local $3
end
get_local $3
i32.eqz
select
i32.ge_s
br_if $break|0
i32.const 3
set_global $~argc
@ -3448,17 +3434,13 @@
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
get_local $0
i32.load
set_local $4
get_local $0
i32.load offset=4
tee_local $3
call $~lib/array/Array<i32>#constructor
tee_local $5
tee_local $4
i32.load
set_local $6
set_local $5
loop $repeat|0
get_local $1
get_local $3
@ -3477,10 +3459,11 @@
i32.const 2
i32.shl
tee_local $2
get_local $6
get_local $5
i32.add
get_local $0
i32.load
get_local $2
get_local $4
i32.add
i32.load offset=8
get_local $1
@ -3495,7 +3478,7 @@
br $repeat|0
end
end
get_local $5
get_local $4
)
(func $start~anonymous|23 (; 52 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
get_local $2
@ -3514,38 +3497,35 @@
(local $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
get_local $0
i32.load
set_local $4
get_local $0
i32.load offset=4
tee_local $3
call $~lib/array/Array<i32>#constructor
tee_local $5
tee_local $4
i32.load
set_local $6
set_local $5
loop $repeat|0
block $break|0
get_local $2
get_local $3
get_local $0
i32.load offset=4
tee_local $7
tee_local $6
get_local $3
get_local $7
get_local $6
i32.lt_s
select
i32.ge_s
br_if $break|0
i32.const 3
set_global $~argc
get_local $6
get_local $5
get_local $2
i32.const 2
i32.shl
i32.add
get_local $4
get_local $0
i32.load
get_local $2
i32.const 2
i32.shl
@ -3563,7 +3543,7 @@
br $repeat|0
end
end
get_local $5
get_local $4
)
(func $start~anonymous|24 (; 54 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
get_global $std/array/i
@ -3592,10 +3572,6 @@
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
get_local $0
i32.load
set_local $6
i32.const 0
call $~lib/array/Array<i32>#constructor
set_local $4
@ -3615,7 +3591,8 @@
select
i32.ge_s
br_if $break|0
get_local $6
get_local $0
i32.load
get_local $2
i32.const 2
i32.shl
@ -3687,10 +3664,6 @@
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
get_local $0
i32.load
set_local $5
get_local $0
i32.load offset=4
set_local $4
@ -3700,9 +3673,9 @@
get_local $4
get_local $0
i32.load offset=4
tee_local $6
tee_local $5
get_local $4
get_local $6
get_local $5
i32.lt_s
select
i32.ge_s
@ -3710,7 +3683,8 @@
i32.const 4
set_global $~argc
get_local $2
get_local $5
get_local $0
i32.load
get_local $3
i32.const 2
i32.shl
@ -3765,10 +3739,6 @@
)
(func $~lib/array/Array<i32>#reduceRight<i32> (; 67 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
get_local $0
i32.load
set_local $4
get_local $0
i32.load offset=4
i32.const 1
@ -3783,7 +3753,8 @@
i32.const 4
set_global $~argc
get_local $2
get_local $4
get_local $0
i32.load
get_local $3
i32.const 2
i32.shl
@ -4249,7 +4220,7 @@
if
i32.const 0
i32.const 8
i32.const 406
i32.const 395
i32.const 4
call $~lib/env/abort
unreachable
@ -4818,7 +4789,7 @@
if
i32.const 0
i32.const 8
i32.const 406
i32.const 395
i32.const 4
call $~lib/env/abort
unreachable
@ -5388,7 +5359,7 @@
if
i32.const 0
i32.const 8
i32.const 406
i32.const 395
i32.const 4
call $~lib/env/abort
unreachable
@ -5771,7 +5742,7 @@
if
i32.const 0
i32.const 8
i32.const 406
i32.const 395
i32.const 4
call $~lib/env/abort
unreachable

View File

@ -2888,7 +2888,7 @@
if
i32.const 0
i32.const 8
i32.const 184
i32.const 182
i32.const 42
call $~lib/env/abort
unreachable
@ -2961,7 +2961,7 @@
if
i32.const 0
i32.const 8
i32.const 246
i32.const 244
i32.const 20
call $~lib/env/abort
unreachable
@ -3003,15 +3003,13 @@
get_local $0
i32.load offset=4
set_local $2
i32.const 0
get_local $1
i32.load offset=4
get_local $1
i32.const 0
i32.eq
if (result i32)
i32.const 0
else
get_local $1
i32.load offset=4
end
select
set_local $3
get_local $2
get_local $3
@ -3394,7 +3392,7 @@
if
i32.const 0
i32.const 8
i32.const 334
i32.const 327
i32.const 42
call $~lib/env/abort
unreachable
@ -3469,7 +3467,7 @@
if
i32.const 0
i32.const 8
i32.const 305
i32.const 299
i32.const 20
call $~lib/env/abort
unreachable
@ -3860,7 +3858,7 @@
if
i32.const 0
i32.const 8
i32.const 109
i32.const 107
i32.const 41
call $~lib/env/abort
unreachable
@ -3904,27 +3902,23 @@
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
get_local $0
i32.load
set_local $2
block $break|0
block
i32.const 0
set_local $3
set_local $2
get_local $0
i32.load offset=4
set_local $4
set_local $3
end
loop $repeat|0
get_local $2
get_local $3
get_local $4
tee_local $5
tee_local $4
get_local $0
i32.load offset=4
tee_local $6
tee_local $5
get_local $4
get_local $5
get_local $6
i32.lt_s
select
i32.lt_s
@ -3934,18 +3928,21 @@
i32.const 3
set_global $~argc
block $~lib/internal/arraybuffer/LOAD<i32,i32>|inlined.9 (result i32)
i32.const 0
get_local $0
i32.load
set_local $5
i32.const 0
set_local $4
get_local $5
get_local $2
get_local $3
i32.const 2
i32.shl
i32.add
get_local $5
get_local $4
i32.add
i32.load offset=8
end
get_local $3
get_local $2
get_local $0
get_local $1
call_indirect (type $iiii)
@ -3953,13 +3950,13 @@
i32.const 0
i32.ne
if
get_local $3
get_local $2
return
end
get_local $3
get_local $2
i32.const 1
i32.add
set_local $3
set_local $2
br $repeat|0
unreachable
end
@ -4009,27 +4006,23 @@
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
get_local $0
i32.load
set_local $2
block $break|0
block
i32.const 0
set_local $3
set_local $2
get_local $0
i32.load offset=4
set_local $4
set_local $3
end
loop $repeat|0
get_local $2
get_local $3
get_local $4
tee_local $5
tee_local $4
get_local $0
i32.load offset=4
tee_local $6
tee_local $5
get_local $4
get_local $5
get_local $6
i32.lt_s
select
i32.lt_s
@ -4039,18 +4032,21 @@
i32.const 3
set_global $~argc
block $~lib/internal/arraybuffer/LOAD<i32,i32>|inlined.11 (result i32)
i32.const 0
get_local $0
i32.load
set_local $5
i32.const 0
set_local $4
get_local $5
get_local $2
get_local $3
i32.const 2
i32.shl
i32.add
get_local $5
get_local $4
i32.add
i32.load offset=8
end
get_local $3
get_local $2
get_local $0
get_local $1
call_indirect (type $iiii)
@ -4062,10 +4058,10 @@
i32.const 0
return
end
get_local $3
get_local $2
i32.const 1
i32.add
set_local $3
set_local $2
br $repeat|0
unreachable
end
@ -4110,27 +4106,23 @@
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
get_local $0
i32.load
set_local $2
block $break|0
block
i32.const 0
set_local $3
set_local $2
get_local $0
i32.load offset=4
set_local $4
set_local $3
end
loop $repeat|0
get_local $2
get_local $3
get_local $4
tee_local $5
tee_local $4
get_local $0
i32.load offset=4
tee_local $6
tee_local $5
get_local $4
get_local $5
get_local $6
i32.lt_s
select
i32.lt_s
@ -4140,18 +4132,21 @@
i32.const 3
set_global $~argc
block $~lib/internal/arraybuffer/LOAD<i32,i32>|inlined.13 (result i32)
i32.const 0
get_local $0
i32.load
set_local $5
i32.const 0
set_local $4
get_local $5
get_local $2
get_local $3
i32.const 2
i32.shl
i32.add
get_local $5
get_local $4
i32.add
i32.load offset=8
end
get_local $3
get_local $2
get_local $0
get_local $1
call_indirect (type $iiii)
@ -4162,10 +4157,10 @@
i32.const 1
return
end
get_local $3
get_local $2
i32.const 1
i32.add
set_local $3
set_local $2
br $repeat|0
unreachable
end
@ -4222,16 +4217,15 @@
loop $repeat|0
get_local $2
get_local $3
i32.lt_s
tee_local $4
if (result i32)
get_local $2
get_local $0
i32.load offset=4
i32.lt_s
else
get_local $4
end
get_local $0
i32.load offset=4
tee_local $5
get_local $4
get_local $5
i32.lt_s
select
i32.lt_s
i32.eqz
br_if $break|0
block
@ -4477,33 +4471,29 @@
(local $5 i32)
(local $6 i32)
(local $7 i32)
(local $8 i32)
(local $9 f32)
get_local $0
i32.load
set_local $2
(local $8 f32)
get_local $0
i32.load offset=4
set_local $3
set_local $2
i32.const 0
get_local $3
get_local $2
call $~lib/array/Array<f32>#constructor
set_local $4
get_local $4
set_local $3
get_local $3
i32.load
set_local $5
set_local $4
block $break|0
i32.const 0
set_local $6
set_local $5
loop $repeat|0
get_local $6
get_local $3
tee_local $7
get_local $5
get_local $2
tee_local $6
get_local $0
i32.load offset=4
tee_local $8
tee_local $7
get_local $6
get_local $7
get_local $8
i32.lt_s
select
i32.lt_s
@ -4514,10 +4504,13 @@
i32.const 3
set_global $~argc
block $~lib/internal/arraybuffer/LOAD<i32,i32>|inlined.15 (result i32)
get_local $0
i32.load
set_local $6
i32.const 0
set_local $7
get_local $2
get_local $6
get_local $5
i32.const 2
i32.shl
i32.add
@ -4525,34 +4518,34 @@
i32.add
i32.load offset=8
end
get_local $6
get_local $5
get_local $0
get_local $1
call_indirect (type $iiif)
end
set_local $9
set_local $8
i32.const 0
set_local $7
get_local $4
get_local $5
get_local $6
i32.const 2
i32.shl
i32.add
get_local $7
i32.add
get_local $9
get_local $8
f32.store offset=8
end
get_local $6
get_local $5
i32.const 1
i32.add
set_local $6
set_local $5
br $repeat|0
unreachable
end
unreachable
end
get_local $4
get_local $3
)
(func $~lib/array/Array<f32>#__get (; 67 ;) (type $iif) (param $0 i32) (param $1 i32) (result f32)
(local $2 i32)
@ -4599,32 +4592,28 @@
(local $5 i32)
(local $6 i32)
(local $7 i32)
(local $8 i32)
get_local $0
i32.load
set_local $2
get_local $0
i32.load offset=4
set_local $3
set_local $2
i32.const 0
get_local $3
get_local $2
call $~lib/array/Array<i32>#constructor
set_local $4
get_local $4
set_local $3
get_local $3
i32.load
set_local $5
set_local $4
block $break|0
i32.const 0
set_local $6
set_local $5
loop $repeat|0
get_local $6
get_local $3
tee_local $7
get_local $5
get_local $2
tee_local $6
get_local $0
i32.load offset=4
tee_local $8
tee_local $7
get_local $6
get_local $7
get_local $8
i32.lt_s
select
i32.lt_s
@ -4635,10 +4624,13 @@
i32.const 3
set_global $~argc
block $~lib/internal/arraybuffer/LOAD<i32,i32>|inlined.16 (result i32)
get_local $0
i32.load
set_local $6
i32.const 0
set_local $7
get_local $2
get_local $6
get_local $5
i32.const 2
i32.shl
i32.add
@ -4646,34 +4638,34 @@
i32.add
i32.load offset=8
end
get_local $6
get_local $5
get_local $0
get_local $1
call_indirect (type $iiii)
end
set_local $7
i32.const 0
set_local $8
set_local $6
get_local $4
get_local $5
get_local $6
i32.const 2
i32.shl
i32.add
get_local $8
get_local $6
i32.add
get_local $7
i32.store offset=8
end
get_local $6
get_local $5
i32.const 1
i32.add
set_local $6
set_local $5
br $repeat|0
unreachable
end
unreachable
end
get_local $4
get_local $3
)
(func $start~anonymous|24 (; 70 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
get_global $std/array/i
@ -4703,31 +4695,27 @@
(local $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
get_local $0
i32.load
set_local $2
i32.const 0
i32.const 0
call $~lib/array/Array<i32>#constructor
set_local $3
set_local $2
block $break|0
block
i32.const 0
set_local $4
set_local $3
get_local $0
i32.load offset=4
set_local $5
set_local $4
end
loop $repeat|0
get_local $3
get_local $4
get_local $5
tee_local $6
tee_local $5
get_local $0
i32.load offset=4
tee_local $7
tee_local $6
get_local $5
get_local $6
get_local $7
i32.lt_s
select
i32.lt_s
@ -4735,10 +4723,13 @@
br_if $break|0
block
block $~lib/internal/arraybuffer/LOAD<i32,i32>|inlined.17 (result i32)
get_local $0
i32.load
set_local $5
i32.const 0
set_local $6
get_local $2
get_local $4
get_local $5
get_local $3
i32.const 2
i32.shl
i32.add
@ -4751,7 +4742,7 @@
i32.const 3
set_global $~argc
get_local $6
get_local $4
get_local $3
get_local $0
get_local $1
call_indirect (type $iiii)
@ -4759,22 +4750,22 @@
i32.const 0
i32.ne
if
get_local $3
get_local $2
get_local $6
call $~lib/array/Array<i32>#push
drop
end
end
get_local $4
get_local $3
i32.const 1
i32.add
set_local $4
set_local $3
br $repeat|0
unreachable
end
unreachable
end
get_local $3
get_local $2
)
(func $start~anonymous|27 (; 74 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
get_local $2
@ -4821,29 +4812,25 @@
(local $5 i32)
(local $6 i32)
(local $7 i32)
(local $8 i32)
get_local $2
set_local $3
get_local $0
i32.load
set_local $4
block $break|0
block
i32.const 0
set_local $5
set_local $4
get_local $0
i32.load offset=4
set_local $6
set_local $5
end
loop $repeat|0
get_local $4
get_local $5
get_local $6
tee_local $7
tee_local $6
get_local $0
i32.load offset=4
tee_local $8
tee_local $7
get_local $6
get_local $7
get_local $8
i32.lt_s
select
i32.lt_s
@ -4854,10 +4841,13 @@
set_global $~argc
get_local $3
block $~lib/internal/arraybuffer/LOAD<i32,i32>|inlined.18 (result i32)
get_local $0
i32.load
set_local $6
i32.const 0
set_local $7
get_local $6
get_local $4
get_local $5
i32.const 2
i32.shl
i32.add
@ -4865,16 +4855,16 @@
i32.add
i32.load offset=8
end
get_local $5
get_local $4
get_local $0
get_local $1
call_indirect (type $iiiii)
end
set_local $3
get_local $5
get_local $4
i32.const 1
i32.add
set_local $5
set_local $4
br $repeat|0
unreachable
end
@ -4905,29 +4895,25 @@
(local $5 i32)
(local $6 i32)
(local $7 i32)
(local $8 i32)
get_local $2
set_local $3
get_local $0
i32.load
set_local $4
block $break|0
block
i32.const 0
set_local $5
set_local $4
get_local $0
i32.load offset=4
set_local $6
set_local $5
end
loop $repeat|0
get_local $4
get_local $5
get_local $6
tee_local $7
tee_local $6
get_local $0
i32.load offset=4
tee_local $8
tee_local $7
get_local $6
get_local $7
get_local $8
i32.lt_s
select
i32.lt_s
@ -4938,10 +4924,13 @@
set_global $~argc
get_local $3
block $~lib/internal/arraybuffer/LOAD<i32,i32>|inlined.19 (result i32)
get_local $0
i32.load
set_local $6
i32.const 0
set_local $7
get_local $6
get_local $4
get_local $5
i32.const 2
i32.shl
i32.add
@ -4949,16 +4938,16 @@
i32.add
i32.load offset=8
end
get_local $5
get_local $4
get_local $0
get_local $1
call_indirect (type $iiiii)
end
set_local $3
get_local $5
get_local $4
i32.const 1
i32.add
set_local $5
set_local $4
br $repeat|0
unreachable
end
@ -5012,17 +5001,14 @@
(local $6 i32)
get_local $2
set_local $3
get_local $0
i32.load
set_local $4
block $break|0
get_local $0
i32.load offset=4
i32.const 1
i32.sub
set_local $5
set_local $4
loop $repeat|0
get_local $5
get_local $4
i32.const 0
i32.ge_s
i32.eqz
@ -5032,10 +5018,13 @@
set_global $~argc
get_local $3
block $~lib/internal/arraybuffer/LOAD<i32,i32>|inlined.20 (result i32)
get_local $0
i32.load
set_local $5
i32.const 0
set_local $6
get_local $4
get_local $5
get_local $4
i32.const 2
i32.shl
i32.add
@ -5043,16 +5032,16 @@
i32.add
i32.load offset=8
end
get_local $5
get_local $4
get_local $0
get_local $1
call_indirect (type $iiiii)
end
set_local $3
get_local $5
get_local $4
i32.const 1
i32.sub
set_local $5
set_local $4
br $repeat|0
unreachable
end
@ -5084,17 +5073,14 @@
(local $6 i32)
get_local $2
set_local $3
get_local $0
i32.load
set_local $4
block $break|0
get_local $0
i32.load offset=4
i32.const 1
i32.sub
set_local $5
set_local $4
loop $repeat|0
get_local $5
get_local $4
i32.const 0
i32.ge_s
i32.eqz
@ -5104,10 +5090,13 @@
set_global $~argc
get_local $3
block $~lib/internal/arraybuffer/LOAD<i32,i32>|inlined.21 (result i32)
get_local $0
i32.load
set_local $5
i32.const 0
set_local $6
get_local $4
get_local $5
get_local $4
i32.const 2
i32.shl
i32.add
@ -5115,16 +5104,16 @@
i32.add
i32.load offset=8
end
get_local $5
get_local $4
get_local $0
get_local $1
call_indirect (type $iiiii)
end
set_local $3
get_local $5
get_local $4
i32.const 1
i32.sub
set_local $5
set_local $4
br $repeat|0
unreachable
end
@ -5796,7 +5785,7 @@
if
i32.const 0
i32.const 8
i32.const 406
i32.const 395
i32.const 4
call $~lib/env/abort
unreachable
@ -6578,7 +6567,7 @@
if
i32.const 0
i32.const 8
i32.const 406
i32.const 395
i32.const 4
call $~lib/env/abort
unreachable
@ -7387,7 +7376,7 @@
if
i32.const 0
i32.const 8
i32.const 406
i32.const 395
i32.const 4
call $~lib/env/abort
unreachable
@ -8061,7 +8050,7 @@
if
i32.const 0
i32.const 8
i32.const 406
i32.const 395
i32.const 4
call $~lib/env/abort
unreachable
@ -8521,7 +8510,7 @@
if
i32.const 0
i32.const 8
i32.const 109
i32.const 107
i32.const 41
call $~lib/env/abort
unreachable
@ -8766,7 +8755,7 @@
if
i32.const 0
i32.const 8
i32.const 406
i32.const 395
i32.const 4
call $~lib/env/abort
unreachable
@ -9034,7 +9023,7 @@
if
i32.const 0
i32.const 8
i32.const 109
i32.const 107
i32.const 41
call $~lib/env/abort
unreachable
@ -9242,7 +9231,7 @@
if
i32.const 0
i32.const 8
i32.const 406
i32.const 395
i32.const 4
call $~lib/env/abort
unreachable
@ -9753,7 +9742,7 @@
if
i32.const 0
i32.const 8
i32.const 406
i32.const 395
i32.const 4
call $~lib/env/abort
unreachable
@ -10353,7 +10342,7 @@
if
i32.const 0
i32.const 8
i32.const 109
i32.const 107
i32.const 41
call $~lib/env/abort
unreachable

View File

@ -1882,7 +1882,7 @@
if
i32.const 0
i32.const 72
i32.const 109
i32.const 107
i32.const 41
call $~lib/env/abort
unreachable

View File

@ -2414,7 +2414,7 @@
if
i32.const 0
i32.const 72
i32.const 109
i32.const 107
i32.const 41
call $~lib/env/abort
unreachable

View File

@ -1998,7 +1998,7 @@
if
i32.const 0
i32.const 184
i32.const 109
i32.const 107
i32.const 41
call $~lib/env/abort
unreachable
@ -2081,7 +2081,7 @@
if
i32.const 0
i32.const 184
i32.const 109
i32.const 107
i32.const 41
call $~lib/env/abort
unreachable
@ -2164,7 +2164,7 @@
if
i32.const 0
i32.const 184
i32.const 109
i32.const 107
i32.const 41
call $~lib/env/abort
unreachable
@ -2247,7 +2247,7 @@
if
i32.const 0
i32.const 184
i32.const 109
i32.const 107
i32.const 41
call $~lib/env/abort
unreachable

View File

@ -1575,7 +1575,7 @@
if
i32.const 0
i32.const 72
i32.const 521
i32.const 527
i32.const 8
call $~lib/env/abort
unreachable
@ -1622,7 +1622,7 @@
if
i32.const 0
i32.const 72
i32.const 525
i32.const 531
i32.const 8
call $~lib/env/abort
unreachable
@ -1695,7 +1695,7 @@
if
i32.const 0
i32.const 72
i32.const 537
i32.const 543
i32.const 8
call $~lib/env/abort
unreachable
@ -1748,7 +1748,7 @@
if
i32.const 0
i32.const 72
i32.const 546
i32.const 552
i32.const 4
call $~lib/env/abort
unreachable

View File

@ -2001,7 +2001,7 @@
if
i32.const 0
i32.const 72
i32.const 521
i32.const 527
i32.const 8
call $~lib/env/abort
unreachable
@ -2055,7 +2055,7 @@
if
i32.const 0
i32.const 72
i32.const 525
i32.const 531
i32.const 8
call $~lib/env/abort
unreachable
@ -2150,7 +2150,7 @@
if
i32.const 0
i32.const 72
i32.const 537
i32.const 543
i32.const 8
call $~lib/env/abort
unreachable
@ -2213,7 +2213,7 @@
if
i32.const 0
i32.const 72
i32.const 546
i32.const 552
i32.const 4
call $~lib/env/abort
unreachable

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff