guard, info on never null, more general array rt

This commit is contained in:
dcode 2019-03-22 15:43:07 +01:00
parent c2ac1a0375
commit 7c0dc66849
69 changed files with 6066 additions and 4930 deletions

View File

@ -189,7 +189,7 @@ export namespace LibrarySymbols {
export const REGISTER = "REGISTER";
export const RETAIN = "RETAIN";
export const RELEASE = "RELEASE";
export const WRAPARRAY = "WRAPARRAY";
export const MAKEARRAY = "MAKEARRAY";
// other
export const length = "length";
export const byteLength = "byteLength";

View File

@ -2689,10 +2689,11 @@ export class Compiler extends DiagnosticEmitter {
switch (expression.assertionKind) {
case AssertionKind.PREFIX:
case AssertionKind.AS: {
let flow = this.currentFlow;
let toType = this.resolver.resolveType( // reports
assert(expression.toType),
this.currentFlow.actualFunction,
this.currentFlow.contextualTypeArguments
flow.actualFunction,
flow.contextualTypeArguments
);
if (!toType) return this.module.createUnreachable();
return this.compileExpression(expression.expression, toType, ConversionKind.EXPLICIT, WrapMode.NONE);
@ -2700,6 +2701,22 @@ export class Compiler extends DiagnosticEmitter {
case AssertionKind.NONNULL: {
assert(!expression.toType);
let expr = this.compileExpressionRetainType(expression.expression, contextualType, WrapMode.NONE);
let type = this.currentType;
if (!type.is(TypeFlags.NULLABLE | TypeFlags.REFERENCE)) {
this.info(
DiagnosticCode.Expression_is_never_null,
expression.expression.range
);
} else if (!this.options.noAssert) {
let module = this.module;
let flow = this.currentFlow;
let tempIndex = flow.getAndFreeTempLocal(type, !flow.canOverflow(expr, type)).index;
expr = module.createIf(
module.createTeeLocal(tempIndex, expr),
module.createGetLocal(tempIndex, type.toNativeType()),
module.createUnreachable()
);
}
this.currentType = this.currentType.nonNullableType;
return expr;
}
@ -6741,13 +6758,13 @@ export class Compiler extends DiagnosticEmitter {
// otherwise allocate a new array header and make it wrap a copy of the static buffer
} else {
let wrapArrayPrototype = assert(program.wrapArrayPrototype);
let wrapArrayInstance = this.resolver.resolveFunction(wrapArrayPrototype, [ elementType ]);
if (!wrapArrayInstance) {
let makeArrayInstance = this.resolver.resolveFunction(assert(program.makeArrayPrototype), [ elementType ]);
if (!makeArrayInstance) {
this.currentType = arrayType;
return module.createUnreachable();
}
let body = this.makeCallInlinePrechecked(wrapArrayInstance, [
let body = this.makeCallInlinePrechecked(makeArrayInstance, [
this.module.createI32(length),
program.options.isWasm64
? this.module.createI64(i64_low(bufferAddress), i64_high(bufferAddress))
: this.module.createI32(i64_low(bufferAddress))
@ -6771,14 +6788,18 @@ export class Compiler extends DiagnosticEmitter {
var flow = this.currentFlow;
var tempThis = flow.getTempLocal(arrayType, false);
var tempDataStart = flow.getTempLocal(arrayBufferInstance.type);
var makeArrayInstance = this.resolver.resolveFunction(assert(program.makeArrayPrototype), [ elementType ]);
if (!makeArrayInstance) {
this.currentType = arrayType;
return module.createUnreachable();
}
var stmts = new Array<ExpressionRef>();
// tempThis = new Array<T>(length)
// tempThis = MAKEARRAY<T>(length)
stmts.push(
module.createSetLocal(tempThis.index,
this.makeCallDirect(assert(arrayInstance.constructorInstance), [
module.createI32(0), // this
this.makeCallInlinePrechecked(makeArrayInstance, [
module.createI32(length)
], reportNode)
], 0, true),
)
);
// tempData = tempThis.dataStart

View File

@ -35,6 +35,7 @@ export enum DiagnosticCode {
_0_must_be_a_value_between_1_and_2_inclusive = 222,
_0_must_be_a_power_of_two = 223,
TODO_Cannot_inline_inferred_calls_and_specific_internals_yet = 224,
Expression_is_never_null = 225,
Unterminated_string_literal = 1002,
Identifier_expected = 1003,
_0_expected = 1005,
@ -171,6 +172,7 @@ export function diagnosticCodeToString(code: DiagnosticCode): string {
case 222: return "'{0}' must be a value between '{1}' and '{2}' inclusive.";
case 223: return "'{0}' must be a power of two.";
case 224: return "TODO: Cannot inline inferred calls and specific internals yet.";
case 225: return "Expression is never 'null'.";
case 1002: return "Unterminated string literal.";
case 1003: return "Identifier expected.";
case 1005: return "'{0}' expected.";

View File

@ -27,6 +27,7 @@
"'{0}' must be a value between '{1}' and '{2}' inclusive.": 222,
"'{0}' must be a power of two.": 223,
"TODO: Cannot inline inferred calls and specific internals yet.": 224,
"Expression is never 'null'.": 225,
"Unterminated string literal.": 1002,
"Identifier expected.": 1003,

View File

@ -368,8 +368,8 @@ export class Program extends DiagnosticEmitter {
retainPrototype: FunctionPrototype | null = null;
/** Runtime release function. */
releasePrototype: FunctionPrototype | null = null;
/** Runtime wrap array function. */
wrapArrayPrototype: FunctionPrototype | null = null;
/** Runtime make array function. */
makeArrayPrototype: FunctionPrototype | null = null;
/** Next class id. */
nextClassId: u32 = 1;
@ -838,9 +838,9 @@ export class Program extends DiagnosticEmitter {
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.releasePrototype = <FunctionPrototype>element;
}
if (element = this.lookupGlobal(LibrarySymbols.WRAPARRAY)) {
if (element = this.lookupGlobal(LibrarySymbols.MAKEARRAY)) {
assert(element.kind == ElementKind.FUNCTION_PROTOTYPE);
this.wrapArrayPrototype = <FunctionPrototype>element;
this.makeArrayPrototype = <FunctionPrototype>element;
}
}

View File

@ -1,13 +1,17 @@
import { ALLOCATE, REALLOCATE, DISCARD, RETAIN, RELEASE, REGISTER, MAX_BYTELENGTH, ArrayBufferView, MOVE } from "./runtime";
import {
ALLOCATE, REALLOCATE, DISCARD, RETAIN, RELEASE, REGISTER, MAX_BYTELENGTH, MOVE, MAKEARRAY,
ArrayBufferView
} from "./runtime";
import { ArrayBuffer } from "./arraybuffer";
import { COMPARATOR, SORT } from "./util/sort";
import { itoa, dtoa, itoa_stream, dtoa_stream, MAX_DOUBLE_LENGTH } from "./util/number";
import { isArray as builtin_isArray } from "./builtins";
import { E_INDEXOUTOFRANGE, E_INVALIDLENGTH, E_EMPTYARRAY, E_HOLEYARRAY } from "./util/error";
/** Ensures that the given array has _at least_ the specified capacity. */
function ensureCapacity(array: ArrayBufferView, minCapacity: i32, alignLog2: u32): void {
if (<u32>minCapacity > <u32>array.dataLength >>> alignLog2) {
if (<u32>minCapacity > <u32>(MAX_BYTELENGTH >>> alignLog2)) throw new RangeError("Invalid array length");
if (<u32>minCapacity > <u32>(MAX_BYTELENGTH >>> alignLog2)) throw new RangeError(E_INVALIDLENGTH);
let oldData = array.data;
let newByteLength = minCapacity << alignLog2;
let newData = REALLOCATE(changetype<usize>(oldData), <usize>newByteLength); // registers on move
@ -26,28 +30,29 @@ export class Array<T> extends ArrayBufferView {
// to work with typed and normal arrays interchangeably. Technically, normal arrays do not need
// `dataStart` (equals `data`) and `dataLength` (equals computed `data.byteLength`).
// Also note that Array<T> with non-nullable T must guard against implicit null values whenever
// 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".
private length_: i32;
static isArray<U>(value: U): bool {
return builtin_isArray(value) && value !== null;
}
static create<T>(capacity: i32): Array<T> {
if (<u32>capacity > <u32>MAX_BYTELENGTH >>> alignof<T>()) throw new RangeError("Invalid length");
var buffer = new ArrayBuffer(capacity = capacity << alignof<T>());
var out = REGISTER<Array<T>>(ALLOCATE(offsetof<Array<T>>()));
out.data = buffer; // links
out.dataStart = changetype<usize>(buffer);
out.dataLength = capacity;
out.length_ = 0;
return out;
static create<T>(capacity: i32 = 0): Array<T> {
if (<u32>capacity > <u32>MAX_BYTELENGTH >>> alignof<T>()) throw new RangeError(E_INVALIDLENGTH);
var array = MAKEARRAY<T>(capacity);
memory.fill(array.dataStart, 0, <usize>array.dataLength);
array.length_ = 0; // !
return array;
}
constructor(length: i32 = 0) {
super(length, alignof<T>());
if (isReference<T>()) {
if (!isNullable<T>()) {
if (length) throw new Error("T must be nullable if length > 0");
if (length) throw new Error(E_HOLEYARRAY);
}
}
this.length_ = length;
@ -62,6 +67,11 @@ export class Array<T> extends ArrayBufferView {
}
set length(length: i32) {
if (isReference<T>()) {
if (!isNullable<T>()) {
if (<u32>length > <u32>this.length_) throw new Error(E_HOLEYARRAY);
}
}
ensureCapacity(this, length, alignof<T>());
this.length_ = length;
}
@ -82,24 +92,39 @@ export class Array<T> extends ArrayBufferView {
@operator("[]") // unchecked is built-in
private __get(index: i32): T {
if (<u32>index >= <u32>this.dataLength >>> alignof<T>()) throw new RangeError("Offset out of bounds");
if (isReference<T>()) {
if (!isNullable<T>()) {
if (<u32>index >= <u32>this.length_) throw new Error(E_HOLEYARRAY);
}
}
if (<u32>index >= <u32>this.dataLength >>> alignof<T>()) throw new RangeError(E_INDEXOUTOFRANGE);
return load<T>(this.dataStart + (<usize>index << alignof<T>()));
}
@operator("[]=") // unchecked is built-in
private __set(index: i32, value: T): void {
var length = this.length_;
if (isReference<T>()) {
if (!isNullable<T>()) {
if (<u32>index > <u32>length) throw new Error(E_HOLEYARRAY);
}
}
ensureCapacity(this, index + 1, alignof<T>());
if (isManaged<T>()) {
let offset = this.dataStart + (<usize>index << alignof<T>());
let oldValue = load<T>(offset);
if (value !== oldValue) {
RELEASE<T,this>(oldValue, this);
if (isNullable<T>()) {
RELEASE<T,this>(oldValue, this); // handles != null
} else if (oldValue !== null) {
RELEASE<T,this>(oldValue, this); // requires != null
}
store<T>(offset, RETAIN<T,this>(value, this));
}
} else {
store<T>(this.dataStart + (<usize>index << alignof<T>()), value);
}
if (index >= this.length_) this.length_ = index + 1;
if (index >= length) this.length_ = index + 1;
}
fill(value: T, start: i32 = 0, end: i32 = i32.MAX_VALUE): this {
@ -167,7 +192,7 @@ export class Array<T> extends ArrayBufferView {
concat(other: Array<T>): Array<T> {
var thisLen = this.length_;
var otherLen = select(0, other.length_, other === null);
var out = new Array<T>(thisLen + otherLen);
var out = MAKEARRAY<T>(thisLen + otherLen);
var outStart = out.dataStart;
var thisSize = <usize>thisLen << alignof<T>();
if (isManaged<T>()) {
@ -217,7 +242,7 @@ export class Array<T> extends ArrayBufferView {
pop(): T {
var length = this.length_;
if (length < 1) throw new RangeError("Array is empty");
if (length < 1) throw new RangeError(E_EMPTYARRAY);
var element = load<T>(this.dataStart + (<usize>(--length) << alignof<T>()));
this.length_ = length;
return element;
@ -231,7 +256,7 @@ export class Array<T> extends ArrayBufferView {
map<U>(callbackfn: (value: T, index: i32, array: Array<T>) => U): Array<U> {
var length = this.length_;
var out = new Array<U>(length);
var out = MAKEARRAY<U>(length);
var outStart = out.dataStart;
for (let index = 0; index < min(length, this.length_); ++index) {
let value = load<T>(this.dataStart + (<usize>index << alignof<T>()));
@ -246,7 +271,7 @@ export class Array<T> extends ArrayBufferView {
}
filter(callbackfn: (value: T, index: i32, array: Array<T>) => bool): Array<T> {
var result = new Array<T>();
var result = MAKEARRAY<T>(0);
for (let index = 0, length = this.length_; index < min(length, this.length_); ++index) {
let value = load<T>(this.dataStart + (<usize>index << alignof<T>()));
if (callbackfn(value, index, this)) result.push(value);
@ -278,7 +303,7 @@ export class Array<T> extends ArrayBufferView {
shift(): T {
var length = this.length_;
if (length < 1) throw new RangeError("Array is empty");
if (length < 1) throw new RangeError(E_EMPTYARRAY);
var base = this.dataStart;
var element = load<T>(base);
var lastIndex = length - 1;
@ -325,7 +350,7 @@ export class Array<T> extends ArrayBufferView {
begin = begin < 0 ? max(begin + length, 0) : min(begin, length);
end = end < 0 ? max(end + length, 0) : min(end , length);
length = max(end - begin, 0);
var slice = new Array<T>(length);
var slice = MAKEARRAY<T>(length);
var sliceBase = slice.dataStart;
var thisBase = this.dataStart + (<usize>begin << alignof<T>());
for (let i = 0; i < length; ++i) {
@ -344,7 +369,7 @@ export class Array<T> extends ArrayBufferView {
var length = this.length_;
start = start < 0 ? max<i32>(length + start, 0) : min<i32>(start, length);
deleteCount = max<i32>(min<i32>(deleteCount, length - start), 0);
var result = new Array<T>(deleteCount);
var result = MAKEARRAY<T>(deleteCount);
var resultStart = result.dataStart;
var thisStart = this.dataStart;
var thisBase = thisStart + (<usize>start << alignof<T>());

View File

@ -1,4 +1,5 @@
import { ALLOCATE, REGISTER, HEADER, HEADER_SIZE, MAX_BYTELENGTH } from "./runtime";
import { E_INVALIDLENGTH } from "./util/error";
@sealed export class ArrayBuffer {
@ -21,7 +22,7 @@ import { ALLOCATE, REGISTER, HEADER, HEADER_SIZE, MAX_BYTELENGTH } from "./runti
}
constructor(length: i32) {
if (<u32>length > <u32>MAX_BYTELENGTH) throw new RangeError("Invalid array buffer length");
if (<u32>length > <u32>MAX_BYTELENGTH) throw new RangeError(E_INVALIDLENGTH);
var buffer = ALLOCATE(<usize>length);
memory.fill(changetype<usize>(buffer), 0, <usize>length);
return REGISTER<ArrayBuffer>(buffer);

View File

@ -1,5 +1,6 @@
import { MAX_BYTELENGTH } from "./runtime";
import { ArrayBuffer } from "./arraybuffer";
import { E_INDEXOUTOFRANGE, E_INVALIDLENGTH } from "./util/error";
// TODO: there is probably a smarter way to check byteOffset for accesses larger than 1 byte
@ -12,11 +13,13 @@ export class DataView {
constructor(
buffer: ArrayBuffer,
byteOffset: i32 = 0,
byteLength: i32 = i32.MIN_VALUE // FIXME
byteLength: i32 = i32.MIN_VALUE // FIXME: TS2304: Cannot find name 'buffer'.
) {
if (byteLength === i32.MIN_VALUE) byteLength = buffer.byteLength - byteOffset; // FIXME
if (<u32>byteLength > <u32>MAX_BYTELENGTH) throw new RangeError("Invalid byteLength");
if (<u32>byteOffset + byteLength > <u32>buffer.byteLength) throw new RangeError("Invalid length");
if (
i32(<u32>byteLength > <u32>MAX_BYTELENGTH) |
i32(<u32>byteOffset + byteLength > <u32>buffer.byteLength)
) throw new RangeError(E_INVALIDLENGTH);
this.data = buffer; // links
var dataStart = changetype<usize>(buffer) + <usize>byteOffset;
this.dataStart = dataStart;
@ -39,7 +42,7 @@ export class DataView {
if (
i32(byteOffset < 0) |
i32(byteOffset + 4 > this.dataLength)
) throw new Error("Offset out of bounds");
) throw new RangeError(E_INDEXOUTOFRANGE);
return littleEndian
? load<f32>(this.dataStart + <usize>byteOffset)
: reinterpret<f32>(
@ -53,7 +56,7 @@ export class DataView {
if (
i32(byteOffset < 0) |
i32(byteOffset + 8 > this.dataLength)
) throw new Error("Offset out of bounds");
) throw new RangeError(E_INDEXOUTOFRANGE);
return littleEndian
? load<f64>(this.dataStart + <usize>byteOffset)
: reinterpret<f64>(
@ -64,7 +67,7 @@ export class DataView {
}
getInt8(byteOffset: i32): i8 {
if (<u32>byteOffset >= <u32>this.dataLength) throw new Error("Offset out of bounds");
if (<u32>byteOffset >= <u32>this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE);
return load<i8>(this.dataStart + <usize>byteOffset);
}
@ -72,7 +75,7 @@ export class DataView {
if (
i32(byteOffset < 0) |
i32(byteOffset + 2 > this.dataLength)
) throw new Error("Offset out of bounds");
) throw new RangeError(E_INDEXOUTOFRANGE);
var result: i16 = load<i16>(this.dataStart + <usize>byteOffset);
return littleEndian ? result : bswap<i16>(result);
}
@ -81,13 +84,13 @@ export class DataView {
if (
i32(byteOffset < 0) |
i32(byteOffset + 4 > this.dataLength)
) throw new Error("Offset out of bounds");
) throw new RangeError(E_INDEXOUTOFRANGE);
var result: i32 = load<i32>(this.dataStart + <usize>byteOffset);
return littleEndian ? result : bswap<i32>(result);
}
getUint8(byteOffset: i32): u8 {
if (<u32>byteOffset >= <u32>this.dataLength) throw new Error("Offset out of bounds");
if (<u32>byteOffset >= <u32>this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE);
return load<u8>(this.dataStart + <usize>byteOffset);
}
@ -95,7 +98,7 @@ export class DataView {
if (
i32(byteOffset < 0) |
i32(byteOffset + 2 > this.dataLength)
) throw new Error("Offset out of bounds");
) throw new RangeError(E_INDEXOUTOFRANGE);
var result: u16 = load<u16>(this.dataStart + <usize>byteOffset);
return littleEndian ? result : bswap<u16>(result);
}
@ -104,7 +107,7 @@ export class DataView {
if (
i32(byteOffset < 0) |
i32(byteOffset + 4 > this.dataLength)
) throw new Error("Offset out of bounds");
) throw new RangeError(E_INDEXOUTOFRANGE);
var result: u32 = load<u32>(this.dataStart + <usize>byteOffset);
return littleEndian ? result : bswap<u32>(result);
}
@ -113,7 +116,7 @@ export class DataView {
if (
i32(byteOffset < 0) |
i32(byteOffset + 4 > this.dataLength)
) throw new Error("Offset out of bounds");
) throw new RangeError(E_INDEXOUTOFRANGE);
if (littleEndian) store<f32>(this.dataStart + <usize>byteOffset, value);
else store<u32>(this.dataStart + <usize>byteOffset, bswap<u32>(reinterpret<u32>(value)));
}
@ -122,13 +125,13 @@ export class DataView {
if (
i32(byteOffset < 0) |
i32(byteOffset + 8 > this.dataLength)
) throw new Error("Offset out of bounds");
) throw new RangeError(E_INDEXOUTOFRANGE);
if (littleEndian) store<f64>(this.dataStart + <usize>byteOffset, value);
else store<u64>(this.dataStart + <usize>byteOffset, bswap<u64>(reinterpret<u64>(value)));
}
setInt8(byteOffset: i32, value: i8): void {
if (<u32>byteOffset >= <u32>this.dataLength) throw new Error("Offset out of bounds");
if (<u32>byteOffset >= <u32>this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE);
store<i8>(this.dataStart + <usize>byteOffset, value);
}
@ -136,7 +139,7 @@ export class DataView {
if (
i32(byteOffset < 0) |
i32(byteOffset + 2 > this.dataLength)
) throw new Error("Offset out of bounds");
) throw new RangeError(E_INDEXOUTOFRANGE);
store<i16>(this.dataStart + <usize>byteOffset, littleEndian ? value : bswap<i16>(value));
}
@ -144,12 +147,12 @@ export class DataView {
if (
i32(byteOffset < 0) |
i32(byteOffset + 4 > this.dataLength)
) throw new Error("Offset out of bounds");
) throw new RangeError(E_INDEXOUTOFRANGE);
store<i32>(this.dataStart + <usize>byteOffset, littleEndian ? value : bswap<i32>(value));
}
setUint8(byteOffset: i32, value: u8): void {
if (<u32>byteOffset >= <u32>this.dataLength) throw new Error("Offset out of bounds");
if (<u32>byteOffset >= <u32>this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE);
store<u8>(this.dataStart + <usize>byteOffset, value);
}
@ -157,7 +160,7 @@ export class DataView {
if (
i32(byteOffset < 0) |
i32(byteOffset + 2 > this.dataLength)
) throw new Error("Offset out of bounds");
) throw new RangeError(E_INDEXOUTOFRANGE);
store<u16>(this.dataStart + <usize>byteOffset, littleEndian ? value : bswap<u16>(value));
}
@ -165,7 +168,7 @@ export class DataView {
if (
i32(byteOffset < 0) |
i32(byteOffset + 4 > this.dataLength)
) throw new Error("Offset out of bounds");
) throw new RangeError(E_INDEXOUTOFRANGE);
store<u32>(this.dataStart + <usize>byteOffset, littleEndian ? value : bswap<u32>(value));
}
@ -175,7 +178,7 @@ export class DataView {
if (
i32(byteOffset < 0) |
i32(byteOffset + 8 > this.dataLength)
) throw new Error("Offset out of bounds");
) throw new RangeError(E_INDEXOUTOFRANGE);
var result: i64 = load<i64>(this.dataStart + <usize>byteOffset);
return littleEndian ? result : bswap<i64>(result);
}
@ -184,7 +187,7 @@ export class DataView {
if (
i32(byteOffset < 0) |
i32(byteOffset + 8 > this.dataLength)
) throw new Error("Offset out of bounds");
) throw new RangeError(E_INDEXOUTOFRANGE);
var result = load<u64>(this.dataStart + <usize>byteOffset);
return littleEndian ? result : bswap<u64>(result);
}
@ -193,7 +196,7 @@ export class DataView {
if (
i32(byteOffset < 0) |
i32(byteOffset + 8 > this.dataLength)
) throw new Error("Offset out of bounds");
) throw new RangeError(E_INDEXOUTOFRANGE);
store<i64>(this.dataStart + <usize>byteOffset, littleEndian ? value : bswap<i64>(value));
}
@ -201,7 +204,7 @@ export class DataView {
if (
i32(byteOffset < 0) |
i32(byteOffset + 8 > this.dataLength)
) throw new Error("Offset out of bounds");
) throw new RangeError(E_INDEXOUTOFRANGE);
store<u64>(this.dataStart + <usize>byteOffset, littleEndian ? value : bswap<u64>(value));
}

View File

@ -1,4 +1,5 @@
import { ALLOCATE, REGISTER, MAX_BYTELENGTH, HEADER, HEADER_SIZE, RETAIN, RELEASE } from "./runtime";
import { E_INDEXOUTOFRANGE, E_INVALIDLENGTH, E_HOLEYARRAY } from "./util/error";
// NOTE: DO NOT USE YET!
@ -9,7 +10,12 @@ export class FixedArray<T> {
[key: number]: T;
constructor(length: i32) {
if (<u32>length > <u32>MAX_BYTELENGTH >>> alignof<T>()) throw new RangeError("Invalid length");
if (<u32>length > <u32>MAX_BYTELENGTH >>> alignof<T>()) throw new RangeError(E_INVALIDLENGTH);
if (isReference<T>()) {
if (!isNullable<T>()) {
if (length) throw new Error(E_HOLEYARRAY);
}
}
var outSize = <usize>length << alignof<T>();
var out = ALLOCATE(outSize);
memory.fill(out, 0, outSize);
@ -21,12 +27,12 @@ export class FixedArray<T> {
}
@operator("[]") private __get(index: i32): T {
if (<u32>index >= <u32>this.length) throw new RangeError("Offset out of bounds");
if (<u32>index >= <u32>this.length) throw new RangeError(E_INDEXOUTOFRANGE);
return this.__unchecked_get(index);
}
@operator("[]=") private __set(index: i32, value: T): void {
if (<u32>index >= <u32>this.length) throw new RangeError("Offset out of bounds");
if (<u32>index >= <u32>this.length) throw new RangeError(E_INDEXOUTOFRANGE);
return this.__unchecked_set(index, value);
}

View File

@ -1171,12 +1171,15 @@ declare class Float64Array extends TypedArray<f64> {}
/** Class representing a sequence of values of type `T`. */
declare class Array<T> {
/** Tests if a value is an array. */
static isArray<U>(value: any): value is Array<any>;
/** Creates a new array with at least the specified capacity and length zero. */
static create<T>(capacity?: i32): Array<T>;
[key: number]: T;
/** Current length of the array. */
length: i32;
/** Constructs a new array. */
/** Constructs a new array. If length is greater than zero and T is a non-nullable reference, use `Array.create` instead.*/
constructor(capacity?: i32);
fill(value: T, start?: i32, end?: i32): this;

View File

@ -8,68 +8,7 @@
import { AL_MASK, MAX_SIZE_32 } from "./util/allocator";
import { HEAP_BASE, memory } from "./memory";
// ALLOCATE(size)
// --------------
// Allocates a runtime object that might eventually make its way into GC'ed userland as a
// managed object. Implicitly prepends the common runtime header to the allocation.
//
// REALLOCATE(ref, size)
// ---------------------
// Changes the size of a previously allocated, but not yet registered, runtime object, for
// example when a pre-allocated buffer turned out to be too small or too large. This works by
// aligning dynamic allocations to actual block size internally so in the best case REALLOCATE
// only updates payload size while in the worst case moves the object to a larger block.
//
// DISCARD(ref)
// ------------
// Discards a runtime object that has not been registed and turned out to be unnecessary.
// Essentially undoes the forgoing ALLOCATE. Should be avoided where possible, of course.
//
// REGISTER<T>(ref)
// ----------------
// Registers a runtime object of kind T. Sets the internal class id within the runtime header
// and asserts that the object hasn't been registered yet. If a tracing garbage collector is
// present that requires initial insertion, the macro also forwards a call to it. Once a
// runtime object has been registed (makes it into userland), it cannot be DISCARD'ed anymore.
//
// RETAIN<T,TParent>(ref, parentRef)
// ---------------------------------
// Introduces a new reference to ref hold by parentRef. A tracing garbage collector will most
// likely link the runtime object within its internal graph when RETAIN is called, while a
// reference counting collector will increment the reference count.
//
// RELEASE<T,TParent>(ref, parentRef)
// ----------------------------------
// Releases a reference to ref hold by parentRef. A tracing garbage collector will most likely
// ignore this by design, while a reference counting collector decrements the reference count
// and potentially frees the runtime object.
//
// MOVE<T,TOldParent,TNewParent>(ref, oldParentRef, newParentRef)
// --------------------------------------------------------------
// Moves a reference to ref hold by oldParentRef to be now hold by newParentRef. This is a
// special case of first RELEASE'ing a reference on one and instantly RETAIN'ing the reference
// on another parent. A tracing garbage collector will most likely link the runtime object as if
// RETAIN'ed on the new parent only, while a reference counting collector can skip increment and
// decrement, as decrementing might otherwise involve a costly check for cyclic garbage.
//
// ALLOCATE_UNMANAGED(size)
// ------------------------
// Allocates an unmanaged struct-like object. This is used by the compiler as an abstraction
// to memory.allocate just in case, and is usually not used directly.
//
// WRAPARRAY<T>(buffer)
// --------------------
// Wraps a buffer's data as a standard array of element type T. Used by the compiler when
// creating an array from a static data segment, but is usually not used directly.
//
// HEADER
// ------
// The common runtime object header prepended to all managed objects. Has a size of 16 bytes in
// WASM32 and contains a classId (e.g. for instanceof checks), the allocation size (e.g. for
// .byteLength and .length computation) and additional reserved fields to be used by GC. If no
// GC is present, the HEADER is cut into half excluding the reserved fields, as indicated by
// HEADER_SIZE.
import { Array } from "./array";
/** Whether the memory manager interface is implemented. */
// @ts-ignore: decorator, stub
@ -79,7 +18,13 @@ import { HEAP_BASE, memory } from "./memory";
// @ts-ignore: decorator, stub
@lazy export const GC_IMPLEMENTED: bool = isDefined(__gc_register);
/** Common runtime header. Each managed object has one. */
/**
* The common runtime object header prepended to all managed objects. Has a size of 16 bytes in
* WASM32 and contains a classId (e.g. for instanceof checks), the allocation size (e.g. for
* .byteLength and .length computation) and additional reserved fields to be used by GC. If no
* GC is present, the HEADER is cut into half excluding the reserved fields, as indicated by
* HEADER_SIZE.
*/
@unmanaged export class HEADER {
/** Unique id of the respective class or a magic value if not yet registered.*/
classId: u32;
@ -120,7 +65,10 @@ export function ADJUSTOBLOCK(payloadSize: usize): usize {
return <usize>1 << <usize>(<u32>32 - clz<u32>(payloadSize + HEADER_SIZE - 1));
}
/** Allocates a new object and returns a pointer to its payload. Does not fill. */
/**
* Allocates a runtime object that might eventually make its way into GC'ed userland as a
* managed object. Implicitly prepends the common runtime header to the allocation.
*/
// @ts-ignore: decorator
@unsafe @inline
export function ALLOCATE(payloadSize: usize): usize {
@ -138,14 +86,22 @@ function doAllocate(payloadSize: usize): usize {
return changetype<usize>(header) + HEADER_SIZE;
}
/** Allocates an object explicitly declared as unmanaged and returns a pointer to it. */
/**
* Allocates an unmanaged struct-like object. This is used by the compiler as an abstraction
* to memory.allocate just in case, and is usually not used directly.
*/
// @ts-ignore: decorator
@unsafe @inline
export function ALLOCATE_UNMANAGED(size: usize): usize {
return memory.allocate(size);
}
/** Reallocates an object if necessary. Returns a pointer to its (moved) payload. */
/**
* Changes the size of a previously allocated, but not yet registered, runtime object, for
* example when a pre-allocated buffer turned out to be too small or too large. This works by
* aligning dynamic allocations to actual block size internally so in the best case REALLOCATE
* only updates payload size while in the worst case moves the object to a larger block.
*/
// @ts-ignore: decorator
@unsafe @inline
export function REALLOCATE(ref: usize, newPayloadSize: usize): usize {
@ -195,7 +151,12 @@ function doReallocate(ref: usize, newPayloadSize: usize): usize {
return ref;
}
/** Registers a managed object to be tracked by the garbage collector, if present. */
/**
* Registers a runtime object of kind T. Sets the internal class id within the runtime header
* and asserts that the object hasn't been registered yet. If a tracing garbage collector is
* present that requires initial insertion, the macro usually forwards a call to it. Once a
* runtime object has been registed (makes it into userland), it cannot be DISCARD'ed anymore.
*/
// @ts-ignore: decorator
@unsafe @inline
export function REGISTER<T>(ref: usize): T {
@ -211,7 +172,12 @@ function doRegister(ref: usize, classId: u32): usize {
return ref;
}
/** Retains a registered object. */
/**
* Introduces a new reference to ref hold by parentRef. A tracing garbage collector will most
* likely link the runtime object within its internal graph when RETAIN is called, while a
* reference counting collector will increment the reference count. If a reference is moved
* from one parent to another, use MOVE instead.
*/
// @ts-ignore: decorator
@unsafe @inline
export function RETAIN<T,TParent>(ref: T, parentRef: TParent): T {
@ -234,19 +200,21 @@ function doRetain(ref: usize, parentRef: usize): void {
if (GC_IMPLEMENTED) __gc_retain(changetype<usize>(ref), changetype<usize>(parentRef));
}
/** Releases a registered object. */
/**
* Releases a reference to ref hold by parentRef. A tracing garbage collector will most likely
* ignore this by design, while a reference counting collector decrements the reference count
* and potentially frees the runtime object.
*/
// @ts-ignore: decorator
@unsafe @inline
export function RELEASE<T,TParent>(ref: T, parentRef: TParent): void {
if (!isManaged<T>()) ERROR("managed reference expected");
if (!isManaged<TParent>()) ERROR("managed reference expected");
// FIXME: new Array<Ref>(10) has non-nullable elements but still contains `null`s.
// In the future, something like this should probably initialize with `new Ref()`s.
// if (isNullable<T>()) {
if (isNullable<T>()) {
if (ref !== null) doRelease(changetype<usize>(ref), changetype<usize>(parentRef));
// } else {
// doRelease(changetype<usize>(ref), changetype<usize>(parentRef));
// }
} else {
doRelease(changetype<usize>(ref), changetype<usize>(parentRef));
}
}
function doRelease(ref: usize, parentRef: usize): void {
@ -258,7 +226,13 @@ function doRelease(ref: usize, parentRef: usize): void {
if (GC_IMPLEMENTED) __gc_release(changetype<usize>(ref), changetype<usize>(parentRef));
}
/** Moves a registered object from one parent to another. */
/**
* Moves a reference to ref hold by oldParentRef to be now hold by newParentRef. This is a
* special case of first RELEASE'ing a reference on one and instantly RETAIN'ing the reference
* on another parent. A tracing garbage collector will most likely link the runtime object as if
* RETAIN'ed on the new parent only, while a reference counting collector can skip increment and
* decrement, as decrementing might otherwise involve a costly check for cyclic garbage.
*/
// @ts-ignore: decorator
@unsafe @inline
export function MOVE<T,TOldParent,TNewParent>(ref: T, oldParentRef: TOldParent, newParentRef: TNewParent): T {
@ -293,7 +267,10 @@ function doMove(ref: usize, oldParentRef: usize, newParentRef: usize): void {
}
}
/** Discards an unregistered object that turned out to be unnecessary. */
/**
* Discards a runtime object that has not been registed and turned out to be unnecessary.
* Essentially undoes the forgoing ALLOCATE. Should be avoided where possible.
*/
// @ts-ignore: decorator
@unsafe @inline
export function DISCARD(ref: usize): void {
@ -305,23 +282,27 @@ function doDiscard(ref: usize): void {
memory.free(changetype<usize>(ref - HEADER_SIZE));
}
/** Wraps a static buffer within an array by copying its contents. */
/**
* Makes a new array and optionally initializes is with existing data from source. Used by the
* compiler to either wrap static array data in a new instance or pre-initialize the memory used
* by an array literal. Does not zero the backing buffer!
*/
// @ts-ignore: decorator
@unsafe @inline
export function WRAPARRAY<T>(buffer: ArrayBuffer): T[] {
return changetype<T[]>(doWrapArray(buffer, CLASSID<T[]>(), alignof<T>()));
export function MAKEARRAY<T>(capacity: i32, source: usize = 0): Array<T> {
return changetype<Array<T>>(doMakeArray(capacity, source, CLASSID<T[]>(), alignof<T>()));
}
function doWrapArray(buffer: ArrayBuffer, classId: u32, alignLog2: usize): usize {
function doMakeArray(capacity: i32, source: usize, classId: u32, alignLog2: usize): usize {
var array = doRegister(doAllocate(offsetof<i32[]>()), classId);
var bufferSize = <usize>buffer.byteLength;
var newBuffer = doRegister(doAllocate(bufferSize), classId);
changetype<ArrayBufferView>(array).data = changetype<ArrayBuffer>(newBuffer); // links
changetype<ArrayBufferView>(array).dataStart = changetype<usize>(newBuffer);
var bufferSize = <usize>capacity << alignLog2;
var buffer = doRegister(doAllocate(<usize>capacity << alignLog2), CLASSID<ArrayBuffer>());
changetype<ArrayBufferView>(array).data = changetype<ArrayBuffer>(buffer); // links
changetype<ArrayBufferView>(array).dataStart = buffer;
changetype<ArrayBufferView>(array).dataLength = bufferSize;
store<i32>(changetype<usize>(array), <i32>(bufferSize >>> alignLog2), offsetof<i32[]>("length_"));
memory.copy(changetype<usize>(newBuffer), changetype<usize>(buffer), bufferSize);
return changetype<usize>(array);
store<i32>(changetype<usize>(array), capacity, offsetof<i32[]>("length_"));
if (source) memory.copy(buffer, source, bufferSize);
return array;
}
// Helpers
@ -341,6 +322,7 @@ function assertRegistered(ref: usize): void {
}
import { ArrayBuffer } from "./arraybuffer";
import { E_INVALIDLENGTH } from "./util/error";
/** Maximum byte length of any buffer. */
// @ts-ignore: decorator
@ -363,7 +345,7 @@ export abstract class ArrayBufferView {
dataLength: u32;
protected constructor(length: i32, alignLog2: i32) {
if (<u32>length > <u32>MAX_BYTELENGTH >>> alignLog2) throw new RangeError("Invalid length");
if (<u32>length > <u32>MAX_BYTELENGTH >>> alignLog2) throw new RangeError(E_INVALIDLENGTH);
var buffer = new ArrayBuffer(length = length << alignLog2);
this.data = buffer;
this.dataStart = changetype<usize>(buffer);

View File

@ -1,6 +1,7 @@
import { ALLOCATE, REGISTER, HEADER, HEADER_SIZE, ArrayBufferView, RETAIN } from "./runtime";
import { ALLOCATE, REGISTER, HEADER, HEADER_SIZE, RETAIN, MAKEARRAY, ArrayBufferView } from "./runtime";
import { MAX_SIZE_32 } from "./util/allocator";
import { compareImpl, parse, CharCode, isWhiteSpaceOrLineTerminator } from "./util/string";
import { E_INVALIDLENGTH } from "./util/error";
@sealed export abstract class String {
@ -322,7 +323,7 @@ import { compareImpl, parse, CharCode, isWhiteSpaceOrLineTerminator } from "./ut
// Most browsers can't handle strings 1 << 28 chars or longer
if (count < 0 || <u64>length * count > (1 << 28)) {
throw new RangeError("Invalid count value");
throw new RangeError(E_INVALIDLENGTH);
}
if (count == 0 || !length) return changetype<String>("");
@ -345,16 +346,16 @@ import { compareImpl, parse, CharCode, isWhiteSpaceOrLineTerminator } from "./ut
split(separator: String | null = null, limit: i32 = i32.MAX_VALUE): String[] {
assert(this !== null);
if (!limit) return new Array<String>();
if (!limit) return MAKEARRAY<String>(0);
if (separator === null) return <String[]>[this];
var length: isize = this.length;
var sepLen: isize = separator.length;
if (limit < 0) limit = i32.MAX_VALUE;
if (!sepLen) {
if (!length) return new Array<String>();
if (!length) return MAKEARRAY<String>(0);
// split by chars
length = min<isize>(length, <isize>limit);
let result = new Array<String>(length);
let result = MAKEARRAY<String>(length);
let resultStart = changetype<ArrayBufferView>(result).dataStart;
for (let i: isize = 0; i < length; ++i) {
let charStr = REGISTER<String>(ALLOCATE(2));
@ -371,11 +372,11 @@ import { compareImpl, parse, CharCode, isWhiteSpaceOrLineTerminator } from "./ut
}
return result;
} else if (!length) {
let result = new Array<String>(1);
let result = MAKEARRAY<String>(1);
store<string>(changetype<ArrayBufferView>(result).dataStart, ""); // no need to register/link
return result;
}
var result = new Array<String>();
var result = MAKEARRAY<String>(0);
var end = 0, start = 0, i = 0;
while ((end = this.indexOf(separator!, start)) != -1) {
let len = end - start;
@ -390,7 +391,7 @@ import { compareImpl, parse, CharCode, isWhiteSpaceOrLineTerminator } from "./ut
start = end + sepLen;
}
if (!start) {
let result = new Array<String>(1);
let result = MAKEARRAY<String>(1);
unchecked(result[0] = this);
return result;
}

View File

@ -1,5 +1,6 @@
import { ALLOCATE, REGISTER, ArrayBufferView } from "./runtime";
import { COMPARATOR, SORT as SORT_IMPL } from "./util/sort";
import { E_INDEXOUTOFRANGE } from "./util/error";
export class Int8Array extends ArrayBufferView {
[key: number]: i8;
@ -22,13 +23,13 @@ export class Int8Array extends ArrayBufferView {
@operator("[]") // unchecked is built-in
private __get(index: i32): i8 {
if (<u32>index >= <u32>this.dataLength) throw new Error("Offset out of bounds");
if (<u32>index >= <u32>this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE);
return load<i8>(this.dataStart + <usize>index);
}
@operator("[]=") // unchecked is built-in
private __set(index: i32, value: native<i8>): void {
if (<u32>index >= <u32>this.dataLength) throw new Error("Offset out of bounds");
if (<u32>index >= <u32>this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE);
store<i8>(this.dataStart + <usize>index, value);
}
@ -104,13 +105,13 @@ export class Uint8Array extends ArrayBufferView {
@operator("[]") // unchecked is built-in
private __get(index: i32): u8 {
if (<u32>index >= <u32>this.dataLength) throw new Error("Offset out of bounds");
if (<u32>index >= <u32>this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE);
return load<u8>(this.dataStart + <usize>index);
}
@operator("[]=") // unchecked is built-in
private __set(index: i32, value: native<u8>): void {
if (<u32>index >= <u32>this.dataLength) throw new Error("Offset out of bounds");
if (<u32>index >= <u32>this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE);
store<u8>(this.dataStart + <usize>index, value);
}
@ -186,13 +187,13 @@ export class Uint8ClampedArray extends ArrayBufferView {
@operator("[]") // unchecked is built-in
private __get(index: i32): u8 {
if (<u32>index >= <u32>this.dataLength) throw new Error("Offset out of bounds");
if (<u32>index >= <u32>this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE);
return load<u8>(this.dataStart + <usize>index);
}
@operator("[]=") // unchecked is built-in
private __set(index: i32, value: native<u8>): void {
if (<u32>index >= <u32>this.dataLength) throw new Error("Offset out of bounds");
if (<u32>index >= <u32>this.dataLength) throw new RangeError(E_INDEXOUTOFRANGE);
store<u8>(this.dataStart + <usize>index, ~(<i32>value >> 31) & (((255 - value) >> 31) | value));
}
@ -268,13 +269,13 @@ export class Int16Array extends ArrayBufferView {
@operator("[]") // unchecked is built-in
private __get(index: i32): i16 {
if (<u32>index >= <u32>this.dataLength >>> alignof<i16>()) throw new Error("Offset out of bounds");
if (<u32>index >= <u32>this.dataLength >>> alignof<i16>()) throw new RangeError(E_INDEXOUTOFRANGE);
return load<i16>(this.dataStart + (<usize>index << alignof<i16>()));
}
@operator("[]=") // unchecked is built-in
private __set(index: i32, value: native<i16>): void {
if (<u32>index >= <u32>this.dataLength >>> alignof<i16>()) throw new Error("Offset out of bounds");
if (<u32>index >= <u32>this.dataLength >>> alignof<i16>()) throw new RangeError(E_INDEXOUTOFRANGE);
store<i16>(this.dataStart + (<usize>index << alignof<i16>()), value);
}
@ -350,13 +351,13 @@ export class Uint16Array extends ArrayBufferView {
@operator("[]") // unchecked is built-in
private __get(index: i32): u16 {
if (<u32>index >= <u32>this.dataLength >>> alignof<u16>()) throw new Error("Offset out of bounds");
if (<u32>index >= <u32>this.dataLength >>> alignof<u16>()) throw new RangeError(E_INDEXOUTOFRANGE);
return load<u16>(this.dataStart + (<usize>index << alignof<u16>()));
}
@operator("[]=") // unchecked is built-in
private __set(index: i32, value: native<u16>): void {
if (<u32>index >= <u32>this.dataLength >>> alignof<u16>()) throw new Error("Offset out of bounds");
if (<u32>index >= <u32>this.dataLength >>> alignof<u16>()) throw new RangeError(E_INDEXOUTOFRANGE);
store<u16>(this.dataStart + (<usize>index << alignof<u16>()), value);
}
@ -432,13 +433,13 @@ export class Int32Array extends ArrayBufferView {
@operator("[]") // unchecked is built-in
private __get(index: i32): i32 {
if (<u32>index >= <u32>this.dataLength >>> alignof<i32>()) throw new Error("Offset out of bounds");
if (<u32>index >= <u32>this.dataLength >>> alignof<i32>()) throw new RangeError(E_INDEXOUTOFRANGE);
return load<i32>(this.dataStart + (<usize>index << alignof<i32>()));
}
@operator("[]=") // unchecked is built-in
private __set(index: i32, value: i32): void {
if (<u32>index >= <u32>this.dataLength >>> alignof<i32>()) throw new Error("Offset out of bounds");
if (<u32>index >= <u32>this.dataLength >>> alignof<i32>()) throw new RangeError(E_INDEXOUTOFRANGE);
store<i32>(this.dataStart + (<usize>index << alignof<i32>()), value);
}
@ -514,13 +515,13 @@ export class Uint32Array extends ArrayBufferView {
@operator("[]") // unchecked is built-in
private __get(index: i32): u32 {
if (<u32>index >= <u32>this.dataLength >>> alignof<u32>()) throw new Error("Offset out of bounds");
if (<u32>index >= <u32>this.dataLength >>> alignof<u32>()) throw new RangeError(E_INDEXOUTOFRANGE);
return load<u32>(this.dataStart + (<usize>index << alignof<u32>()));
}
@operator("[]=") // unchecked is built-in
private __set(index: i32, value: u32): void {
if (<u32>index >= <u32>this.dataLength >>> alignof<u32>()) throw new Error("Offset out of bounds");
if (<u32>index >= <u32>this.dataLength >>> alignof<u32>()) throw new RangeError(E_INDEXOUTOFRANGE);
store<u32>(this.dataStart + (<usize>index << alignof<u32>()), value);
}
@ -596,13 +597,13 @@ export class Int64Array extends ArrayBufferView {
@operator("[]") // unchecked is built-in
private __get(index: i32): i64 {
if (<u32>index >= <u32>this.dataLength >>> alignof<i64>()) throw new Error("Offset out of bounds");
if (<u32>index >= <u32>this.dataLength >>> alignof<i64>()) throw new RangeError(E_INDEXOUTOFRANGE);
return load<i64>(this.dataStart + (<usize>index << alignof<i64>()));
}
@operator("[]=") // unchecked is built-in
private __set(index: i32, value: i64): void {
if (<u32>index >= <u32>this.dataLength >>> alignof<i64>()) throw new Error("Offset out of bounds");
if (<u32>index >= <u32>this.dataLength >>> alignof<i64>()) throw new RangeError(E_INDEXOUTOFRANGE);
store<i64>(this.dataStart + (<usize>index << alignof<i64>()), value);
}
@ -678,13 +679,13 @@ export class Uint64Array extends ArrayBufferView {
@operator("[]") // unchecked is built-in
private __get(index: i32): u64 {
if (<u32>index >= <u32>this.dataLength >>> alignof<u64>()) throw new Error("Offset out of bounds");
if (<u32>index >= <u32>this.dataLength >>> alignof<u64>()) throw new RangeError(E_INDEXOUTOFRANGE);
return load<u64>(this.dataStart + (<usize>index << alignof<u64>()));
}
@operator("[]=") // unchecked is built-in
private __set(index: i32, value: u64): void {
if (<u32>index >= <u32>this.dataLength >>> alignof<u64>()) throw new Error("Offset out of bounds");
if (<u32>index >= <u32>this.dataLength >>> alignof<u64>()) throw new RangeError(E_INDEXOUTOFRANGE);
store<u64>(this.dataStart + (<usize>index << alignof<u64>()), value);
}
@ -760,13 +761,13 @@ export class Float32Array extends ArrayBufferView {
@operator("[]") // unchecked is built-in
private __get(index: i32): f32 {
if (<u32>index >= <u32>this.dataLength >>> alignof<f32>()) throw new Error("Offset out of bounds");
if (<u32>index >= <u32>this.dataLength >>> alignof<f32>()) throw new RangeError(E_INDEXOUTOFRANGE);
return load<f32>(this.dataStart + (<usize>index << alignof<f32>()));
}
@operator("[]=") // unchecked is built-in
private __set(index: i32, value: f32): void {
if (<u32>index >= <u32>this.dataLength >>> alignof<f32>()) throw new Error("Offset out of bounds");
if (<u32>index >= <u32>this.dataLength >>> alignof<f32>()) throw new RangeError(E_INDEXOUTOFRANGE);
store<f32>(this.dataStart + (<usize>index << alignof<f32>()), value);
}
@ -842,13 +843,13 @@ export class Float64Array extends ArrayBufferView {
@operator("[]") // unchecked is built-in
private __get(index: i32): f64 {
if (<u32>index >= <u32>this.dataLength >>> alignof<f64>()) throw new Error("Offset out of bounds");
if (<u32>index >= <u32>this.dataLength >>> alignof<f64>()) throw new RangeError(E_INDEXOUTOFRANGE);
return load<f64>(this.dataStart + (<usize>index << alignof<f64>()));
}
@operator("[]=") // unchecked is built-in
private __set(index: i32, value: f64): void {
if (<u32>index >= <u32>this.dataLength >>> alignof<f64>()) throw new Error("Offset out of bounds");
if (<u32>index >= <u32>this.dataLength >>> alignof<f64>()) throw new RangeError(E_INDEXOUTOFRANGE);
store<f64>(this.dataStart + (<usize>index << alignof<f64>()), value);
}

View File

@ -0,0 +1,18 @@
// Common error messages for use accross the standard library. Keeping error messages compact
// and reusing them where possible ensures minimal static data in binaries.
// @ts-ignore: decorator
@lazy @inline
export const E_INDEXOUTOFRANGE: string = "Index out of range";
// @ts-ignore: decorator
@lazy @inline
export const E_INVALIDLENGTH: string = "Invalid length";
// @ts-ignore: decorator
@lazy @inline
export const E_EMPTYARRAY: string = "Array is empty";
// @ts-ignore: decorator
@lazy @inline
export const E_HOLEYARRAY: string = "Element type must be nullable if array is holey";

View File

@ -376,6 +376,7 @@ declare class DataView {
declare class Array<T> {
static isArray<U>(value: any): value is Array<any>;
static create<T>(capacity?: i32): Array<T>;
[key: number]: T;
length: i32;

View File

@ -229,7 +229,13 @@ globalScope["isArrayLike"] = function isArrayLike(expr) {
&& typeof expr.length === 'number'
&& expr.length >= 0
&& Math.trunc(expr.length) === expr.length;
}
};
Array.create = function(capacity) {
var arr = new Array(capacity);
arr.length = 0;
return arr;
};
globalScope["isDefined"] = function isDefined(expr) {
return typeof expr !== "undefined";

View File

@ -106,7 +106,7 @@
if
i32.const 0
i32.const 16
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -120,7 +120,7 @@
if
i32.const 0
i32.const 16
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable

View File

@ -141,7 +141,7 @@
if
i32.const 0
i32.const 16
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -156,7 +156,7 @@
if
i32.const 0
i32.const 16
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable

View File

@ -116,7 +116,7 @@
if
i32.const 0
i32.const 16
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -130,7 +130,7 @@
if
i32.const 0
i32.const 16
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable

View File

@ -151,7 +151,7 @@
if
i32.const 0
i32.const 16
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -166,7 +166,7 @@
if
i32.const 0
i32.const 16
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable

View File

@ -131,7 +131,7 @@
if
i32.const 0
i32.const 16
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -145,7 +145,7 @@
if
i32.const 0
i32.const 16
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable

View File

@ -193,7 +193,7 @@
if
i32.const 0
i32.const 16
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -208,7 +208,7 @@
if
i32.const 0
i32.const 16
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable

View File

@ -85,7 +85,7 @@
if
i32.const 0
i32.const 16
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -99,7 +99,7 @@
if
i32.const 0
i32.const 16
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable

View File

@ -143,7 +143,7 @@
if
i32.const 0
i32.const 16
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -158,7 +158,7 @@
if
i32.const 0
i32.const 16
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable

View File

@ -131,7 +131,7 @@
if
i32.const 0
i32.const 48
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -145,7 +145,7 @@
if
i32.const 0
i32.const 48
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable

View File

@ -407,7 +407,7 @@
if
i32.const 0
i32.const 48
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -422,7 +422,7 @@
if
i32.const 0
i32.const 48
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable

View File

@ -57,7 +57,7 @@
if
i32.const 0
i32.const 16
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -72,7 +72,7 @@
if
i32.const 0
i32.const 16
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable

View File

@ -13,24 +13,56 @@
(export "table" (table $0))
(export "testVar" (func $nonNullAssertion/testVar))
(export "testObj" (func $nonNullAssertion/testObj))
(export "testProp" (func $nonNullAssertion/testObj))
(export "testProp" (func $nonNullAssertion/testProp))
(export "testArr" (func $nonNullAssertion/testArr))
(export "testElem" (func $nonNullAssertion/testArr))
(export "testElem" (func $nonNullAssertion/testElem))
(export "testAll" (func $nonNullAssertion/testAll))
(export "testAll2" (func $nonNullAssertion/testAll))
(export "testFn" (func $nonNullAssertion/testFn))
(export "testFn2" (func $nonNullAssertion/testFn))
(export "testRet" (func $nonNullAssertion/testFn))
(export "testFn2" (func $nonNullAssertion/testFn2))
(export "testRet" (func $nonNullAssertion/testRet))
(export "testObjFn" (func $nonNullAssertion/testObjFn))
(export "testObjRet" (func $nonNullAssertion/testObjFn))
(export "testObjRet" (func $nonNullAssertion/testObjRet))
(func $nonNullAssertion/testVar (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
i32.eqz
if
unreachable
end
local.get $0
)
(func $nonNullAssertion/testObj (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
i32.eqz
if
unreachable
end
local.get $0
i32.load
)
(func $~lib/array/Array<Foo>#__get (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(func $nonNullAssertion/testProp (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
i32.load
local.tee $0
i32.eqz
if
unreachable
end
local.get $0
)
(func $~lib/array/Array<Foo>#__get (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
i32.const 0
local.get $0
i32.load offset=12
i32.ge_u
if
i32.const 0
i32.const 16
i32.const 97
i32.const 45
call $~lib/env/abort
unreachable
end
i32.const 0
local.get $0
i32.load offset=8
@ -40,7 +72,7 @@
if
i32.const 0
i32.const 16
i32.const 69
i32.const 100
i32.const 61
call $~lib/env/abort
unreachable
@ -49,29 +81,116 @@
i32.load offset=4
i32.load
)
(func $nonNullAssertion/testArr (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(func $nonNullAssertion/testArr (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
i32.eqz
if
unreachable
end
local.get $0
call $~lib/array/Array<Foo>#__get
)
(func $nonNullAssertion/testAll (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(func $~lib/array/Array<Foo | null>#__get (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
i32.const 0
local.get $0
call $~lib/array/Array<Foo>#__get
i32.load offset=8
i32.const 2
i32.shr_u
i32.ge_u
if
i32.const 0
i32.const 16
i32.const 100
i32.const 61
call $~lib/env/abort
unreachable
end
local.get $0
i32.load offset=4
i32.load
)
(func $nonNullAssertion/testFn (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(func $nonNullAssertion/testElem (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
call $~lib/array/Array<Foo | null>#__get
local.tee $0
i32.eqz
if
unreachable
end
local.get $0
)
(func $nonNullAssertion/testAll (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
i32.eqz
if
unreachable
end
local.get $0
call $~lib/array/Array<Foo | null>#__get
local.tee $0
i32.eqz
if
unreachable
end
local.get $0
i32.load
local.tee $0
i32.eqz
if
unreachable
end
local.get $0
)
(func $nonNullAssertion/testFn (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
i32.const 0
global.set $~lib/argc
local.get $0
call_indirect (type $FUNCSIG$i)
)
(func $nonNullAssertion/testObjFn (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(func $nonNullAssertion/testFn2 (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
i32.eqz
if
unreachable
end
i32.const 0
global.set $~lib/argc
local.get $0
call_indirect (type $FUNCSIG$i)
)
(func $nonNullAssertion/testRet (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
i32.const 0
global.set $~lib/argc
local.get $0
call_indirect (type $FUNCSIG$i)
local.tee $0
i32.eqz
if
unreachable
end
local.get $0
)
(func $nonNullAssertion/testObjFn (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
i32.const 0
global.set $~lib/argc
local.get $0
i32.load offset=4
call_indirect (type $FUNCSIG$i)
)
(func $null (; 8 ;) (type $FUNCSIG$v)
(func $nonNullAssertion/testObjRet (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
i32.const 0
global.set $~lib/argc
local.get $0
i32.load offset=4
call_indirect (type $FUNCSIG$i)
local.tee $0
i32.eqz
if
unreachable
end
local.get $0
)
(func $null (; 14 ;) (type $FUNCSIG$v)
nop
)
)

View File

@ -30,7 +30,7 @@ export function testAll(foo: Array<Foo | null> | null): Foo {
}
export function testAll2(foo: Array<Foo | null> | null): Foo {
return foo!![0]!!!.bar!!!!;
return foo!![0]!!.bar!!; // 3x AS225: Expression is never 'null'
}
export function testFn(fn: (() => Foo | null) | null): Foo | null {

View File

@ -29,17 +29,50 @@
(export "testObjFn" (func $nonNullAssertion/testObjFn))
(export "testObjRet" (func $nonNullAssertion/testObjRet))
(func $nonNullAssertion/testVar (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
local.get $0
local.tee $1
if (result i32)
local.get $1
else
unreachable
end
)
(func $nonNullAssertion/testObj (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
local.get $0
local.tee $1
if (result i32)
local.get $1
else
unreachable
end
i32.load
)
(func $nonNullAssertion/testProp (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
local.get $0
i32.load
local.tee $1
if (result i32)
local.get $1
else
unreachable
end
)
(func $~lib/array/Array<Foo>#__get (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $1
local.get $0
i32.load offset=12
i32.ge_u
if
i32.const 0
i32.const 16
i32.const 97
i32.const 45
call $~lib/env/abort
unreachable
end
local.get $1
local.get $0
i32.load offset=8
@ -49,7 +82,7 @@
if
i32.const 0
i32.const 16
i32.const 69
i32.const 100
i32.const 61
call $~lib/env/abort
unreachable
@ -63,7 +96,14 @@
i32.load
)
(func $nonNullAssertion/testArr (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
local.get $0
local.tee $1
if (result i32)
local.get $1
else
unreachable
end
i32.const 0
call $~lib/array/Array<Foo>#__get
)
@ -77,7 +117,7 @@
if
i32.const 0
i32.const 16
i32.const 69
i32.const 100
i32.const 61
call $~lib/env/abort
unreachable
@ -91,21 +131,66 @@
i32.load
)
(func $nonNullAssertion/testElem (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
local.get $0
i32.const 0
call $~lib/array/Array<Foo | null>#__get
local.tee $1
if (result i32)
local.get $1
else
unreachable
end
)
(func $nonNullAssertion/testAll (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
local.get $0
local.tee $1
if (result i32)
local.get $1
else
unreachable
end
i32.const 0
call $~lib/array/Array<Foo | null>#__get
local.tee $1
if (result i32)
local.get $1
else
unreachable
end
i32.load
local.tee $1
if (result i32)
local.get $1
else
unreachable
end
)
(func $nonNullAssertion/testAll2 (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
local.get $0
local.tee $1
if (result i32)
local.get $1
else
unreachable
end
i32.const 0
call $~lib/array/Array<Foo | null>#__get
local.tee $1
if (result i32)
local.get $1
else
unreachable
end
i32.load
local.tee $1
if (result i32)
local.get $1
else
unreachable
end
)
(func $nonNullAssertion/testFn (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
i32.const 0
@ -115,18 +200,34 @@
)
(func $nonNullAssertion/testFn2 (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
local.get $0
local.set $1
local.tee $1
if (result i32)
local.get $1
else
unreachable
end
local.set $2
i32.const 0
global.set $~lib/argc
local.get $1
local.get $2
call_indirect (type $FUNCSIG$i)
)
(func $nonNullAssertion/testRet (; 12 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
block (result i32)
i32.const 0
global.set $~lib/argc
local.get $0
call_indirect (type $FUNCSIG$i)
end
local.tee $1
if (result i32)
local.get $1
else
unreachable
end
)
(func $nonNullAssertion/testObjFn (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
i32.const 0
@ -136,11 +237,20 @@
call_indirect (type $FUNCSIG$i)
)
(func $nonNullAssertion/testObjRet (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
block (result i32)
i32.const 0
global.set $~lib/argc
local.get $0
i32.load offset=4
call_indirect (type $FUNCSIG$i)
end
local.tee $1
if (result i32)
local.get $1
else
unreachable
end
)
(func $null (; 15 ;) (type $FUNCSIG$v)
)

View File

@ -302,7 +302,7 @@
if
i32.const 0
i32.const 464
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -316,7 +316,7 @@
if
i32.const 0
i32.const 464
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable
@ -2427,7 +2427,7 @@
if
i32.const 0
i32.const 1648
i32.const 186
i32.const 187
i32.const 4
call $~lib/env/abort
unreachable

View File

@ -399,7 +399,7 @@
if
i32.const 0
i32.const 464
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -414,7 +414,7 @@
if
i32.const 0
i32.const 464
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable
@ -3418,7 +3418,7 @@
if
i32.const 0
i32.const 1648
i32.const 186
i32.const 187
i32.const 4
call $~lib/env/abort
unreachable

View File

@ -106,7 +106,7 @@
if
i32.const 0
i32.const 48
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -120,7 +120,7 @@
if
i32.const 0
i32.const 48
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable

View File

@ -143,7 +143,7 @@
if
i32.const 0
i32.const 48
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -158,7 +158,7 @@
if
i32.const 0
i32.const 48
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable

View File

@ -100,7 +100,7 @@
if
i32.const 0
i32.const 16
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -114,7 +114,7 @@
if
i32.const 0
i32.const 16
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable

View File

@ -150,7 +150,7 @@
if
i32.const 0
i32.const 16
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -165,7 +165,7 @@
if
i32.const 0
i32.const 16
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable

View File

@ -20,6 +20,18 @@
(export "stringArrayArrayPropertyAccess" (func $std/array-access/stringArrayArrayPropertyAccess))
(export "stringArrayArrayMethodCall" (func $std/array-access/stringArrayArrayMethodCall))
(func $~lib/array/Array<Array<i32>>#__get (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $1
local.get $0
i32.load offset=12
i32.ge_u
if
i32.const 0
i32.const 16
i32.const 97
i32.const 45
call $~lib/env/abort
unreachable
end
local.get $1
local.get $0
i32.load offset=8
@ -29,7 +41,7 @@
if
i32.const 0
i32.const 16
i32.const 69
i32.const 100
i32.const 61
call $~lib/env/abort
unreachable
@ -42,14 +54,34 @@
i32.add
i32.load
)
(func $std/array-access/i32ArrayArrayElementAccess (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(func $~lib/array/Array<i32>#__get (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
i32.const 1
local.get $0
i32.load offset=8
i32.const 2
i32.shr_u
i32.ge_u
if
i32.const 0
i32.const 16
i32.const 100
i32.const 61
call $~lib/env/abort
unreachable
end
local.get $0
i32.load offset=4
i32.const 4
i32.add
i32.load
)
(func $std/array-access/i32ArrayArrayElementAccess (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
i32.const 0
call $~lib/array/Array<Array<i32>>#__get
i32.const 1
call $~lib/array/Array<Array<i32>>#__get
call $~lib/array/Array<i32>#__get
)
(func $std/array-access/stringArrayPropertyAccess (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(func $std/array-access/stringArrayPropertyAccess (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
i32.const 0
call $~lib/array/Array<Array<i32>>#__get
@ -59,7 +91,7 @@
i32.const 1
i32.shr_u
)
(func $~lib/util/string/compareImpl (; 4 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func $~lib/util/string/compareImpl (; 5 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
i32.const 56
@ -101,7 +133,7 @@
end
local.get $4
)
(func $~lib/string/String#startsWith (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(func $~lib/string/String#startsWith (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@ -110,7 +142,7 @@
if
i32.const 0
i32.const 64
i32.const 161
i32.const 162
i32.const 4
call $~lib/env/abort
unreachable
@ -148,13 +180,13 @@
call $~lib/util/string/compareImpl
i32.eqz
)
(func $std/array-access/stringArrayMethodCall (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(func $std/array-access/stringArrayMethodCall (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
i32.const 0
call $~lib/array/Array<Array<i32>>#__get
call $~lib/string/String#startsWith
)
(func $std/array-access/stringArrayArrayPropertyAccess (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(func $std/array-access/stringArrayArrayPropertyAccess (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
i32.const 0
call $~lib/array/Array<Array<i32>>#__get
@ -166,7 +198,7 @@
i32.const 1
i32.shr_u
)
(func $std/array-access/stringArrayArrayMethodCall (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(func $std/array-access/stringArrayArrayMethodCall (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
i32.const 0
call $~lib/array/Array<Array<i32>>#__get
@ -174,7 +206,7 @@
call $~lib/array/Array<Array<i32>>#__get
call $~lib/string/String#startsWith
)
(func $null (; 9 ;) (type $FUNCSIG$v)
(func $null (; 10 ;) (type $FUNCSIG$v)
nop
)
)

View File

@ -25,6 +25,18 @@
(export "stringArrayArrayPropertyAccess" (func $std/array-access/stringArrayArrayPropertyAccess))
(export "stringArrayArrayMethodCall" (func $std/array-access/stringArrayArrayMethodCall))
(func $~lib/array/Array<Array<i32>>#__get (; 1 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $1
local.get $0
i32.load offset=12
i32.ge_u
if
i32.const 0
i32.const 16
i32.const 97
i32.const 45
call $~lib/env/abort
unreachable
end
local.get $1
local.get $0
i32.load offset=8
@ -34,7 +46,7 @@
if
i32.const 0
i32.const 16
i32.const 69
i32.const 100
i32.const 61
call $~lib/env/abort
unreachable
@ -57,7 +69,7 @@
if
i32.const 0
i32.const 16
i32.const 69
i32.const 100
i32.const 61
call $~lib/env/abort
unreachable
@ -78,6 +90,18 @@
call $~lib/array/Array<i32>#__get
)
(func $~lib/array/Array<String>#__get (; 4 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $1
local.get $0
i32.load offset=12
i32.ge_u
if
i32.const 0
i32.const 16
i32.const 97
i32.const 45
call $~lib/env/abort
unreachable
end
local.get $1
local.get $0
i32.load offset=8
@ -87,7 +111,7 @@
if
i32.const 0
i32.const 16
i32.const 69
i32.const 100
i32.const 61
call $~lib/env/abort
unreachable
@ -181,7 +205,7 @@
if
i32.const 0
i32.const 64
i32.const 161
i32.const 162
i32.const 4
call $~lib/env/abort
unreachable
@ -243,6 +267,18 @@
call $~lib/string/String#startsWith
)
(func $~lib/array/Array<Array<String>>#__get (; 10 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $1
local.get $0
i32.load offset=12
i32.ge_u
if
i32.const 0
i32.const 16
i32.const 97
i32.const 45
call $~lib/env/abort
unreachable
end
local.get $1
local.get $0
i32.load offset=8
@ -252,7 +288,7 @@
if
i32.const 0
i32.const 16
i32.const 69
i32.const 100
i32.const 61
call $~lib/env/abort
unreachable

View File

@ -4,7 +4,6 @@
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $FUNCSIG$vi (func (param i32)))
(type $FUNCSIG$v (func))
(type $FUNCSIG$vii (func (param i32 i32)))
(type $FUNCSIG$i (func (result i32)))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(memory $0 1)
@ -17,7 +16,6 @@
(data (i32.const 184) "\01")
(data (i32.const 192) "\04\00\00\00\10\00\00\00\c0\00\00\00\c0")
(data (i32.const 216) "\03\00\00\00\1e\00\00\00~\00l\00i\00b\00/\00r\00u\00n\00t\00i\00m\00e\00.\00t\00s")
(data (i32.const 256) "\03\00\00\00&\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(global $std/array-literal/emptyArrayI32 (mut i32) (i32.const 200))
@ -39,7 +37,7 @@
if
i32.const 0
i32.const 104
i32.const 69
i32.const 100
i32.const 61
call $~lib/env/abort
unreachable
@ -60,7 +58,7 @@
if
i32.const 0
i32.const 104
i32.const 69
i32.const 100
i32.const 61
call $~lib/env/abort
unreachable
@ -156,225 +154,14 @@
i32.const 8
i32.add
)
(func $~lib/memory/memory.fill (; 5 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
(local $2 i32)
block $~lib/util/memory/memset|inlined.0
local.get $1
i32.eqz
br_if $~lib/util/memory/memset|inlined.0
(func $~lib/runtime/assertUnregistered (; 5 ;) (type $FUNCSIG$vi) (param $0 i32)
local.get $0
i32.const 0
i32.store8
local.get $0
local.get $1
i32.add
i32.const 1
i32.sub
i32.const 0
i32.store8
local.get $1
i32.const 2
i32.le_u
br_if $~lib/util/memory/memset|inlined.0
local.get $0
i32.const 1
i32.add
i32.const 0
i32.store8
local.get $0
i32.const 2
i32.add
i32.const 0
i32.store8
local.get $0
local.get $1
i32.add
local.tee $2
i32.const 2
i32.sub
i32.const 0
i32.store8
local.get $2
i32.const 3
i32.sub
i32.const 0
i32.store8
local.get $1
i32.const 6
i32.le_u
br_if $~lib/util/memory/memset|inlined.0
local.get $0
i32.const 3
i32.add
i32.const 0
i32.store8
local.get $0
local.get $1
i32.add
i32.const 4
i32.sub
i32.const 0
i32.store8
local.get $1
i32.const 8
i32.le_u
br_if $~lib/util/memory/memset|inlined.0
local.get $1
i32.const 0
local.get $0
i32.sub
i32.const 3
i32.and
local.tee $2
i32.sub
local.set $1
local.get $0
local.get $2
i32.add
local.tee $0
i32.const 0
i32.store
local.get $1
i32.const -4
i32.and
local.tee $1
local.get $0
i32.add
i32.const 4
i32.sub
i32.const 0
i32.store
local.get $1
i32.const 8
i32.le_u
br_if $~lib/util/memory/memset|inlined.0
local.get $0
i32.const 4
i32.add
i32.const 0
i32.store
local.get $0
i32.const 8
i32.add
i32.const 0
i32.store
local.get $0
local.get $1
i32.add
local.tee $2
i32.const 12
i32.sub
i32.const 0
i32.store
local.get $2
i32.const 8
i32.sub
i32.const 0
i32.store
local.get $1
i32.const 24
i32.le_u
br_if $~lib/util/memory/memset|inlined.0
local.get $0
i32.const 12
i32.add
i32.const 0
i32.store
local.get $0
i32.const 16
i32.add
i32.const 0
i32.store
local.get $0
i32.const 20
i32.add
i32.const 0
i32.store
local.get $0
i32.const 24
i32.add
i32.const 0
i32.store
local.get $0
local.get $1
i32.add
local.tee $2
i32.const 28
i32.sub
i32.const 0
i32.store
local.get $2
i32.const 24
i32.sub
i32.const 0
i32.store
local.get $2
i32.const 20
i32.sub
i32.const 0
i32.store
local.get $2
i32.const 16
i32.sub
i32.const 0
i32.store
local.get $0
i32.const 4
i32.and
i32.const 24
i32.add
local.tee $2
local.get $0
i32.add
local.set $0
local.get $1
local.get $2
i32.sub
local.set $1
loop $continue|0
local.get $1
i32.const 32
i32.ge_u
if
local.get $0
i64.const 0
i64.store
local.get $0
i32.const 8
i32.add
i64.const 0
i64.store
local.get $0
i32.const 16
i32.add
i64.const 0
i64.store
local.get $0
i32.const 24
i32.add
i64.const 0
i64.store
local.get $1
i32.const 32
i32.sub
local.set $1
local.get $0
i32.const 32
i32.add
local.set $0
br $continue|0
end
end
end
)
(func $~lib/runtime/assertUnregistered (; 6 ;) (type $FUNCSIG$vi) (param $0 i32)
local.get $0
i32.const 304
i32.const 256
i32.le_u
if
i32.const 0
i32.const 224
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -388,13 +175,13 @@
if
i32.const 0
i32.const 224
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable
end
)
(func $~lib/runtime/doRegister (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/runtime/doRegister (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $0
call $~lib/runtime/assertUnregistered
local.get $0
@ -404,91 +191,46 @@
i32.store
local.get $0
)
(func $~lib/arraybuffer/ArrayBuffer#constructor (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
local.get $0
i32.const 1073741816
i32.gt_u
if
i32.const 0
i32.const 264
i32.const 24
i32.const 43
call $~lib/env/abort
unreachable
end
local.get $0
call $~lib/runtime/doAllocate
local.tee $1
local.get $0
call $~lib/memory/memory.fill
local.get $1
i32.const 1
call $~lib/runtime/doRegister
)
(func $~lib/runtime/ArrayBufferView#constructor (; 9 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/runtime/doMakeArray (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
i32.const 3
i32.const 1073741816
local.get $1
i32.shr_u
i32.gt_u
if
i32.const 0
i32.const 224
i32.const 251
i32.const 57
call $~lib/env/abort
unreachable
end
i32.const 16
call $~lib/runtime/doAllocate
local.get $0
call $~lib/runtime/doRegister
local.tee $0
i32.const 3
local.get $1
i32.shl
local.tee $1
call $~lib/runtime/doAllocate
i32.const 1
call $~lib/runtime/doRegister
local.tee $2
call $~lib/arraybuffer/ArrayBuffer#constructor
local.set $1
i32.store
local.get $0
i32.eqz
if
i32.const 12
local.get $2
i32.store offset=4
local.get $0
local.get $1
i32.store offset=8
local.get $0
i32.const 3
i32.store offset=12
local.get $0
)
(func $std/array-literal/Ref#constructor (; 8 ;) (type $FUNCSIG$i) (result i32)
i32.const 0
call $~lib/runtime/doAllocate
i32.const 5
call $~lib/runtime/doRegister
local.set $0
end
local.get $0
i32.const 0
i32.store
local.get $0
i32.const 0
i32.store offset=4
local.get $0
i32.const 0
i32.store offset=8
local.get $0
local.get $1
i32.store
local.get $0
local.get $1
i32.store offset=4
local.get $0
local.get $2
i32.store offset=8
local.get $0
)
(func $std/array-literal/Ref#constructor (; 10 ;) (type $FUNCSIG$i) (result i32)
(func $std/array-literal/RefWithCtor#constructor (; 9 ;) (type $FUNCSIG$i) (result i32)
i32.const 0
call $~lib/runtime/doAllocate
i32.const 6
i32.const 7
call $~lib/runtime/doRegister
)
(func $std/array-literal/RefWithCtor#constructor (; 11 ;) (type $FUNCSIG$i) (result i32)
i32.const 0
call $~lib/runtime/doAllocate
i32.const 8
call $~lib/runtime/doRegister
)
(func $start:std/array-literal (; 12 ;) (type $FUNCSIG$v)
(func $start:std/array-literal (; 10 ;) (type $FUNCSIG$v)
(local $0 i32)
(local $1 i32)
(local $2 i32)
@ -600,23 +342,14 @@
call $~lib/env/abort
unreachable
end
i32.const 304
i32.const 256
global.set $~lib/allocator/arena/startOffset
global.get $~lib/allocator/arena/startOffset
global.set $~lib/allocator/arena/offset
i32.const 16
call $~lib/runtime/doAllocate
i32.const 2
call $~lib/runtime/doRegister
i32.const 0
call $~lib/runtime/ArrayBufferView#constructor
call $~lib/runtime/doMakeArray
local.tee $0
i32.const 0
i32.store offset=12
local.get $0
i32.const 3
i32.store offset=12
local.get $0
i32.load offset=4
local.tee $1
global.get $std/array-literal/i
@ -690,19 +423,10 @@
end
i32.const 0
global.set $std/array-literal/i
i32.const 16
call $~lib/runtime/doAllocate
i32.const 4
call $~lib/runtime/doRegister
i32.const 2
call $~lib/runtime/ArrayBufferView#constructor
call $~lib/runtime/doMakeArray
local.tee $1
i32.const 0
i32.store offset=12
local.get $1
i32.const 3
i32.store offset=12
local.get $1
i32.load offset=4
local.tee $0
global.get $std/array-literal/i
@ -774,19 +498,10 @@
call $~lib/env/abort
unreachable
end
i32.const 16
call $~lib/runtime/doAllocate
i32.const 7
call $~lib/runtime/doRegister
i32.const 6
i32.const 2
call $~lib/runtime/ArrayBufferView#constructor
call $~lib/runtime/doMakeArray
local.tee $0
i32.const 0
i32.store offset=12
local.get $0
i32.const 3
i32.store offset=12
local.get $0
i32.load offset=4
local.tee $1
call $std/array-literal/Ref#constructor
@ -811,19 +526,10 @@
call $~lib/env/abort
unreachable
end
i32.const 16
call $~lib/runtime/doAllocate
i32.const 9
call $~lib/runtime/doRegister
i32.const 8
i32.const 2
call $~lib/runtime/ArrayBufferView#constructor
call $~lib/runtime/doMakeArray
local.tee $1
i32.const 0
i32.store offset=12
local.get $1
i32.const 3
i32.store offset=12
local.get $1
i32.load offset=4
local.tee $0
call $std/array-literal/RefWithCtor#constructor
@ -849,10 +555,10 @@
unreachable
end
)
(func $start (; 13 ;) (type $FUNCSIG$v)
(func $start (; 11 ;) (type $FUNCSIG$v)
call $start:std/array-literal
)
(func $null (; 14 ;) (type $FUNCSIG$v)
(func $null (; 12 ;) (type $FUNCSIG$v)
nop
)
)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -752,9 +752,9 @@ function isSorted<T>(data: Array<T>, comparator: (a: T, b: T) => i32 = COMPARATO
}
function createReverseOrderedArray(size: i32): Array<i32> {
var arr = new Array<i32>(size);
for (let i = 0; i < arr.length; i++) {
arr[i] = arr.length - 1 - i;
var arr = Array.create<i32>(size);
for (let i = 0; i < size; i++) {
arr[i] = size - 1 - i;
}
return arr;
}
@ -762,30 +762,31 @@ function createReverseOrderedArray(size: i32): Array<i32> {
NativeMath.seedRandom(reinterpret<u64>(JSMath.random()));
function createRandomOrderedArray(size: i32): Array<i32> {
var arr = new Array<i32>(size);
for (let i = 0; i < arr.length; i++) {
arr[i] = <i32>(NativeMath.random() * arr.length);
var arr = Array.create<i32>(size);
for (let i = 0; i < size; i++) {
arr[i] = <i32>(NativeMath.random() *size);
}
return arr;
}
function createReverseOrderedNestedArray(size: i32): Array<Array<i32>> {
var arr = new Array<Array<i32>>(size);
for (let i: i32 = 0; i < arr.length; i++) {
arr[i] = new Array<i32>(1);
arr[i][0] = arr.length - 1 - i;
var arr = Array.create<Array<i32>>(size);
for (let i: i32 = 0; i < size; i++) {
let inner = Array.create<i32>(1);
inner[0] = size - 1 - i;
arr[i] = inner;
}
return arr;
}
class Proxy<T> {
constructor(public x: T = 0) {}
constructor(public x: T) {}
}
function createReverseOrderedElementsArray(size: i32): Proxy<i32>[] {
var arr = new Array<Proxy<i32>>(size);
for (let i: i32 = 0; i < arr.length; i++) {
arr[i] = new Proxy<i32>(arr.length - 1 - i);
var arr = Array.create<Proxy<i32>>(size);
for (let i: i32 = 0; i < size; i++) {
arr[i] = new Proxy<i32>(size - 1 - i);
}
return arr;
}
@ -802,8 +803,8 @@ function createRandomString(len: i32): string {
}
function createRandomStringArray(size: i32): string[] {
var arr = new Array<string>(size);
for (let i: i32 = 0; i < arr.length; i++) {
var arr = Array.create<string>(size);
for (let i: i32 = 0; i < size; i++) {
arr[i] = createRandomString(<i32>(NativeMath.random() * 32));
}
return arr;

File diff suppressed because it is too large Load Diff

View File

@ -326,7 +326,7 @@
if
i32.const 0
i32.const 64
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -340,7 +340,7 @@
if
i32.const 0
i32.const 64
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable
@ -364,7 +364,7 @@
if
i32.const 0
i32.const 16
i32.const 24
i32.const 25
i32.const 43
call $~lib/env/abort
unreachable
@ -1552,7 +1552,7 @@
if
i32.const 0
i32.const 64
i32.const 251
i32.const 348
i32.const 57
call $~lib/env/abort
unreachable
@ -1592,37 +1592,32 @@
i32.store offset=8
local.get $0
)
(func $~lib/runtime/doWrapArray (; 11 ;) (type $FUNCSIG$i) (result i32)
(func $~lib/runtime/doMakeArray (; 11 ;) (type $FUNCSIG$i) (result i32)
(local $0 i32)
(local $1 i32)
(local $2 i32)
i32.const 16
call $~lib/runtime/doAllocate
i32.const 5
call $~lib/runtime/doRegister
local.tee $0
i32.const 148
i32.load
local.tee $1
i32.const 8
call $~lib/runtime/doAllocate
i32.const 5
i32.const 2
call $~lib/runtime/doRegister
local.tee $2
local.tee $1
i32.store
local.get $0
local.get $2
local.get $1
i32.store offset=4
local.get $0
local.get $1
i32.const 8
i32.store offset=8
local.get $0
local.get $1
i32.const 2
i32.shr_u
i32.store offset=12
local.get $2
i32.const 152
local.get $1
i32.const 152
i32.const 8
call $~lib/memory/memory.copy
local.get $0
)
@ -1636,25 +1631,18 @@
local.tee $2
i32.const 1073741816
i32.gt_u
if
i32.const 0
i32.const 168
i32.const 18
i32.const 47
call $~lib/env/abort
unreachable
end
local.get $2
local.get $0
i32.const 8
i32.sub
i32.load offset=4
i32.gt_u
i32.or
if
i32.const 0
i32.const 168
i32.const 19
i32.const 63
i32.const 22
i32.const 6
call $~lib/env/abort
unreachable
end
@ -1882,7 +1870,7 @@
i32.const 0
call $~lib/runtime/ArrayBufferView#constructor
global.set $std/arraybuffer/arr8
call $~lib/runtime/doWrapArray
call $~lib/runtime/doMakeArray
drop
global.get $std/arraybuffer/arr8
if (result i32)

View File

@ -409,7 +409,7 @@
if
i32.const 0
i32.const 64
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -424,7 +424,7 @@
if
i32.const 0
i32.const 64
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable
@ -449,7 +449,7 @@
if
i32.const 0
i32.const 16
i32.const 24
i32.const 25
i32.const 43
call $~lib/env/abort
unreachable
@ -2051,7 +2051,7 @@
if
i32.const 0
i32.const 64
i32.const 251
i32.const 348
i32.const 57
call $~lib/env/abort
unreachable
@ -2125,42 +2125,46 @@
local.set $0
local.get $0
)
(func $~lib/runtime/doWrapArray (; 19 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(func $~lib/runtime/doMakeArray (; 19 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
i32.const 16
call $~lib/runtime/doAllocate
local.get $1
call $~lib/runtime/doRegister
local.set $3
local.get $0
call $~lib/arraybuffer/ArrayBuffer#get:byteLength
local.set $4
local.get $4
call $~lib/runtime/doAllocate
local.get $1
call $~lib/runtime/doRegister
local.set $5
local.get $3
local.get $5
i32.store
local.get $3
local.get $5
i32.store offset=4
local.get $3
local.get $4
i32.store offset=8
local.get $3
local.get $4
local.get $2
i32.shr_u
i32.store offset=12
local.get $5
call $~lib/runtime/doRegister
local.set $4
local.get $0
local.get $4
call $~lib/memory/memory.copy
local.get $3
i32.shl
local.set $5
local.get $0
local.get $3
i32.shl
call $~lib/runtime/doAllocate
i32.const 2
call $~lib/runtime/doRegister
local.set $6
local.get $4
local.get $6
i32.store
local.get $4
local.get $6
i32.store offset=4
local.get $4
local.get $5
i32.store offset=8
local.get $4
local.get $0
i32.store offset=12
local.get $1
if
local.get $6
local.get $1
local.get $5
call $~lib/memory/memory.copy
end
local.get $4
)
(func $~lib/typedarray/Int32Array#constructor (; 20 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
@ -2201,25 +2205,18 @@
local.get $3
global.get $~lib/runtime/MAX_BYTELENGTH
i32.gt_u
if
i32.const 0
i32.const 168
i32.const 18
i32.const 47
call $~lib/env/abort
unreachable
end
local.get $2
local.get $3
i32.add
local.get $1
call $~lib/arraybuffer/ArrayBuffer#get:byteLength
i32.gt_u
i32.or
if
i32.const 0
i32.const 168
i32.const 19
i32.const 63
i32.const 22
i32.const 6
call $~lib/env/abort
unreachable
end
@ -2272,6 +2269,7 @@
)
(func $start:std/arraybuffer (; 23 ;) (type $FUNCSIG$v)
(local $0 i32)
(local $1 i32)
global.get $~lib/memory/HEAP_BASE
i32.const 7
i32.add
@ -2531,13 +2529,16 @@
i32.const 1
call $~lib/typedarray/Uint8Array#constructor
global.set $std/arraybuffer/arr8
block $~lib/runtime/WRAPARRAY<i32>|inlined.0 (result i32)
i32.const 152
block $~lib/runtime/MAKEARRAY<i32>|inlined.0 (result i32)
i32.const 2
local.set $0
i32.const 152
local.set $1
local.get $0
local.get $1
i32.const 5
i32.const 2
call $~lib/runtime/doWrapArray
call $~lib/runtime/doMakeArray
end
call $~lib/arraybuffer/ArrayBuffer.isView<Array<i32>>
i32.eqz

View File

@ -163,7 +163,7 @@
if
i32.const 0
i32.const 16
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -177,7 +177,7 @@
if
i32.const 0
i32.const 16
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable
@ -240,7 +240,7 @@
if
i32.const 0
i32.const 104
i32.const 113
i32.const 114
i32.const 44
call $~lib/env/abort
unreachable
@ -270,15 +270,6 @@
local.get $2
i32.const 1073741816
i32.gt_u
end
if
i32.const 0
i32.const 152
i32.const 18
i32.const 47
call $~lib/env/abort
unreachable
end
local.get $1
local.get $2
i32.add
@ -287,11 +278,13 @@
i32.sub
i32.load offset=4
i32.gt_u
i32.or
end
if
i32.const 0
i32.const 152
i32.const 19
i32.const 63
i32.const 22
i32.const 6
call $~lib/env/abort
unreachable
end
@ -335,7 +328,7 @@
if
i32.const 0
i32.const 152
i32.const 42
i32.const 45
i32.const 6
call $~lib/env/abort
unreachable
@ -401,7 +394,7 @@
if
i32.const 0
i32.const 152
i32.const 56
i32.const 59
i32.const 7
call $~lib/env/abort
unreachable
@ -427,7 +420,7 @@
if
i32.const 0
i32.const 152
i32.const 67
i32.const 70
i32.const 49
call $~lib/env/abort
unreachable
@ -452,7 +445,7 @@
if
i32.const 0
i32.const 152
i32.const 75
i32.const 78
i32.const 7
call $~lib/env/abort
unreachable
@ -494,7 +487,7 @@
if
i32.const 0
i32.const 152
i32.const 84
i32.const 87
i32.const 7
call $~lib/env/abort
unreachable
@ -531,7 +524,7 @@
if
i32.const 0
i32.const 152
i32.const 178
i32.const 181
i32.const 6
call $~lib/env/abort
unreachable
@ -556,7 +549,7 @@
if
i32.const 0
i32.const 152
i32.const 90
i32.const 93
i32.const 49
call $~lib/env/abort
unreachable
@ -581,7 +574,7 @@
if
i32.const 0
i32.const 152
i32.const 98
i32.const 101
i32.const 6
call $~lib/env/abort
unreachable
@ -621,7 +614,7 @@
if
i32.const 0
i32.const 152
i32.const 107
i32.const 110
i32.const 6
call $~lib/env/abort
unreachable
@ -658,7 +651,7 @@
if
i32.const 0
i32.const 152
i32.const 187
i32.const 190
i32.const 6
call $~lib/env/abort
unreachable
@ -683,7 +676,7 @@
if
i32.const 0
i32.const 152
i32.const 116
i32.const 119
i32.const 6
call $~lib/env/abort
unreachable
@ -721,7 +714,7 @@
if
i32.const 0
i32.const 152
i32.const 125
i32.const 128
i32.const 6
call $~lib/env/abort
unreachable
@ -749,7 +742,7 @@
if
i32.const 0
i32.const 152
i32.const 131
i32.const 134
i32.const 49
call $~lib/env/abort
unreachable
@ -767,7 +760,7 @@
if
i32.const 0
i32.const 152
i32.const 139
i32.const 142
i32.const 6
call $~lib/env/abort
unreachable
@ -803,7 +796,7 @@
if
i32.const 0
i32.const 152
i32.const 147
i32.const 150
i32.const 6
call $~lib/env/abort
unreachable
@ -839,7 +832,7 @@
if
i32.const 0
i32.const 152
i32.const 196
i32.const 199
i32.const 6
call $~lib/env/abort
unreachable
@ -863,7 +856,7 @@
if
i32.const 0
i32.const 152
i32.const 152
i32.const 155
i32.const 49
call $~lib/env/abort
unreachable
@ -881,7 +874,7 @@
if
i32.const 0
i32.const 152
i32.const 160
i32.const 163
i32.const 6
call $~lib/env/abort
unreachable
@ -915,7 +908,7 @@
if
i32.const 0
i32.const 152
i32.const 168
i32.const 171
i32.const 6
call $~lib/env/abort
unreachable
@ -951,7 +944,7 @@
if
i32.const 0
i32.const 152
i32.const 204
i32.const 207
i32.const 6
call $~lib/env/abort
unreachable

View File

@ -415,7 +415,7 @@
if
i32.const 0
i32.const 16
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -430,7 +430,7 @@
if
i32.const 0
i32.const 16
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable
@ -455,7 +455,7 @@
if
i32.const 0
i32.const 56
i32.const 24
i32.const 25
i32.const 43
call $~lib/env/abort
unreachable
@ -490,7 +490,7 @@
if
i32.const 0
i32.const 16
i32.const 251
i32.const 348
i32.const 57
call $~lib/env/abort
unreachable
@ -572,7 +572,7 @@
if
i32.const 0
i32.const 104
i32.const 113
i32.const 114
i32.const 44
call $~lib/env/abort
unreachable
@ -606,25 +606,18 @@
local.get $3
global.get $~lib/runtime/MAX_BYTELENGTH
i32.gt_u
if
i32.const 0
i32.const 152
i32.const 18
i32.const 47
call $~lib/env/abort
unreachable
end
local.get $2
local.get $3
i32.add
local.get $1
call $~lib/arraybuffer/ArrayBuffer#get:byteLength
i32.gt_u
i32.or
if
i32.const 0
i32.const 152
i32.const 19
i32.const 63
i32.const 22
i32.const 6
call $~lib/env/abort
unreachable
end
@ -714,7 +707,7 @@
if
i32.const 0
i32.const 152
i32.const 42
i32.const 45
i32.const 6
call $~lib/env/abort
unreachable
@ -791,7 +784,7 @@
if
i32.const 0
i32.const 152
i32.const 56
i32.const 59
i32.const 7
call $~lib/env/abort
unreachable
@ -823,7 +816,7 @@
if
i32.const 0
i32.const 152
i32.const 67
i32.const 70
i32.const 49
call $~lib/env/abort
unreachable
@ -865,7 +858,7 @@
if
i32.const 0
i32.const 152
i32.const 75
i32.const 78
i32.const 7
call $~lib/env/abort
unreachable
@ -915,7 +908,7 @@
if
i32.const 0
i32.const 152
i32.const 84
i32.const 87
i32.const 7
call $~lib/env/abort
unreachable
@ -990,7 +983,7 @@
if
i32.const 0
i32.const 152
i32.const 178
i32.const 181
i32.const 6
call $~lib/env/abort
unreachable
@ -1019,7 +1012,7 @@
if
i32.const 0
i32.const 152
i32.const 90
i32.const 93
i32.const 49
call $~lib/env/abort
unreachable
@ -1059,7 +1052,7 @@
if
i32.const 0
i32.const 152
i32.const 98
i32.const 101
i32.const 6
call $~lib/env/abort
unreachable
@ -1095,7 +1088,7 @@
if
i32.const 0
i32.const 152
i32.const 107
i32.const 110
i32.const 6
call $~lib/env/abort
unreachable
@ -1131,7 +1124,7 @@
if
i32.const 0
i32.const 152
i32.const 187
i32.const 190
i32.const 6
call $~lib/env/abort
unreachable
@ -1166,7 +1159,7 @@
if
i32.const 0
i32.const 152
i32.const 116
i32.const 119
i32.const 6
call $~lib/env/abort
unreachable
@ -1206,7 +1199,7 @@
if
i32.const 0
i32.const 152
i32.const 125
i32.const 128
i32.const 6
call $~lib/env/abort
unreachable
@ -1240,7 +1233,7 @@
if
i32.const 0
i32.const 152
i32.const 131
i32.const 134
i32.const 49
call $~lib/env/abort
unreachable
@ -1266,7 +1259,7 @@
if
i32.const 0
i32.const 152
i32.const 139
i32.const 142
i32.const 6
call $~lib/env/abort
unreachable
@ -1300,7 +1293,7 @@
if
i32.const 0
i32.const 152
i32.const 147
i32.const 150
i32.const 6
call $~lib/env/abort
unreachable
@ -1334,7 +1327,7 @@
if
i32.const 0
i32.const 152
i32.const 196
i32.const 199
i32.const 6
call $~lib/env/abort
unreachable
@ -1362,7 +1355,7 @@
if
i32.const 0
i32.const 152
i32.const 152
i32.const 155
i32.const 49
call $~lib/env/abort
unreachable
@ -1388,7 +1381,7 @@
if
i32.const 0
i32.const 152
i32.const 160
i32.const 163
i32.const 6
call $~lib/env/abort
unreachable
@ -1422,7 +1415,7 @@
if
i32.const 0
i32.const 152
i32.const 168
i32.const 171
i32.const 6
call $~lib/env/abort
unreachable
@ -1456,7 +1449,7 @@
if
i32.const 0
i32.const 152
i32.const 204
i32.const 207
i32.const 6
call $~lib/env/abort
unreachable

View File

@ -90,7 +90,7 @@
if
i32.const 0
i32.const 48
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -104,7 +104,7 @@
if
i32.const 0
i32.const 48
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable

View File

@ -150,7 +150,7 @@
if
i32.const 0
i32.const 48
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -165,7 +165,7 @@
if
i32.const 0
i32.const 48
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable

View File

@ -123,7 +123,7 @@
if
i32.const 0
i32.const 16
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -137,7 +137,7 @@
if
i32.const 0
i32.const 16
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable
@ -372,7 +372,7 @@
if
i32.const 0
i32.const 56
i32.const 24
i32.const 25
i32.const 43
call $~lib/env/abort
unreachable

View File

@ -156,7 +156,7 @@
if
i32.const 0
i32.const 16
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -171,7 +171,7 @@
if
i32.const 0
i32.const 16
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable
@ -453,7 +453,7 @@
if
i32.const 0
i32.const 56
i32.const 24
i32.const 25
i32.const 43
call $~lib/env/abort
unreachable

View File

@ -84,7 +84,7 @@
if
i32.const 0
i32.const 16
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -98,7 +98,7 @@
if
i32.const 0
i32.const 16
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable

View File

@ -143,7 +143,7 @@
if
i32.const 0
i32.const 16
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -158,7 +158,7 @@
if
i32.const 0
i32.const 16
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable

View File

@ -167,7 +167,7 @@
if
i32.const 0
i32.const 16
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -181,7 +181,7 @@
if
i32.const 0
i32.const 16
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable

View File

@ -211,7 +211,7 @@
if
i32.const 0
i32.const 16
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -226,7 +226,7 @@
if
i32.const 0
i32.const 16
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable

View File

@ -2616,7 +2616,7 @@
if
i32.const 0
i32.const 232
i32.const 107
i32.const 133
i32.const 8
call $~lib/env/abort
unreachable
@ -2653,7 +2653,7 @@
if
i32.const 0
i32.const 232
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -2667,7 +2667,7 @@
if
i32.const 0
i32.const 232
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable

View File

@ -3304,7 +3304,7 @@
if
i32.const 0
i32.const 232
i32.const 107
i32.const 133
i32.const 8
call $~lib/env/abort
unreachable
@ -3345,7 +3345,7 @@
if
i32.const 0
i32.const 232
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -3360,7 +3360,7 @@
if
i32.const 0
i32.const 232
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable

View File

@ -119,7 +119,7 @@
if
i32.const 0
i32.const 16
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -133,7 +133,7 @@
if
i32.const 0
i32.const 16
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable
@ -368,7 +368,7 @@
if
i32.const 0
i32.const 56
i32.const 24
i32.const 25
i32.const 43
call $~lib/env/abort
unreachable

View File

@ -156,7 +156,7 @@
if
i32.const 0
i32.const 16
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -171,7 +171,7 @@
if
i32.const 0
i32.const 16
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable
@ -453,7 +453,7 @@
if
i32.const 0
i32.const 56
i32.const 24
i32.const 25
i32.const 43
call $~lib/env/abort
unreachable

View File

@ -36,7 +36,7 @@
if
i32.const 0
i32.const 240
i32.const 69
i32.const 100
i32.const 61
call $~lib/env/abort
unreachable
@ -329,7 +329,7 @@
if
i32.const 0
i32.const 240
i32.const 10
i32.const 14
i32.const 64
call $~lib/env/abort
unreachable
@ -360,6 +360,10 @@
end
)
(func $~lib/array/Array<i32>#__set (; 5 ;) (type $FUNCSIG$v)
(local $0 i32)
i32.const 44
i32.load
local.set $0
i32.const 32
i32.const 2
call $~lib/array/ensureCapacity
@ -368,8 +372,7 @@
i32.const 2
i32.store
i32.const 0
i32.const 44
i32.load
local.get $0
i32.ge_s
if
i32.const 44
@ -387,7 +390,7 @@
if
i32.const 0
i32.const 240
i32.const 69
i32.const 100
i32.const 61
call $~lib/env/abort
unreachable
@ -401,6 +404,10 @@
i64.load
)
(func $~lib/array/Array<i64>#__set (; 7 ;) (type $FUNCSIG$v)
(local $0 i32)
i32.const 92
i32.load
local.set $0
i32.const 80
i32.const 3
call $~lib/array/ensureCapacity
@ -409,8 +416,7 @@
i64.const 4
i64.store
i32.const 0
i32.const 92
i32.load
local.get $0
i32.ge_s
if
i32.const 92
@ -428,7 +434,7 @@
if
i32.const 0
i32.const 240
i32.const 69
i32.const 100
i32.const 61
call $~lib/env/abort
unreachable
@ -442,6 +448,10 @@
f32.load
)
(func $~lib/array/Array<f32>#__set (; 9 ;) (type $FUNCSIG$v)
(local $0 i32)
i32.const 132
i32.load
local.set $0
i32.const 120
i32.const 2
call $~lib/array/ensureCapacity
@ -450,8 +460,7 @@
f32.const 2.5
f32.store
i32.const 0
i32.const 132
i32.load
local.get $0
i32.ge_s
if
i32.const 132
@ -469,7 +478,7 @@
if
i32.const 0
i32.const 240
i32.const 69
i32.const 100
i32.const 61
call $~lib/env/abort
unreachable
@ -483,6 +492,10 @@
f64.load
)
(func $~lib/array/Array<f64>#__set (; 11 ;) (type $FUNCSIG$v)
(local $0 i32)
i32.const 180
i32.load
local.set $0
i32.const 168
i32.const 3
call $~lib/array/ensureCapacity
@ -491,8 +504,7 @@
f64.const 2.25
f64.store
i32.const 0
i32.const 180
i32.load
local.get $0
i32.ge_s
if
i32.const 180

View File

@ -52,7 +52,7 @@
if
i32.const 0
i32.const 240
i32.const 69
i32.const 100
i32.const 61
call $~lib/env/abort
unreachable
@ -1837,7 +1837,7 @@
if
i32.const 0
i32.const 280
i32.const 107
i32.const 133
i32.const 8
call $~lib/env/abort
unreachable
@ -1889,7 +1889,7 @@
if
i32.const 0
i32.const 240
i32.const 10
i32.const 14
i32.const 64
call $~lib/env/abort
unreachable
@ -1928,6 +1928,10 @@
end
)
(func $~lib/array/Array<i32>#__set (; 11 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
local.get $0
i32.load offset=12
local.set $3
local.get $0
local.get $1
i32.const 1
@ -1943,8 +1947,7 @@
local.get $2
i32.store
local.get $1
local.get $0
i32.load offset=12
local.get $3
i32.ge_s
if
local.get $0
@ -1968,7 +1971,7 @@
if
i32.const 0
i32.const 240
i32.const 69
i32.const 100
i32.const 61
call $~lib/env/abort
unreachable
@ -1982,6 +1985,10 @@
i64.load
)
(func $~lib/array/Array<i64>#__set (; 14 ;) (type $FUNCSIG$viij) (param $0 i32) (param $1 i32) (param $2 i64)
(local $3 i32)
local.get $0
i32.load offset=12
local.set $3
local.get $0
local.get $1
i32.const 1
@ -1997,8 +2004,7 @@
local.get $2
i64.store
local.get $1
local.get $0
i32.load offset=12
local.get $3
i32.ge_s
if
local.get $0
@ -2022,7 +2028,7 @@
if
i32.const 0
i32.const 240
i32.const 69
i32.const 100
i32.const 61
call $~lib/env/abort
unreachable
@ -2036,6 +2042,10 @@
f32.load
)
(func $~lib/array/Array<f32>#__set (; 17 ;) (type $FUNCSIG$viif) (param $0 i32) (param $1 i32) (param $2 f32)
(local $3 i32)
local.get $0
i32.load offset=12
local.set $3
local.get $0
local.get $1
i32.const 1
@ -2051,8 +2061,7 @@
local.get $2
f32.store
local.get $1
local.get $0
i32.load offset=12
local.get $3
i32.ge_s
if
local.get $0
@ -2076,7 +2085,7 @@
if
i32.const 0
i32.const 240
i32.const 69
i32.const 100
i32.const 61
call $~lib/env/abort
unreachable
@ -2090,6 +2099,10 @@
f64.load
)
(func $~lib/array/Array<f64>#__set (; 20 ;) (type $FUNCSIG$viid) (param $0 i32) (param $1 i32) (param $2 f64)
(local $3 i32)
local.get $0
i32.load offset=12
local.set $3
local.get $0
local.get $1
i32.const 1
@ -2105,8 +2118,7 @@
local.get $2
f64.store
local.get $1
local.get $0
i32.load offset=12
local.get $3
i32.ge_s
if
local.get $0

View File

@ -1514,7 +1514,7 @@
if
i32.const 0
i32.const 136
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -1528,7 +1528,7 @@
if
i32.const 0
i32.const 136
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable
@ -1596,7 +1596,7 @@
if
i32.const 0
i32.const 96
i32.const 447
i32.const 448
i32.const 8
call $~lib/env/abort
unreachable
@ -1643,7 +1643,7 @@
if
i32.const 0
i32.const 96
i32.const 451
i32.const 452
i32.const 8
call $~lib/env/abort
unreachable
@ -1716,7 +1716,7 @@
if
i32.const 0
i32.const 96
i32.const 463
i32.const 464
i32.const 8
call $~lib/env/abort
unreachable
@ -1769,7 +1769,7 @@
if
i32.const 0
i32.const 96
i32.const 472
i32.const 473
i32.const 4
call $~lib/env/abort
unreachable

View File

@ -1928,7 +1928,7 @@
if
i32.const 0
i32.const 136
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -1943,7 +1943,7 @@
if
i32.const 0
i32.const 136
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable
@ -2036,7 +2036,7 @@
if
i32.const 0
i32.const 96
i32.const 447
i32.const 448
i32.const 8
call $~lib/env/abort
unreachable
@ -2090,7 +2090,7 @@
if
i32.const 0
i32.const 96
i32.const 451
i32.const 452
i32.const 8
call $~lib/env/abort
unreachable
@ -2185,7 +2185,7 @@
if
i32.const 0
i32.const 96
i32.const 463
i32.const 464
i32.const 8
call $~lib/env/abort
unreachable
@ -2248,7 +2248,7 @@
if
i32.const 0
i32.const 96
i32.const 472
i32.const 473
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

View File

@ -143,7 +143,7 @@
if
i32.const 0
i32.const 72
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -157,7 +157,7 @@
if
i32.const 0
i32.const 72
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable
@ -392,7 +392,7 @@
if
i32.const 0
i32.const 112
i32.const 24
i32.const 25
i32.const 43
call $~lib/env/abort
unreachable

View File

@ -201,7 +201,7 @@
if
i32.const 0
i32.const 72
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -216,7 +216,7 @@
if
i32.const 0
i32.const 72
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable
@ -498,7 +498,7 @@
if
i32.const 0
i32.const 112
i32.const 24
i32.const 25
i32.const 43
call $~lib/env/abort
unreachable

View File

@ -403,7 +403,7 @@
if
i32.const 0
i32.const 64
i32.const 217
i32.const 313
i32.const 2
call $~lib/env/abort
unreachable
@ -417,7 +417,7 @@
if
i32.const 0
i32.const 64
i32.const 218
i32.const 314
i32.const 2
call $~lib/env/abort
unreachable
@ -441,7 +441,7 @@
if
i32.const 0
i32.const 104
i32.const 24
i32.const 25
i32.const 43
call $~lib/env/abort
unreachable
@ -465,7 +465,7 @@
if
i32.const 0
i32.const 64
i32.const 251
i32.const 348
i32.const 57
call $~lib/env/abort
unreachable
@ -1078,7 +1078,7 @@
if
i32.const 0
i32.const 152
i32.const 441
i32.const 442
i32.const 63
call $~lib/env/abort
unreachable
@ -1102,7 +1102,7 @@
if
i32.const 0
i32.const 152
i32.const 435
i32.const 436
i32.const 63
call $~lib/env/abort
unreachable
@ -1212,7 +1212,7 @@
if
i32.const 0
i32.const 152
i32.const 851
i32.const 852
i32.const 63
call $~lib/env/abort
unreachable
@ -1750,7 +1750,7 @@
if
i32.const 0
i32.const 152
i32.const 845
i32.const 846
i32.const 63
call $~lib/env/abort
unreachable
@ -1771,7 +1771,7 @@
if
i32.const 0
i32.const 152
i32.const 195
i32.const 196
i32.const 44
call $~lib/env/abort
unreachable
@ -1803,7 +1803,7 @@
if
i32.const 0
i32.const 152
i32.const 189
i32.const 190
i32.const 44
call $~lib/env/abort
unreachable
@ -1822,7 +1822,7 @@
if
i32.const 0
i32.const 152
i32.const 31
i32.const 32
i32.const 44
call $~lib/env/abort
unreachable
@ -2992,40 +2992,39 @@
end
end
)
(func $~lib/runtime/doWrapArray (; 36 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(func $~lib/runtime/doMakeArray (; 36 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
(local $4 i32)
i32.const 16
call $~lib/runtime/doAllocate
local.get $1
call $~lib/runtime/doRegister
local.tee $3
local.get $0
i32.const 8
i32.sub
i32.load offset=4
local.tee $4
call $~lib/runtime/doAllocate
local.get $1
call $~lib/runtime/doRegister
local.tee $1
i32.store
local.get $3
local.get $1
i32.store offset=4
local.get $3
local.get $4
i32.store offset=8
local.get $3
local.get $4
local.get $2
i32.shr_u
call $~lib/runtime/doRegister
local.tee $2
local.get $0
local.get $3
i32.shl
local.tee $3
call $~lib/runtime/doAllocate
i32.const 2
call $~lib/runtime/doRegister
local.tee $4
i32.store
local.get $2
local.get $4
i32.store offset=4
local.get $2
local.get $3
i32.store offset=8
local.get $2
local.get $0
i32.store offset=12
local.get $1
local.get $0
if
local.get $4
call $~lib/memory/memory.copy
local.get $1
local.get $3
call $~lib/memory/memory.copy
end
local.get $2
)
(func $~lib/typedarray/Int8Array#__get (; 37 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
local.get $1
@ -3035,7 +3034,7 @@
if
i32.const 0
i32.const 152
i32.const 25
i32.const 26
i32.const 44
call $~lib/env/abort
unreachable
@ -3054,7 +3053,7 @@
if
i32.const 0
i32.const 216
i32.const 69
i32.const 100
i32.const 61
call $~lib/env/abort
unreachable
@ -3274,7 +3273,7 @@
if
i32.const 0
i32.const 216
i32.const 69
i32.const 100
i32.const 61
call $~lib/env/abort
unreachable
@ -3414,7 +3413,7 @@
if
i32.const 0
i32.const 152
i32.const 113
i32.const 114
i32.const 44
call $~lib/env/abort
unreachable
@ -3537,7 +3536,7 @@
if
i32.const 0
i32.const 152
i32.const 277
i32.const 278
i32.const 63
call $~lib/env/abort
unreachable
@ -3633,7 +3632,7 @@
if
i32.const 0
i32.const 152
i32.const 359
i32.const 360
i32.const 63
call $~lib/env/abort
unreachable
@ -3800,7 +3799,7 @@
if
i32.const 0
i32.const 152
i32.const 523
i32.const 524
i32.const 63
call $~lib/env/abort
unreachable
@ -3854,7 +3853,7 @@
if
i32.const 0
i32.const 152
i32.const 605
i32.const 606
i32.const 63
call $~lib/env/abort
unreachable
@ -3954,7 +3953,7 @@
if
i32.const 0
i32.const 152
i32.const 687
i32.const 688
i32.const 63
call $~lib/env/abort
unreachable
@ -4008,7 +4007,7 @@
if
i32.const 0
i32.const 152
i32.const 769
i32.const 770
i32.const 63
call $~lib/env/abort
unreachable
@ -4998,7 +4997,7 @@
if
i32.const 0
i32.const 152
i32.const 107
i32.const 108
i32.const 44
call $~lib/env/abort
unreachable
@ -5236,7 +5235,7 @@
if
i32.const 0
i32.const 152
i32.const 271
i32.const 272
i32.const 63
call $~lib/env/abort
unreachable
@ -5372,7 +5371,7 @@
if
i32.const 0
i32.const 152
i32.const 353
i32.const 354
i32.const 63
call $~lib/env/abort
unreachable
@ -5621,7 +5620,7 @@
if
i32.const 0
i32.const 152
i32.const 517
i32.const 518
i32.const 63
call $~lib/env/abort
unreachable
@ -5762,7 +5761,7 @@
if
i32.const 0
i32.const 152
i32.const 599
i32.const 600
i32.const 63
call $~lib/env/abort
unreachable
@ -5898,7 +5897,7 @@
if
i32.const 0
i32.const 152
i32.const 681
i32.const 682
i32.const 63
call $~lib/env/abort
unreachable
@ -6039,7 +6038,7 @@
if
i32.const 0
i32.const 152
i32.const 763
i32.const 764
i32.const 63
call $~lib/env/abort
unreachable
@ -12892,10 +12891,11 @@
i32.const 3
call $~lib/typedarray/Int8Array#fill
global.get $std/typedarray/arr8
i32.const 5
i32.const 200
i32.const 15
i32.const 0
call $~lib/runtime/doWrapArray
call $~lib/runtime/doMakeArray
call $std/typedarray/isInt8ArrayEqual
i32.eqz
if
@ -12912,10 +12912,11 @@
i32.const 2147483647
call $~lib/typedarray/Int8Array#fill
global.get $std/typedarray/arr8
i32.const 5
i32.const 256
i32.const 15
i32.const 0
call $~lib/runtime/doWrapArray
call $~lib/runtime/doMakeArray
call $std/typedarray/isInt8ArrayEqual
i32.eqz
if
@ -12932,10 +12933,11 @@
i32.const -3
call $~lib/typedarray/Int8Array#fill
global.get $std/typedarray/arr8
i32.const 5
i32.const 272
i32.const 15
i32.const 0
call $~lib/runtime/doWrapArray
call $~lib/runtime/doMakeArray
call $std/typedarray/isInt8ArrayEqual
i32.eqz
if
@ -12952,10 +12954,11 @@
i32.const 2147483647
call $~lib/typedarray/Int8Array#fill
global.get $std/typedarray/arr8
i32.const 5
i32.const 288
i32.const 15
i32.const 0
call $~lib/runtime/doWrapArray
call $~lib/runtime/doMakeArray
call $std/typedarray/isInt8ArrayEqual
i32.eqz
if
@ -12972,10 +12975,11 @@
i32.const 0
call $~lib/typedarray/Int8Array#fill
global.get $std/typedarray/arr8
i32.const 5
i32.const 304
i32.const 15
i32.const 0
call $~lib/runtime/doWrapArray
call $~lib/runtime/doMakeArray
call $std/typedarray/isInt8ArrayEqual
i32.eqz
if
@ -13037,10 +13041,11 @@
unreachable
end
global.get $std/typedarray/sub8
i32.const 3
i32.const 320
i32.const 15
i32.const 0
call $~lib/runtime/doWrapArray
call $~lib/runtime/doMakeArray
call $std/typedarray/isInt8ArrayEqual
i32.eqz
if
@ -13052,10 +13057,11 @@
unreachable
end
global.get $std/typedarray/arr8
i32.const 5
i32.const 336
i32.const 15
i32.const 0
call $~lib/runtime/doWrapArray
call $~lib/runtime/doMakeArray
call $std/typedarray/isInt8ArrayEqual
i32.eqz
if
@ -13095,10 +13101,11 @@
i32.const 3
call $~lib/typedarray/Int32Array#fill
global.get $std/typedarray/arr32
i32.const 5
i32.const 352
i32.const 16
i32.const 2
call $~lib/runtime/doWrapArray
call $~lib/runtime/doMakeArray
call $std/typedarray/isInt32ArrayEqual
i32.eqz
if
@ -13115,10 +13122,11 @@
i32.const 2147483647
call $~lib/typedarray/Int32Array#fill
global.get $std/typedarray/arr32
i32.const 5
i32.const 384
i32.const 16
i32.const 2
call $~lib/runtime/doWrapArray
call $~lib/runtime/doMakeArray
call $std/typedarray/isInt32ArrayEqual
i32.eqz
if
@ -13135,10 +13143,11 @@
i32.const -3
call $~lib/typedarray/Int32Array#fill
global.get $std/typedarray/arr32
i32.const 5
i32.const 416
i32.const 16
i32.const 2
call $~lib/runtime/doWrapArray
call $~lib/runtime/doMakeArray
call $std/typedarray/isInt32ArrayEqual
i32.eqz
if
@ -13155,10 +13164,11 @@
i32.const 2147483647
call $~lib/typedarray/Int32Array#fill
global.get $std/typedarray/arr32
i32.const 5
i32.const 448
i32.const 16
i32.const 2
call $~lib/runtime/doWrapArray
call $~lib/runtime/doMakeArray
call $std/typedarray/isInt32ArrayEqual
i32.eqz
if
@ -13175,10 +13185,11 @@
i32.const 0
call $~lib/typedarray/Int32Array#fill
global.get $std/typedarray/arr32
i32.const 5
i32.const 480
i32.const 16
i32.const 2
call $~lib/runtime/doWrapArray
call $~lib/runtime/doMakeArray
call $std/typedarray/isInt32ArrayEqual
i32.eqz
if
@ -13242,10 +13253,11 @@
unreachable
end
global.get $std/typedarray/sub32
i32.const 3
i32.const 512
i32.const 16
i32.const 2
call $~lib/runtime/doWrapArray
call $~lib/runtime/doMakeArray
call $std/typedarray/isInt32ArrayEqual
i32.eqz
if
@ -13257,10 +13269,11 @@
unreachable
end
global.get $std/typedarray/arr32
i32.const 5
i32.const 536
i32.const 16
i32.const 2
call $~lib/runtime/doWrapArray
call $~lib/runtime/doMakeArray
call $std/typedarray/isInt32ArrayEqual
i32.eqz
if

File diff suppressed because it is too large Load Diff