mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-04-25 07:02:13 +00:00
Rework inlining logic (#463)
This commit is contained in:
parent
01cade13f9
commit
831054dfd3
130
src/builtins.ts
130
src/builtins.ts
@ -154,7 +154,7 @@ export function compileCall(
|
||||
}
|
||||
let element = compiler.resolver.resolveExpression(
|
||||
operands[0],
|
||||
compiler.currentFunction,
|
||||
compiler.currentFlow,
|
||||
Type.void,
|
||||
ReportMode.SWALLOW
|
||||
);
|
||||
@ -639,11 +639,11 @@ export function compileCall(
|
||||
case TypeKind.I8:
|
||||
case TypeKind.I16:
|
||||
case TypeKind.I32: {
|
||||
let currentFunction = compiler.currentFunction;
|
||||
let flow = compiler.currentFlow;
|
||||
|
||||
// possibly overflows, e.g. abs<i8>(-128) == 128
|
||||
let tempLocal1 = currentFunction.getTempLocal(Type.i32, false);
|
||||
let tempLocalIndex2 = currentFunction.getAndFreeTempLocal(Type.i32, false).index;
|
||||
let tempLocal1 = flow.getTempLocal(Type.i32, false);
|
||||
let tempLocalIndex2 = flow.getAndFreeTempLocal(Type.i32, false).index;
|
||||
let tempLocalIndex1 = tempLocal1.index;
|
||||
|
||||
// (x + (x >> 31)) ^ (x >> 31)
|
||||
@ -661,16 +661,16 @@ export function compileCall(
|
||||
module.createGetLocal(tempLocalIndex2, NativeType.I32)
|
||||
);
|
||||
|
||||
currentFunction.freeTempLocal(tempLocal1);
|
||||
flow.freeTempLocal(tempLocal1);
|
||||
break;
|
||||
}
|
||||
case TypeKind.ISIZE: {
|
||||
let options = compiler.options;
|
||||
let currentFunction = compiler.currentFunction;
|
||||
let flow = compiler.currentFlow;
|
||||
let wasm64 = options.isWasm64;
|
||||
|
||||
let tempLocal1 = currentFunction.getTempLocal(options.usizeType, false);
|
||||
let tempLocalIndex2 = currentFunction.getAndFreeTempLocal(options.usizeType, false).index;
|
||||
let tempLocal1 = flow.getTempLocal(options.usizeType, false);
|
||||
let tempLocalIndex2 = flow.getAndFreeTempLocal(options.usizeType, false).index;
|
||||
let tempLocalIndex1 = tempLocal1.index;
|
||||
|
||||
ret = module.createBinary(wasm64 ? BinaryOp.XorI64 : BinaryOp.XorI32,
|
||||
@ -687,14 +687,14 @@ export function compileCall(
|
||||
module.createGetLocal(tempLocalIndex2, options.nativeSizeType)
|
||||
);
|
||||
|
||||
currentFunction.freeTempLocal(tempLocal1);
|
||||
flow.freeTempLocal(tempLocal1);
|
||||
break;
|
||||
}
|
||||
case TypeKind.I64: {
|
||||
let currentFunction = compiler.currentFunction;
|
||||
let flow = compiler.currentFlow;
|
||||
|
||||
let tempLocal1 = currentFunction.getTempLocal(Type.i64, false);
|
||||
let tempLocalIndex2 = currentFunction.getAndFreeTempLocal(Type.i64, false).index;
|
||||
let tempLocal1 = flow.getTempLocal(Type.i64, false);
|
||||
let tempLocalIndex2 = flow.getAndFreeTempLocal(Type.i64, false).index;
|
||||
let tempLocalIndex1 = tempLocal1.index;
|
||||
|
||||
// (x + (x >> 63)) ^ (x >> 63)
|
||||
@ -712,7 +712,7 @@ export function compileCall(
|
||||
module.createGetLocal(tempLocalIndex2, NativeType.I64)
|
||||
);
|
||||
|
||||
currentFunction.freeTempLocal(tempLocal1);
|
||||
flow.freeTempLocal(tempLocal1);
|
||||
break;
|
||||
}
|
||||
case TypeKind.USIZE: {
|
||||
@ -792,16 +792,16 @@ export function compileCall(
|
||||
case TypeKind.I8:
|
||||
case TypeKind.I16:
|
||||
case TypeKind.I32: {
|
||||
let flow = compiler.currentFunction.flow;
|
||||
let tempLocal0 = compiler.currentFunction.getTempLocal(
|
||||
let flow = compiler.currentFlow;
|
||||
let tempLocal0 = flow.getTempLocal(
|
||||
compiler.currentType,
|
||||
!flow.canOverflow(arg0, compiler.currentType)
|
||||
);
|
||||
let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(
|
||||
let tempLocal1 = flow.getAndFreeTempLocal(
|
||||
compiler.currentType,
|
||||
!flow.canOverflow(arg1, compiler.currentType)
|
||||
);
|
||||
compiler.currentFunction.freeTempLocal(tempLocal0);
|
||||
flow.freeTempLocal(tempLocal0);
|
||||
ret = module.createSelect(
|
||||
module.createTeeLocal(tempLocal0.index, arg0),
|
||||
module.createTeeLocal(tempLocal1.index, arg1),
|
||||
@ -816,16 +816,16 @@ export function compileCall(
|
||||
case TypeKind.U16:
|
||||
case TypeKind.U32:
|
||||
case TypeKind.BOOL: {
|
||||
let flow = compiler.currentFunction.flow;
|
||||
let tempLocal0 = compiler.currentFunction.getTempLocal(
|
||||
let flow = compiler.currentFlow;
|
||||
let tempLocal0 = flow.getTempLocal(
|
||||
compiler.currentType,
|
||||
!flow.canOverflow(arg0, compiler.currentType)
|
||||
);
|
||||
let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(
|
||||
let tempLocal1 = flow.getAndFreeTempLocal(
|
||||
compiler.currentType,
|
||||
!flow.canOverflow(arg1, compiler.currentType)
|
||||
);
|
||||
compiler.currentFunction.freeTempLocal(tempLocal0);
|
||||
flow.freeTempLocal(tempLocal0);
|
||||
ret = module.createSelect(
|
||||
module.createTeeLocal(tempLocal0.index, arg0),
|
||||
module.createTeeLocal(tempLocal1.index, arg1),
|
||||
@ -837,9 +837,10 @@ export function compileCall(
|
||||
break;
|
||||
}
|
||||
case TypeKind.I64: {
|
||||
let tempLocal0 = compiler.currentFunction.getTempLocal(Type.i64, false);
|
||||
let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(Type.i64, false);
|
||||
compiler.currentFunction.freeTempLocal(tempLocal0);
|
||||
let flow = compiler.currentFlow;
|
||||
let tempLocal0 = flow.getTempLocal(Type.i64, false);
|
||||
let tempLocal1 = flow.getAndFreeTempLocal(Type.i64, false);
|
||||
flow.freeTempLocal(tempLocal0);
|
||||
ret = module.createSelect(
|
||||
module.createTeeLocal(tempLocal0.index, arg0),
|
||||
module.createTeeLocal(tempLocal1.index, arg1),
|
||||
@ -851,9 +852,10 @@ export function compileCall(
|
||||
break;
|
||||
}
|
||||
case TypeKind.U64: {
|
||||
let tempLocal0 = compiler.currentFunction.getTempLocal(Type.i64, false);
|
||||
let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(Type.i64, false);
|
||||
compiler.currentFunction.freeTempLocal(tempLocal0);
|
||||
let flow = compiler.currentFlow;
|
||||
let tempLocal0 = flow.getTempLocal(Type.i64, false);
|
||||
let tempLocal1 = flow.getAndFreeTempLocal(Type.i64, false);
|
||||
flow.freeTempLocal(tempLocal0);
|
||||
ret = module.createSelect(
|
||||
module.createTeeLocal(tempLocal0.index, arg0),
|
||||
module.createTeeLocal(tempLocal1.index, arg1),
|
||||
@ -865,9 +867,10 @@ export function compileCall(
|
||||
break;
|
||||
}
|
||||
case TypeKind.ISIZE: {
|
||||
let tempLocal0 = compiler.currentFunction.getTempLocal(compiler.options.usizeType, false);
|
||||
let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(compiler.options.usizeType, false);
|
||||
compiler.currentFunction.freeTempLocal(tempLocal0);
|
||||
let flow = compiler.currentFlow;
|
||||
let tempLocal0 = flow.getTempLocal(compiler.options.usizeType, false);
|
||||
let tempLocal1 = flow.getAndFreeTempLocal(compiler.options.usizeType, false);
|
||||
flow.freeTempLocal(tempLocal0);
|
||||
ret = module.createSelect(
|
||||
module.createTeeLocal(tempLocal0.index, arg0),
|
||||
module.createTeeLocal(tempLocal1.index, arg1),
|
||||
@ -890,9 +893,10 @@ export function compileCall(
|
||||
ret = module.createUnreachable();
|
||||
break;
|
||||
}
|
||||
let tempLocal0 = compiler.currentFunction.getTempLocal(compiler.options.usizeType, false);
|
||||
let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(compiler.options.usizeType, false);
|
||||
compiler.currentFunction.freeTempLocal(tempLocal0);
|
||||
let flow = compiler.currentFlow;
|
||||
let tempLocal0 = flow.getTempLocal(compiler.options.usizeType, false);
|
||||
let tempLocal1 = flow.getAndFreeTempLocal(compiler.options.usizeType, false);
|
||||
flow.freeTempLocal(tempLocal0);
|
||||
ret = module.createSelect(
|
||||
module.createTeeLocal(tempLocal0.index, arg0),
|
||||
module.createTeeLocal(tempLocal1.index, arg1),
|
||||
@ -960,16 +964,16 @@ export function compileCall(
|
||||
case TypeKind.I8:
|
||||
case TypeKind.I16:
|
||||
case TypeKind.I32: {
|
||||
let flow = compiler.currentFunction.flow;
|
||||
let tempLocal0 = compiler.currentFunction.getTempLocal(
|
||||
let flow = compiler.currentFlow;
|
||||
let tempLocal0 = flow.getTempLocal(
|
||||
compiler.currentType,
|
||||
!flow.canOverflow(arg0, compiler.currentType)
|
||||
);
|
||||
let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(
|
||||
let tempLocal1 = flow.getAndFreeTempLocal(
|
||||
compiler.currentType,
|
||||
!flow.canOverflow(arg1, compiler.currentType)
|
||||
);
|
||||
compiler.currentFunction.freeTempLocal(tempLocal0);
|
||||
flow.freeTempLocal(tempLocal0);
|
||||
ret = module.createSelect(
|
||||
module.createTeeLocal(tempLocal0.index, arg0),
|
||||
module.createTeeLocal(tempLocal1.index, arg1),
|
||||
@ -984,16 +988,16 @@ export function compileCall(
|
||||
case TypeKind.U16:
|
||||
case TypeKind.U32:
|
||||
case TypeKind.BOOL: {
|
||||
let flow = compiler.currentFunction.flow;
|
||||
let tempLocal0 = compiler.currentFunction.getTempLocal(
|
||||
let flow = compiler.currentFlow;
|
||||
let tempLocal0 = flow.getTempLocal(
|
||||
compiler.currentType,
|
||||
!flow.canOverflow(arg0, compiler.currentType)
|
||||
);
|
||||
let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(
|
||||
let tempLocal1 = flow.getAndFreeTempLocal(
|
||||
compiler.currentType,
|
||||
!flow.canOverflow(arg1, compiler.currentType)
|
||||
);
|
||||
compiler.currentFunction.freeTempLocal(tempLocal0);
|
||||
flow.freeTempLocal(tempLocal0);
|
||||
ret = module.createSelect(
|
||||
module.createTeeLocal(tempLocal0.index, arg0),
|
||||
module.createTeeLocal(tempLocal1.index, arg1),
|
||||
@ -1005,9 +1009,10 @@ export function compileCall(
|
||||
break;
|
||||
}
|
||||
case TypeKind.I64: {
|
||||
let tempLocal0 = compiler.currentFunction.getTempLocal(Type.i64, false);
|
||||
let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(Type.i64, false);
|
||||
compiler.currentFunction.freeTempLocal(tempLocal0);
|
||||
let flow = compiler.currentFlow;
|
||||
let tempLocal0 = flow.getTempLocal(Type.i64, false);
|
||||
let tempLocal1 = flow.getAndFreeTempLocal(Type.i64, false);
|
||||
flow.freeTempLocal(tempLocal0);
|
||||
ret = module.createSelect(
|
||||
module.createTeeLocal(tempLocal0.index, arg0),
|
||||
module.createTeeLocal(tempLocal1.index, arg1),
|
||||
@ -1019,9 +1024,10 @@ export function compileCall(
|
||||
break;
|
||||
}
|
||||
case TypeKind.U64: {
|
||||
let tempLocal0 = compiler.currentFunction.getTempLocal(Type.i64, false);
|
||||
let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(Type.i64, false);
|
||||
compiler.currentFunction.freeTempLocal(tempLocal0);
|
||||
let flow = compiler.currentFlow;
|
||||
let tempLocal0 = flow.getTempLocal(Type.i64, false);
|
||||
let tempLocal1 = flow.getAndFreeTempLocal(Type.i64, false);
|
||||
flow.freeTempLocal(tempLocal0);
|
||||
ret = module.createSelect(
|
||||
module.createTeeLocal(tempLocal0.index, arg0),
|
||||
module.createTeeLocal(tempLocal1.index, arg1),
|
||||
@ -1033,9 +1039,10 @@ export function compileCall(
|
||||
break;
|
||||
}
|
||||
case TypeKind.ISIZE: {
|
||||
let tempLocal0 = compiler.currentFunction.getTempLocal(compiler.options.usizeType, false);
|
||||
let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(compiler.options.usizeType, false);
|
||||
compiler.currentFunction.freeTempLocal(tempLocal0);
|
||||
let flow = compiler.currentFlow;
|
||||
let tempLocal0 = flow.getTempLocal(compiler.options.usizeType, false);
|
||||
let tempLocal1 = flow.getAndFreeTempLocal(compiler.options.usizeType, false);
|
||||
flow.freeTempLocal(tempLocal0);
|
||||
ret = module.createSelect(
|
||||
module.createTeeLocal(tempLocal0.index, arg0),
|
||||
module.createTeeLocal(tempLocal1.index, arg1),
|
||||
@ -1058,9 +1065,10 @@ export function compileCall(
|
||||
ret = module.createUnreachable();
|
||||
break;
|
||||
}
|
||||
let tempLocal0 = compiler.currentFunction.getTempLocal(compiler.options.usizeType, false);
|
||||
let tempLocal1 = compiler.currentFunction.getAndFreeTempLocal(compiler.options.usizeType, false);
|
||||
compiler.currentFunction.freeTempLocal(tempLocal0);
|
||||
let flow = compiler.currentFlow;
|
||||
let tempLocal0 = flow.getTempLocal(compiler.options.usizeType, false);
|
||||
let tempLocal1 = flow.getAndFreeTempLocal(compiler.options.usizeType, false);
|
||||
flow.freeTempLocal(tempLocal0);
|
||||
ret = module.createSelect(
|
||||
module.createTeeLocal(tempLocal0.index, arg0),
|
||||
module.createTeeLocal(tempLocal1.index, arg1),
|
||||
@ -2186,8 +2194,8 @@ export function compileCall(
|
||||
case TypeKind.U8:
|
||||
case TypeKind.U16:
|
||||
case TypeKind.BOOL: {
|
||||
let flow = compiler.currentFunction.flow;
|
||||
let tempLocal = compiler.currentFunction.getAndFreeTempLocal(
|
||||
let flow = compiler.currentFlow;
|
||||
let tempLocal = flow.getAndFreeTempLocal(
|
||||
compiler.currentType,
|
||||
!flow.canOverflow(arg0, compiler.currentType)
|
||||
);
|
||||
@ -2201,7 +2209,7 @@ export function compileCall(
|
||||
case TypeKind.I32:
|
||||
case TypeKind.U32:
|
||||
default: {
|
||||
let tempLocal = compiler.currentFunction.getAndFreeTempLocal(Type.i32, false);
|
||||
let tempLocal = compiler.currentFlow.getAndFreeTempLocal(Type.i32, false);
|
||||
ret = module.createIf(
|
||||
module.createTeeLocal(tempLocal.index, arg0),
|
||||
module.createGetLocal(tempLocal.index, NativeType.I32),
|
||||
@ -2211,7 +2219,7 @@ export function compileCall(
|
||||
}
|
||||
case TypeKind.I64:
|
||||
case TypeKind.U64: {
|
||||
let tempLocal = compiler.currentFunction.getAndFreeTempLocal(Type.i64, false);
|
||||
let tempLocal = compiler.currentFlow.getAndFreeTempLocal(Type.i64, false);
|
||||
ret = module.createIf(
|
||||
module.createUnary(UnaryOp.EqzI64,
|
||||
module.createTeeLocal(tempLocal.index, arg0)
|
||||
@ -2223,7 +2231,7 @@ export function compileCall(
|
||||
}
|
||||
case TypeKind.ISIZE:
|
||||
case TypeKind.USIZE: {
|
||||
let tempLocal = compiler.currentFunction.getAndFreeTempLocal(compiler.options.usizeType, false);
|
||||
let tempLocal = compiler.currentFlow.getAndFreeTempLocal(compiler.options.usizeType, false);
|
||||
ret = module.createIf(
|
||||
module.createUnary(
|
||||
compiler.options.isWasm64
|
||||
@ -2237,7 +2245,7 @@ export function compileCall(
|
||||
break;
|
||||
}
|
||||
case TypeKind.F32: {
|
||||
let tempLocal = compiler.currentFunction.getAndFreeTempLocal(Type.f32, false);
|
||||
let tempLocal = compiler.currentFlow.getAndFreeTempLocal(Type.f32, false);
|
||||
ret = module.createIf(
|
||||
module.createBinary(BinaryOp.EqF32,
|
||||
module.createTeeLocal(tempLocal.index, arg0),
|
||||
@ -2249,7 +2257,7 @@ export function compileCall(
|
||||
break;
|
||||
}
|
||||
case TypeKind.F64: {
|
||||
let tempLocal = compiler.currentFunction.getAndFreeTempLocal(Type.f64, false);
|
||||
let tempLocal = compiler.currentFlow.getAndFreeTempLocal(Type.f64, false);
|
||||
ret = module.createIf(
|
||||
module.createBinary(BinaryOp.EqF64,
|
||||
module.createTeeLocal(tempLocal.index, arg0),
|
||||
@ -2286,7 +2294,7 @@ export function compileCall(
|
||||
);
|
||||
return module.createUnreachable();
|
||||
}
|
||||
let flow = compiler.currentFunction.flow;
|
||||
let flow = compiler.currentFlow;
|
||||
flow.set(FlowFlags.UNCHECKED_CONTEXT);
|
||||
ret = compiler.compileExpressionRetainType(operands[0], contextualType, WrapMode.NONE);
|
||||
flow.unset(FlowFlags.UNCHECKED_CONTEXT);
|
||||
|
915
src/compiler.ts
915
src/compiler.ts
File diff suppressed because it is too large
Load Diff
498
src/program.ts
498
src/program.ts
@ -584,7 +584,7 @@ export class Program extends DiagnosticEmitter {
|
||||
let derivedPrototype = queuedExtends[i];
|
||||
let derivedDeclaration = derivedPrototype.declaration;
|
||||
let derivedType = assert(derivedDeclaration.extendsType);
|
||||
let baseElement = resolver.resolveIdentifier(derivedType.name, null); // reports
|
||||
let baseElement = resolver.resolveIdentifier(derivedType.name, null, null); // reports
|
||||
if (!baseElement) continue;
|
||||
if (baseElement.kind == ElementKind.CLASS_PROTOTYPE) {
|
||||
let basePrototype = <ClassPrototype>baseElement;
|
||||
@ -2473,8 +2473,6 @@ export class Function extends Element {
|
||||
localsByIndex: Local[] = [];
|
||||
/** List of additional non-parameter locals. */
|
||||
additionalLocals: Type[] = [];
|
||||
/** Current break context label. */
|
||||
breakContext: string | null = null;
|
||||
/** Contextual type arguments. */
|
||||
contextualTypeArguments: Map<string,Type> | null;
|
||||
/** Current control flow. */
|
||||
@ -2490,8 +2488,6 @@ export class Function extends Element {
|
||||
/** The outer scope, if a function expression. */
|
||||
outerScope: Flow | null = null;
|
||||
|
||||
private nextBreakId: i32 = 0;
|
||||
private breakStack: i32[] | null = null;
|
||||
nextInlineId: i32 = 0;
|
||||
|
||||
/** Constructs a new concrete function. */
|
||||
@ -2509,45 +2505,42 @@ export class Function extends Element {
|
||||
this.flags = prototype.flags;
|
||||
this.decoratorFlags = prototype.decoratorFlags;
|
||||
this.contextualTypeArguments = contextualTypeArguments;
|
||||
if (prototype.internalName != "NATIVE_CODE") { // e.g. generated constructor without a real prototype
|
||||
if (!(prototype.is(CommonFlags.AMBIENT))) {
|
||||
let localIndex = 0;
|
||||
if (parent && parent.kind == ElementKind.CLASS) {
|
||||
assert(this.is(CommonFlags.INSTANCE));
|
||||
let local = new Local(
|
||||
prototype.program,
|
||||
"this",
|
||||
localIndex++,
|
||||
assert(signature.thisType)
|
||||
);
|
||||
this.localsByName.set("this", local);
|
||||
this.localsByIndex[local.index] = local;
|
||||
let inheritedTypeArguments = (<Class>parent).contextualTypeArguments;
|
||||
if (inheritedTypeArguments) {
|
||||
if (!this.contextualTypeArguments) this.contextualTypeArguments = new Map();
|
||||
for (let [inheritedName, inheritedType] of inheritedTypeArguments) {
|
||||
if (!this.contextualTypeArguments.has(inheritedName)) {
|
||||
this.contextualTypeArguments.set(inheritedName, inheritedType);
|
||||
}
|
||||
if (!prototype.is(CommonFlags.AMBIENT)) {
|
||||
let localIndex = 0;
|
||||
if (parent && parent.kind == ElementKind.CLASS) {
|
||||
let local = new Local(
|
||||
prototype.program,
|
||||
"this",
|
||||
localIndex++,
|
||||
assert(signature.thisType)
|
||||
);
|
||||
this.localsByName.set("this", local);
|
||||
this.localsByIndex[local.index] = local;
|
||||
let inheritedTypeArguments = (<Class>parent).contextualTypeArguments;
|
||||
if (inheritedTypeArguments) {
|
||||
if (!this.contextualTypeArguments) this.contextualTypeArguments = new Map();
|
||||
for (let [inheritedName, inheritedType] of inheritedTypeArguments) {
|
||||
if (!this.contextualTypeArguments.has(inheritedName)) {
|
||||
this.contextualTypeArguments.set(inheritedName, inheritedType);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
assert(!this.is(CommonFlags.INSTANCE)); // internal error
|
||||
}
|
||||
let parameterTypes = signature.parameterTypes;
|
||||
for (let i = 0, k = parameterTypes.length; i < k; ++i) {
|
||||
let parameterType = parameterTypes[i];
|
||||
let parameterName = signature.getParameterName(i);
|
||||
let local = new Local(
|
||||
prototype.program,
|
||||
parameterName,
|
||||
localIndex++,
|
||||
parameterType
|
||||
// FIXME: declaration?
|
||||
);
|
||||
this.localsByName.set(parameterName, local);
|
||||
this.localsByIndex[local.index] = local;
|
||||
}
|
||||
} else {
|
||||
assert(!this.is(CommonFlags.INSTANCE)); // internal error
|
||||
}
|
||||
let parameterTypes = signature.parameterTypes;
|
||||
for (let i = 0, k = parameterTypes.length; i < k; ++i) {
|
||||
let parameterType = parameterTypes[i];
|
||||
let parameterName = signature.getParameterName(i);
|
||||
let local = new Local(
|
||||
prototype.program,
|
||||
parameterName,
|
||||
localIndex++,
|
||||
parameterType
|
||||
// FIXME: declaration?
|
||||
);
|
||||
this.localsByName.set(parameterName, local);
|
||||
this.localsByIndex[local.index] = local;
|
||||
}
|
||||
}
|
||||
this.flow = Flow.create(this);
|
||||
@ -2576,140 +2569,23 @@ export class Function extends Element {
|
||||
return local;
|
||||
}
|
||||
|
||||
private tempI32s: Local[] | null = null;
|
||||
private tempI64s: Local[] | null = null;
|
||||
private tempF32s: Local[] | null = null;
|
||||
private tempF64s: Local[] | null = null;
|
||||
// used by flows to keep track of temporary locals
|
||||
tempI32s: Local[] | null = null;
|
||||
tempI64s: Local[] | null = null;
|
||||
tempF32s: Local[] | null = null;
|
||||
tempF64s: Local[] | null = null;
|
||||
|
||||
/** Gets a free temporary local of the specified type. */
|
||||
getTempLocal(type: Type, wrapped: bool = false): Local {
|
||||
var temps: Local[] | null;
|
||||
switch (type.toNativeType()) {
|
||||
case NativeType.I32: {
|
||||
temps = this.tempI32s;
|
||||
break;
|
||||
}
|
||||
case NativeType.I64: {
|
||||
temps = this.tempI64s;
|
||||
break;
|
||||
}
|
||||
case NativeType.F32: {
|
||||
temps = this.tempF32s;
|
||||
break;
|
||||
}
|
||||
case NativeType.F64: {
|
||||
temps = this.tempF64s;
|
||||
break;
|
||||
}
|
||||
default: throw new Error("concrete type expected");
|
||||
}
|
||||
var local: Local;
|
||||
if (temps && temps.length) {
|
||||
local = temps.pop();
|
||||
local.type = type;
|
||||
local.flags = CommonFlags.NONE;
|
||||
} else {
|
||||
local = this.addLocal(type);
|
||||
}
|
||||
if (type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) {
|
||||
this.flow.setLocalWrapped(local.index, wrapped);
|
||||
}
|
||||
return local;
|
||||
}
|
||||
|
||||
/** Frees the temporary local for reuse. */
|
||||
freeTempLocal(local: Local): void {
|
||||
if (local.is(CommonFlags.INLINED)) return;
|
||||
assert(local.index >= 0);
|
||||
var temps: Local[];
|
||||
assert(local.type != null); // internal error
|
||||
switch ((<Type>local.type).toNativeType()) {
|
||||
case NativeType.I32: {
|
||||
temps = this.tempI32s || (this.tempI32s = []);
|
||||
break;
|
||||
}
|
||||
case NativeType.I64: {
|
||||
temps = this.tempI64s || (this.tempI64s = []);
|
||||
break;
|
||||
}
|
||||
case NativeType.F32: {
|
||||
temps = this.tempF32s || (this.tempF32s = []);
|
||||
break;
|
||||
}
|
||||
case NativeType.F64: {
|
||||
temps = this.tempF64s || (this.tempF64s = []);
|
||||
break;
|
||||
}
|
||||
default: throw new Error("concrete type expected");
|
||||
}
|
||||
assert(local.index >= 0);
|
||||
temps.push(local);
|
||||
}
|
||||
|
||||
/** Gets and immediately frees a temporary local of the specified type. */
|
||||
getAndFreeTempLocal(type: Type, wrapped: bool): Local {
|
||||
var temps: Local[];
|
||||
switch (type.toNativeType()) {
|
||||
case NativeType.I32: {
|
||||
temps = this.tempI32s || (this.tempI32s = []);
|
||||
break;
|
||||
}
|
||||
case NativeType.I64: {
|
||||
temps = this.tempI64s || (this.tempI64s = []);
|
||||
break;
|
||||
}
|
||||
case NativeType.F32: {
|
||||
temps = this.tempF32s || (this.tempF32s = []);
|
||||
break;
|
||||
}
|
||||
case NativeType.F64: {
|
||||
temps = this.tempF64s || (this.tempF64s = []);
|
||||
break;
|
||||
}
|
||||
default: throw new Error("concrete type expected");
|
||||
}
|
||||
var local: Local;
|
||||
if (temps.length) {
|
||||
local = temps[temps.length - 1];
|
||||
local.type = type;
|
||||
} else {
|
||||
local = this.addLocal(type);
|
||||
temps.push(local);
|
||||
}
|
||||
if (type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) {
|
||||
this.flow.setLocalWrapped(local.index, wrapped);
|
||||
}
|
||||
return local;
|
||||
}
|
||||
|
||||
/** Enters a(nother) break context. */
|
||||
enterBreakContext(): string {
|
||||
var id = this.nextBreakId++;
|
||||
if (!this.breakStack) this.breakStack = [ id ];
|
||||
else this.breakStack.push(id);
|
||||
return this.breakContext = id.toString(10);
|
||||
}
|
||||
|
||||
/** Leaves the current break context. */
|
||||
leaveBreakContext(): void {
|
||||
assert(this.breakStack != null);
|
||||
var length = (<i32[]>this.breakStack).length;
|
||||
assert(length > 0);
|
||||
(<i32[]>this.breakStack).pop();
|
||||
if (length > 1) {
|
||||
this.breakContext = (<i32[]>this.breakStack)[length - 2].toString(10);
|
||||
} else {
|
||||
this.breakContext = null;
|
||||
this.breakStack = null;
|
||||
}
|
||||
}
|
||||
// used by flows to keep track of break labels
|
||||
nextBreakId: i32 = 0;
|
||||
breakStack: i32[] | null = null;
|
||||
breakLabel: string | null = null;
|
||||
|
||||
/** Finalizes the function once compiled, releasing no longer needed resources. */
|
||||
finalize(module: Module, ref: FunctionRef): void {
|
||||
this.ref = ref;
|
||||
assert(!this.breakStack || !this.breakStack.length); // internal error
|
||||
this.breakStack = null;
|
||||
this.breakContext = null;
|
||||
this.breakLabel = null;
|
||||
this.tempI32s = this.tempI64s = this.tempF32s = this.tempF64s = null;
|
||||
if (this.program.options.sourceMap) {
|
||||
let debugLocations = this.debugLocations;
|
||||
@ -3049,39 +2925,39 @@ export const enum FlowFlags {
|
||||
|
||||
// categorical
|
||||
|
||||
/** This branch always returns. */
|
||||
/** This flow returns. */
|
||||
RETURNS = 1 << 0,
|
||||
/** This branch always returns a wrapped value. */
|
||||
/** This flow returns a wrapped value. */
|
||||
RETURNS_WRAPPED = 1 << 1,
|
||||
/** This branch always throws. */
|
||||
/** This flow throws. */
|
||||
THROWS = 1 << 2,
|
||||
/** This branch always breaks. */
|
||||
/** This flow breaks. */
|
||||
BREAKS = 1 << 3,
|
||||
/** This branch always continues. */
|
||||
/** This flow continues. */
|
||||
CONTINUES = 1 << 4,
|
||||
/** This branch always allocates. Constructors only. */
|
||||
/** This flow allocates. Constructors only. */
|
||||
ALLOCATES = 1 << 5,
|
||||
/** This branch always calls super. Constructors only. */
|
||||
/** This flow calls super. Constructors only. */
|
||||
CALLS_SUPER = 1 << 6,
|
||||
|
||||
// conditional
|
||||
|
||||
/** This branch conditionally returns in a child branch. */
|
||||
/** This flow conditionally returns in a child flow. */
|
||||
CONDITIONALLY_RETURNS = 1 << 7,
|
||||
/** This branch conditionally throws in a child branch. */
|
||||
/** This flow conditionally throws in a child flow. */
|
||||
CONDITIONALLY_THROWS = 1 << 8,
|
||||
/** This branch conditionally breaks in a child branch. */
|
||||
/** This flow conditionally breaks in a child flow. */
|
||||
CONDITIONALLY_BREAKS = 1 << 9,
|
||||
/** This branch conditionally continues in a child branch. */
|
||||
/** This flow conditionally continues in a child flow. */
|
||||
CONDITIONALLY_CONTINUES = 1 << 10,
|
||||
/** This branch conditionally allocates in a child branch. Constructors only. */
|
||||
/** This flow conditionally allocates in a child flow. Constructors only. */
|
||||
CONDITIONALLY_ALLOCATES = 1 << 11,
|
||||
|
||||
// special
|
||||
|
||||
/** This branch is part of inlining a function. */
|
||||
/** This is an inlining flow. */
|
||||
INLINE_CONTEXT = 1 << 12,
|
||||
/** This branch explicitly requests no bounds checking. */
|
||||
/** This is a flow with explicitly disabled bounds checking. */
|
||||
UNCHECKED_CONTEXT = 1 << 13,
|
||||
|
||||
// masks
|
||||
@ -3117,13 +2993,11 @@ export class Flow {
|
||||
/** Flow flags indicating specific conditions. */
|
||||
flags: FlowFlags;
|
||||
/** Function this flow belongs to. */
|
||||
currentFunction: Function;
|
||||
parentFunction: Function;
|
||||
/** The label we break to when encountering a continue statement. */
|
||||
continueLabel: string | null;
|
||||
/** The label we break to when encountering a break statement. */
|
||||
breakLabel: string | null;
|
||||
/** The label we break to when encountering a return statement, when inlining. */
|
||||
returnLabel: string | null;
|
||||
/** The current return type. */
|
||||
returnType: Type;
|
||||
/** The current contextual type arguments. */
|
||||
@ -3134,25 +3008,46 @@ export class Flow {
|
||||
wrappedLocals: I64;
|
||||
/** Local variable wrap states for locals with index >= 64. */
|
||||
wrappedLocalsExt: I64[] | null;
|
||||
/** Function being inlined, when inlining. */
|
||||
inlineFunction: Function | null;
|
||||
/** The label we break to when encountering a return statement, when inlining. */
|
||||
inlineReturnLabel: string | null;
|
||||
|
||||
/** Creates the parent flow of the specified function. */
|
||||
static create(currentFunction: Function): Flow {
|
||||
var parentFlow = new Flow();
|
||||
parentFlow.parent = null;
|
||||
parentFlow.flags = FlowFlags.NONE;
|
||||
parentFlow.currentFunction = currentFunction;
|
||||
parentFlow.continueLabel = null;
|
||||
parentFlow.breakLabel = null;
|
||||
parentFlow.returnLabel = null;
|
||||
parentFlow.returnType = currentFunction.signature.returnType;
|
||||
parentFlow.contextualTypeArguments = currentFunction.contextualTypeArguments;
|
||||
parentFlow.wrappedLocals = i64_new(0);
|
||||
parentFlow.wrappedLocalsExt = null;
|
||||
return parentFlow;
|
||||
static create(parentFunction: Function): Flow {
|
||||
var flow = new Flow();
|
||||
flow.parent = null;
|
||||
flow.flags = FlowFlags.NONE;
|
||||
flow.parentFunction = parentFunction;
|
||||
flow.continueLabel = null;
|
||||
flow.breakLabel = null;
|
||||
flow.returnType = parentFunction.signature.returnType;
|
||||
flow.contextualTypeArguments = parentFunction.contextualTypeArguments;
|
||||
flow.wrappedLocals = i64_new(0);
|
||||
flow.wrappedLocalsExt = null;
|
||||
flow.inlineFunction = null;
|
||||
flow.inlineReturnLabel = null;
|
||||
return flow;
|
||||
}
|
||||
|
||||
/** Creates an inline flow within `currentFunction`. */
|
||||
static createInline(parentFunction: Function, inlineFunction: Function): Flow {
|
||||
var flow = Flow.create(parentFunction);
|
||||
flow.set(FlowFlags.INLINE_CONTEXT);
|
||||
flow.inlineFunction = inlineFunction;
|
||||
flow.inlineReturnLabel = inlineFunction.internalName + "|inlined." + (inlineFunction.nextInlineId++).toString(10);
|
||||
flow.returnType = inlineFunction.signature.returnType;
|
||||
flow.contextualTypeArguments = inlineFunction.contextualTypeArguments;
|
||||
return flow;
|
||||
}
|
||||
|
||||
private constructor() { }
|
||||
|
||||
/** Gets the actual function being compiled, The inlined function when inlining, otherwise the parent function. */
|
||||
get actualFunction(): Function {
|
||||
return this.inlineFunction || this.parentFunction;
|
||||
}
|
||||
|
||||
/** Tests if this flow has the specified flag or flags. */
|
||||
is(flag: FlowFlags): bool { return (this.flags & flag) == flag; }
|
||||
/** Tests if this flow has one of the specified flags. */
|
||||
@ -3167,44 +3062,119 @@ export class Flow {
|
||||
var branch = new Flow();
|
||||
branch.parent = this;
|
||||
branch.flags = this.flags;
|
||||
branch.currentFunction = this.currentFunction;
|
||||
branch.parentFunction = this.parentFunction;
|
||||
branch.continueLabel = this.continueLabel;
|
||||
branch.breakLabel = this.breakLabel;
|
||||
branch.returnLabel = this.returnLabel;
|
||||
branch.returnType = this.returnType;
|
||||
branch.contextualTypeArguments = this.contextualTypeArguments;
|
||||
branch.wrappedLocals = this.wrappedLocals;
|
||||
branch.wrappedLocalsExt = this.wrappedLocalsExt ? this.wrappedLocalsExt.slice() : null;
|
||||
branch.inlineFunction = this.inlineFunction;
|
||||
branch.inlineReturnLabel = this.inlineReturnLabel;
|
||||
return branch;
|
||||
}
|
||||
|
||||
/** Frees this flow's scoped variables. */
|
||||
free(): Flow {
|
||||
var parent = assert(this.parent);
|
||||
if (this.scopedLocals) { // free block-scoped locals
|
||||
for (let scopedLocal of this.scopedLocals.values()) {
|
||||
if (scopedLocal.is(CommonFlags.SCOPED)) { // otherwise an alias
|
||||
this.currentFunction.freeTempLocal(scopedLocal);
|
||||
}
|
||||
}
|
||||
this.scopedLocals = null;
|
||||
/** Gets a free temporary local of the specified type. */
|
||||
getTempLocal(type: Type, wrapped: bool = false): Local {
|
||||
var parentFunction = this.parentFunction;
|
||||
var temps: Local[] | null;
|
||||
switch (type.toNativeType()) {
|
||||
case NativeType.I32: { temps = parentFunction.tempI32s; break; }
|
||||
case NativeType.I64: { temps = parentFunction.tempI64s; break; }
|
||||
case NativeType.F32: { temps = parentFunction.tempF32s; break; }
|
||||
case NativeType.F64: { temps = parentFunction.tempF64s; break; }
|
||||
default: throw new Error("concrete type expected");
|
||||
}
|
||||
return parent;
|
||||
var local: Local;
|
||||
if (temps && temps.length) {
|
||||
local = temps.pop();
|
||||
local.type = type;
|
||||
local.flags = CommonFlags.NONE;
|
||||
} else {
|
||||
local = parentFunction.addLocal(type);
|
||||
}
|
||||
if (type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) this.setLocalWrapped(local.index, wrapped);
|
||||
return local;
|
||||
}
|
||||
|
||||
/** Frees the temporary local for reuse. */
|
||||
freeTempLocal(local: Local): void {
|
||||
if (local.is(CommonFlags.INLINED)) return;
|
||||
assert(local.index >= 0);
|
||||
var parentFunction = this.parentFunction;
|
||||
var temps: Local[];
|
||||
assert(local.type != null); // internal error
|
||||
switch ((<Type>local.type).toNativeType()) {
|
||||
case NativeType.I32: {
|
||||
temps = parentFunction.tempI32s || (parentFunction.tempI32s = []);
|
||||
break;
|
||||
}
|
||||
case NativeType.I64: {
|
||||
temps = parentFunction.tempI64s || (parentFunction.tempI64s = []);
|
||||
break;
|
||||
}
|
||||
case NativeType.F32: {
|
||||
temps = parentFunction.tempF32s || (parentFunction.tempF32s = []);
|
||||
break;
|
||||
}
|
||||
case NativeType.F64: {
|
||||
temps = parentFunction.tempF64s || (parentFunction.tempF64s = []);
|
||||
break;
|
||||
}
|
||||
default: throw new Error("concrete type expected");
|
||||
}
|
||||
assert(local.index >= 0);
|
||||
temps.push(local);
|
||||
}
|
||||
|
||||
/** Gets and immediately frees a temporary local of the specified type. */
|
||||
getAndFreeTempLocal(type: Type, wrapped: bool): Local {
|
||||
var parentFunction = this.parentFunction;
|
||||
var temps: Local[];
|
||||
switch (type.toNativeType()) {
|
||||
case NativeType.I32: {
|
||||
temps = parentFunction.tempI32s || (parentFunction.tempI32s = []);
|
||||
break;
|
||||
}
|
||||
case NativeType.I64: {
|
||||
temps = parentFunction.tempI64s || (parentFunction.tempI64s = []);
|
||||
break;
|
||||
}
|
||||
case NativeType.F32: {
|
||||
temps = parentFunction.tempF32s || (parentFunction.tempF32s = []);
|
||||
break;
|
||||
}
|
||||
case NativeType.F64: {
|
||||
temps = parentFunction.tempF64s || (parentFunction.tempF64s = []);
|
||||
break;
|
||||
}
|
||||
default: throw new Error("concrete type expected");
|
||||
}
|
||||
var local: Local;
|
||||
if (temps.length) {
|
||||
local = temps[temps.length - 1];
|
||||
local.type = type;
|
||||
} else {
|
||||
local = parentFunction.addLocal(type);
|
||||
temps.push(local);
|
||||
}
|
||||
if (type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) this.setLocalWrapped(local.index, wrapped);
|
||||
return local;
|
||||
}
|
||||
|
||||
/** Adds a new scoped local of the specified name. */
|
||||
addScopedLocal(type: Type, name: string, wrapped: bool, declaration?: VariableDeclaration): Local {
|
||||
var scopedLocal = this.currentFunction.getTempLocal(type, false);
|
||||
addScopedLocal(name: string, type: Type, wrapped: bool, reportNode: Node | null = null): Local {
|
||||
var scopedLocal = this.getTempLocal(type, false);
|
||||
if (!this.scopedLocals) this.scopedLocals = new Map();
|
||||
else {
|
||||
let existingLocal = this.scopedLocals.get(name);
|
||||
if (existingLocal) {
|
||||
if (declaration) {
|
||||
this.currentFunction.program.error(
|
||||
if (reportNode) {
|
||||
this.parentFunction.program.error(
|
||||
DiagnosticCode.Duplicate_identifier_0,
|
||||
declaration.name.range
|
||||
reportNode.range
|
||||
);
|
||||
} else assert(false);
|
||||
}
|
||||
return existingLocal;
|
||||
}
|
||||
}
|
||||
@ -3216,47 +3186,56 @@ export class Flow {
|
||||
return scopedLocal;
|
||||
}
|
||||
|
||||
/** Adds a new scoped alias for the specified local. */
|
||||
addScopedLocalAlias(index: i32, type: Type, name: string): Local {
|
||||
/** Adds a new scoped alias for the specified local. For example `super` aliased to the `this` local. */
|
||||
addScopedAlias(name: string, type: Type, index: i32, reportNode: Node | null = null): Local {
|
||||
if (!this.scopedLocals) this.scopedLocals = new Map();
|
||||
else {
|
||||
let existingLocal = this.scopedLocals.get(name);
|
||||
if (existingLocal) {
|
||||
let declaration = existingLocal.declaration;
|
||||
if (declaration) {
|
||||
this.currentFunction.program.error(
|
||||
if (reportNode) {
|
||||
this.parentFunction.program.error(
|
||||
DiagnosticCode.Duplicate_identifier_0,
|
||||
declaration.name.range
|
||||
reportNode.range
|
||||
);
|
||||
} else assert(false);
|
||||
}
|
||||
return existingLocal;
|
||||
}
|
||||
}
|
||||
assert(index < this.currentFunction.localsByIndex.length);
|
||||
var scopedAlias = new Local( // not SCOPED as an indicator that it isn't automatically free'd
|
||||
this.currentFunction.program,
|
||||
assert(index < this.parentFunction.localsByIndex.length);
|
||||
var scopedAlias = new Local(
|
||||
this.parentFunction.program,
|
||||
name,
|
||||
index,
|
||||
type,
|
||||
null
|
||||
);
|
||||
// not flagged as SCOPED as it must not be free'd when the flow is finalized
|
||||
this.scopedLocals.set(name, scopedAlias);
|
||||
return scopedAlias;
|
||||
}
|
||||
|
||||
/** Gets the local of the specified name in the current scope. */
|
||||
getScopedLocal(name: string): Local | null {
|
||||
var local: Local | null;
|
||||
var current: Flow | null = this;
|
||||
do {
|
||||
if (current.scopedLocals && (local = current.scopedLocals.get(name))) {
|
||||
return local;
|
||||
/** Frees this flow's scoped variables and returns its parent flow. */
|
||||
freeScopedLocals(): void {
|
||||
if (this.scopedLocals) {
|
||||
for (let scopedLocal of this.scopedLocals.values()) {
|
||||
if (scopedLocal.is(CommonFlags.SCOPED)) { // otherwise an alias
|
||||
this.freeTempLocal(scopedLocal);
|
||||
}
|
||||
}
|
||||
} while (current = current.parent);
|
||||
return this.currentFunction.localsByName.get(name);
|
||||
this.scopedLocals = null;
|
||||
}
|
||||
}
|
||||
|
||||
/** Tests if the local with the specified index is considered wrapped. */
|
||||
/** Looks up the local of the specified name in the current scope. */
|
||||
lookupLocal(name: string): Local | null {
|
||||
var local: Local | null;
|
||||
var current: Flow | null = this;
|
||||
do if (current.scopedLocals && (local = current.scopedLocals.get(name))) return local;
|
||||
while (current = current.parent);
|
||||
return this.parentFunction.localsByName.get(name);
|
||||
}
|
||||
|
||||
/** Tests if the value of the local at the specified index is considered wrapped. */
|
||||
isLocalWrapped(index: i32): bool {
|
||||
var map: I64;
|
||||
var ext: I64[] | null;
|
||||
@ -3283,7 +3262,7 @@ export class Flow {
|
||||
);
|
||||
}
|
||||
|
||||
/** Sets if the local with the specified index is considered wrapped. */
|
||||
/** Sets if the value of the local at the specified index is considered wrapped. */
|
||||
setLocalWrapped(index: i32, wrapped: bool): void {
|
||||
var map: I64;
|
||||
var off: i32 = -1;
|
||||
@ -3322,6 +3301,30 @@ export class Flow {
|
||||
else this.wrappedLocals = map;
|
||||
}
|
||||
|
||||
/** Pushes a new break label to the stack, for example when entering a loop that one can `break` from. */
|
||||
pushBreakLabel(): string {
|
||||
var parentFunction = this.parentFunction;
|
||||
var id = parentFunction.nextBreakId++;
|
||||
var stack = parentFunction.breakStack;
|
||||
if (!stack) parentFunction.breakStack = [ id ];
|
||||
else stack.push(id);
|
||||
return parentFunction.breakLabel = id.toString(10);
|
||||
}
|
||||
|
||||
/** Pops the most recent break label from the stack. */
|
||||
popBreakLabel(): void {
|
||||
var parentFunction = this.parentFunction;
|
||||
var stack = assert(parentFunction.breakStack);
|
||||
var length = assert(stack.length);
|
||||
stack.pop();
|
||||
if (length > 1) {
|
||||
parentFunction.breakLabel = stack[length - 2].toString(10);
|
||||
} else {
|
||||
parentFunction.breakLabel = null;
|
||||
parentFunction.breakStack = null;
|
||||
}
|
||||
}
|
||||
|
||||
/** Inherits flags and local wrap states from the specified flow (e.g. blocks). */
|
||||
inherit(other: Flow): void {
|
||||
this.flags |= other.flags & (FlowFlags.ANY_CATEGORICAL | FlowFlags.ANY_CONDITIONAL);
|
||||
@ -3395,9 +3398,8 @@ export class Flow {
|
||||
|
||||
// overflows if the local isn't wrapped or the conversion does
|
||||
case ExpressionId.GetLocal: {
|
||||
let currentFunction = this.currentFunction;
|
||||
let local = currentFunction.localsByIndex[getGetLocalIndex(expr)];
|
||||
return !currentFunction.flow.isLocalWrapped(local.index)
|
||||
let local = this.parentFunction.localsByIndex[getGetLocalIndex(expr)];
|
||||
return !this.isLocalWrapped(local.index)
|
||||
|| canConversionOverflow(local.type, type);
|
||||
}
|
||||
|
||||
@ -3410,7 +3412,7 @@ export class Flow {
|
||||
// overflows if the conversion does (globals are wrapped on set)
|
||||
case ExpressionId.GetGlobal: {
|
||||
// TODO: this is inefficient because it has to read a string
|
||||
let global = assert(this.currentFunction.program.elementsLookup.get(assert(getGetGlobalName(expr))));
|
||||
let global = assert(this.parentFunction.program.elementsLookup.get(assert(getGetGlobalName(expr))));
|
||||
assert(global.kind == ElementKind.GLOBAL);
|
||||
return canConversionOverflow(assert((<Global>global).type), type);
|
||||
}
|
||||
@ -3594,7 +3596,6 @@ export class Flow {
|
||||
let last = getBlockChild(expr, size - 1);
|
||||
return this.canOverflow(last, type);
|
||||
}
|
||||
// actually, brs with a value that'd be handled here is not emitted atm
|
||||
break;
|
||||
}
|
||||
|
||||
@ -3612,7 +3613,7 @@ export class Flow {
|
||||
|
||||
// overflows if the call does not return a wrapped value or the conversion does
|
||||
case ExpressionId.Call: {
|
||||
let program = this.currentFunction.program;
|
||||
let program = this.parentFunction.program;
|
||||
let instance = assert(program.instancesLookup.get(assert(getCallTarget(expr))));
|
||||
assert(instance.kind == ElementKind.FUNCTION);
|
||||
let returnType = (<Function>instance).signature.returnType;
|
||||
@ -3625,15 +3626,6 @@ export class Flow {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Finalizes this flow. Must be the topmost parent flow of the function. */
|
||||
finalize(): void {
|
||||
assert(this.parent == null); // must be the topmost parent flow
|
||||
this.continueLabel = null;
|
||||
this.breakLabel = null;
|
||||
this.returnLabel = null;
|
||||
this.contextualTypeArguments = null;
|
||||
}
|
||||
}
|
||||
|
||||
/** Tests if a conversion from one type to another can technically overflow. */
|
||||
|
@ -25,7 +25,8 @@ import {
|
||||
DecoratorFlags,
|
||||
FieldPrototype,
|
||||
Field,
|
||||
Global
|
||||
Global,
|
||||
Flow
|
||||
} from "./program";
|
||||
|
||||
import {
|
||||
@ -355,22 +356,26 @@ export class Resolver extends DiagnosticEmitter {
|
||||
/** Resolves an identifier to the element it refers to. */
|
||||
resolveIdentifier(
|
||||
identifier: IdentifierExpression,
|
||||
flow: Flow | null,
|
||||
context: Element | null,
|
||||
reportMode: ReportMode = ReportMode.REPORT
|
||||
): Element | null {
|
||||
var name = identifier.text;
|
||||
var element: Element | null;
|
||||
|
||||
if (flow) {
|
||||
let local = flow.lookupLocal(name);
|
||||
if (local) {
|
||||
this.currentThisExpression = null;
|
||||
this.currentElementExpression = null;
|
||||
return local;
|
||||
}
|
||||
}
|
||||
|
||||
if (context) {
|
||||
|
||||
switch (context.kind) {
|
||||
case ElementKind.FUNCTION: { // search locals, use prototype
|
||||
element = (<Function>context).flow.getScopedLocal(name);
|
||||
if (element) {
|
||||
this.currentThisExpression = null;
|
||||
this.currentElementExpression = null;
|
||||
return element;
|
||||
}
|
||||
case ElementKind.FUNCTION: { // use prototype
|
||||
context = (<Function>context).prototype.parent;
|
||||
break;
|
||||
}
|
||||
@ -433,13 +438,13 @@ export class Resolver extends DiagnosticEmitter {
|
||||
/** Resolves a property access to the element it refers to. */
|
||||
resolvePropertyAccess(
|
||||
propertyAccess: PropertyAccessExpression,
|
||||
contextualFunction: Function,
|
||||
flow: Flow,
|
||||
contextualType: Type,
|
||||
reportMode: ReportMode = ReportMode.REPORT
|
||||
): Element | null {
|
||||
// start by resolving the lhs target (expression before the last dot)
|
||||
var targetExpression = propertyAccess.expression;
|
||||
var target = this.resolveExpression(targetExpression, contextualFunction, contextualType, reportMode); // reports
|
||||
var target = this.resolveExpression(targetExpression, flow, contextualType, reportMode); // reports
|
||||
if (!target) return null;
|
||||
|
||||
// at this point we know exactly what the target is, so look up the element within
|
||||
@ -565,12 +570,12 @@ export class Resolver extends DiagnosticEmitter {
|
||||
|
||||
resolveElementAccess(
|
||||
elementAccess: ElementAccessExpression,
|
||||
contextualFunction: Function,
|
||||
flow: Flow,
|
||||
contextualType: Type,
|
||||
reportMode: ReportMode = ReportMode.REPORT
|
||||
): Element | null {
|
||||
var targetExpression = elementAccess.expression;
|
||||
var target = this.resolveExpression(targetExpression, contextualFunction, contextualType, reportMode);
|
||||
var target = this.resolveExpression(targetExpression, flow, contextualType, reportMode);
|
||||
if (!target) return null;
|
||||
switch (target.kind) {
|
||||
case ElementKind.GLOBAL: if (!this.ensureResolvedLazyGlobal(<Global>target, reportMode)) return null;
|
||||
@ -685,7 +690,7 @@ export class Resolver extends DiagnosticEmitter {
|
||||
|
||||
resolveExpression(
|
||||
expression: Expression,
|
||||
contextualFunction: Function,
|
||||
flow: Flow,
|
||||
contextualType: Type = Type.void,
|
||||
reportMode: ReportMode = ReportMode.REPORT
|
||||
): Element | null {
|
||||
@ -697,14 +702,14 @@ export class Resolver extends DiagnosticEmitter {
|
||||
if ((<AssertionExpression>expression).assertionKind == AssertionKind.NONNULL) {
|
||||
return this.resolveExpression(
|
||||
(<AssertionExpression>expression).expression,
|
||||
contextualFunction,
|
||||
flow,
|
||||
contextualType,
|
||||
reportMode
|
||||
);
|
||||
}
|
||||
let type = this.resolveType(
|
||||
assert((<AssertionExpression>expression).toType),
|
||||
contextualFunction.flow.contextualTypeArguments,
|
||||
flow.contextualTypeArguments,
|
||||
reportMode
|
||||
);
|
||||
if (!type) return null;
|
||||
@ -733,7 +738,7 @@ export class Resolver extends DiagnosticEmitter {
|
||||
}
|
||||
return this.resolveExpression(
|
||||
operand,
|
||||
contextualFunction,
|
||||
flow,
|
||||
contextualType,
|
||||
reportMode
|
||||
);
|
||||
@ -743,7 +748,7 @@ export class Resolver extends DiagnosticEmitter {
|
||||
case Token.MINUS_MINUS: {
|
||||
return this.resolveExpression(
|
||||
(<UnaryPrefixExpression>expression).operand,
|
||||
contextualFunction,
|
||||
flow,
|
||||
contextualType,
|
||||
reportMode
|
||||
);
|
||||
@ -754,7 +759,7 @@ export class Resolver extends DiagnosticEmitter {
|
||||
case Token.TILDE: {
|
||||
let resolvedOperand = this.resolveExpression(
|
||||
(<UnaryPrefixExpression>expression).operand,
|
||||
contextualFunction,
|
||||
flow,
|
||||
contextualType,
|
||||
reportMode
|
||||
);
|
||||
@ -772,7 +777,7 @@ export class Resolver extends DiagnosticEmitter {
|
||||
case Token.MINUS_MINUS: {
|
||||
return this.resolveExpression(
|
||||
(<UnaryPostfixExpression>expression).operand,
|
||||
contextualFunction,
|
||||
flow,
|
||||
contextualType,
|
||||
reportMode
|
||||
);
|
||||
@ -788,15 +793,15 @@ export class Resolver extends DiagnosticEmitter {
|
||||
throw new Error("not implemented");
|
||||
}
|
||||
case NodeKind.THIS: { // -> Class / ClassPrototype
|
||||
if (contextualFunction.flow.is(FlowFlags.INLINE_CONTEXT)) {
|
||||
let explicitLocal = contextualFunction.flow.getScopedLocal("this");
|
||||
if (flow.is(FlowFlags.INLINE_CONTEXT)) {
|
||||
let explicitLocal = flow.lookupLocal("this");
|
||||
if (explicitLocal) {
|
||||
this.currentThisExpression = null;
|
||||
this.currentElementExpression = null;
|
||||
return explicitLocal;
|
||||
}
|
||||
}
|
||||
let parent = contextualFunction.parent;
|
||||
let parent = flow.parentFunction.parent;
|
||||
if (parent) {
|
||||
this.currentThisExpression = null;
|
||||
this.currentElementExpression = null;
|
||||
@ -811,15 +816,15 @@ export class Resolver extends DiagnosticEmitter {
|
||||
return null;
|
||||
}
|
||||
case NodeKind.SUPER: { // -> Class
|
||||
if (contextualFunction.flow.is(FlowFlags.INLINE_CONTEXT)) {
|
||||
let explicitLocal = contextualFunction.flow.getScopedLocal("super");
|
||||
if (flow.is(FlowFlags.INLINE_CONTEXT)) {
|
||||
let explicitLocal = flow.lookupLocal("super");
|
||||
if (explicitLocal) {
|
||||
this.currentThisExpression = null;
|
||||
this.currentElementExpression = null;
|
||||
return explicitLocal;
|
||||
}
|
||||
}
|
||||
let parent = contextualFunction.parent;
|
||||
let parent = flow.actualFunction.parent;
|
||||
if (parent && parent.kind == ElementKind.CLASS && (parent = (<Class>parent).base)) {
|
||||
this.currentThisExpression = null;
|
||||
this.currentElementExpression = null;
|
||||
@ -834,7 +839,7 @@ export class Resolver extends DiagnosticEmitter {
|
||||
return null;
|
||||
}
|
||||
case NodeKind.IDENTIFIER: {
|
||||
return this.resolveIdentifier(<IdentifierExpression>expression, contextualFunction, reportMode);
|
||||
return this.resolveIdentifier(<IdentifierExpression>expression, flow, flow.actualFunction, reportMode);
|
||||
}
|
||||
case NodeKind.LITERAL: {
|
||||
switch ((<LiteralExpression>expression).literalKind) {
|
||||
@ -871,7 +876,7 @@ export class Resolver extends DiagnosticEmitter {
|
||||
case NodeKind.PROPERTYACCESS: {
|
||||
return this.resolvePropertyAccess(
|
||||
<PropertyAccessExpression>expression,
|
||||
contextualFunction,
|
||||
flow,
|
||||
contextualType,
|
||||
reportMode
|
||||
);
|
||||
@ -879,20 +884,20 @@ export class Resolver extends DiagnosticEmitter {
|
||||
case NodeKind.ELEMENTACCESS: {
|
||||
return this.resolveElementAccess(
|
||||
<ElementAccessExpression>expression,
|
||||
contextualFunction,
|
||||
flow,
|
||||
contextualType,
|
||||
reportMode
|
||||
);
|
||||
}
|
||||
case NodeKind.CALL: {
|
||||
let targetExpression = (<CallExpression>expression).expression;
|
||||
let target = this.resolveExpression(targetExpression, contextualFunction, contextualType, reportMode);
|
||||
let target = this.resolveExpression(targetExpression, flow, contextualType, reportMode);
|
||||
if (!target) return null;
|
||||
if (target.kind == ElementKind.FUNCTION_PROTOTYPE) {
|
||||
let instance = this.resolveFunctionInclTypeArguments(
|
||||
<FunctionPrototype>target,
|
||||
(<CallExpression>expression).typeArguments,
|
||||
makeMap<string,Type>(contextualFunction.flow.contextualTypeArguments),
|
||||
makeMap<string,Type>(flow.contextualTypeArguments),
|
||||
expression,
|
||||
reportMode
|
||||
);
|
||||
|
@ -1249,7 +1249,9 @@
|
||||
local.get $8
|
||||
else
|
||||
local.get $1
|
||||
local.get $1
|
||||
local.set $9
|
||||
local.get $9
|
||||
local.get $9
|
||||
f32.ne
|
||||
end
|
||||
i32.const 0
|
||||
@ -2531,7 +2533,9 @@
|
||||
local.get $8
|
||||
else
|
||||
local.get $1
|
||||
local.get $1
|
||||
local.set $9
|
||||
local.get $9
|
||||
local.get $9
|
||||
f64.ne
|
||||
end
|
||||
i32.const 0
|
||||
|
@ -16,7 +16,9 @@
|
||||
call $inlining-recursive/bar
|
||||
)
|
||||
(func $inlining-recursive/bar (; 2 ;) (type $v)
|
||||
call $inlining-recursive/baz
|
||||
block $inlining-recursive/bar|inlined.0
|
||||
call $inlining-recursive/baz
|
||||
end
|
||||
)
|
||||
(func $null (; 3 ;) (type $v)
|
||||
)
|
||||
|
@ -7,8 +7,10 @@
|
||||
(memory $0 1)
|
||||
(data (i32.const 8) "\0b\00\00\00i\00n\00l\00i\00n\00i\00n\00g\00.\00t\00s")
|
||||
(table $0 2 funcref)
|
||||
(elem (i32.const 0) $null $inlining/test_funcs~anonymous|1)
|
||||
(elem (i32.const 0) $null $inlining/func_fe~anonymous|1)
|
||||
(global $~argc (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(export "test" (func $inlining/test))
|
||||
@ -16,7 +18,7 @@
|
||||
(func $inlining/test (; 1 ;) (type $i) (result i32)
|
||||
i32.const 3
|
||||
)
|
||||
(func $inlining/test_funcs~anonymous|1 (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $inlining/func_fe~anonymous|1 (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
)
|
||||
(func $inlining/test_funcs (; 3 ;) (type $v)
|
||||
@ -36,10 +38,155 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $start (; 4 ;) (type $v)
|
||||
call $inlining/test_funcs
|
||||
(func $~lib/allocator/arena/__memory_allocate (; 4 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
local.get $0
|
||||
i32.const 1073741824
|
||||
i32.gt_u
|
||||
if
|
||||
unreachable
|
||||
end
|
||||
global.get $~lib/allocator/arena/offset
|
||||
local.tee $1
|
||||
local.get $0
|
||||
i32.const 1
|
||||
local.get $0
|
||||
i32.const 1
|
||||
i32.gt_u
|
||||
select
|
||||
i32.add
|
||||
i32.const 7
|
||||
i32.add
|
||||
i32.const -8
|
||||
i32.and
|
||||
local.tee $2
|
||||
current_memory
|
||||
local.tee $3
|
||||
i32.const 16
|
||||
i32.shl
|
||||
i32.gt_u
|
||||
if
|
||||
local.get $3
|
||||
local.get $2
|
||||
local.get $1
|
||||
i32.sub
|
||||
i32.const 65535
|
||||
i32.add
|
||||
i32.const -65536
|
||||
i32.and
|
||||
i32.const 16
|
||||
i32.shr_u
|
||||
local.tee $0
|
||||
local.get $3
|
||||
local.get $0
|
||||
i32.gt_s
|
||||
select
|
||||
grow_memory
|
||||
i32.const 0
|
||||
i32.lt_s
|
||||
if
|
||||
local.get $0
|
||||
grow_memory
|
||||
i32.const 0
|
||||
i32.lt_s
|
||||
if
|
||||
unreachable
|
||||
end
|
||||
end
|
||||
end
|
||||
local.get $2
|
||||
global.set $~lib/allocator/arena/offset
|
||||
local.get $1
|
||||
)
|
||||
(func $null (; 5 ;) (type $v)
|
||||
(func $inlining/test_ctor (; 5 ;) (type $v)
|
||||
(local $0 i32)
|
||||
i32.const 16
|
||||
call $~lib/allocator/arena/__memory_allocate
|
||||
local.tee $0
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 8
|
||||
call $~lib/allocator/arena/__memory_allocate
|
||||
local.set $0
|
||||
end
|
||||
local.get $0
|
||||
i32.const 1
|
||||
i32.store
|
||||
local.get $0
|
||||
i32.const 0
|
||||
i32.store offset=4
|
||||
local.get $0
|
||||
i32.const 2
|
||||
i32.store offset=4
|
||||
local.get $0
|
||||
i32.const 3
|
||||
i32.store offset=8
|
||||
local.get $0
|
||||
i32.const 0
|
||||
i32.store offset=12
|
||||
local.get $0
|
||||
i32.const 4
|
||||
i32.store offset=12
|
||||
local.get $0
|
||||
i32.load
|
||||
i32.const 1
|
||||
i32.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 97
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
i32.const 2
|
||||
i32.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 98
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.const 3
|
||||
i32.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 99
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
local.get $0
|
||||
i32.load offset=12
|
||||
i32.const 4
|
||||
i32.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 100
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $start (; 6 ;) (type $v)
|
||||
call $inlining/test_funcs
|
||||
i32.const 40
|
||||
global.set $~lib/allocator/arena/startOffset
|
||||
global.get $~lib/allocator/arena/startOffset
|
||||
global.set $~lib/allocator/arena/offset
|
||||
call $inlining/test_ctor
|
||||
)
|
||||
(func $null (; 7 ;) (type $v)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
@ -72,3 +72,32 @@ function test_funcs(): void {
|
||||
}
|
||||
|
||||
test_funcs();
|
||||
|
||||
import "allocator/arena";
|
||||
|
||||
class Baz {
|
||||
a: i32 = 1;
|
||||
b: i32;
|
||||
@inline constructor(c: i32) {
|
||||
this.b = c;
|
||||
}
|
||||
}
|
||||
|
||||
class Bar extends Baz {
|
||||
d: i32 = 3;
|
||||
e: i32;
|
||||
@inline constructor(f: i32) {
|
||||
super(2);
|
||||
this.e = f;
|
||||
}
|
||||
}
|
||||
|
||||
function test_ctor(): void {
|
||||
var bar = new Bar(4);
|
||||
assert(bar.a == 1);
|
||||
assert(bar.b == 2);
|
||||
assert(bar.d == 3);
|
||||
assert(bar.e == 4);
|
||||
}
|
||||
|
||||
test_ctor();
|
||||
|
@ -7,9 +7,15 @@
|
||||
(memory $0 1)
|
||||
(data (i32.const 8) "\0b\00\00\00i\00n\00l\00i\00n\00i\00n\00g\00.\00t\00s\00")
|
||||
(table $0 2 funcref)
|
||||
(elem (i32.const 0) $null $inlining/test_funcs~anonymous|1)
|
||||
(elem (i32.const 0) $null $inlining/func_fe~anonymous|1)
|
||||
(global $inlining/constantGlobal i32 (i32.const 1))
|
||||
(global $~argc (mut i32) (i32.const 0))
|
||||
(global $~lib/internal/allocator/AL_BITS i32 (i32.const 3))
|
||||
(global $~lib/internal/allocator/AL_SIZE i32 (i32.const 8))
|
||||
(global $~lib/internal/allocator/AL_MASK i32 (i32.const 7))
|
||||
(global $~lib/internal/allocator/MAX_SIZE_32 i32 (i32.const 1073741824))
|
||||
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
|
||||
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 36))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
@ -20,7 +26,7 @@
|
||||
i32.const 2
|
||||
i32.add
|
||||
)
|
||||
(func $inlining/test_funcs~anonymous|1 (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $inlining/func_fe~anonymous|1 (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
)
|
||||
(func $inlining/test_funcs (; 3 ;) (type $v)
|
||||
@ -163,16 +169,14 @@
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.set $3
|
||||
block
|
||||
local.get $3
|
||||
local.set $5
|
||||
local.get $5
|
||||
local.set $6
|
||||
local.get $6
|
||||
i32.const 1
|
||||
i32.add
|
||||
local.set $4
|
||||
end
|
||||
local.get $3
|
||||
local.set $5
|
||||
local.get $5
|
||||
local.set $6
|
||||
local.get $6
|
||||
i32.const 1
|
||||
i32.add
|
||||
local.set $4
|
||||
local.get $4
|
||||
end
|
||||
i32.const 3
|
||||
@ -191,16 +195,14 @@
|
||||
local.set $4
|
||||
local.get $4
|
||||
local.set $3
|
||||
block
|
||||
local.get $3
|
||||
local.set $6
|
||||
local.get $6
|
||||
local.set $5
|
||||
local.get $5
|
||||
i32.const 1
|
||||
i32.add
|
||||
local.set $2
|
||||
end
|
||||
local.get $3
|
||||
local.set $6
|
||||
local.get $6
|
||||
local.set $5
|
||||
local.get $5
|
||||
i32.const 1
|
||||
i32.add
|
||||
local.set $2
|
||||
local.get $2
|
||||
end
|
||||
i32.const 4
|
||||
@ -214,8 +216,10 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i32.const 0
|
||||
local.set $2
|
||||
block $inlining/func_iv|inlined.0
|
||||
i32.const 0
|
||||
local.set $2
|
||||
end
|
||||
block (result i32)
|
||||
i32.const 1
|
||||
global.set $~argc
|
||||
@ -259,11 +263,13 @@
|
||||
i32.const 123
|
||||
local.set $7
|
||||
block $inlining/Foo#method_this|inlined.0 (result i32)
|
||||
i32.const 43
|
||||
local.set $3
|
||||
i32.const 3
|
||||
local.set $2
|
||||
local.get $7
|
||||
local.set $3
|
||||
i32.const 43
|
||||
local.set $2
|
||||
i32.const 3
|
||||
local.set $4
|
||||
local.get $3
|
||||
end
|
||||
i32.const 123
|
||||
i32.eq
|
||||
@ -277,7 +283,199 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $start (; 4 ;) (type $v)
|
||||
(func $~lib/allocator/arena/__memory_allocate (; 4 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $0
|
||||
global.get $~lib/internal/allocator/MAX_SIZE_32
|
||||
i32.gt_u
|
||||
if
|
||||
unreachable
|
||||
end
|
||||
global.get $~lib/allocator/arena/offset
|
||||
local.set $1
|
||||
local.get $1
|
||||
local.get $0
|
||||
local.tee $2
|
||||
i32.const 1
|
||||
local.tee $3
|
||||
local.get $2
|
||||
local.get $3
|
||||
i32.gt_u
|
||||
select
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
local.set $4
|
||||
current_memory
|
||||
local.set $5
|
||||
local.get $4
|
||||
local.get $5
|
||||
i32.const 16
|
||||
i32.shl
|
||||
i32.gt_u
|
||||
if
|
||||
local.get $4
|
||||
local.get $1
|
||||
i32.sub
|
||||
i32.const 65535
|
||||
i32.add
|
||||
i32.const 65535
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
i32.const 16
|
||||
i32.shr_u
|
||||
local.set $2
|
||||
local.get $5
|
||||
local.tee $3
|
||||
local.get $2
|
||||
local.tee $6
|
||||
local.get $3
|
||||
local.get $6
|
||||
i32.gt_s
|
||||
select
|
||||
local.set $3
|
||||
local.get $3
|
||||
grow_memory
|
||||
i32.const 0
|
||||
i32.lt_s
|
||||
if
|
||||
local.get $2
|
||||
grow_memory
|
||||
i32.const 0
|
||||
i32.lt_s
|
||||
if
|
||||
unreachable
|
||||
end
|
||||
end
|
||||
end
|
||||
local.get $4
|
||||
global.set $~lib/allocator/arena/offset
|
||||
local.get $1
|
||||
)
|
||||
(func $~lib/memory/memory.allocate (; 5 ;) (type $ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
call $~lib/allocator/arena/__memory_allocate
|
||||
return
|
||||
)
|
||||
(func $inlining/test_ctor (; 6 ;) (type $v)
|
||||
(local $0 i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
block $inlining/Bar#constructor|inlined.0 (result i32)
|
||||
i32.const 0
|
||||
local.set $0
|
||||
i32.const 4
|
||||
local.set $1
|
||||
block $inlining/Baz#constructor|inlined.0 (result i32)
|
||||
local.get $0
|
||||
if (result i32)
|
||||
local.get $0
|
||||
else
|
||||
i32.const 16
|
||||
call $~lib/memory/memory.allocate
|
||||
end
|
||||
local.set $2
|
||||
i32.const 2
|
||||
local.set $3
|
||||
block (result i32)
|
||||
local.get $2
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 8
|
||||
call $~lib/memory/memory.allocate
|
||||
local.set $2
|
||||
end
|
||||
local.get $2
|
||||
i32.const 1
|
||||
i32.store
|
||||
local.get $2
|
||||
i32.const 0
|
||||
i32.store offset=4
|
||||
local.get $2
|
||||
end
|
||||
local.get $3
|
||||
i32.store offset=4
|
||||
local.get $2
|
||||
end
|
||||
local.set $0
|
||||
local.get $0
|
||||
i32.const 3
|
||||
i32.store offset=8
|
||||
local.get $0
|
||||
i32.const 0
|
||||
i32.store offset=12
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.store offset=12
|
||||
local.get $0
|
||||
end
|
||||
local.set $4
|
||||
local.get $4
|
||||
i32.load
|
||||
i32.const 1
|
||||
i32.eq
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 97
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
local.get $4
|
||||
i32.load offset=4
|
||||
i32.const 2
|
||||
i32.eq
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 98
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
local.get $4
|
||||
i32.load offset=8
|
||||
i32.const 3
|
||||
i32.eq
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 99
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
local.get $4
|
||||
i32.load offset=12
|
||||
i32.const 4
|
||||
i32.eq
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 100
|
||||
i32.const 2
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $start (; 7 ;) (type $v)
|
||||
call $inlining/test
|
||||
i32.const 3
|
||||
i32.eq
|
||||
@ -291,7 +489,18 @@
|
||||
unreachable
|
||||
end
|
||||
call $inlining/test_funcs
|
||||
global.get $HEAP_BASE
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.add
|
||||
global.get $~lib/internal/allocator/AL_MASK
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
global.set $~lib/allocator/arena/startOffset
|
||||
global.get $~lib/allocator/arena/startOffset
|
||||
global.set $~lib/allocator/arena/offset
|
||||
call $inlining/test_ctor
|
||||
)
|
||||
(func $null (; 5 ;) (type $v)
|
||||
(func $null (; 8 ;) (type $v)
|
||||
)
|
||||
)
|
||||
|
@ -44,6 +44,8 @@
|
||||
(func $~lib/array/Array<Foo>#__get (; 3 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $2
|
||||
@ -54,14 +56,18 @@
|
||||
i32.shr_u
|
||||
i32.lt_u
|
||||
if (result i32)
|
||||
i32.const 0
|
||||
local.set $3
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $1
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $3
|
||||
local.get $5
|
||||
i32.add
|
||||
i32.load offset=8
|
||||
else
|
||||
@ -76,6 +82,8 @@
|
||||
(func $~lib/array/Array<Foo | null>#__get (; 5 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $2
|
||||
@ -86,14 +94,18 @@
|
||||
i32.shr_u
|
||||
i32.lt_u
|
||||
if (result i32)
|
||||
i32.const 0
|
||||
local.set $3
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $1
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $3
|
||||
local.get $5
|
||||
i32.add
|
||||
i32.load offset=8
|
||||
else
|
||||
|
@ -423,32 +423,32 @@
|
||||
(local $7 i32)
|
||||
(local $8 i64)
|
||||
(local $9 i32)
|
||||
(local $10 i64)
|
||||
(local $10 i32)
|
||||
(local $11 i32)
|
||||
(local $12 i32)
|
||||
(local $12 i64)
|
||||
(local $13 i64)
|
||||
(local $14 i64)
|
||||
local.get $3
|
||||
local.get $1
|
||||
i64.sub
|
||||
local.set $8
|
||||
local.set $12
|
||||
i64.const 1
|
||||
i32.const 0
|
||||
local.get $4
|
||||
i32.sub
|
||||
local.tee $11
|
||||
i64.extend_i32_s
|
||||
local.tee $13
|
||||
local.tee $1
|
||||
i64.shl
|
||||
local.tee $10
|
||||
local.tee $13
|
||||
i64.const 1
|
||||
i64.sub
|
||||
local.tee $14
|
||||
local.get $3
|
||||
i64.and
|
||||
local.set $1
|
||||
local.set $8
|
||||
local.get $3
|
||||
local.get $13
|
||||
local.get $1
|
||||
i64.shr_u
|
||||
i32.wrap_i64
|
||||
local.tee $7
|
||||
@ -456,7 +456,7 @@
|
||||
local.set $9
|
||||
i32.const 2064
|
||||
i32.load
|
||||
local.set $12
|
||||
local.set $10
|
||||
loop $continue|0
|
||||
local.get $9
|
||||
i32.const 0
|
||||
@ -612,9 +612,9 @@
|
||||
local.get $11
|
||||
i64.extend_i32_s
|
||||
i64.shl
|
||||
local.get $1
|
||||
local.get $8
|
||||
i64.add
|
||||
local.tee $3
|
||||
local.tee $1
|
||||
local.get $5
|
||||
i64.le_u
|
||||
if
|
||||
@ -622,7 +622,9 @@
|
||||
local.get $9
|
||||
i32.add
|
||||
global.set $~lib/internal/number/_K
|
||||
local.get $12
|
||||
local.get $5
|
||||
local.set $3
|
||||
local.get $10
|
||||
local.get $9
|
||||
i32.const 2
|
||||
i32.shl
|
||||
@ -631,7 +633,9 @@
|
||||
local.get $11
|
||||
i64.extend_i32_s
|
||||
i64.shl
|
||||
local.set $1
|
||||
local.set $8
|
||||
local.get $12
|
||||
local.set $5
|
||||
local.get $6
|
||||
i32.const 1
|
||||
i32.sub
|
||||
@ -641,37 +645,37 @@
|
||||
i32.add
|
||||
local.tee $2
|
||||
i32.load16_u offset=4
|
||||
local.set $7
|
||||
local.set $10
|
||||
loop $continue|2
|
||||
local.get $3
|
||||
local.get $8
|
||||
local.get $1
|
||||
local.get $5
|
||||
i64.lt_u
|
||||
local.tee $0
|
||||
if
|
||||
local.get $5
|
||||
local.get $3
|
||||
i64.sub
|
||||
local.get $1
|
||||
i64.sub
|
||||
local.get $8
|
||||
i64.ge_u
|
||||
local.set $0
|
||||
end
|
||||
local.get $0
|
||||
if
|
||||
local.get $1
|
||||
local.get $3
|
||||
i64.add
|
||||
local.get $8
|
||||
i64.add
|
||||
local.get $5
|
||||
i64.lt_u
|
||||
local.tee $0
|
||||
i32.eqz
|
||||
if
|
||||
local.get $8
|
||||
local.get $3
|
||||
local.get $5
|
||||
local.get $1
|
||||
i64.sub
|
||||
local.get $1
|
||||
local.get $3
|
||||
i64.add
|
||||
local.get $8
|
||||
i64.add
|
||||
local.get $5
|
||||
i64.sub
|
||||
i64.gt_u
|
||||
local.set $0
|
||||
@ -679,19 +683,19 @@
|
||||
end
|
||||
local.get $0
|
||||
if
|
||||
local.get $7
|
||||
local.get $10
|
||||
i32.const 1
|
||||
i32.sub
|
||||
local.set $7
|
||||
local.set $10
|
||||
local.get $1
|
||||
local.get $3
|
||||
local.get $8
|
||||
i64.add
|
||||
local.set $3
|
||||
local.set $1
|
||||
br $continue|2
|
||||
end
|
||||
end
|
||||
local.get $2
|
||||
local.get $7
|
||||
local.get $10
|
||||
i32.store16 offset=4
|
||||
local.get $6
|
||||
return
|
||||
@ -704,14 +708,14 @@
|
||||
i64.const 10
|
||||
i64.mul
|
||||
local.set $5
|
||||
local.get $1
|
||||
local.get $8
|
||||
i64.const 10
|
||||
i64.mul
|
||||
local.tee $1
|
||||
local.tee $8
|
||||
local.get $11
|
||||
i64.extend_i32_s
|
||||
i64.shr_u
|
||||
local.tee $3
|
||||
local.tee $1
|
||||
local.get $6
|
||||
i64.extend_i32_s
|
||||
i64.or
|
||||
@ -728,7 +732,7 @@
|
||||
i32.shl
|
||||
local.get $0
|
||||
i32.add
|
||||
local.get $3
|
||||
local.get $1
|
||||
i32.wrap_i64
|
||||
i32.const 65535
|
||||
i32.and
|
||||
@ -740,10 +744,10 @@
|
||||
i32.const 1
|
||||
i32.sub
|
||||
local.set $9
|
||||
local.get $1
|
||||
local.get $8
|
||||
local.get $14
|
||||
i64.and
|
||||
local.tee $1
|
||||
local.tee $8
|
||||
local.get $5
|
||||
i64.ge_u
|
||||
br_if $continue|3
|
||||
@ -751,7 +755,9 @@
|
||||
local.get $9
|
||||
i32.add
|
||||
global.set $~lib/internal/number/_K
|
||||
local.get $12
|
||||
local.get $13
|
||||
local.set $1
|
||||
local.get $10
|
||||
i32.const 0
|
||||
local.get $9
|
||||
i32.sub
|
||||
@ -759,49 +765,50 @@
|
||||
i32.shl
|
||||
i32.add
|
||||
i64.load32_u offset=8
|
||||
local.get $8
|
||||
local.get $12
|
||||
i64.mul
|
||||
local.set $8
|
||||
local.set $3
|
||||
local.get $6
|
||||
local.tee $10
|
||||
i32.const 1
|
||||
i32.sub
|
||||
i32.const 1
|
||||
i32.shl
|
||||
local.get $0
|
||||
i32.add
|
||||
local.tee $7
|
||||
local.tee $4
|
||||
i32.load16_u offset=4
|
||||
local.set $4
|
||||
local.set $6
|
||||
loop $continue|4
|
||||
local.get $1
|
||||
local.get $8
|
||||
local.get $3
|
||||
i64.lt_u
|
||||
local.tee $2
|
||||
if
|
||||
local.get $5
|
||||
local.get $1
|
||||
local.get $8
|
||||
i64.sub
|
||||
local.get $10
|
||||
local.get $1
|
||||
i64.ge_u
|
||||
local.set $2
|
||||
end
|
||||
local.get $2
|
||||
if
|
||||
local.get $1
|
||||
local.get $10
|
||||
i64.add
|
||||
local.get $8
|
||||
i64.add
|
||||
local.get $3
|
||||
i64.lt_u
|
||||
local.tee $2
|
||||
i32.eqz
|
||||
if
|
||||
local.get $3
|
||||
local.get $8
|
||||
local.get $1
|
||||
i64.sub
|
||||
local.get $1
|
||||
local.get $10
|
||||
i64.add
|
||||
local.get $8
|
||||
i64.add
|
||||
local.get $3
|
||||
i64.sub
|
||||
i64.gt_u
|
||||
local.set $2
|
||||
@ -809,21 +816,21 @@
|
||||
end
|
||||
local.get $2
|
||||
if
|
||||
local.get $4
|
||||
local.get $6
|
||||
i32.const 1
|
||||
i32.sub
|
||||
local.set $4
|
||||
local.set $6
|
||||
local.get $1
|
||||
local.get $10
|
||||
local.get $8
|
||||
i64.add
|
||||
local.set $1
|
||||
local.set $8
|
||||
br $continue|4
|
||||
end
|
||||
end
|
||||
local.get $7
|
||||
local.get $4
|
||||
i32.store16 offset=4
|
||||
local.get $6
|
||||
i32.store16 offset=4
|
||||
local.get $10
|
||||
end
|
||||
)
|
||||
(func $~lib/internal/memory/memcpy (; 9 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
@ -1944,74 +1951,73 @@
|
||||
local.get $1
|
||||
local.get $2
|
||||
i32.add
|
||||
local.tee $5
|
||||
i32.le_s
|
||||
local.tee $3
|
||||
i32.le_s
|
||||
local.tee $4
|
||||
if
|
||||
local.get $5
|
||||
local.get $3
|
||||
i32.const 21
|
||||
i32.le_s
|
||||
local.set $3
|
||||
local.set $4
|
||||
end
|
||||
local.get $3
|
||||
local.get $4
|
||||
if (result i32)
|
||||
local.get $1
|
||||
local.set $3
|
||||
local.set $4
|
||||
loop $repeat|0
|
||||
block $break|0
|
||||
local.get $4
|
||||
local.get $3
|
||||
local.get $5
|
||||
i32.ge_s
|
||||
br_if $break|0
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 1
|
||||
i32.shl
|
||||
local.get $0
|
||||
i32.add
|
||||
i32.const 48
|
||||
i32.store16 offset=4
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 1
|
||||
i32.add
|
||||
local.set $3
|
||||
local.set $4
|
||||
br $repeat|0
|
||||
end
|
||||
end
|
||||
local.get $5
|
||||
local.get $3
|
||||
i32.const 1
|
||||
i32.shl
|
||||
local.get $0
|
||||
i32.add
|
||||
i32.const 3145774
|
||||
i32.store offset=4
|
||||
local.get $5
|
||||
local.get $3
|
||||
i32.const 2
|
||||
i32.add
|
||||
else
|
||||
local.get $5
|
||||
local.get $3
|
||||
i32.const 0
|
||||
i32.gt_s
|
||||
local.tee $3
|
||||
local.tee $4
|
||||
if
|
||||
local.get $5
|
||||
local.get $3
|
||||
i32.const 21
|
||||
i32.le_s
|
||||
local.set $3
|
||||
local.set $4
|
||||
end
|
||||
local.get $3
|
||||
local.get $4
|
||||
if (result i32)
|
||||
local.get $5
|
||||
local.get $3
|
||||
i32.const 1
|
||||
i32.shl
|
||||
local.get $0
|
||||
i32.add
|
||||
local.tee $3
|
||||
i32.const 4
|
||||
i32.add
|
||||
local.tee $0
|
||||
local.tee $4
|
||||
i32.const 2
|
||||
i32.add
|
||||
local.get $0
|
||||
local.get $4
|
||||
i32.const 0
|
||||
local.get $2
|
||||
i32.sub
|
||||
@ -2019,6 +2025,10 @@
|
||||
i32.shl
|
||||
call $~lib/internal/memory/memmove
|
||||
local.get $3
|
||||
i32.const 1
|
||||
i32.shl
|
||||
local.get $0
|
||||
i32.add
|
||||
i32.const 46
|
||||
i32.store16 offset=4
|
||||
local.get $1
|
||||
@ -2026,25 +2036,25 @@
|
||||
i32.add
|
||||
else
|
||||
i32.const -6
|
||||
local.get $5
|
||||
local.get $3
|
||||
i32.lt_s
|
||||
local.tee $3
|
||||
local.tee $4
|
||||
if
|
||||
local.get $5
|
||||
local.get $3
|
||||
i32.const 0
|
||||
i32.le_s
|
||||
local.set $3
|
||||
local.set $4
|
||||
end
|
||||
local.get $3
|
||||
local.get $4
|
||||
if (result i32)
|
||||
local.get $0
|
||||
i32.const 4
|
||||
i32.add
|
||||
local.tee $2
|
||||
i32.const 2
|
||||
local.get $5
|
||||
local.get $3
|
||||
i32.sub
|
||||
local.tee $3
|
||||
local.tee $4
|
||||
i32.const 1
|
||||
i32.shl
|
||||
i32.add
|
||||
@ -2057,29 +2067,29 @@
|
||||
i32.const 3014704
|
||||
i32.store offset=4
|
||||
i32.const 2
|
||||
local.set $4
|
||||
local.set $3
|
||||
loop $repeat|1
|
||||
block $break|1
|
||||
local.get $4
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.ge_s
|
||||
br_if $break|1
|
||||
local.get $4
|
||||
local.get $3
|
||||
i32.const 1
|
||||
i32.shl
|
||||
local.get $0
|
||||
i32.add
|
||||
i32.const 48
|
||||
i32.store16 offset=4
|
||||
local.get $4
|
||||
local.get $3
|
||||
i32.const 1
|
||||
i32.add
|
||||
local.set $4
|
||||
local.set $3
|
||||
br $repeat|1
|
||||
end
|
||||
end
|
||||
local.get $1
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.add
|
||||
else
|
||||
local.get $1
|
||||
@ -2092,52 +2102,52 @@
|
||||
local.get $0
|
||||
i32.const 4
|
||||
i32.add
|
||||
local.tee $3
|
||||
local.tee $4
|
||||
block (result i32)
|
||||
local.get $5
|
||||
local.get $3
|
||||
i32.const 1
|
||||
i32.sub
|
||||
local.tee $4
|
||||
local.tee $3
|
||||
i32.const 0
|
||||
i32.lt_s
|
||||
local.tee $2
|
||||
if
|
||||
i32.const 0
|
||||
local.get $4
|
||||
local.get $3
|
||||
i32.sub
|
||||
local.set $4
|
||||
local.set $3
|
||||
end
|
||||
local.get $4
|
||||
local.get $3
|
||||
end
|
||||
local.get $4
|
||||
local.get $3
|
||||
call $~lib/internal/number/decimalCount32
|
||||
i32.const 1
|
||||
i32.add
|
||||
local.tee $4
|
||||
local.tee $5
|
||||
call $~lib/internal/number/utoa32_lut
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 45
|
||||
i32.const 43
|
||||
local.get $2
|
||||
select
|
||||
i32.store16 offset=4
|
||||
local.get $4
|
||||
local.get $5
|
||||
i32.const 2
|
||||
i32.add
|
||||
else
|
||||
local.get $0
|
||||
i32.const 4
|
||||
i32.add
|
||||
local.tee $3
|
||||
local.tee $4
|
||||
i32.const 4
|
||||
i32.add
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 2
|
||||
i32.add
|
||||
local.get $1
|
||||
i32.const 1
|
||||
i32.shl
|
||||
local.tee $4
|
||||
local.tee $5
|
||||
i32.const 2
|
||||
i32.sub
|
||||
call $~lib/internal/memory/memmove
|
||||
@ -2145,7 +2155,7 @@
|
||||
i32.const 46
|
||||
i32.store16 offset=6
|
||||
local.get $0
|
||||
local.get $4
|
||||
local.get $5
|
||||
i32.add
|
||||
local.tee $0
|
||||
i32.const 101
|
||||
@ -2153,30 +2163,30 @@
|
||||
local.get $0
|
||||
i32.const 4
|
||||
i32.add
|
||||
local.tee $3
|
||||
local.tee $4
|
||||
block (result i32)
|
||||
local.get $5
|
||||
local.get $3
|
||||
i32.const 1
|
||||
i32.sub
|
||||
local.tee $4
|
||||
local.tee $3
|
||||
i32.const 0
|
||||
i32.lt_s
|
||||
local.tee $2
|
||||
if
|
||||
i32.const 0
|
||||
local.get $4
|
||||
local.get $3
|
||||
i32.sub
|
||||
local.set $4
|
||||
local.set $3
|
||||
end
|
||||
local.get $4
|
||||
local.get $3
|
||||
end
|
||||
local.get $4
|
||||
local.get $3
|
||||
call $~lib/internal/number/decimalCount32
|
||||
i32.const 1
|
||||
i32.add
|
||||
local.tee $0
|
||||
call $~lib/internal/number/utoa32_lut
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 45
|
||||
i32.const 43
|
||||
local.get $2
|
||||
@ -2198,19 +2208,18 @@
|
||||
(local $4 i32)
|
||||
(local $5 i64)
|
||||
(local $6 i32)
|
||||
(local $7 i64)
|
||||
(local $8 i32)
|
||||
(local $7 i32)
|
||||
(local $8 i64)
|
||||
(local $9 i64)
|
||||
(local $10 i64)
|
||||
(local $11 i64)
|
||||
(local $12 i64)
|
||||
(local $13 i32)
|
||||
(local $12 i32)
|
||||
(local $13 i64)
|
||||
(local $14 i32)
|
||||
(local $15 i64)
|
||||
local.get $1
|
||||
f64.const 0
|
||||
f64.lt
|
||||
local.tee $13
|
||||
local.tee $12
|
||||
if (result f64)
|
||||
local.get $0
|
||||
i32.const 45
|
||||
@ -2221,32 +2230,32 @@
|
||||
local.get $1
|
||||
end
|
||||
i64.reinterpret_f64
|
||||
local.tee $2
|
||||
local.tee $13
|
||||
i64.const 9218868437227405312
|
||||
i64.and
|
||||
i64.const 52
|
||||
i64.shr_u
|
||||
i32.wrap_i64
|
||||
local.set $8
|
||||
local.get $2
|
||||
local.set $7
|
||||
local.get $13
|
||||
i64.const 4503599627370495
|
||||
i64.and
|
||||
local.get $8
|
||||
local.get $7
|
||||
i32.const 0
|
||||
i32.ne
|
||||
local.tee $6
|
||||
local.tee $4
|
||||
i64.extend_i32_u
|
||||
i64.const 52
|
||||
i64.shl
|
||||
i64.add
|
||||
local.set $2
|
||||
local.get $8
|
||||
local.get $7
|
||||
i32.const 1
|
||||
local.get $6
|
||||
local.get $4
|
||||
select
|
||||
i32.const 1075
|
||||
i32.sub
|
||||
local.tee $8
|
||||
local.tee $7
|
||||
i32.const 1
|
||||
i32.sub
|
||||
local.set $6
|
||||
@ -2275,7 +2284,7 @@
|
||||
i64.shl
|
||||
i64.const 1
|
||||
i64.sub
|
||||
local.get $8
|
||||
local.get $7
|
||||
local.get $14
|
||||
i32.sub
|
||||
local.get $6
|
||||
@ -2342,27 +2351,27 @@
|
||||
local.tee $2
|
||||
i64.const 4294967295
|
||||
i64.and
|
||||
local.tee $7
|
||||
local.tee $8
|
||||
global.get $~lib/internal/number/_frc_pow
|
||||
local.tee $5
|
||||
i64.const 4294967295
|
||||
i64.and
|
||||
local.tee $9
|
||||
i64.mul
|
||||
local.set $10
|
||||
local.set $3
|
||||
local.get $5
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
local.tee $11
|
||||
local.get $7
|
||||
local.tee $10
|
||||
local.get $8
|
||||
i64.mul
|
||||
local.get $2
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
local.tee $12
|
||||
local.tee $2
|
||||
local.get $9
|
||||
i64.mul
|
||||
local.get $10
|
||||
local.get $3
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
i64.add
|
||||
@ -2374,43 +2383,43 @@
|
||||
i64.add
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
local.get $11
|
||||
local.get $12
|
||||
local.get $2
|
||||
local.get $10
|
||||
i64.mul
|
||||
local.get $3
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
i64.add
|
||||
i64.add
|
||||
local.set $2
|
||||
local.set $13
|
||||
local.get $5
|
||||
i64.const 4294967295
|
||||
i64.and
|
||||
local.tee $11
|
||||
local.tee $2
|
||||
global.get $~lib/internal/number/_frc_plus
|
||||
local.tee $3
|
||||
i64.const 4294967295
|
||||
i64.and
|
||||
local.tee $10
|
||||
i64.mul
|
||||
local.set $7
|
||||
local.set $11
|
||||
local.get $10
|
||||
local.get $5
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
local.tee $8
|
||||
i64.mul
|
||||
local.get $2
|
||||
local.get $3
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
local.tee $9
|
||||
i64.mul
|
||||
local.get $11
|
||||
local.get $3
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
local.tee $12
|
||||
i64.mul
|
||||
local.get $7
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
i64.add
|
||||
local.tee $3
|
||||
local.tee $2
|
||||
i64.const 4294967295
|
||||
i64.and
|
||||
i64.add
|
||||
@ -2418,97 +2427,95 @@
|
||||
i64.add
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
local.get $8
|
||||
local.get $9
|
||||
local.get $12
|
||||
i64.mul
|
||||
local.get $3
|
||||
local.get $2
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
i64.add
|
||||
i64.add
|
||||
local.set $15
|
||||
local.set $11
|
||||
global.get $~lib/internal/number/_frc_minus
|
||||
local.tee $3
|
||||
local.tee $2
|
||||
i64.const 4294967295
|
||||
i64.and
|
||||
local.tee $7
|
||||
local.tee $8
|
||||
local.get $5
|
||||
i64.const 4294967295
|
||||
i64.and
|
||||
local.tee $9
|
||||
i64.mul
|
||||
local.set $10
|
||||
local.get $5
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
local.tee $11
|
||||
local.get $7
|
||||
i64.mul
|
||||
local.get $3
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
local.tee $12
|
||||
local.get $9
|
||||
i64.mul
|
||||
local.get $10
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
i64.add
|
||||
local.tee $3
|
||||
i64.const 4294967295
|
||||
i64.and
|
||||
i64.add
|
||||
local.set $5
|
||||
local.get $15
|
||||
local.set $3
|
||||
local.get $11
|
||||
i64.const 1
|
||||
i64.sub
|
||||
local.tee $7
|
||||
local.get $11
|
||||
local.get $12
|
||||
local.tee $11
|
||||
local.get $5
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
local.tee $10
|
||||
local.get $8
|
||||
i64.mul
|
||||
local.get $2
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
local.tee $2
|
||||
local.get $9
|
||||
i64.mul
|
||||
local.get $3
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
i64.add
|
||||
local.get $5
|
||||
local.tee $3
|
||||
i64.const 4294967295
|
||||
i64.and
|
||||
i64.add
|
||||
i64.const 2147483647
|
||||
i64.add
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
local.get $2
|
||||
local.get $10
|
||||
i64.mul
|
||||
local.get $3
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
i64.add
|
||||
i64.add
|
||||
i64.const 1
|
||||
i64.add
|
||||
i64.sub
|
||||
local.set $3
|
||||
local.get $13
|
||||
local.get $12
|
||||
i32.const 1
|
||||
i32.shl
|
||||
local.get $0
|
||||
i32.add
|
||||
local.get $0
|
||||
local.get $2
|
||||
local.get $8
|
||||
local.get $13
|
||||
global.get $~lib/internal/number/_exp_pow
|
||||
local.tee $14
|
||||
local.get $7
|
||||
local.get $4
|
||||
i32.sub
|
||||
global.get $~lib/internal/number/_exp_pow
|
||||
local.tee $4
|
||||
i32.add
|
||||
i32.const -64
|
||||
i32.sub
|
||||
local.get $7
|
||||
local.get $4
|
||||
local.get $11
|
||||
global.get $~lib/internal/number/_exp
|
||||
local.get $14
|
||||
i32.add
|
||||
i32.const -64
|
||||
i32.sub
|
||||
local.get $3
|
||||
local.get $13
|
||||
local.get $12
|
||||
call $~lib/internal/number/genDigits
|
||||
local.get $13
|
||||
local.get $12
|
||||
i32.sub
|
||||
global.get $~lib/internal/number/_K
|
||||
call $~lib/internal/number/prettify
|
||||
local.get $13
|
||||
local.get $12
|
||||
i32.add
|
||||
)
|
||||
(func $~lib/string/String#substring (; 13 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1888,7 +1888,7 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
block
|
||||
block $~lib/memory/memory.fill|inlined.0
|
||||
global.get $std/allocator_arena/ptr1
|
||||
local.set $0
|
||||
i32.const 18
|
||||
@ -1933,7 +1933,7 @@
|
||||
end
|
||||
unreachable
|
||||
end
|
||||
block
|
||||
block $~lib/memory/memory.copy|inlined.0
|
||||
global.get $std/allocator_arena/ptr2
|
||||
local.set $2
|
||||
global.get $std/allocator_arena/ptr1
|
||||
@ -2004,32 +2004,20 @@
|
||||
block $~lib/memory/memory.free|inlined.0
|
||||
global.get $std/allocator_arena/ptr1
|
||||
local.set $2
|
||||
block
|
||||
local.get $2
|
||||
call $~lib/allocator/arena/__memory_free
|
||||
br $~lib/memory/memory.free|inlined.0
|
||||
unreachable
|
||||
end
|
||||
unreachable
|
||||
local.get $2
|
||||
call $~lib/allocator/arena/__memory_free
|
||||
br $~lib/memory/memory.free|inlined.0
|
||||
end
|
||||
block $~lib/memory/memory.free|inlined.1
|
||||
global.get $std/allocator_arena/ptr2
|
||||
local.set $2
|
||||
block
|
||||
local.get $2
|
||||
call $~lib/allocator/arena/__memory_free
|
||||
br $~lib/memory/memory.free|inlined.1
|
||||
unreachable
|
||||
end
|
||||
unreachable
|
||||
local.get $2
|
||||
call $~lib/allocator/arena/__memory_free
|
||||
br $~lib/memory/memory.free|inlined.1
|
||||
end
|
||||
block $~lib/memory/memory.reset|inlined.0
|
||||
block
|
||||
call $~lib/allocator/arena/__memory_reset
|
||||
br $~lib/memory/memory.reset|inlined.0
|
||||
unreachable
|
||||
end
|
||||
unreachable
|
||||
call $~lib/allocator/arena/__memory_reset
|
||||
br $~lib/memory/memory.reset|inlined.0
|
||||
end
|
||||
block $~lib/memory/memory.allocate|inlined.2 (result i32)
|
||||
global.get $std/allocator_arena/size
|
||||
|
@ -28,6 +28,8 @@
|
||||
(func $~lib/array/Array<Array<i32>>#__get (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $2
|
||||
@ -38,14 +40,18 @@
|
||||
i32.shr_u
|
||||
i32.lt_u
|
||||
if (result i32)
|
||||
i32.const 0
|
||||
local.set $3
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $1
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $3
|
||||
local.get $5
|
||||
i32.add
|
||||
i32.load offset=8
|
||||
else
|
||||
@ -55,6 +61,8 @@
|
||||
(func $~lib/array/Array<i32>#__get (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $2
|
||||
@ -65,14 +73,18 @@
|
||||
i32.shr_u
|
||||
i32.lt_u
|
||||
if (result i32)
|
||||
i32.const 0
|
||||
local.set $3
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $1
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $3
|
||||
local.get $5
|
||||
i32.add
|
||||
i32.load offset=8
|
||||
else
|
||||
@ -89,6 +101,8 @@
|
||||
(func $~lib/array/Array<String>#__get (; 4 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $2
|
||||
@ -99,14 +113,18 @@
|
||||
i32.shr_u
|
||||
i32.lt_u
|
||||
if (result i32)
|
||||
i32.const 0
|
||||
local.set $3
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $1
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $3
|
||||
local.get $5
|
||||
i32.add
|
||||
i32.load offset=8
|
||||
else
|
||||
@ -250,6 +268,8 @@
|
||||
(func $~lib/array/Array<Array<String>>#__get (; 9 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $2
|
||||
@ -260,14 +280,18 @@
|
||||
i32.shr_u
|
||||
i32.lt_u
|
||||
if (result i32)
|
||||
i32.const 0
|
||||
local.set $3
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $1
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $3
|
||||
local.get $5
|
||||
i32.add
|
||||
i32.load offset=8
|
||||
else
|
||||
|
@ -40,6 +40,8 @@
|
||||
(func $~lib/array/Array<i8>#__get (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $2
|
||||
@ -50,14 +52,18 @@
|
||||
i32.shr_u
|
||||
i32.lt_u
|
||||
if (result i32)
|
||||
i32.const 0
|
||||
local.set $3
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $1
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 0
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $3
|
||||
local.get $5
|
||||
i32.add
|
||||
i32.load8_s offset=8
|
||||
else
|
||||
@ -67,6 +73,8 @@
|
||||
(func $~lib/array/Array<i32>#__get (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $2
|
||||
@ -77,14 +85,18 @@
|
||||
i32.shr_u
|
||||
i32.lt_u
|
||||
if (result i32)
|
||||
i32.const 0
|
||||
local.set $3
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $1
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $3
|
||||
local.get $5
|
||||
i32.add
|
||||
i32.load offset=8
|
||||
else
|
||||
@ -475,6 +487,7 @@
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $1
|
||||
i32.const 1073741816
|
||||
i32.gt_u
|
||||
@ -514,34 +527,44 @@
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.store offset=4
|
||||
local.get $3
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $2
|
||||
call $~lib/internal/memory/memset
|
||||
block $~lib/memory/memory.fill|inlined.0
|
||||
local.get $3
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $2
|
||||
local.set $6
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $6
|
||||
call $~lib/internal/memory/memset
|
||||
end
|
||||
local.get $0
|
||||
)
|
||||
(func $~lib/array/Array<i8>#__unchecked_set (; 9 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $3
|
||||
i32.const 0
|
||||
local.set $4
|
||||
local.get $3
|
||||
local.get $1
|
||||
local.set $4
|
||||
local.get $2
|
||||
local.set $5
|
||||
i32.const 0
|
||||
local.set $6
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 0
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $4
|
||||
local.get $6
|
||||
i32.add
|
||||
local.get $2
|
||||
local.get $5
|
||||
i32.store8 offset=8
|
||||
)
|
||||
(func $~lib/array/Array<i32>#constructor (; 10 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
@ -549,6 +572,7 @@
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $1
|
||||
i32.const 268435454
|
||||
i32.gt_u
|
||||
@ -588,34 +612,44 @@
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.store offset=4
|
||||
local.get $3
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $2
|
||||
call $~lib/internal/memory/memset
|
||||
block $~lib/memory/memory.fill|inlined.1
|
||||
local.get $3
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $2
|
||||
local.set $6
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $6
|
||||
call $~lib/internal/memory/memset
|
||||
end
|
||||
local.get $0
|
||||
)
|
||||
(func $~lib/array/Array<i32>#__unchecked_set (; 11 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $3
|
||||
i32.const 0
|
||||
local.set $4
|
||||
local.get $3
|
||||
local.get $1
|
||||
local.set $4
|
||||
local.get $2
|
||||
local.set $5
|
||||
i32.const 0
|
||||
local.set $6
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $4
|
||||
local.get $6
|
||||
i32.add
|
||||
local.get $2
|
||||
local.get $5
|
||||
i32.store offset=8
|
||||
)
|
||||
(func $std/array-literal/Ref#constructor (; 12 ;) (type $ii) (param $0 i32) (result i32)
|
||||
@ -633,6 +667,7 @@
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $1
|
||||
i32.const 268435454
|
||||
i32.gt_u
|
||||
@ -672,34 +707,44 @@
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.store offset=4
|
||||
local.get $3
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $2
|
||||
call $~lib/internal/memory/memset
|
||||
block $~lib/memory/memory.fill|inlined.2
|
||||
local.get $3
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $2
|
||||
local.set $6
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $6
|
||||
call $~lib/internal/memory/memset
|
||||
end
|
||||
local.get $0
|
||||
)
|
||||
(func $~lib/array/Array<Ref>#__unchecked_set (; 14 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $3
|
||||
i32.const 0
|
||||
local.set $4
|
||||
local.get $3
|
||||
local.get $1
|
||||
local.set $4
|
||||
local.get $2
|
||||
local.set $5
|
||||
i32.const 0
|
||||
local.set $6
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $4
|
||||
local.get $6
|
||||
i32.add
|
||||
local.get $2
|
||||
local.get $5
|
||||
i32.store offset=8
|
||||
)
|
||||
(func $std/array-literal/RefWithCtor#constructor (; 15 ;) (type $ii) (param $0 i32) (result i32)
|
||||
@ -717,6 +762,7 @@
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $1
|
||||
i32.const 268435454
|
||||
i32.gt_u
|
||||
@ -756,34 +802,44 @@
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.store offset=4
|
||||
local.get $3
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $2
|
||||
call $~lib/internal/memory/memset
|
||||
block $~lib/memory/memory.fill|inlined.3
|
||||
local.get $3
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $2
|
||||
local.set $6
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $6
|
||||
call $~lib/internal/memory/memset
|
||||
end
|
||||
local.get $0
|
||||
)
|
||||
(func $~lib/array/Array<RefWithCtor>#__unchecked_set (; 17 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $3
|
||||
i32.const 0
|
||||
local.set $4
|
||||
local.get $3
|
||||
local.get $1
|
||||
local.set $4
|
||||
local.get $2
|
||||
local.set $5
|
||||
i32.const 0
|
||||
local.set $6
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $4
|
||||
local.get $6
|
||||
i32.add
|
||||
local.get $2
|
||||
local.get $5
|
||||
i32.store offset=8
|
||||
)
|
||||
(func $start (; 18 ;) (type $v)
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1437,25 +1437,26 @@
|
||||
(local $4 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $3
|
||||
local.set $4
|
||||
local.get $1
|
||||
i32.const 0
|
||||
i32.lt_s
|
||||
if (result i32)
|
||||
local.get $1
|
||||
local.get $3
|
||||
i32.add
|
||||
local.tee $4
|
||||
i32.const 0
|
||||
local.get $4
|
||||
i32.add
|
||||
local.tee $3
|
||||
i32.const 0
|
||||
local.get $3
|
||||
i32.const 0
|
||||
i32.gt_s
|
||||
select
|
||||
else
|
||||
local.get $1
|
||||
local.tee $3
|
||||
local.get $4
|
||||
local.get $3
|
||||
local.get $1
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.lt_s
|
||||
select
|
||||
end
|
||||
@ -1465,33 +1466,34 @@
|
||||
i32.lt_s
|
||||
if (result i32)
|
||||
local.get $2
|
||||
local.get $3
|
||||
i32.add
|
||||
local.tee $4
|
||||
i32.const 0
|
||||
local.get $4
|
||||
i32.add
|
||||
local.tee $3
|
||||
i32.const 0
|
||||
local.get $3
|
||||
i32.const 0
|
||||
i32.gt_s
|
||||
select
|
||||
else
|
||||
local.get $2
|
||||
local.tee $3
|
||||
local.get $4
|
||||
local.get $3
|
||||
local.get $2
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.lt_s
|
||||
select
|
||||
end
|
||||
local.get $1
|
||||
i32.sub
|
||||
local.tee $4
|
||||
local.tee $3
|
||||
i32.const 0
|
||||
local.get $4
|
||||
local.get $3
|
||||
i32.const 0
|
||||
i32.gt_s
|
||||
select
|
||||
local.tee $2
|
||||
call $~lib/internal/arraybuffer/allocateUnsafe
|
||||
local.tee $3
|
||||
call $~lib/internal/arraybuffer/allocateUnsafe
|
||||
local.tee $2
|
||||
i32.const 8
|
||||
i32.add
|
||||
local.get $0
|
||||
@ -1499,9 +1501,9 @@
|
||||
i32.add
|
||||
local.get $1
|
||||
i32.add
|
||||
local.get $2
|
||||
call $~lib/internal/memory/memmove
|
||||
local.get $3
|
||||
call $~lib/internal/memory/memmove
|
||||
local.get $2
|
||||
)
|
||||
(func $~lib/arraybuffer/ArrayBuffer#slice|trampoline (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
|
@ -412,6 +412,7 @@
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $1
|
||||
global.get $~lib/internal/arraybuffer/MAX_BLENGTH
|
||||
i32.gt_u
|
||||
@ -437,9 +438,11 @@
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $1
|
||||
local.set $6
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $1
|
||||
local.get $6
|
||||
call $~lib/internal/memory/memset
|
||||
end
|
||||
local.get $3
|
||||
@ -1878,6 +1881,7 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(local $7 i32)
|
||||
(local $8 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $3
|
||||
@ -1947,20 +1951,24 @@
|
||||
local.get $6
|
||||
call $~lib/internal/arraybuffer/allocateUnsafe
|
||||
local.set $7
|
||||
local.get $7
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $4
|
||||
local.get $0
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.get $1
|
||||
i32.add
|
||||
local.set $5
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $6
|
||||
call $~lib/internal/memory/memmove
|
||||
block $~lib/memory/memory.copy|inlined.0
|
||||
local.get $7
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $4
|
||||
local.get $0
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.get $1
|
||||
i32.add
|
||||
local.set $5
|
||||
local.get $6
|
||||
local.set $8
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $8
|
||||
call $~lib/internal/memory/memmove
|
||||
end
|
||||
local.get $7
|
||||
)
|
||||
(func $~lib/arraybuffer/ArrayBuffer#slice|trampoline (; 9 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
@ -2047,6 +2055,7 @@
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $1
|
||||
i32.const 1073741816
|
||||
i32.gt_u
|
||||
@ -2065,16 +2074,20 @@
|
||||
local.get $2
|
||||
call $~lib/internal/arraybuffer/allocateUnsafe
|
||||
local.set $3
|
||||
local.get $3
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $2
|
||||
call $~lib/internal/memory/memset
|
||||
block $~lib/memory/memory.fill|inlined.1
|
||||
local.get $3
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $2
|
||||
local.set $6
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $6
|
||||
call $~lib/internal/memory/memset
|
||||
end
|
||||
block (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
@ -2123,6 +2136,7 @@
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $1
|
||||
i32.const 268435454
|
||||
i32.gt_u
|
||||
@ -2141,16 +2155,20 @@
|
||||
local.get $2
|
||||
call $~lib/internal/arraybuffer/allocateUnsafe
|
||||
local.set $3
|
||||
local.get $3
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $2
|
||||
call $~lib/internal/memory/memset
|
||||
block $~lib/memory/memory.fill|inlined.2
|
||||
local.get $3
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $2
|
||||
local.set $6
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $6
|
||||
call $~lib/internal/memory/memset
|
||||
end
|
||||
block (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
|
@ -474,18 +474,19 @@
|
||||
(local $4 i32)
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
local.set $3
|
||||
local.set $4
|
||||
local.get $1
|
||||
local.tee $3
|
||||
i32.const 1073741816
|
||||
i32.gt_u
|
||||
local.tee $4
|
||||
local.tee $1
|
||||
if (result i32)
|
||||
local.get $4
|
||||
else
|
||||
local.get $1
|
||||
else
|
||||
local.get $3
|
||||
i32.const 4
|
||||
i32.add
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.gt_s
|
||||
end
|
||||
if
|
||||
@ -503,7 +504,7 @@
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
i32.add
|
||||
local.get $1
|
||||
local.get $3
|
||||
i32.add
|
||||
f32.load offset=8
|
||||
else
|
||||
@ -512,7 +513,7 @@
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
i32.add
|
||||
local.get $1
|
||||
local.get $3
|
||||
i32.add
|
||||
i32.load offset=8
|
||||
local.tee $0
|
||||
@ -595,19 +596,20 @@
|
||||
i32.load offset=8
|
||||
local.set $3
|
||||
local.get $1
|
||||
local.tee $2
|
||||
i32.const 1073741816
|
||||
i32.gt_u
|
||||
local.tee $2
|
||||
local.tee $1
|
||||
i32.eqz
|
||||
if
|
||||
local.get $1
|
||||
local.get $2
|
||||
i32.const 1
|
||||
i32.add
|
||||
local.get $3
|
||||
i32.gt_s
|
||||
local.set $2
|
||||
local.set $1
|
||||
end
|
||||
local.get $2
|
||||
local.get $1
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 136
|
||||
@ -621,7 +623,7 @@
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
i32.add
|
||||
local.get $1
|
||||
local.get $2
|
||||
i32.add
|
||||
i32.load8_s offset=8
|
||||
)
|
||||
@ -630,18 +632,19 @@
|
||||
(local $4 i32)
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
local.set $3
|
||||
local.set $4
|
||||
local.get $1
|
||||
local.tee $3
|
||||
i32.const 1073741816
|
||||
i32.gt_u
|
||||
local.tee $4
|
||||
local.tee $1
|
||||
if (result i32)
|
||||
local.get $4
|
||||
else
|
||||
local.get $1
|
||||
else
|
||||
local.get $3
|
||||
i32.const 2
|
||||
i32.add
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.gt_s
|
||||
end
|
||||
if
|
||||
@ -657,7 +660,7 @@
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
i32.add
|
||||
local.get $1
|
||||
local.get $3
|
||||
i32.add
|
||||
i32.load16_s offset=8
|
||||
local.set $0
|
||||
@ -683,18 +686,19 @@
|
||||
(local $4 i32)
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
local.set $3
|
||||
local.set $4
|
||||
local.get $1
|
||||
local.tee $3
|
||||
i32.const 1073741816
|
||||
i32.gt_u
|
||||
local.tee $4
|
||||
local.tee $1
|
||||
if (result i32)
|
||||
local.get $4
|
||||
else
|
||||
local.get $1
|
||||
else
|
||||
local.get $3
|
||||
i32.const 4
|
||||
i32.add
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.gt_s
|
||||
end
|
||||
if
|
||||
@ -710,7 +714,7 @@
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
i32.add
|
||||
local.get $1
|
||||
local.get $3
|
||||
i32.add
|
||||
i32.load offset=8
|
||||
local.set $0
|
||||
@ -767,19 +771,20 @@
|
||||
i32.load offset=8
|
||||
local.set $3
|
||||
local.get $1
|
||||
local.tee $2
|
||||
i32.const 1073741816
|
||||
i32.gt_u
|
||||
local.tee $2
|
||||
local.tee $1
|
||||
i32.eqz
|
||||
if
|
||||
local.get $1
|
||||
local.get $2
|
||||
i32.const 1
|
||||
i32.add
|
||||
local.get $3
|
||||
i32.gt_s
|
||||
local.set $2
|
||||
local.set $1
|
||||
end
|
||||
local.get $2
|
||||
local.get $1
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 136
|
||||
@ -793,7 +798,7 @@
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
i32.add
|
||||
local.get $1
|
||||
local.get $2
|
||||
i32.add
|
||||
i32.load8_u offset=8
|
||||
)
|
||||
@ -802,18 +807,19 @@
|
||||
(local $4 i32)
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
local.set $3
|
||||
local.set $4
|
||||
local.get $1
|
||||
local.tee $3
|
||||
i32.const 1073741816
|
||||
i32.gt_u
|
||||
local.tee $4
|
||||
local.tee $1
|
||||
if (result i32)
|
||||
local.get $4
|
||||
else
|
||||
local.get $1
|
||||
else
|
||||
local.get $3
|
||||
i32.const 2
|
||||
i32.add
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.gt_s
|
||||
end
|
||||
if
|
||||
@ -829,7 +835,7 @@
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
i32.add
|
||||
local.get $1
|
||||
local.get $3
|
||||
i32.add
|
||||
i32.load16_u offset=8
|
||||
local.set $0
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -139,6 +139,8 @@
|
||||
if
|
||||
block $~lib/collector/itcm/refToObj|inlined.0 (result i32)
|
||||
local.get $0
|
||||
local.set $1
|
||||
local.get $1
|
||||
global.get $~lib/collector/itcm/HEADER_SIZE
|
||||
i32.sub
|
||||
end
|
||||
@ -382,6 +384,8 @@
|
||||
global.set $~argc
|
||||
block $~lib/collector/itcm/objToRef|inlined.0 (result i32)
|
||||
local.get $0
|
||||
local.set $1
|
||||
local.get $1
|
||||
global.get $~lib/collector/itcm/HEADER_SIZE
|
||||
i32.add
|
||||
end
|
||||
@ -434,13 +438,11 @@
|
||||
i32.ge_u
|
||||
if
|
||||
block $~lib/memory/memory.free|inlined.0
|
||||
block
|
||||
local.get $0
|
||||
call $~lib/allocator/arena/__memory_free
|
||||
br $~lib/memory/memory.free|inlined.0
|
||||
unreachable
|
||||
end
|
||||
unreachable
|
||||
local.get $0
|
||||
local.set $1
|
||||
local.get $1
|
||||
call $~lib/allocator/arena/__memory_free
|
||||
br $~lib/memory/memory.free|inlined.0
|
||||
end
|
||||
end
|
||||
else
|
||||
@ -524,6 +526,8 @@
|
||||
call $~lib/collector/itcm/ManagedObjectList#push
|
||||
block $~lib/collector/itcm/objToRef|inlined.1 (result i32)
|
||||
local.get $3
|
||||
local.set $2
|
||||
local.get $2
|
||||
global.get $~lib/collector/itcm/HEADER_SIZE
|
||||
i32.add
|
||||
end
|
||||
@ -2272,6 +2276,7 @@
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $2
|
||||
@ -2305,37 +2310,43 @@
|
||||
local.get $1
|
||||
call $~lib/internal/arraybuffer/allocateUnsafe
|
||||
local.set $3
|
||||
local.get $3
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $4
|
||||
local.get $0
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $5
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $2
|
||||
call $~lib/internal/memory/memmove
|
||||
block $~lib/memory/memory.copy|inlined.0
|
||||
local.get $3
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $4
|
||||
local.get $0
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $5
|
||||
local.get $2
|
||||
local.set $6
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $6
|
||||
call $~lib/internal/memory/memmove
|
||||
end
|
||||
local.get $3
|
||||
local.set $0
|
||||
end
|
||||
local.get $0
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.get $2
|
||||
i32.add
|
||||
local.set $3
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $1
|
||||
local.get $2
|
||||
i32.sub
|
||||
local.set $4
|
||||
local.get $3
|
||||
local.get $5
|
||||
local.get $4
|
||||
call $~lib/internal/memory/memset
|
||||
block $~lib/memory/memory.fill|inlined.0
|
||||
local.get $0
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.get $2
|
||||
i32.add
|
||||
local.set $3
|
||||
i32.const 0
|
||||
local.set $6
|
||||
local.get $1
|
||||
local.get $2
|
||||
i32.sub
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $6
|
||||
local.get $5
|
||||
call $~lib/internal/memory/memset
|
||||
end
|
||||
else
|
||||
local.get $1
|
||||
local.get $2
|
||||
@ -2365,19 +2376,23 @@
|
||||
(local $3 i32)
|
||||
block $~lib/collector/itcm/refToObj|inlined.1 (result i32)
|
||||
local.get $0
|
||||
local.set $2
|
||||
local.get $2
|
||||
global.get $~lib/collector/itcm/HEADER_SIZE
|
||||
i32.sub
|
||||
end
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $3
|
||||
call $~lib/collector/itcm/ManagedObject#get:color
|
||||
global.get $~lib/collector/itcm/white
|
||||
i32.eqz
|
||||
i32.eq
|
||||
local.tee $3
|
||||
local.tee $2
|
||||
if (result i32)
|
||||
block $~lib/collector/itcm/refToObj|inlined.3 (result i32)
|
||||
local.get $1
|
||||
local.set $2
|
||||
local.get $2
|
||||
global.get $~lib/collector/itcm/HEADER_SIZE
|
||||
i32.sub
|
||||
end
|
||||
@ -2385,10 +2400,10 @@
|
||||
global.get $~lib/collector/itcm/white
|
||||
i32.eq
|
||||
else
|
||||
local.get $3
|
||||
local.get $2
|
||||
end
|
||||
if
|
||||
local.get $2
|
||||
local.get $3
|
||||
call $~lib/collector/itcm/ManagedObject#makeGray
|
||||
end
|
||||
)
|
||||
@ -2396,6 +2411,9 @@
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(local $7 i32)
|
||||
(local $8 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $3
|
||||
@ -2436,17 +2454,25 @@
|
||||
i32.add
|
||||
i32.store offset=4
|
||||
end
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $1
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $5
|
||||
i32.add
|
||||
local.get $2
|
||||
i32.store offset=8
|
||||
block $~lib/internal/arraybuffer/STORE<Foo,Foo>|inlined.0
|
||||
local.get $3
|
||||
local.set $5
|
||||
local.get $1
|
||||
local.set $6
|
||||
local.get $2
|
||||
local.set $7
|
||||
i32.const 0
|
||||
local.set $8
|
||||
local.get $5
|
||||
local.get $6
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $8
|
||||
i32.add
|
||||
local.get $7
|
||||
i32.store offset=8
|
||||
end
|
||||
local.get $0
|
||||
local.get $2
|
||||
call $~lib/collector/itcm/__gc_link
|
||||
|
@ -215,6 +215,8 @@
|
||||
if
|
||||
block $~lib/collector/itcm/refToObj|inlined.0 (result i32)
|
||||
local.get $0
|
||||
local.set $1
|
||||
local.get $1
|
||||
global.get $~lib/collector/itcm/HEADER_SIZE
|
||||
i32.sub
|
||||
end
|
||||
@ -333,6 +335,8 @@
|
||||
global.set $~argc
|
||||
block $~lib/collector/itcm/objToRef|inlined.0 (result i32)
|
||||
local.get $0
|
||||
local.set $1
|
||||
local.get $1
|
||||
global.get $~lib/collector/itcm/HEADER_SIZE
|
||||
i32.add
|
||||
end
|
||||
@ -385,13 +389,11 @@
|
||||
i32.ge_u
|
||||
if
|
||||
block $~lib/memory/memory.free|inlined.0
|
||||
block
|
||||
local.get $0
|
||||
call $~lib/allocator/arena/__memory_free
|
||||
br $~lib/memory/memory.free|inlined.0
|
||||
unreachable
|
||||
end
|
||||
unreachable
|
||||
local.get $0
|
||||
local.set $1
|
||||
local.get $1
|
||||
call $~lib/allocator/arena/__memory_free
|
||||
br $~lib/memory/memory.free|inlined.0
|
||||
end
|
||||
end
|
||||
else
|
||||
@ -439,6 +441,8 @@
|
||||
call $~lib/collector/itcm/ManagedObjectList#push
|
||||
block $~lib/collector/itcm/objToRef|inlined.1 (result i32)
|
||||
local.get $3
|
||||
local.set $2
|
||||
local.get $2
|
||||
global.get $~lib/collector/itcm/HEADER_SIZE
|
||||
i32.add
|
||||
end
|
||||
|
@ -207,6 +207,8 @@
|
||||
if
|
||||
block $~lib/collector/itcm/refToObj|inlined.0 (result i32)
|
||||
local.get $0
|
||||
local.set $1
|
||||
local.get $1
|
||||
global.get $~lib/collector/itcm/HEADER_SIZE
|
||||
i32.sub
|
||||
end
|
||||
@ -325,6 +327,8 @@
|
||||
global.set $~argc
|
||||
block $~lib/collector/itcm/objToRef|inlined.0 (result i32)
|
||||
local.get $0
|
||||
local.set $1
|
||||
local.get $1
|
||||
global.get $~lib/collector/itcm/HEADER_SIZE
|
||||
i32.add
|
||||
end
|
||||
@ -377,13 +381,11 @@
|
||||
i32.ge_u
|
||||
if
|
||||
block $~lib/memory/memory.free|inlined.0
|
||||
block
|
||||
local.get $0
|
||||
call $~lib/allocator/arena/__memory_free
|
||||
br $~lib/memory/memory.free|inlined.0
|
||||
unreachable
|
||||
end
|
||||
unreachable
|
||||
local.get $0
|
||||
local.set $1
|
||||
local.get $1
|
||||
call $~lib/allocator/arena/__memory_free
|
||||
br $~lib/memory/memory.free|inlined.0
|
||||
end
|
||||
end
|
||||
else
|
||||
@ -431,6 +433,8 @@
|
||||
call $~lib/collector/itcm/ManagedObjectList#push
|
||||
block $~lib/collector/itcm/objToRef|inlined.1 (result i32)
|
||||
local.get $3
|
||||
local.set $2
|
||||
local.get $2
|
||||
global.get $~lib/collector/itcm/HEADER_SIZE
|
||||
i32.add
|
||||
end
|
||||
|
@ -72,7 +72,10 @@
|
||||
(export "tanh" (func $std/libm/tanh))
|
||||
(export "trunc" (func $std/libm/trunc))
|
||||
(func $std/libm/abs (; 0 ;) (type $FF) (param $0 f64) (result f64)
|
||||
(local $1 f64)
|
||||
local.get $0
|
||||
local.set $1
|
||||
local.get $1
|
||||
f64.abs
|
||||
)
|
||||
(func $~lib/math/R (; 1 ;) (type $FF) (param $0 f64) (result f64)
|
||||
@ -1915,11 +1918,17 @@
|
||||
call $~lib/math/NativeMath.cbrt
|
||||
)
|
||||
(func $std/libm/ceil (; 21 ;) (type $FF) (param $0 f64) (result f64)
|
||||
(local $1 f64)
|
||||
local.get $0
|
||||
local.set $1
|
||||
local.get $1
|
||||
f64.ceil
|
||||
)
|
||||
(func $std/libm/clz32 (; 22 ;) (type $FF) (param $0 f64) (result f64)
|
||||
(local $1 f64)
|
||||
local.get $0
|
||||
local.set $1
|
||||
local.get $1
|
||||
i32.trunc_f64_s
|
||||
i32.clz
|
||||
f64.convert_i32_s
|
||||
@ -2507,6 +2516,7 @@
|
||||
(local $2 i32)
|
||||
(local $3 f64)
|
||||
(local $4 f64)
|
||||
(local $5 f64)
|
||||
local.get $0
|
||||
i64.reinterpret_f64
|
||||
local.set $1
|
||||
@ -2570,6 +2580,8 @@
|
||||
return
|
||||
end
|
||||
block $~lib/math/expo2|inlined.0 (result f64)
|
||||
local.get $0
|
||||
local.set $4
|
||||
i32.const 1023
|
||||
i32.const 2043
|
||||
i32.const 2
|
||||
@ -2581,14 +2593,14 @@
|
||||
i64.const 32
|
||||
i64.shl
|
||||
f64.reinterpret_i64
|
||||
local.set $4
|
||||
local.get $0
|
||||
local.set $5
|
||||
local.get $4
|
||||
f64.const 1416.0996898839683
|
||||
f64.sub
|
||||
call $~lib/math/NativeMath.exp
|
||||
local.get $4
|
||||
local.get $5
|
||||
f64.mul
|
||||
local.get $4
|
||||
local.get $5
|
||||
f64.mul
|
||||
end
|
||||
local.set $3
|
||||
@ -2607,11 +2619,17 @@
|
||||
call $~lib/math/NativeMath.expm1
|
||||
)
|
||||
(func $std/libm/floor (; 32 ;) (type $FF) (param $0 f64) (result f64)
|
||||
(local $1 f64)
|
||||
local.get $0
|
||||
local.set $1
|
||||
local.get $1
|
||||
f64.floor
|
||||
)
|
||||
(func $std/libm/fround (; 33 ;) (type $Ff) (param $0 f64) (result f32)
|
||||
(local $1 f64)
|
||||
local.get $0
|
||||
local.set $1
|
||||
local.get $1
|
||||
f32.demote_f64
|
||||
)
|
||||
(func $~lib/math/NativeMath.hypot (; 34 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64)
|
||||
@ -3401,13 +3419,25 @@
|
||||
call $~lib/math/NativeMath.log2
|
||||
)
|
||||
(func $std/libm/max (; 45 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64)
|
||||
(local $2 f64)
|
||||
(local $3 f64)
|
||||
local.get $0
|
||||
local.set $2
|
||||
local.get $1
|
||||
local.set $3
|
||||
local.get $2
|
||||
local.get $3
|
||||
f64.max
|
||||
)
|
||||
(func $std/libm/min (; 46 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64)
|
||||
(local $2 f64)
|
||||
(local $3 f64)
|
||||
local.get $0
|
||||
local.set $2
|
||||
local.get $1
|
||||
local.set $3
|
||||
local.get $2
|
||||
local.get $3
|
||||
f64.min
|
||||
)
|
||||
(func $~lib/math/NativeMath.pow (; 47 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64)
|
||||
@ -4504,28 +4534,34 @@
|
||||
call $~lib/math/NativeMath.pow
|
||||
)
|
||||
(func $std/libm/round (; 49 ;) (type $FF) (param $0 f64) (result f64)
|
||||
(local $1 f64)
|
||||
local.get $0
|
||||
local.set $1
|
||||
local.get $1
|
||||
f64.const 0.5
|
||||
f64.add
|
||||
f64.floor
|
||||
local.get $0
|
||||
local.get $1
|
||||
f64.copysign
|
||||
)
|
||||
(func $std/libm/sign (; 50 ;) (type $FF) (param $0 f64) (result f64)
|
||||
(local $1 f64)
|
||||
block $~lib/math/NativeMath.sign|inlined.0 (result f64)
|
||||
local.get $0
|
||||
local.set $1
|
||||
local.get $1
|
||||
f64.const 0
|
||||
f64.gt
|
||||
if (result f64)
|
||||
f64.const 1
|
||||
else
|
||||
local.get $0
|
||||
local.get $1
|
||||
f64.const 0
|
||||
f64.lt
|
||||
if (result f64)
|
||||
f64.const -1
|
||||
else
|
||||
local.get $0
|
||||
local.get $1
|
||||
end
|
||||
end
|
||||
br $~lib/math/NativeMath.sign|inlined.0
|
||||
@ -4546,6 +4582,7 @@
|
||||
(local $4 f64)
|
||||
(local $5 f64)
|
||||
(local $6 f64)
|
||||
(local $7 f64)
|
||||
local.get $0
|
||||
i64.reinterpret_f64
|
||||
i64.const 9223372036854775807
|
||||
@ -4615,6 +4652,8 @@
|
||||
local.get $5
|
||||
f64.mul
|
||||
block $~lib/math/expo2|inlined.1 (result f64)
|
||||
local.get $2
|
||||
local.set $6
|
||||
i32.const 1023
|
||||
i32.const 2043
|
||||
i32.const 2
|
||||
@ -4626,14 +4665,14 @@
|
||||
i64.const 32
|
||||
i64.shl
|
||||
f64.reinterpret_i64
|
||||
local.set $6
|
||||
local.get $2
|
||||
local.set $7
|
||||
local.get $6
|
||||
f64.const 1416.0996898839683
|
||||
f64.sub
|
||||
call $~lib/math/NativeMath.exp
|
||||
local.get $6
|
||||
local.get $7
|
||||
f64.mul
|
||||
local.get $6
|
||||
local.get $7
|
||||
f64.mul
|
||||
end
|
||||
f64.mul
|
||||
@ -4645,7 +4684,10 @@
|
||||
call $~lib/math/NativeMath.sinh
|
||||
)
|
||||
(func $std/libm/sqrt (; 55 ;) (type $FF) (param $0 f64) (result f64)
|
||||
(local $1 f64)
|
||||
local.get $0
|
||||
local.set $1
|
||||
local.get $1
|
||||
f64.sqrt
|
||||
)
|
||||
(func $~lib/math/NativeMath.tan (; 56 ;) (type $FF) (param $0 f64) (result f64)
|
||||
@ -4753,7 +4795,10 @@
|
||||
call $~lib/math/NativeMath.tanh
|
||||
)
|
||||
(func $std/libm/trunc (; 60 ;) (type $FF) (param $0 f64) (result f64)
|
||||
(local $1 f64)
|
||||
local.get $0
|
||||
local.set $1
|
||||
local.get $1
|
||||
f64.trunc
|
||||
)
|
||||
(func $null (; 61 ;) (type $v)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -5795,8 +5795,8 @@
|
||||
local.get $0
|
||||
local.get $1
|
||||
f64.mul
|
||||
local.tee $0
|
||||
local.get $0
|
||||
local.tee $1
|
||||
local.get $1
|
||||
f64.div
|
||||
return
|
||||
end
|
||||
@ -6020,8 +6020,8 @@
|
||||
local.get $0
|
||||
local.get $1
|
||||
f32.mul
|
||||
local.tee $0
|
||||
local.get $0
|
||||
local.tee $1
|
||||
local.get $1
|
||||
f32.div
|
||||
return
|
||||
end
|
||||
@ -8175,11 +8175,14 @@
|
||||
call $std/math/check<f32>
|
||||
)
|
||||
(func $std/math/test_sign (; 127 ;) (type $FUNCSIG$idd) (param $0 f64) (param $1 f64) (result i32)
|
||||
(local $2 i32)
|
||||
(local $2 f64)
|
||||
(local $3 i32)
|
||||
local.get $0
|
||||
local.set $2
|
||||
f64.const 1
|
||||
f64.const -1
|
||||
local.get $0
|
||||
local.get $0
|
||||
local.get $2
|
||||
local.get $2
|
||||
f64.const 0
|
||||
f64.lt
|
||||
select
|
||||
@ -8190,16 +8193,16 @@
|
||||
local.get $1
|
||||
f64.const 0
|
||||
call $std/math/check<f64>
|
||||
local.tee $2
|
||||
local.tee $3
|
||||
if
|
||||
local.get $0
|
||||
call $~lib/bindings/Math/sign
|
||||
local.get $1
|
||||
f64.const 0
|
||||
call $std/math/check<f64>
|
||||
local.set $2
|
||||
local.set $3
|
||||
end
|
||||
local.get $2
|
||||
local.get $3
|
||||
)
|
||||
(func $std/math/test_signf (; 128 ;) (type $FUNCSIG$iff) (param $0 f32) (param $1 f32) (result i32)
|
||||
f32.const 1
|
||||
|
@ -233,6 +233,7 @@
|
||||
)
|
||||
(func $std/math/ulperr (; 34 ;) (type $FFFF) (param $0 f64) (param $1 f64) (param $2 f64) (result f64)
|
||||
(local $3 i32)
|
||||
(local $4 f64)
|
||||
local.get $0
|
||||
call $~lib/builtins/isNaN<f64>
|
||||
local.tee $3
|
||||
@ -252,12 +253,14 @@
|
||||
if
|
||||
block $~lib/math/NativeMath.signbit|inlined.2 (result i32)
|
||||
local.get $0
|
||||
local.set $4
|
||||
local.get $4
|
||||
i64.reinterpret_f64
|
||||
i64.const 63
|
||||
i64.shr_u
|
||||
i32.wrap_i64
|
||||
local.get $0
|
||||
local.get $0
|
||||
local.get $4
|
||||
local.get $4
|
||||
f64.eq
|
||||
i32.and
|
||||
end
|
||||
@ -265,12 +268,14 @@
|
||||
i32.ne
|
||||
block $~lib/math/NativeMath.signbit|inlined.3 (result i32)
|
||||
local.get $1
|
||||
local.set $4
|
||||
local.get $4
|
||||
i64.reinterpret_f64
|
||||
i64.const 63
|
||||
i64.shr_u
|
||||
i32.wrap_i64
|
||||
local.get $1
|
||||
local.get $1
|
||||
local.get $4
|
||||
local.get $4
|
||||
f64.eq
|
||||
i32.and
|
||||
end
|
||||
@ -469,6 +474,7 @@
|
||||
)
|
||||
(func $std/math/ulperrf (; 40 ;) (type $ffff) (param $0 f32) (param $1 f32) (param $2 f32) (result f32)
|
||||
(local $3 i32)
|
||||
(local $4 f32)
|
||||
local.get $0
|
||||
call $~lib/builtins/isNaN<f32>
|
||||
local.tee $3
|
||||
@ -488,11 +494,13 @@
|
||||
if
|
||||
block $~lib/math/NativeMathf.signbit|inlined.2 (result i32)
|
||||
local.get $0
|
||||
local.set $4
|
||||
local.get $4
|
||||
i32.reinterpret_f32
|
||||
i32.const 31
|
||||
i32.shr_u
|
||||
local.get $0
|
||||
local.get $0
|
||||
local.get $4
|
||||
local.get $4
|
||||
f32.eq
|
||||
i32.and
|
||||
end
|
||||
@ -500,11 +508,13 @@
|
||||
i32.ne
|
||||
block $~lib/math/NativeMathf.signbit|inlined.3 (result i32)
|
||||
local.get $1
|
||||
local.set $4
|
||||
local.get $4
|
||||
i32.reinterpret_f32
|
||||
i32.const 31
|
||||
i32.shr_u
|
||||
local.get $1
|
||||
local.get $1
|
||||
local.get $4
|
||||
local.get $4
|
||||
f32.eq
|
||||
i32.and
|
||||
end
|
||||
@ -592,22 +602,25 @@
|
||||
call $std/math/check<f32>
|
||||
)
|
||||
(func $std/math/test_abs (; 44 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32)
|
||||
(local $4 i32)
|
||||
(local $4 f64)
|
||||
(local $5 i32)
|
||||
block $~lib/math/NativeMath.abs|inlined.0 (result f64)
|
||||
local.get $0
|
||||
local.set $4
|
||||
local.get $4
|
||||
f64.abs
|
||||
end
|
||||
local.get $1
|
||||
local.get $2
|
||||
local.get $3
|
||||
call $std/math/check<f64>
|
||||
local.tee $4
|
||||
local.tee $5
|
||||
if (result i32)
|
||||
global.get $std/math/js
|
||||
i32.eqz
|
||||
local.tee $4
|
||||
local.tee $5
|
||||
if (result i32)
|
||||
local.get $4
|
||||
local.get $5
|
||||
else
|
||||
local.get $0
|
||||
call $~lib/bindings/Math/abs
|
||||
@ -617,12 +630,15 @@
|
||||
call $std/math/check<f64>
|
||||
end
|
||||
else
|
||||
local.get $4
|
||||
local.get $5
|
||||
end
|
||||
)
|
||||
(func $std/math/test_absf (; 45 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32)
|
||||
(local $4 f32)
|
||||
block $~lib/math/NativeMathf.abs|inlined.0 (result f32)
|
||||
local.get $0
|
||||
local.set $4
|
||||
local.get $4
|
||||
f32.abs
|
||||
end
|
||||
local.get $1
|
||||
@ -4244,22 +4260,25 @@
|
||||
call $std/math/check<f32>
|
||||
)
|
||||
(func $std/math/test_ceil (; 84 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32)
|
||||
(local $4 i32)
|
||||
(local $4 f64)
|
||||
(local $5 i32)
|
||||
block $~lib/math/NativeMath.ceil|inlined.0 (result f64)
|
||||
local.get $0
|
||||
local.set $4
|
||||
local.get $4
|
||||
f64.ceil
|
||||
end
|
||||
local.get $1
|
||||
local.get $2
|
||||
local.get $3
|
||||
call $std/math/check<f64>
|
||||
local.tee $4
|
||||
local.tee $5
|
||||
if (result i32)
|
||||
global.get $std/math/js
|
||||
i32.eqz
|
||||
local.tee $4
|
||||
local.tee $5
|
||||
if (result i32)
|
||||
local.get $4
|
||||
local.get $5
|
||||
else
|
||||
local.get $0
|
||||
call $~lib/bindings/Math/ceil
|
||||
@ -4269,12 +4288,15 @@
|
||||
call $std/math/check<f64>
|
||||
end
|
||||
else
|
||||
local.get $4
|
||||
local.get $5
|
||||
end
|
||||
)
|
||||
(func $std/math/test_ceilf (; 85 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32)
|
||||
(local $4 f32)
|
||||
block $~lib/math/NativeMathf.ceil|inlined.0 (result f32)
|
||||
local.get $0
|
||||
local.set $4
|
||||
local.get $4
|
||||
f32.ceil
|
||||
end
|
||||
local.get $1
|
||||
@ -4766,6 +4788,7 @@
|
||||
(local $2 i32)
|
||||
(local $3 f64)
|
||||
(local $4 f64)
|
||||
(local $5 f64)
|
||||
local.get $0
|
||||
i64.reinterpret_f64
|
||||
local.set $1
|
||||
@ -4829,6 +4852,8 @@
|
||||
return
|
||||
end
|
||||
block $~lib/math/expo2|inlined.0 (result f64)
|
||||
local.get $0
|
||||
local.set $4
|
||||
i32.const 1023
|
||||
i32.const 2043
|
||||
i32.const 2
|
||||
@ -4840,14 +4865,14 @@
|
||||
i64.const 32
|
||||
i64.shl
|
||||
f64.reinterpret_i64
|
||||
local.set $4
|
||||
local.get $0
|
||||
local.set $5
|
||||
local.get $4
|
||||
f64.const 1416.0996898839683
|
||||
f64.sub
|
||||
call $~lib/math/NativeMath.exp
|
||||
local.get $4
|
||||
local.get $5
|
||||
f64.mul
|
||||
local.get $4
|
||||
local.get $5
|
||||
f64.mul
|
||||
end
|
||||
local.set $3
|
||||
@ -5322,6 +5347,7 @@
|
||||
(func $~lib/math/NativeMathf.cosh (; 92 ;) (type $ff) (param $0 f32) (result f32)
|
||||
(local $1 i32)
|
||||
(local $2 f32)
|
||||
(local $3 f32)
|
||||
local.get $0
|
||||
i32.reinterpret_f32
|
||||
local.set $1
|
||||
@ -5380,6 +5406,8 @@
|
||||
return
|
||||
end
|
||||
block $~lib/math/expo2f|inlined.0 (result f32)
|
||||
local.get $0
|
||||
local.set $2
|
||||
i32.const 127
|
||||
i32.const 235
|
||||
i32.const 1
|
||||
@ -5388,14 +5416,14 @@
|
||||
i32.const 23
|
||||
i32.shl
|
||||
f32.reinterpret_i32
|
||||
local.set $2
|
||||
local.get $0
|
||||
local.set $3
|
||||
local.get $2
|
||||
f32.const 162.88958740234375
|
||||
f32.sub
|
||||
call $~lib/math/NativeMathf.exp
|
||||
local.get $2
|
||||
local.get $3
|
||||
f32.mul
|
||||
local.get $2
|
||||
local.get $3
|
||||
f32.mul
|
||||
end
|
||||
)
|
||||
@ -5478,22 +5506,25 @@
|
||||
call $std/math/check<f32>
|
||||
)
|
||||
(func $std/math/test_floor (; 98 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32)
|
||||
(local $4 i32)
|
||||
(local $4 f64)
|
||||
(local $5 i32)
|
||||
block $~lib/math/NativeMath.floor|inlined.0 (result f64)
|
||||
local.get $0
|
||||
local.set $4
|
||||
local.get $4
|
||||
f64.floor
|
||||
end
|
||||
local.get $1
|
||||
local.get $2
|
||||
local.get $3
|
||||
call $std/math/check<f64>
|
||||
local.tee $4
|
||||
local.tee $5
|
||||
if (result i32)
|
||||
global.get $std/math/js
|
||||
i32.eqz
|
||||
local.tee $4
|
||||
local.tee $5
|
||||
if (result i32)
|
||||
local.get $4
|
||||
local.get $5
|
||||
else
|
||||
local.get $0
|
||||
call $~lib/bindings/Math/floor
|
||||
@ -5503,12 +5534,15 @@
|
||||
call $std/math/check<f64>
|
||||
end
|
||||
else
|
||||
local.get $4
|
||||
local.get $5
|
||||
end
|
||||
)
|
||||
(func $std/math/test_floorf (; 99 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32)
|
||||
(local $4 f32)
|
||||
block $~lib/math/NativeMathf.floor|inlined.0 (result f32)
|
||||
local.get $0
|
||||
local.set $4
|
||||
local.get $4
|
||||
f32.floor
|
||||
end
|
||||
local.get $1
|
||||
@ -6947,23 +6981,29 @@
|
||||
call $std/math/check<f32>
|
||||
)
|
||||
(func $std/math/test_max (; 116 ;) (type $FFFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32)
|
||||
(local $5 i32)
|
||||
(local $5 f64)
|
||||
(local $6 f64)
|
||||
(local $7 i32)
|
||||
block $~lib/math/NativeMath.max|inlined.0 (result f64)
|
||||
local.get $0
|
||||
local.set $5
|
||||
local.get $1
|
||||
local.set $6
|
||||
local.get $5
|
||||
local.get $6
|
||||
f64.max
|
||||
end
|
||||
local.get $2
|
||||
local.get $3
|
||||
local.get $4
|
||||
call $std/math/check<f64>
|
||||
local.tee $5
|
||||
local.tee $7
|
||||
if (result i32)
|
||||
global.get $std/math/js
|
||||
i32.eqz
|
||||
local.tee $5
|
||||
local.tee $7
|
||||
if (result i32)
|
||||
local.get $5
|
||||
local.get $7
|
||||
else
|
||||
local.get $0
|
||||
local.get $1
|
||||
@ -6974,13 +7014,19 @@
|
||||
call $std/math/check<f64>
|
||||
end
|
||||
else
|
||||
local.get $5
|
||||
local.get $7
|
||||
end
|
||||
)
|
||||
(func $std/math/test_maxf (; 117 ;) (type $ffffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32)
|
||||
(local $5 f32)
|
||||
(local $6 f32)
|
||||
block $~lib/math/NativeMathf.max|inlined.0 (result f32)
|
||||
local.get $0
|
||||
local.set $5
|
||||
local.get $1
|
||||
local.set $6
|
||||
local.get $5
|
||||
local.get $6
|
||||
f32.max
|
||||
end
|
||||
local.get $2
|
||||
@ -6989,23 +7035,29 @@
|
||||
call $std/math/check<f32>
|
||||
)
|
||||
(func $std/math/test_min (; 118 ;) (type $FFFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 i32) (result i32)
|
||||
(local $5 i32)
|
||||
(local $5 f64)
|
||||
(local $6 f64)
|
||||
(local $7 i32)
|
||||
block $~lib/math/NativeMath.min|inlined.0 (result f64)
|
||||
local.get $0
|
||||
local.set $5
|
||||
local.get $1
|
||||
local.set $6
|
||||
local.get $5
|
||||
local.get $6
|
||||
f64.min
|
||||
end
|
||||
local.get $2
|
||||
local.get $3
|
||||
local.get $4
|
||||
call $std/math/check<f64>
|
||||
local.tee $5
|
||||
local.tee $7
|
||||
if (result i32)
|
||||
global.get $std/math/js
|
||||
i32.eqz
|
||||
local.tee $5
|
||||
local.tee $7
|
||||
if (result i32)
|
||||
local.get $5
|
||||
local.get $7
|
||||
else
|
||||
local.get $0
|
||||
local.get $1
|
||||
@ -7016,13 +7068,19 @@
|
||||
call $std/math/check<f64>
|
||||
end
|
||||
else
|
||||
local.get $5
|
||||
local.get $7
|
||||
end
|
||||
)
|
||||
(func $std/math/test_minf (; 119 ;) (type $ffffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 f32) (param $4 i32) (result i32)
|
||||
(local $5 f32)
|
||||
(local $6 f32)
|
||||
block $~lib/math/NativeMathf.min|inlined.0 (result f32)
|
||||
local.get $0
|
||||
local.set $5
|
||||
local.get $1
|
||||
local.set $6
|
||||
local.get $5
|
||||
local.get $6
|
||||
f32.min
|
||||
end
|
||||
local.get $2
|
||||
@ -7083,7 +7141,9 @@
|
||||
local.get $8
|
||||
else
|
||||
local.get $1
|
||||
local.get $1
|
||||
local.set $9
|
||||
local.get $9
|
||||
local.get $9
|
||||
f64.ne
|
||||
end
|
||||
i32.const 0
|
||||
@ -7368,7 +7428,9 @@
|
||||
local.get $8
|
||||
else
|
||||
local.get $1
|
||||
local.get $1
|
||||
local.set $9
|
||||
local.get $9
|
||||
local.get $9
|
||||
f32.ne
|
||||
end
|
||||
i32.const 0
|
||||
@ -9848,12 +9910,15 @@
|
||||
f32.sub
|
||||
)
|
||||
(func $std/math/test_round (; 133 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32)
|
||||
(local $4 f64)
|
||||
block $~lib/math/NativeMath.round|inlined.0 (result f64)
|
||||
local.get $0
|
||||
local.set $4
|
||||
local.get $4
|
||||
f64.const 0.5
|
||||
f64.add
|
||||
f64.floor
|
||||
local.get $0
|
||||
local.get $4
|
||||
f64.copysign
|
||||
end
|
||||
local.get $1
|
||||
@ -9862,12 +9927,15 @@
|
||||
call $std/math/check<f64>
|
||||
)
|
||||
(func $std/math/test_roundf (; 134 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32)
|
||||
(local $4 f32)
|
||||
block $~lib/math/NativeMathf.round|inlined.0 (result f32)
|
||||
local.get $0
|
||||
local.set $4
|
||||
local.get $4
|
||||
f32.const 0.5
|
||||
f32.add
|
||||
f32.floor
|
||||
local.get $0
|
||||
local.get $4
|
||||
f32.copysign
|
||||
end
|
||||
local.get $1
|
||||
@ -9876,21 +9944,24 @@
|
||||
call $std/math/check<f32>
|
||||
)
|
||||
(func $std/math/test_sign (; 135 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32)
|
||||
(local $4 i32)
|
||||
(local $4 f64)
|
||||
(local $5 i32)
|
||||
block $~lib/math/NativeMath.sign|inlined.0 (result f64)
|
||||
local.get $0
|
||||
local.set $4
|
||||
local.get $4
|
||||
f64.const 0
|
||||
f64.gt
|
||||
if (result f64)
|
||||
f64.const 1
|
||||
else
|
||||
local.get $0
|
||||
local.get $4
|
||||
f64.const 0
|
||||
f64.lt
|
||||
if (result f64)
|
||||
f64.const -1
|
||||
else
|
||||
local.get $0
|
||||
local.get $4
|
||||
end
|
||||
end
|
||||
br $~lib/math/NativeMath.sign|inlined.0
|
||||
@ -9899,13 +9970,13 @@
|
||||
local.get $2
|
||||
local.get $3
|
||||
call $std/math/check<f64>
|
||||
local.tee $4
|
||||
local.tee $5
|
||||
if (result i32)
|
||||
global.get $std/math/js
|
||||
i32.eqz
|
||||
local.tee $4
|
||||
local.tee $5
|
||||
if (result i32)
|
||||
local.get $4
|
||||
local.get $5
|
||||
else
|
||||
local.get $0
|
||||
call $~lib/bindings/Math/sign
|
||||
@ -9915,24 +9986,27 @@
|
||||
call $std/math/check<f64>
|
||||
end
|
||||
else
|
||||
local.get $4
|
||||
local.get $5
|
||||
end
|
||||
)
|
||||
(func $std/math/test_signf (; 136 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32)
|
||||
(local $4 f32)
|
||||
block $~lib/math/NativeMathf.sign|inlined.0 (result f32)
|
||||
local.get $0
|
||||
local.set $4
|
||||
local.get $4
|
||||
f32.const 0
|
||||
f32.gt
|
||||
if (result f32)
|
||||
f32.const 1
|
||||
else
|
||||
local.get $0
|
||||
local.get $4
|
||||
f32.const 0
|
||||
f32.lt
|
||||
if (result f32)
|
||||
f32.const -1
|
||||
else
|
||||
local.get $0
|
||||
local.get $4
|
||||
end
|
||||
end
|
||||
br $~lib/math/NativeMathf.sign|inlined.0
|
||||
@ -10610,6 +10684,7 @@
|
||||
(local $4 f64)
|
||||
(local $5 f64)
|
||||
(local $6 f64)
|
||||
(local $7 f64)
|
||||
local.get $0
|
||||
i64.reinterpret_f64
|
||||
i64.const 9223372036854775807
|
||||
@ -10679,6 +10754,8 @@
|
||||
local.get $5
|
||||
f64.mul
|
||||
block $~lib/math/expo2|inlined.1 (result f64)
|
||||
local.get $2
|
||||
local.set $6
|
||||
i32.const 1023
|
||||
i32.const 2043
|
||||
i32.const 2
|
||||
@ -10690,14 +10767,14 @@
|
||||
i64.const 32
|
||||
i64.shl
|
||||
f64.reinterpret_i64
|
||||
local.set $6
|
||||
local.get $2
|
||||
local.set $7
|
||||
local.get $6
|
||||
f64.const 1416.0996898839683
|
||||
f64.sub
|
||||
call $~lib/math/NativeMath.exp
|
||||
local.get $6
|
||||
local.get $7
|
||||
f64.mul
|
||||
local.get $6
|
||||
local.get $7
|
||||
f64.mul
|
||||
end
|
||||
f64.mul
|
||||
@ -10737,6 +10814,7 @@
|
||||
(local $3 f32)
|
||||
(local $4 f32)
|
||||
(local $5 f32)
|
||||
(local $6 f32)
|
||||
local.get $0
|
||||
i32.reinterpret_f32
|
||||
i32.const 2147483647
|
||||
@ -10801,6 +10879,8 @@
|
||||
local.get $4
|
||||
f32.mul
|
||||
block $~lib/math/expo2f|inlined.1 (result f32)
|
||||
local.get $2
|
||||
local.set $5
|
||||
i32.const 127
|
||||
i32.const 235
|
||||
i32.const 1
|
||||
@ -10809,14 +10889,14 @@
|
||||
i32.const 23
|
||||
i32.shl
|
||||
f32.reinterpret_i32
|
||||
local.set $5
|
||||
local.get $2
|
||||
local.set $6
|
||||
local.get $5
|
||||
f32.const 162.88958740234375
|
||||
f32.sub
|
||||
call $~lib/math/NativeMathf.exp
|
||||
local.get $5
|
||||
local.get $6
|
||||
f32.mul
|
||||
local.get $5
|
||||
local.get $6
|
||||
f32.mul
|
||||
end
|
||||
f32.mul
|
||||
@ -10832,22 +10912,25 @@
|
||||
call $std/math/check<f32>
|
||||
)
|
||||
(func $std/math/test_sqrt (; 145 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32)
|
||||
(local $4 i32)
|
||||
(local $4 f64)
|
||||
(local $5 i32)
|
||||
block $~lib/math/NativeMath.sqrt|inlined.0 (result f64)
|
||||
local.get $0
|
||||
local.set $4
|
||||
local.get $4
|
||||
f64.sqrt
|
||||
end
|
||||
local.get $1
|
||||
local.get $2
|
||||
local.get $3
|
||||
call $std/math/check<f64>
|
||||
local.tee $4
|
||||
local.tee $5
|
||||
if (result i32)
|
||||
global.get $std/math/js
|
||||
i32.eqz
|
||||
local.tee $4
|
||||
local.tee $5
|
||||
if (result i32)
|
||||
local.get $4
|
||||
local.get $5
|
||||
else
|
||||
local.get $0
|
||||
call $~lib/bindings/Math/sqrt
|
||||
@ -10857,12 +10940,15 @@
|
||||
call $std/math/check<f64>
|
||||
end
|
||||
else
|
||||
local.get $4
|
||||
local.get $5
|
||||
end
|
||||
)
|
||||
(func $std/math/test_sqrtf (; 146 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32)
|
||||
(local $4 f32)
|
||||
block $~lib/math/NativeMathf.sqrt|inlined.0 (result f32)
|
||||
local.get $0
|
||||
local.set $4
|
||||
local.get $4
|
||||
f32.sqrt
|
||||
end
|
||||
local.get $1
|
||||
@ -11084,22 +11170,25 @@
|
||||
call $std/math/check<f32>
|
||||
)
|
||||
(func $std/math/test_trunc (; 151 ;) (type $FFFii) (param $0 f64) (param $1 f64) (param $2 f64) (param $3 i32) (result i32)
|
||||
(local $4 i32)
|
||||
(local $4 f64)
|
||||
(local $5 i32)
|
||||
block $~lib/math/NativeMath.trunc|inlined.0 (result f64)
|
||||
local.get $0
|
||||
local.set $4
|
||||
local.get $4
|
||||
f64.trunc
|
||||
end
|
||||
local.get $1
|
||||
local.get $2
|
||||
local.get $3
|
||||
call $std/math/check<f64>
|
||||
local.tee $4
|
||||
local.tee $5
|
||||
if (result i32)
|
||||
global.get $std/math/js
|
||||
i32.eqz
|
||||
local.tee $4
|
||||
local.tee $5
|
||||
if (result i32)
|
||||
local.get $4
|
||||
local.get $5
|
||||
else
|
||||
local.get $0
|
||||
call $~lib/bindings/Math/trunc
|
||||
@ -11109,12 +11198,15 @@
|
||||
call $std/math/check<f64>
|
||||
end
|
||||
else
|
||||
local.get $4
|
||||
local.get $5
|
||||
end
|
||||
)
|
||||
(func $std/math/test_truncf (; 152 ;) (type $fffii) (param $0 f32) (param $1 f32) (param $2 f32) (param $3 i32) (result i32)
|
||||
(local $4 f32)
|
||||
block $~lib/math/NativeMathf.trunc|inlined.0 (result f32)
|
||||
local.get $0
|
||||
local.set $4
|
||||
local.get $4
|
||||
f32.trunc
|
||||
end
|
||||
local.get $1
|
||||
@ -34868,7 +34960,7 @@
|
||||
end
|
||||
unreachable
|
||||
end
|
||||
block
|
||||
block $~lib/math/NativeMathf.seedRandom|inlined.0
|
||||
call $~lib/bindings/Math/random
|
||||
i64.reinterpret_f64
|
||||
local.set $3
|
||||
|
@ -73,8 +73,8 @@
|
||||
local.get $0
|
||||
local.get $1
|
||||
f64.mul
|
||||
local.tee $0
|
||||
local.get $0
|
||||
local.tee $1
|
||||
local.get $1
|
||||
f64.div
|
||||
return
|
||||
end
|
||||
@ -324,8 +324,8 @@
|
||||
local.get $0
|
||||
local.get $1
|
||||
f32.mul
|
||||
local.tee $0
|
||||
local.get $0
|
||||
local.tee $1
|
||||
local.get $1
|
||||
f32.div
|
||||
return
|
||||
end
|
||||
|
@ -76,7 +76,9 @@
|
||||
local.get $8
|
||||
else
|
||||
local.get $1
|
||||
local.get $1
|
||||
local.set $9
|
||||
local.get $9
|
||||
local.get $9
|
||||
f64.ne
|
||||
end
|
||||
i32.const 0
|
||||
@ -388,7 +390,9 @@
|
||||
local.get $8
|
||||
else
|
||||
local.get $1
|
||||
local.get $1
|
||||
local.set $9
|
||||
local.get $9
|
||||
local.get $9
|
||||
f32.ne
|
||||
end
|
||||
i32.const 0
|
||||
|
@ -1477,14 +1477,12 @@
|
||||
unreachable
|
||||
end
|
||||
global.get $std/pointer/buf
|
||||
local.tee $0
|
||||
i32.const 8
|
||||
i32.add
|
||||
local.tee $0
|
||||
f32.const 1.2999999523162842
|
||||
f32.store
|
||||
local.get $0
|
||||
i32.const 8
|
||||
i32.add
|
||||
f32.load
|
||||
f32.const 1.2999999523162842
|
||||
f32.ne
|
||||
|
@ -1,10 +1,8 @@
|
||||
(module
|
||||
(type $iii (func (param i32 i32) (result i32)))
|
||||
(type $iiiiv (func (param i32 i32 i32 i32)))
|
||||
(type $iiv (func (param i32 i32)))
|
||||
(type $iiiv (func (param i32 i32 i32)))
|
||||
(type $iifv (func (param i32 i32 f32)))
|
||||
(type $iif (func (param i32 i32) (result f32)))
|
||||
(type $ifv (func (param i32 f32)))
|
||||
(type $v (func))
|
||||
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
|
||||
@ -22,10 +20,7 @@
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $std/pointer/Pointer<Entry>#constructor (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
local.get $1
|
||||
)
|
||||
(func $~lib/internal/memory/memset (; 2 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(func $~lib/internal/memory/memset (; 1 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i64)
|
||||
@ -279,7 +274,7 @@
|
||||
end
|
||||
end
|
||||
)
|
||||
(func $~lib/internal/memory/memcpy (; 3 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(func $~lib/internal/memory/memcpy (; 2 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
@ -1480,7 +1475,7 @@
|
||||
i32.store8
|
||||
end
|
||||
)
|
||||
(func $~lib/internal/memory/memmove (; 4 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(func $~lib/internal/memory/memmove (; 3 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(local $3 i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
@ -1707,34 +1702,38 @@
|
||||
end
|
||||
end
|
||||
)
|
||||
(func $std/pointer/Pointer<Entry>#set:value (; 5 ;) (type $iiv) (param $0 i32) (param $1 i32)
|
||||
(func $std/pointer/Pointer<Entry>#set:value (; 4 ;) (type $iiv) (param $0 i32) (param $1 i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
local.get $1
|
||||
i32.const 0
|
||||
i32.eq
|
||||
if
|
||||
i32.const 0
|
||||
local.set $2
|
||||
i32.const 8
|
||||
local.set $3
|
||||
local.get $0
|
||||
local.set $2
|
||||
i32.const 0
|
||||
local.set $3
|
||||
i32.const 8
|
||||
local.set $4
|
||||
local.get $2
|
||||
local.get $3
|
||||
local.get $4
|
||||
call $~lib/internal/memory/memset
|
||||
else
|
||||
i32.const 8
|
||||
local.set $3
|
||||
local.get $0
|
||||
local.set $4
|
||||
local.get $1
|
||||
local.set $3
|
||||
i32.const 8
|
||||
local.set $2
|
||||
local.get $4
|
||||
local.get $3
|
||||
local.get $2
|
||||
call $~lib/internal/memory/memmove
|
||||
end
|
||||
)
|
||||
(func $std/pointer/Pointer<f32>#constructor (; 6 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
local.get $1
|
||||
)
|
||||
(func $std/pointer/Pointer<f32>#set (; 7 ;) (type $iifv) (param $0 i32) (param $1 i32) (param $2 f32)
|
||||
(func $std/pointer/Pointer<f32>#set (; 5 ;) (type $iifv) (param $0 i32) (param $1 i32) (param $2 f32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.const 4
|
||||
@ -1743,20 +1742,12 @@
|
||||
local.get $2
|
||||
f32.store
|
||||
)
|
||||
(func $std/pointer/Pointer<f32>#get (; 8 ;) (type $iif) (param $0 i32) (param $1 i32) (result f32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.const 4
|
||||
i32.mul
|
||||
i32.add
|
||||
f32.load
|
||||
)
|
||||
(func $std/pointer/Pointer<f32>#set:value (; 9 ;) (type $ifv) (param $0 i32) (param $1 f32)
|
||||
(func $std/pointer/Pointer<f32>#set:value (; 6 ;) (type $ifv) (param $0 i32) (param $1 f32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
f32.store
|
||||
)
|
||||
(func $start (; 10 ;) (type $v)
|
||||
(func $start (; 7 ;) (type $v)
|
||||
(local $0 i32)
|
||||
(local $1 i32)
|
||||
(local $2 f32)
|
||||
@ -2132,9 +2123,18 @@
|
||||
i32.const 1
|
||||
f32.const 1.2000000476837158
|
||||
call $std/pointer/Pointer<f32>#set
|
||||
global.get $std/pointer/buf
|
||||
i32.const 0
|
||||
call $std/pointer/Pointer<f32>#get
|
||||
block $std/pointer/Pointer<f32>#get|inlined.0 (result f32)
|
||||
global.get $std/pointer/buf
|
||||
local.set $1
|
||||
i32.const 0
|
||||
local.set $0
|
||||
local.get $1
|
||||
local.get $0
|
||||
i32.const 4
|
||||
i32.mul
|
||||
i32.add
|
||||
f32.load
|
||||
end
|
||||
f32.const 1.100000023841858
|
||||
f32.eq
|
||||
i32.eqz
|
||||
@ -2146,9 +2146,18 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
global.get $std/pointer/buf
|
||||
i32.const 1
|
||||
call $std/pointer/Pointer<f32>#get
|
||||
block $std/pointer/Pointer<f32>#get|inlined.1 (result f32)
|
||||
global.get $std/pointer/buf
|
||||
local.set $0
|
||||
i32.const 1
|
||||
local.set $1
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.const 4
|
||||
i32.mul
|
||||
i32.add
|
||||
f32.load
|
||||
end
|
||||
f32.const 1.2000000476837158
|
||||
f32.eq
|
||||
i32.eqz
|
||||
@ -2160,7 +2169,7 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
block $std/pointer/Pointer<f32>#get|inlined.0 (result f32)
|
||||
block $std/pointer/Pointer<f32>#get|inlined.2 (result f32)
|
||||
global.get $std/pointer/buf
|
||||
local.set $1
|
||||
i32.const 0
|
||||
@ -2183,7 +2192,7 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
block $std/pointer/Pointer<f32>#get|inlined.1 (result f32)
|
||||
block $std/pointer/Pointer<f32>#get|inlined.3 (result f32)
|
||||
global.get $std/pointer/buf
|
||||
local.set $0
|
||||
i32.const 1
|
||||
@ -2232,7 +2241,7 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
block
|
||||
block $std/pointer/Pointer<f32>#set|inlined.0
|
||||
global.get $std/pointer/buf
|
||||
local.set $1
|
||||
i32.const 2
|
||||
@ -2247,9 +2256,18 @@
|
||||
local.get $2
|
||||
f32.store
|
||||
end
|
||||
global.get $std/pointer/buf
|
||||
i32.const 2
|
||||
call $std/pointer/Pointer<f32>#get
|
||||
block $std/pointer/Pointer<f32>#get|inlined.4 (result f32)
|
||||
global.get $std/pointer/buf
|
||||
local.set $0
|
||||
i32.const 2
|
||||
local.set $1
|
||||
local.get $0
|
||||
local.get $1
|
||||
i32.const 4
|
||||
i32.mul
|
||||
i32.add
|
||||
f32.load
|
||||
end
|
||||
f32.const 1.2999999523162842
|
||||
f32.eq
|
||||
i32.eqz
|
||||
@ -2261,13 +2279,13 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
block $std/pointer/Pointer<f32>#get|inlined.2 (result f32)
|
||||
block $std/pointer/Pointer<f32>#get|inlined.5 (result f32)
|
||||
global.get $std/pointer/buf
|
||||
local.set $0
|
||||
i32.const 2
|
||||
local.set $1
|
||||
local.get $0
|
||||
i32.const 2
|
||||
local.set $0
|
||||
local.get $1
|
||||
local.get $0
|
||||
i32.const 4
|
||||
i32.mul
|
||||
i32.add
|
||||
@ -2302,8 +2320,8 @@
|
||||
call $std/pointer/Pointer<f32>#set:value
|
||||
block $std/pointer/Pointer<f32>#get:value|inlined.0 (result f32)
|
||||
global.get $std/pointer/buf
|
||||
local.set $1
|
||||
local.get $1
|
||||
local.set $0
|
||||
local.get $0
|
||||
f32.load
|
||||
br $std/pointer/Pointer<f32>#get:value|inlined.0
|
||||
end
|
||||
@ -2332,6 +2350,6 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 11 ;) (type $v)
|
||||
(func $null (; 8 ;) (type $v)
|
||||
)
|
||||
)
|
||||
|
@ -428,6 +428,7 @@
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $1
|
||||
global.get $~lib/internal/arraybuffer/MAX_BLENGTH
|
||||
i32.gt_u
|
||||
@ -453,9 +454,11 @@
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $1
|
||||
local.set $6
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $1
|
||||
local.get $6
|
||||
call $~lib/internal/memory/memset
|
||||
end
|
||||
local.get $3
|
||||
@ -844,6 +847,8 @@
|
||||
local.get $1
|
||||
block $~lib/internal/hash/HASH<i8>|inlined.1 (result i32)
|
||||
local.get $1
|
||||
local.set $2
|
||||
local.get $2
|
||||
i32.const 24
|
||||
i32.shl
|
||||
i32.const 24
|
||||
@ -852,15 +857,15 @@
|
||||
br $~lib/internal/hash/HASH<i8>|inlined.1
|
||||
end
|
||||
call $~lib/set/Set<i8>#find
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $3
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
return
|
||||
end
|
||||
local.get $2
|
||||
local.get $2
|
||||
local.get $3
|
||||
local.get $3
|
||||
i32.load offset=4
|
||||
global.get $~lib/set/EMPTY
|
||||
i32.or
|
||||
@ -875,21 +880,21 @@
|
||||
i32.load offset=4
|
||||
i32.const 1
|
||||
i32.shr_u
|
||||
local.set $3
|
||||
local.get $3
|
||||
local.set $4
|
||||
local.get $4
|
||||
i32.const 1
|
||||
i32.add
|
||||
global.get $~lib/set/INITIAL_CAPACITY
|
||||
local.tee $4
|
||||
local.tee $2
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
local.tee $5
|
||||
local.get $4
|
||||
local.get $2
|
||||
local.get $5
|
||||
i32.gt_u
|
||||
select
|
||||
i32.ge_u
|
||||
local.tee $4
|
||||
local.tee $2
|
||||
if (result i32)
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
@ -901,11 +906,11 @@
|
||||
i32.trunc_f64_s
|
||||
i32.lt_s
|
||||
else
|
||||
local.get $4
|
||||
local.get $2
|
||||
end
|
||||
if
|
||||
local.get $0
|
||||
local.get $3
|
||||
local.get $4
|
||||
call $~lib/set/Set<i8>#rehash
|
||||
end
|
||||
i32.const 1
|
||||
@ -1566,21 +1571,23 @@
|
||||
local.get $1
|
||||
block $~lib/internal/hash/HASH<u8>|inlined.1 (result i32)
|
||||
local.get $1
|
||||
local.set $2
|
||||
local.get $2
|
||||
i32.const 255
|
||||
i32.and
|
||||
call $~lib/internal/hash/hash8
|
||||
br $~lib/internal/hash/HASH<u8>|inlined.1
|
||||
end
|
||||
call $~lib/set/Set<u8>#find
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $3
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
return
|
||||
end
|
||||
local.get $2
|
||||
local.get $2
|
||||
local.get $3
|
||||
local.get $3
|
||||
i32.load offset=4
|
||||
global.get $~lib/set/EMPTY
|
||||
i32.or
|
||||
@ -1595,21 +1602,21 @@
|
||||
i32.load offset=4
|
||||
i32.const 1
|
||||
i32.shr_u
|
||||
local.set $3
|
||||
local.get $3
|
||||
local.set $4
|
||||
local.get $4
|
||||
i32.const 1
|
||||
i32.add
|
||||
global.get $~lib/set/INITIAL_CAPACITY
|
||||
local.tee $4
|
||||
local.tee $2
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
local.tee $5
|
||||
local.get $4
|
||||
local.get $2
|
||||
local.get $5
|
||||
i32.gt_u
|
||||
select
|
||||
i32.ge_u
|
||||
local.tee $4
|
||||
local.tee $2
|
||||
if (result i32)
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
@ -1621,11 +1628,11 @@
|
||||
i32.trunc_f64_s
|
||||
i32.lt_s
|
||||
else
|
||||
local.get $4
|
||||
local.get $2
|
||||
end
|
||||
if
|
||||
local.get $0
|
||||
local.get $3
|
||||
local.get $4
|
||||
call $~lib/set/Set<u8>#rehash
|
||||
end
|
||||
i32.const 1
|
||||
@ -2312,6 +2319,8 @@
|
||||
local.get $1
|
||||
block $~lib/internal/hash/HASH<i16>|inlined.1 (result i32)
|
||||
local.get $1
|
||||
local.set $2
|
||||
local.get $2
|
||||
i32.const 16
|
||||
i32.shl
|
||||
i32.const 16
|
||||
@ -2320,15 +2329,15 @@
|
||||
br $~lib/internal/hash/HASH<i16>|inlined.1
|
||||
end
|
||||
call $~lib/set/Set<i16>#find
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $3
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
return
|
||||
end
|
||||
local.get $2
|
||||
local.get $2
|
||||
local.get $3
|
||||
local.get $3
|
||||
i32.load offset=4
|
||||
global.get $~lib/set/EMPTY
|
||||
i32.or
|
||||
@ -2343,21 +2352,21 @@
|
||||
i32.load offset=4
|
||||
i32.const 1
|
||||
i32.shr_u
|
||||
local.set $3
|
||||
local.get $3
|
||||
local.set $4
|
||||
local.get $4
|
||||
i32.const 1
|
||||
i32.add
|
||||
global.get $~lib/set/INITIAL_CAPACITY
|
||||
local.tee $4
|
||||
local.tee $2
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
local.tee $5
|
||||
local.get $4
|
||||
local.get $2
|
||||
local.get $5
|
||||
i32.gt_u
|
||||
select
|
||||
i32.ge_u
|
||||
local.tee $4
|
||||
local.tee $2
|
||||
if (result i32)
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
@ -2369,11 +2378,11 @@
|
||||
i32.trunc_f64_s
|
||||
i32.lt_s
|
||||
else
|
||||
local.get $4
|
||||
local.get $2
|
||||
end
|
||||
if
|
||||
local.get $0
|
||||
local.get $3
|
||||
local.get $4
|
||||
call $~lib/set/Set<i16>#rehash
|
||||
end
|
||||
i32.const 1
|
||||
@ -3034,21 +3043,23 @@
|
||||
local.get $1
|
||||
block $~lib/internal/hash/HASH<u16>|inlined.1 (result i32)
|
||||
local.get $1
|
||||
local.set $2
|
||||
local.get $2
|
||||
i32.const 65535
|
||||
i32.and
|
||||
call $~lib/internal/hash/hash16
|
||||
br $~lib/internal/hash/HASH<u16>|inlined.1
|
||||
end
|
||||
call $~lib/set/Set<u16>#find
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $3
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
return
|
||||
end
|
||||
local.get $2
|
||||
local.get $2
|
||||
local.get $3
|
||||
local.get $3
|
||||
i32.load offset=4
|
||||
global.get $~lib/set/EMPTY
|
||||
i32.or
|
||||
@ -3063,21 +3074,21 @@
|
||||
i32.load offset=4
|
||||
i32.const 1
|
||||
i32.shr_u
|
||||
local.set $3
|
||||
local.get $3
|
||||
local.set $4
|
||||
local.get $4
|
||||
i32.const 1
|
||||
i32.add
|
||||
global.get $~lib/set/INITIAL_CAPACITY
|
||||
local.tee $4
|
||||
local.tee $2
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
local.tee $5
|
||||
local.get $4
|
||||
local.get $2
|
||||
local.get $5
|
||||
i32.gt_u
|
||||
select
|
||||
i32.ge_u
|
||||
local.tee $4
|
||||
local.tee $2
|
||||
if (result i32)
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
@ -3089,11 +3100,11 @@
|
||||
i32.trunc_f64_s
|
||||
i32.lt_s
|
||||
else
|
||||
local.get $4
|
||||
local.get $2
|
||||
end
|
||||
if
|
||||
local.get $0
|
||||
local.get $3
|
||||
local.get $4
|
||||
call $~lib/set/Set<u16>#rehash
|
||||
end
|
||||
i32.const 1
|
||||
@ -3792,19 +3803,21 @@
|
||||
local.get $1
|
||||
block $~lib/internal/hash/HASH<i32>|inlined.1 (result i32)
|
||||
local.get $1
|
||||
local.set $2
|
||||
local.get $2
|
||||
call $~lib/internal/hash/hash32
|
||||
br $~lib/internal/hash/HASH<i32>|inlined.1
|
||||
end
|
||||
call $~lib/set/Set<i32>#find
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $3
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
return
|
||||
end
|
||||
local.get $2
|
||||
local.get $2
|
||||
local.get $3
|
||||
local.get $3
|
||||
i32.load offset=4
|
||||
global.get $~lib/set/EMPTY
|
||||
i32.or
|
||||
@ -3819,21 +3832,21 @@
|
||||
i32.load offset=4
|
||||
i32.const 1
|
||||
i32.shr_u
|
||||
local.set $3
|
||||
local.get $3
|
||||
local.set $4
|
||||
local.get $4
|
||||
i32.const 1
|
||||
i32.add
|
||||
global.get $~lib/set/INITIAL_CAPACITY
|
||||
local.tee $4
|
||||
local.tee $2
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
local.tee $5
|
||||
local.get $4
|
||||
local.get $2
|
||||
local.get $5
|
||||
i32.gt_u
|
||||
select
|
||||
i32.ge_u
|
||||
local.tee $4
|
||||
local.tee $2
|
||||
if (result i32)
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
@ -3845,11 +3858,11 @@
|
||||
i32.trunc_f64_s
|
||||
i32.lt_s
|
||||
else
|
||||
local.get $4
|
||||
local.get $2
|
||||
end
|
||||
if
|
||||
local.get $0
|
||||
local.get $3
|
||||
local.get $4
|
||||
call $~lib/set/Set<i32>#rehash
|
||||
end
|
||||
i32.const 1
|
||||
@ -4506,19 +4519,21 @@
|
||||
local.get $1
|
||||
block $~lib/internal/hash/HASH<u32>|inlined.1 (result i32)
|
||||
local.get $1
|
||||
local.set $2
|
||||
local.get $2
|
||||
call $~lib/internal/hash/hash32
|
||||
br $~lib/internal/hash/HASH<u32>|inlined.1
|
||||
end
|
||||
call $~lib/set/Set<u32>#find
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $3
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
return
|
||||
end
|
||||
local.get $2
|
||||
local.get $2
|
||||
local.get $3
|
||||
local.get $3
|
||||
i32.load offset=4
|
||||
global.get $~lib/set/EMPTY
|
||||
i32.or
|
||||
@ -4533,21 +4548,21 @@
|
||||
i32.load offset=4
|
||||
i32.const 1
|
||||
i32.shr_u
|
||||
local.set $3
|
||||
local.get $3
|
||||
local.set $4
|
||||
local.get $4
|
||||
i32.const 1
|
||||
i32.add
|
||||
global.get $~lib/set/INITIAL_CAPACITY
|
||||
local.tee $4
|
||||
local.tee $2
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
local.tee $5
|
||||
local.get $4
|
||||
local.get $2
|
||||
local.get $5
|
||||
i32.gt_u
|
||||
select
|
||||
i32.ge_u
|
||||
local.tee $4
|
||||
local.tee $2
|
||||
if (result i32)
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
@ -4559,11 +4574,11 @@
|
||||
i32.trunc_f64_s
|
||||
i32.lt_s
|
||||
else
|
||||
local.get $4
|
||||
local.get $2
|
||||
end
|
||||
if
|
||||
local.get $0
|
||||
local.get $3
|
||||
local.get $4
|
||||
call $~lib/set/Set<u32>#rehash
|
||||
end
|
||||
i32.const 1
|
||||
@ -5301,27 +5316,30 @@
|
||||
i32.load offset=20
|
||||
)
|
||||
(func $~lib/set/Set<i64>#delete (; 79 ;) (type $iIi) (param $0 i32) (param $1 i64) (result i32)
|
||||
(local $2 i32)
|
||||
(local $2 i64)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
block $~lib/internal/hash/HASH<i64>|inlined.1 (result i32)
|
||||
local.get $1
|
||||
local.set $2
|
||||
local.get $2
|
||||
call $~lib/internal/hash/hash64
|
||||
br $~lib/internal/hash/HASH<i64>|inlined.1
|
||||
end
|
||||
call $~lib/set/Set<i64>#find
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $3
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
return
|
||||
end
|
||||
local.get $2
|
||||
local.get $2
|
||||
local.get $3
|
||||
local.get $3
|
||||
i32.load offset=8
|
||||
global.get $~lib/set/EMPTY
|
||||
i32.or
|
||||
@ -5336,21 +5354,21 @@
|
||||
i32.load offset=4
|
||||
i32.const 1
|
||||
i32.shr_u
|
||||
local.set $3
|
||||
local.get $3
|
||||
local.set $4
|
||||
local.get $4
|
||||
i32.const 1
|
||||
i32.add
|
||||
global.get $~lib/set/INITIAL_CAPACITY
|
||||
local.tee $4
|
||||
local.tee $5
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
local.tee $5
|
||||
local.get $4
|
||||
local.tee $6
|
||||
local.get $5
|
||||
local.get $6
|
||||
i32.gt_u
|
||||
select
|
||||
i32.ge_u
|
||||
local.tee $4
|
||||
local.tee $5
|
||||
if (result i32)
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
@ -5362,11 +5380,11 @@
|
||||
i32.trunc_f64_s
|
||||
i32.lt_s
|
||||
else
|
||||
local.get $4
|
||||
local.get $5
|
||||
end
|
||||
if
|
||||
local.get $0
|
||||
local.get $3
|
||||
local.get $4
|
||||
call $~lib/set/Set<i64>#rehash
|
||||
end
|
||||
i32.const 1
|
||||
@ -6016,27 +6034,30 @@
|
||||
i32.load offset=20
|
||||
)
|
||||
(func $~lib/set/Set<u64>#delete (; 89 ;) (type $iIi) (param $0 i32) (param $1 i64) (result i32)
|
||||
(local $2 i32)
|
||||
(local $2 i64)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
block $~lib/internal/hash/HASH<u64>|inlined.1 (result i32)
|
||||
local.get $1
|
||||
local.set $2
|
||||
local.get $2
|
||||
call $~lib/internal/hash/hash64
|
||||
br $~lib/internal/hash/HASH<u64>|inlined.1
|
||||
end
|
||||
call $~lib/set/Set<u64>#find
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $3
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
return
|
||||
end
|
||||
local.get $2
|
||||
local.get $2
|
||||
local.get $3
|
||||
local.get $3
|
||||
i32.load offset=8
|
||||
global.get $~lib/set/EMPTY
|
||||
i32.or
|
||||
@ -6051,21 +6072,21 @@
|
||||
i32.load offset=4
|
||||
i32.const 1
|
||||
i32.shr_u
|
||||
local.set $3
|
||||
local.get $3
|
||||
local.set $4
|
||||
local.get $4
|
||||
i32.const 1
|
||||
i32.add
|
||||
global.get $~lib/set/INITIAL_CAPACITY
|
||||
local.tee $4
|
||||
local.tee $5
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
local.tee $5
|
||||
local.get $4
|
||||
local.tee $6
|
||||
local.get $5
|
||||
local.get $6
|
||||
i32.gt_u
|
||||
select
|
||||
i32.ge_u
|
||||
local.tee $4
|
||||
local.tee $5
|
||||
if (result i32)
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
@ -6077,11 +6098,11 @@
|
||||
i32.trunc_f64_s
|
||||
i32.lt_s
|
||||
else
|
||||
local.get $4
|
||||
local.get $5
|
||||
end
|
||||
if
|
||||
local.get $0
|
||||
local.get $3
|
||||
local.get $4
|
||||
call $~lib/set/Set<u64>#rehash
|
||||
end
|
||||
i32.const 1
|
||||
@ -6733,28 +6754,31 @@
|
||||
i32.load offset=20
|
||||
)
|
||||
(func $~lib/set/Set<f32>#delete (; 99 ;) (type $ifi) (param $0 i32) (param $1 f32) (result i32)
|
||||
(local $2 i32)
|
||||
(local $2 f32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
block $~lib/internal/hash/HASH<f32>|inlined.1 (result i32)
|
||||
local.get $1
|
||||
local.set $2
|
||||
local.get $2
|
||||
i32.reinterpret_f32
|
||||
call $~lib/internal/hash/hash32
|
||||
br $~lib/internal/hash/HASH<f32>|inlined.1
|
||||
end
|
||||
call $~lib/set/Set<f32>#find
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $3
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
return
|
||||
end
|
||||
local.get $2
|
||||
local.get $2
|
||||
local.get $3
|
||||
local.get $3
|
||||
i32.load offset=4
|
||||
global.get $~lib/set/EMPTY
|
||||
i32.or
|
||||
@ -6769,21 +6793,21 @@
|
||||
i32.load offset=4
|
||||
i32.const 1
|
||||
i32.shr_u
|
||||
local.set $3
|
||||
local.get $3
|
||||
local.set $4
|
||||
local.get $4
|
||||
i32.const 1
|
||||
i32.add
|
||||
global.get $~lib/set/INITIAL_CAPACITY
|
||||
local.tee $4
|
||||
local.tee $5
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
local.tee $5
|
||||
local.get $4
|
||||
local.tee $6
|
||||
local.get $5
|
||||
local.get $6
|
||||
i32.gt_u
|
||||
select
|
||||
i32.ge_u
|
||||
local.tee $4
|
||||
local.tee $5
|
||||
if (result i32)
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
@ -6795,11 +6819,11 @@
|
||||
i32.trunc_f64_s
|
||||
i32.lt_s
|
||||
else
|
||||
local.get $4
|
||||
local.get $5
|
||||
end
|
||||
if
|
||||
local.get $0
|
||||
local.get $3
|
||||
local.get $4
|
||||
call $~lib/set/Set<f32>#rehash
|
||||
end
|
||||
i32.const 1
|
||||
@ -7451,28 +7475,31 @@
|
||||
i32.load offset=20
|
||||
)
|
||||
(func $~lib/set/Set<f64>#delete (; 109 ;) (type $iFi) (param $0 i32) (param $1 f64) (result i32)
|
||||
(local $2 i32)
|
||||
(local $2 f64)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
block $~lib/internal/hash/HASH<f64>|inlined.1 (result i32)
|
||||
local.get $1
|
||||
local.set $2
|
||||
local.get $2
|
||||
i64.reinterpret_f64
|
||||
call $~lib/internal/hash/hash64
|
||||
br $~lib/internal/hash/HASH<f64>|inlined.1
|
||||
end
|
||||
call $~lib/set/Set<f64>#find
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $3
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
return
|
||||
end
|
||||
local.get $2
|
||||
local.get $2
|
||||
local.get $3
|
||||
local.get $3
|
||||
i32.load offset=8
|
||||
global.get $~lib/set/EMPTY
|
||||
i32.or
|
||||
@ -7487,21 +7514,21 @@
|
||||
i32.load offset=4
|
||||
i32.const 1
|
||||
i32.shr_u
|
||||
local.set $3
|
||||
local.get $3
|
||||
local.set $4
|
||||
local.get $4
|
||||
i32.const 1
|
||||
i32.add
|
||||
global.get $~lib/set/INITIAL_CAPACITY
|
||||
local.tee $4
|
||||
local.tee $5
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
local.tee $5
|
||||
local.get $4
|
||||
local.tee $6
|
||||
local.get $5
|
||||
local.get $6
|
||||
i32.gt_u
|
||||
select
|
||||
i32.ge_u
|
||||
local.tee $4
|
||||
local.tee $5
|
||||
if (result i32)
|
||||
local.get $0
|
||||
i32.load offset=20
|
||||
@ -7513,11 +7540,11 @@
|
||||
i32.trunc_f64_s
|
||||
i32.lt_s
|
||||
else
|
||||
local.get $4
|
||||
local.get $5
|
||||
end
|
||||
if
|
||||
local.get $0
|
||||
local.get $3
|
||||
local.get $4
|
||||
call $~lib/set/Set<f64>#rehash
|
||||
end
|
||||
i32.const 1
|
||||
|
@ -45,6 +45,8 @@
|
||||
(func $~lib/array/Array<i32>#__get (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $2
|
||||
@ -55,14 +57,18 @@
|
||||
i32.shr_u
|
||||
i32.lt_u
|
||||
if (result i32)
|
||||
i32.const 0
|
||||
local.set $3
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $1
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $3
|
||||
local.get $5
|
||||
i32.add
|
||||
i32.load offset=8
|
||||
else
|
||||
@ -1879,6 +1885,7 @@
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $2
|
||||
@ -1912,46 +1919,50 @@
|
||||
local.get $1
|
||||
call $~lib/internal/arraybuffer/allocateUnsafe
|
||||
local.set $3
|
||||
local.get $3
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $4
|
||||
local.get $0
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $5
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $2
|
||||
call $~lib/internal/memory/memmove
|
||||
block $~lib/memory/memory.copy|inlined.0
|
||||
local.get $3
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $4
|
||||
local.get $0
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $5
|
||||
local.get $2
|
||||
local.set $6
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $6
|
||||
call $~lib/internal/memory/memmove
|
||||
end
|
||||
block $~lib/memory/memory.free|inlined.0
|
||||
block
|
||||
local.get $0
|
||||
call $~lib/allocator/arena/__memory_free
|
||||
br $~lib/memory/memory.free|inlined.0
|
||||
unreachable
|
||||
end
|
||||
unreachable
|
||||
local.get $0
|
||||
local.set $6
|
||||
local.get $6
|
||||
call $~lib/allocator/arena/__memory_free
|
||||
br $~lib/memory/memory.free|inlined.0
|
||||
end
|
||||
local.get $3
|
||||
local.set $0
|
||||
end
|
||||
local.get $0
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.get $2
|
||||
i32.add
|
||||
local.set $3
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $1
|
||||
local.get $2
|
||||
i32.sub
|
||||
local.set $4
|
||||
local.get $3
|
||||
local.get $5
|
||||
local.get $4
|
||||
call $~lib/internal/memory/memset
|
||||
block $~lib/memory/memory.fill|inlined.0
|
||||
local.get $0
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.get $2
|
||||
i32.add
|
||||
local.set $3
|
||||
i32.const 0
|
||||
local.set $6
|
||||
local.get $1
|
||||
local.get $2
|
||||
i32.sub
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $6
|
||||
local.get $5
|
||||
call $~lib/internal/memory/memset
|
||||
end
|
||||
else
|
||||
local.get $1
|
||||
local.get $2
|
||||
@ -1980,6 +1991,9 @@
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(local $7 i32)
|
||||
(local $8 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $3
|
||||
@ -2020,21 +2034,31 @@
|
||||
i32.add
|
||||
i32.store offset=4
|
||||
end
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $1
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $5
|
||||
i32.add
|
||||
local.get $2
|
||||
i32.store offset=8
|
||||
block $~lib/internal/arraybuffer/STORE<i32,i32>|inlined.0
|
||||
local.get $3
|
||||
local.set $5
|
||||
local.get $1
|
||||
local.set $6
|
||||
local.get $2
|
||||
local.set $7
|
||||
i32.const 0
|
||||
local.set $8
|
||||
local.get $5
|
||||
local.get $6
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $8
|
||||
i32.add
|
||||
local.get $7
|
||||
i32.store offset=8
|
||||
end
|
||||
)
|
||||
(func $~lib/array/Array<i64>#__get (; 11 ;) (type $iiI) (param $0 i32) (param $1 i32) (result i64)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $2
|
||||
@ -2045,14 +2069,18 @@
|
||||
i32.shr_u
|
||||
i32.lt_u
|
||||
if (result i64)
|
||||
i32.const 0
|
||||
local.set $3
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $1
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 3
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $3
|
||||
local.get $5
|
||||
i32.add
|
||||
i64.load offset=8
|
||||
else
|
||||
@ -2063,6 +2091,9 @@
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(local $7 i64)
|
||||
(local $8 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $3
|
||||
@ -2103,21 +2134,31 @@
|
||||
i32.add
|
||||
i32.store offset=4
|
||||
end
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $1
|
||||
i32.const 3
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $5
|
||||
i32.add
|
||||
local.get $2
|
||||
i64.store offset=8
|
||||
block $~lib/internal/arraybuffer/STORE<i64,i64>|inlined.0
|
||||
local.get $3
|
||||
local.set $5
|
||||
local.get $1
|
||||
local.set $6
|
||||
local.get $2
|
||||
local.set $7
|
||||
i32.const 0
|
||||
local.set $8
|
||||
local.get $5
|
||||
local.get $6
|
||||
i32.const 3
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $8
|
||||
i32.add
|
||||
local.get $7
|
||||
i64.store offset=8
|
||||
end
|
||||
)
|
||||
(func $~lib/array/Array<f32>#__get (; 13 ;) (type $iif) (param $0 i32) (param $1 i32) (result f32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $2
|
||||
@ -2128,14 +2169,18 @@
|
||||
i32.shr_u
|
||||
i32.lt_u
|
||||
if (result f32)
|
||||
i32.const 0
|
||||
local.set $3
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $1
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $3
|
||||
local.get $5
|
||||
i32.add
|
||||
f32.load offset=8
|
||||
else
|
||||
@ -2146,6 +2191,9 @@
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(local $7 f32)
|
||||
(local $8 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $3
|
||||
@ -2186,21 +2234,31 @@
|
||||
i32.add
|
||||
i32.store offset=4
|
||||
end
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $1
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $5
|
||||
i32.add
|
||||
local.get $2
|
||||
f32.store offset=8
|
||||
block $~lib/internal/arraybuffer/STORE<f32,f32>|inlined.0
|
||||
local.get $3
|
||||
local.set $5
|
||||
local.get $1
|
||||
local.set $6
|
||||
local.get $2
|
||||
local.set $7
|
||||
i32.const 0
|
||||
local.set $8
|
||||
local.get $5
|
||||
local.get $6
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $8
|
||||
i32.add
|
||||
local.get $7
|
||||
f32.store offset=8
|
||||
end
|
||||
)
|
||||
(func $~lib/array/Array<f64>#__get (; 15 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $2
|
||||
@ -2211,14 +2269,18 @@
|
||||
i32.shr_u
|
||||
i32.lt_u
|
||||
if (result f64)
|
||||
i32.const 0
|
||||
local.set $3
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $1
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 3
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $3
|
||||
local.get $5
|
||||
i32.add
|
||||
f64.load offset=8
|
||||
else
|
||||
@ -2229,6 +2291,9 @@
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(local $7 f64)
|
||||
(local $8 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $3
|
||||
@ -2269,17 +2334,25 @@
|
||||
i32.add
|
||||
i32.store offset=4
|
||||
end
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $1
|
||||
i32.const 3
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $5
|
||||
i32.add
|
||||
local.get $2
|
||||
f64.store offset=8
|
||||
block $~lib/internal/arraybuffer/STORE<f64,f64>|inlined.0
|
||||
local.get $3
|
||||
local.set $5
|
||||
local.get $1
|
||||
local.set $6
|
||||
local.get $2
|
||||
local.set $7
|
||||
i32.const 0
|
||||
local.set $8
|
||||
local.get $5
|
||||
local.get $6
|
||||
i32.const 3
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $8
|
||||
i32.add
|
||||
local.get $7
|
||||
f64.store offset=8
|
||||
end
|
||||
)
|
||||
(func $start (; 17 ;) (type $v)
|
||||
(local $0 i32)
|
||||
|
@ -1926,6 +1926,7 @@
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(local $7 i32)
|
||||
(local $8 i32)
|
||||
local.get $1
|
||||
i32.const 1
|
||||
i32.lt_u
|
||||
@ -2223,22 +2224,26 @@
|
||||
i32.shr_u
|
||||
call $~lib/internal/string/allocateUnsafe
|
||||
local.set $7
|
||||
local.get $7
|
||||
global.get $~lib/internal/string/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $3
|
||||
local.get $3
|
||||
local.get $4
|
||||
local.get $5
|
||||
call $~lib/internal/memory/memmove
|
||||
block $~lib/memory/memory.copy|inlined.0
|
||||
local.get $7
|
||||
global.get $~lib/internal/string/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $3
|
||||
local.get $4
|
||||
local.set $6
|
||||
local.get $5
|
||||
local.set $8
|
||||
local.get $3
|
||||
local.get $6
|
||||
local.get $8
|
||||
call $~lib/internal/memory/memmove
|
||||
end
|
||||
block $~lib/memory/memory.free|inlined.0
|
||||
block
|
||||
local.get $4
|
||||
call $~lib/allocator/arena/__memory_free
|
||||
br $~lib/memory/memory.free|inlined.0
|
||||
unreachable
|
||||
end
|
||||
unreachable
|
||||
local.get $4
|
||||
local.set $8
|
||||
local.get $8
|
||||
call $~lib/allocator/arena/__memory_free
|
||||
br $~lib/memory/memory.free|inlined.0
|
||||
end
|
||||
local.get $7
|
||||
)
|
||||
@ -2607,13 +2612,9 @@
|
||||
block $~lib/memory/memory.free|inlined.1
|
||||
global.get $std/string-utf8/ptr
|
||||
local.set $0
|
||||
block
|
||||
local.get $0
|
||||
call $~lib/allocator/arena/__memory_free
|
||||
br $~lib/memory/memory.free|inlined.1
|
||||
unreachable
|
||||
end
|
||||
unreachable
|
||||
local.get $0
|
||||
call $~lib/allocator/arena/__memory_free
|
||||
br $~lib/memory/memory.free|inlined.1
|
||||
end
|
||||
)
|
||||
(func $null (; 12 ;) (type $v)
|
||||
|
@ -4251,32 +4251,32 @@
|
||||
(local $7 i32)
|
||||
(local $8 i64)
|
||||
(local $9 i32)
|
||||
(local $10 i64)
|
||||
(local $10 i32)
|
||||
(local $11 i32)
|
||||
(local $12 i32)
|
||||
(local $12 i64)
|
||||
(local $13 i64)
|
||||
(local $14 i64)
|
||||
local.get $3
|
||||
local.get $1
|
||||
i64.sub
|
||||
local.set $8
|
||||
local.set $12
|
||||
i64.const 1
|
||||
i32.const 0
|
||||
local.get $4
|
||||
i32.sub
|
||||
local.tee $11
|
||||
i64.extend_i32_s
|
||||
local.tee $13
|
||||
local.tee $1
|
||||
i64.shl
|
||||
local.tee $10
|
||||
local.tee $13
|
||||
i64.const 1
|
||||
i64.sub
|
||||
local.tee $14
|
||||
local.get $3
|
||||
i64.and
|
||||
local.set $1
|
||||
local.set $8
|
||||
local.get $3
|
||||
local.get $13
|
||||
local.get $1
|
||||
i64.shr_u
|
||||
i32.wrap_i64
|
||||
local.tee $7
|
||||
@ -4284,7 +4284,7 @@
|
||||
local.set $9
|
||||
i32.const 4624
|
||||
i32.load
|
||||
local.set $12
|
||||
local.set $10
|
||||
loop $continue|0
|
||||
local.get $9
|
||||
i32.const 0
|
||||
@ -4440,9 +4440,9 @@
|
||||
local.get $11
|
||||
i64.extend_i32_s
|
||||
i64.shl
|
||||
local.get $1
|
||||
local.get $8
|
||||
i64.add
|
||||
local.tee $3
|
||||
local.tee $1
|
||||
local.get $5
|
||||
i64.le_u
|
||||
if
|
||||
@ -4450,7 +4450,9 @@
|
||||
local.get $9
|
||||
i32.add
|
||||
global.set $~lib/internal/number/_K
|
||||
local.get $12
|
||||
local.get $5
|
||||
local.set $3
|
||||
local.get $10
|
||||
local.get $9
|
||||
i32.const 2
|
||||
i32.shl
|
||||
@ -4459,7 +4461,9 @@
|
||||
local.get $11
|
||||
i64.extend_i32_s
|
||||
i64.shl
|
||||
local.set $1
|
||||
local.set $8
|
||||
local.get $12
|
||||
local.set $5
|
||||
local.get $6
|
||||
i32.const 1
|
||||
i32.sub
|
||||
@ -4469,37 +4473,37 @@
|
||||
i32.add
|
||||
local.tee $2
|
||||
i32.load16_u offset=4
|
||||
local.set $7
|
||||
local.set $10
|
||||
loop $continue|2
|
||||
local.get $3
|
||||
local.get $8
|
||||
local.get $1
|
||||
local.get $5
|
||||
i64.lt_u
|
||||
local.tee $0
|
||||
if
|
||||
local.get $5
|
||||
local.get $3
|
||||
i64.sub
|
||||
local.get $1
|
||||
i64.sub
|
||||
local.get $8
|
||||
i64.ge_u
|
||||
local.set $0
|
||||
end
|
||||
local.get $0
|
||||
if
|
||||
local.get $1
|
||||
local.get $3
|
||||
i64.add
|
||||
local.get $8
|
||||
i64.add
|
||||
local.get $5
|
||||
i64.lt_u
|
||||
local.tee $0
|
||||
i32.eqz
|
||||
if
|
||||
local.get $8
|
||||
local.get $3
|
||||
local.get $5
|
||||
local.get $1
|
||||
i64.sub
|
||||
local.get $1
|
||||
local.get $3
|
||||
i64.add
|
||||
local.get $8
|
||||
i64.add
|
||||
local.get $5
|
||||
i64.sub
|
||||
i64.gt_u
|
||||
local.set $0
|
||||
@ -4507,19 +4511,19 @@
|
||||
end
|
||||
local.get $0
|
||||
if
|
||||
local.get $7
|
||||
local.get $10
|
||||
i32.const 1
|
||||
i32.sub
|
||||
local.set $7
|
||||
local.set $10
|
||||
local.get $1
|
||||
local.get $3
|
||||
local.get $8
|
||||
i64.add
|
||||
local.set $3
|
||||
local.set $1
|
||||
br $continue|2
|
||||
end
|
||||
end
|
||||
local.get $2
|
||||
local.get $7
|
||||
local.get $10
|
||||
i32.store16 offset=4
|
||||
local.get $6
|
||||
return
|
||||
@ -4532,14 +4536,14 @@
|
||||
i64.const 10
|
||||
i64.mul
|
||||
local.set $5
|
||||
local.get $1
|
||||
local.get $8
|
||||
i64.const 10
|
||||
i64.mul
|
||||
local.tee $1
|
||||
local.tee $8
|
||||
local.get $11
|
||||
i64.extend_i32_s
|
||||
i64.shr_u
|
||||
local.tee $3
|
||||
local.tee $1
|
||||
local.get $6
|
||||
i64.extend_i32_s
|
||||
i64.or
|
||||
@ -4556,7 +4560,7 @@
|
||||
i32.shl
|
||||
local.get $0
|
||||
i32.add
|
||||
local.get $3
|
||||
local.get $1
|
||||
i32.wrap_i64
|
||||
i32.const 65535
|
||||
i32.and
|
||||
@ -4568,10 +4572,10 @@
|
||||
i32.const 1
|
||||
i32.sub
|
||||
local.set $9
|
||||
local.get $1
|
||||
local.get $8
|
||||
local.get $14
|
||||
i64.and
|
||||
local.tee $1
|
||||
local.tee $8
|
||||
local.get $5
|
||||
i64.ge_u
|
||||
br_if $continue|3
|
||||
@ -4579,7 +4583,9 @@
|
||||
local.get $9
|
||||
i32.add
|
||||
global.set $~lib/internal/number/_K
|
||||
local.get $12
|
||||
local.get $13
|
||||
local.set $1
|
||||
local.get $10
|
||||
i32.const 0
|
||||
local.get $9
|
||||
i32.sub
|
||||
@ -4587,49 +4593,50 @@
|
||||
i32.shl
|
||||
i32.add
|
||||
i64.load32_u offset=8
|
||||
local.get $8
|
||||
local.get $12
|
||||
i64.mul
|
||||
local.set $8
|
||||
local.set $3
|
||||
local.get $6
|
||||
local.tee $10
|
||||
i32.const 1
|
||||
i32.sub
|
||||
i32.const 1
|
||||
i32.shl
|
||||
local.get $0
|
||||
i32.add
|
||||
local.tee $7
|
||||
local.tee $4
|
||||
i32.load16_u offset=4
|
||||
local.set $4
|
||||
local.set $6
|
||||
loop $continue|4
|
||||
local.get $1
|
||||
local.get $8
|
||||
local.get $3
|
||||
i64.lt_u
|
||||
local.tee $2
|
||||
if
|
||||
local.get $5
|
||||
local.get $1
|
||||
local.get $8
|
||||
i64.sub
|
||||
local.get $10
|
||||
local.get $1
|
||||
i64.ge_u
|
||||
local.set $2
|
||||
end
|
||||
local.get $2
|
||||
if
|
||||
local.get $1
|
||||
local.get $10
|
||||
i64.add
|
||||
local.get $8
|
||||
i64.add
|
||||
local.get $3
|
||||
i64.lt_u
|
||||
local.tee $2
|
||||
i32.eqz
|
||||
if
|
||||
local.get $3
|
||||
local.get $8
|
||||
local.get $1
|
||||
i64.sub
|
||||
local.get $1
|
||||
local.get $10
|
||||
i64.add
|
||||
local.get $8
|
||||
i64.add
|
||||
local.get $3
|
||||
i64.sub
|
||||
i64.gt_u
|
||||
local.set $2
|
||||
@ -4637,21 +4644,21 @@
|
||||
end
|
||||
local.get $2
|
||||
if
|
||||
local.get $4
|
||||
local.get $6
|
||||
i32.const 1
|
||||
i32.sub
|
||||
local.set $4
|
||||
local.set $6
|
||||
local.get $1
|
||||
local.get $10
|
||||
local.get $8
|
||||
i64.add
|
||||
local.set $1
|
||||
local.set $8
|
||||
br $continue|4
|
||||
end
|
||||
end
|
||||
local.get $7
|
||||
local.get $4
|
||||
i32.store16 offset=4
|
||||
local.get $6
|
||||
i32.store16 offset=4
|
||||
local.get $10
|
||||
end
|
||||
)
|
||||
(func $~lib/internal/number/prettify (; 51 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
@ -4677,74 +4684,73 @@
|
||||
local.get $1
|
||||
local.get $2
|
||||
i32.add
|
||||
local.tee $5
|
||||
i32.le_s
|
||||
local.tee $3
|
||||
i32.le_s
|
||||
local.tee $4
|
||||
if
|
||||
local.get $5
|
||||
local.get $3
|
||||
i32.const 21
|
||||
i32.le_s
|
||||
local.set $3
|
||||
local.set $4
|
||||
end
|
||||
local.get $3
|
||||
local.get $4
|
||||
if (result i32)
|
||||
local.get $1
|
||||
local.set $3
|
||||
local.set $4
|
||||
loop $repeat|0
|
||||
block $break|0
|
||||
local.get $4
|
||||
local.get $3
|
||||
local.get $5
|
||||
i32.ge_s
|
||||
br_if $break|0
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 1
|
||||
i32.shl
|
||||
local.get $0
|
||||
i32.add
|
||||
i32.const 48
|
||||
i32.store16 offset=4
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 1
|
||||
i32.add
|
||||
local.set $3
|
||||
local.set $4
|
||||
br $repeat|0
|
||||
end
|
||||
end
|
||||
local.get $5
|
||||
local.get $3
|
||||
i32.const 1
|
||||
i32.shl
|
||||
local.get $0
|
||||
i32.add
|
||||
i32.const 3145774
|
||||
i32.store offset=4
|
||||
local.get $5
|
||||
local.get $3
|
||||
i32.const 2
|
||||
i32.add
|
||||
else
|
||||
local.get $5
|
||||
local.get $3
|
||||
i32.const 0
|
||||
i32.gt_s
|
||||
local.tee $3
|
||||
local.tee $4
|
||||
if
|
||||
local.get $5
|
||||
local.get $3
|
||||
i32.const 21
|
||||
i32.le_s
|
||||
local.set $3
|
||||
local.set $4
|
||||
end
|
||||
local.get $3
|
||||
local.get $4
|
||||
if (result i32)
|
||||
local.get $5
|
||||
local.get $3
|
||||
i32.const 1
|
||||
i32.shl
|
||||
local.get $0
|
||||
i32.add
|
||||
local.tee $3
|
||||
i32.const 4
|
||||
i32.add
|
||||
local.tee $0
|
||||
local.tee $4
|
||||
i32.const 2
|
||||
i32.add
|
||||
local.get $0
|
||||
local.get $4
|
||||
i32.const 0
|
||||
local.get $2
|
||||
i32.sub
|
||||
@ -4752,6 +4758,10 @@
|
||||
i32.shl
|
||||
call $~lib/internal/memory/memmove
|
||||
local.get $3
|
||||
i32.const 1
|
||||
i32.shl
|
||||
local.get $0
|
||||
i32.add
|
||||
i32.const 46
|
||||
i32.store16 offset=4
|
||||
local.get $1
|
||||
@ -4759,25 +4769,25 @@
|
||||
i32.add
|
||||
else
|
||||
i32.const -6
|
||||
local.get $5
|
||||
local.get $3
|
||||
i32.lt_s
|
||||
local.tee $3
|
||||
local.tee $4
|
||||
if
|
||||
local.get $5
|
||||
local.get $3
|
||||
i32.const 0
|
||||
i32.le_s
|
||||
local.set $3
|
||||
local.set $4
|
||||
end
|
||||
local.get $3
|
||||
local.get $4
|
||||
if (result i32)
|
||||
local.get $0
|
||||
i32.const 4
|
||||
i32.add
|
||||
local.tee $2
|
||||
i32.const 2
|
||||
local.get $5
|
||||
local.get $3
|
||||
i32.sub
|
||||
local.tee $3
|
||||
local.tee $4
|
||||
i32.const 1
|
||||
i32.shl
|
||||
i32.add
|
||||
@ -4790,29 +4800,29 @@
|
||||
i32.const 3014704
|
||||
i32.store offset=4
|
||||
i32.const 2
|
||||
local.set $4
|
||||
local.set $3
|
||||
loop $repeat|1
|
||||
block $break|1
|
||||
local.get $4
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.ge_s
|
||||
br_if $break|1
|
||||
local.get $4
|
||||
local.get $3
|
||||
i32.const 1
|
||||
i32.shl
|
||||
local.get $0
|
||||
i32.add
|
||||
i32.const 48
|
||||
i32.store16 offset=4
|
||||
local.get $4
|
||||
local.get $3
|
||||
i32.const 1
|
||||
i32.add
|
||||
local.set $4
|
||||
local.set $3
|
||||
br $repeat|1
|
||||
end
|
||||
end
|
||||
local.get $1
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.add
|
||||
else
|
||||
local.get $1
|
||||
@ -4825,52 +4835,52 @@
|
||||
local.get $0
|
||||
i32.const 4
|
||||
i32.add
|
||||
local.tee $3
|
||||
local.tee $4
|
||||
block (result i32)
|
||||
local.get $5
|
||||
local.get $3
|
||||
i32.const 1
|
||||
i32.sub
|
||||
local.tee $4
|
||||
local.tee $3
|
||||
i32.const 0
|
||||
i32.lt_s
|
||||
local.tee $2
|
||||
if
|
||||
i32.const 0
|
||||
local.get $4
|
||||
local.get $3
|
||||
i32.sub
|
||||
local.set $4
|
||||
local.set $3
|
||||
end
|
||||
local.get $4
|
||||
local.get $3
|
||||
end
|
||||
local.get $4
|
||||
local.get $3
|
||||
call $~lib/internal/number/decimalCount32
|
||||
i32.const 1
|
||||
i32.add
|
||||
local.tee $4
|
||||
local.tee $5
|
||||
call $~lib/internal/number/utoa32_lut
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 45
|
||||
i32.const 43
|
||||
local.get $2
|
||||
select
|
||||
i32.store16 offset=4
|
||||
local.get $4
|
||||
local.get $5
|
||||
i32.const 2
|
||||
i32.add
|
||||
else
|
||||
local.get $0
|
||||
i32.const 4
|
||||
i32.add
|
||||
local.tee $3
|
||||
local.tee $4
|
||||
i32.const 4
|
||||
i32.add
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 2
|
||||
i32.add
|
||||
local.get $1
|
||||
i32.const 1
|
||||
i32.shl
|
||||
local.tee $4
|
||||
local.tee $5
|
||||
i32.const 2
|
||||
i32.sub
|
||||
call $~lib/internal/memory/memmove
|
||||
@ -4878,7 +4888,7 @@
|
||||
i32.const 46
|
||||
i32.store16 offset=6
|
||||
local.get $0
|
||||
local.get $4
|
||||
local.get $5
|
||||
i32.add
|
||||
local.tee $0
|
||||
i32.const 101
|
||||
@ -4886,30 +4896,30 @@
|
||||
local.get $0
|
||||
i32.const 4
|
||||
i32.add
|
||||
local.tee $3
|
||||
local.tee $4
|
||||
block (result i32)
|
||||
local.get $5
|
||||
local.get $3
|
||||
i32.const 1
|
||||
i32.sub
|
||||
local.tee $4
|
||||
local.tee $3
|
||||
i32.const 0
|
||||
i32.lt_s
|
||||
local.tee $2
|
||||
if
|
||||
i32.const 0
|
||||
local.get $4
|
||||
local.get $3
|
||||
i32.sub
|
||||
local.set $4
|
||||
local.set $3
|
||||
end
|
||||
local.get $4
|
||||
local.get $3
|
||||
end
|
||||
local.get $4
|
||||
local.get $3
|
||||
call $~lib/internal/number/decimalCount32
|
||||
i32.const 1
|
||||
i32.add
|
||||
local.tee $0
|
||||
call $~lib/internal/number/utoa32_lut
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 45
|
||||
i32.const 43
|
||||
local.get $2
|
||||
@ -4931,19 +4941,18 @@
|
||||
(local $4 i32)
|
||||
(local $5 i64)
|
||||
(local $6 i32)
|
||||
(local $7 i64)
|
||||
(local $8 i32)
|
||||
(local $7 i32)
|
||||
(local $8 i64)
|
||||
(local $9 i64)
|
||||
(local $10 i64)
|
||||
(local $11 i64)
|
||||
(local $12 i64)
|
||||
(local $13 i32)
|
||||
(local $12 i32)
|
||||
(local $13 i64)
|
||||
(local $14 i32)
|
||||
(local $15 i64)
|
||||
local.get $1
|
||||
f64.const 0
|
||||
f64.lt
|
||||
local.tee $13
|
||||
local.tee $12
|
||||
if (result f64)
|
||||
local.get $0
|
||||
i32.const 45
|
||||
@ -4954,32 +4963,32 @@
|
||||
local.get $1
|
||||
end
|
||||
i64.reinterpret_f64
|
||||
local.tee $2
|
||||
local.tee $13
|
||||
i64.const 9218868437227405312
|
||||
i64.and
|
||||
i64.const 52
|
||||
i64.shr_u
|
||||
i32.wrap_i64
|
||||
local.set $8
|
||||
local.get $2
|
||||
local.set $7
|
||||
local.get $13
|
||||
i64.const 4503599627370495
|
||||
i64.and
|
||||
local.get $8
|
||||
local.get $7
|
||||
i32.const 0
|
||||
i32.ne
|
||||
local.tee $6
|
||||
local.tee $4
|
||||
i64.extend_i32_u
|
||||
i64.const 52
|
||||
i64.shl
|
||||
i64.add
|
||||
local.set $2
|
||||
local.get $8
|
||||
local.get $7
|
||||
i32.const 1
|
||||
local.get $6
|
||||
local.get $4
|
||||
select
|
||||
i32.const 1075
|
||||
i32.sub
|
||||
local.tee $8
|
||||
local.tee $7
|
||||
i32.const 1
|
||||
i32.sub
|
||||
local.set $6
|
||||
@ -5008,7 +5017,7 @@
|
||||
i64.shl
|
||||
i64.const 1
|
||||
i64.sub
|
||||
local.get $8
|
||||
local.get $7
|
||||
local.get $14
|
||||
i32.sub
|
||||
local.get $6
|
||||
@ -5075,27 +5084,27 @@
|
||||
local.tee $2
|
||||
i64.const 4294967295
|
||||
i64.and
|
||||
local.tee $7
|
||||
local.tee $8
|
||||
global.get $~lib/internal/number/_frc_pow
|
||||
local.tee $5
|
||||
i64.const 4294967295
|
||||
i64.and
|
||||
local.tee $9
|
||||
i64.mul
|
||||
local.set $10
|
||||
local.set $3
|
||||
local.get $5
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
local.tee $11
|
||||
local.get $7
|
||||
local.tee $10
|
||||
local.get $8
|
||||
i64.mul
|
||||
local.get $2
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
local.tee $12
|
||||
local.tee $2
|
||||
local.get $9
|
||||
i64.mul
|
||||
local.get $10
|
||||
local.get $3
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
i64.add
|
||||
@ -5107,43 +5116,43 @@
|
||||
i64.add
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
local.get $11
|
||||
local.get $12
|
||||
local.get $2
|
||||
local.get $10
|
||||
i64.mul
|
||||
local.get $3
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
i64.add
|
||||
i64.add
|
||||
local.set $2
|
||||
local.set $13
|
||||
local.get $5
|
||||
i64.const 4294967295
|
||||
i64.and
|
||||
local.tee $11
|
||||
local.tee $2
|
||||
global.get $~lib/internal/number/_frc_plus
|
||||
local.tee $3
|
||||
i64.const 4294967295
|
||||
i64.and
|
||||
local.tee $10
|
||||
i64.mul
|
||||
local.set $7
|
||||
local.set $11
|
||||
local.get $10
|
||||
local.get $5
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
local.tee $8
|
||||
i64.mul
|
||||
local.get $2
|
||||
local.get $3
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
local.tee $9
|
||||
i64.mul
|
||||
local.get $11
|
||||
local.get $3
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
local.tee $12
|
||||
i64.mul
|
||||
local.get $7
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
i64.add
|
||||
local.tee $3
|
||||
local.tee $2
|
||||
i64.const 4294967295
|
||||
i64.and
|
||||
i64.add
|
||||
@ -5151,97 +5160,95 @@
|
||||
i64.add
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
local.get $8
|
||||
local.get $9
|
||||
local.get $12
|
||||
i64.mul
|
||||
local.get $3
|
||||
local.get $2
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
i64.add
|
||||
i64.add
|
||||
local.set $15
|
||||
local.set $11
|
||||
global.get $~lib/internal/number/_frc_minus
|
||||
local.tee $3
|
||||
local.tee $2
|
||||
i64.const 4294967295
|
||||
i64.and
|
||||
local.tee $7
|
||||
local.tee $8
|
||||
local.get $5
|
||||
i64.const 4294967295
|
||||
i64.and
|
||||
local.tee $9
|
||||
i64.mul
|
||||
local.set $10
|
||||
local.get $5
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
local.tee $11
|
||||
local.get $7
|
||||
i64.mul
|
||||
local.get $3
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
local.tee $12
|
||||
local.get $9
|
||||
i64.mul
|
||||
local.get $10
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
i64.add
|
||||
local.tee $3
|
||||
i64.const 4294967295
|
||||
i64.and
|
||||
i64.add
|
||||
local.set $5
|
||||
local.get $15
|
||||
local.set $3
|
||||
local.get $11
|
||||
i64.const 1
|
||||
i64.sub
|
||||
local.tee $7
|
||||
local.get $11
|
||||
local.get $12
|
||||
local.tee $11
|
||||
local.get $5
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
local.tee $10
|
||||
local.get $8
|
||||
i64.mul
|
||||
local.get $2
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
local.tee $2
|
||||
local.get $9
|
||||
i64.mul
|
||||
local.get $3
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
i64.add
|
||||
local.get $5
|
||||
local.tee $3
|
||||
i64.const 4294967295
|
||||
i64.and
|
||||
i64.add
|
||||
i64.const 2147483647
|
||||
i64.add
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
local.get $2
|
||||
local.get $10
|
||||
i64.mul
|
||||
local.get $3
|
||||
i64.const 32
|
||||
i64.shr_u
|
||||
i64.add
|
||||
i64.add
|
||||
i64.const 1
|
||||
i64.add
|
||||
i64.sub
|
||||
local.set $3
|
||||
local.get $13
|
||||
local.get $12
|
||||
i32.const 1
|
||||
i32.shl
|
||||
local.get $0
|
||||
i32.add
|
||||
local.get $0
|
||||
local.get $2
|
||||
local.get $8
|
||||
local.get $13
|
||||
global.get $~lib/internal/number/_exp_pow
|
||||
local.tee $14
|
||||
local.get $7
|
||||
local.get $4
|
||||
i32.sub
|
||||
global.get $~lib/internal/number/_exp_pow
|
||||
local.tee $4
|
||||
i32.add
|
||||
i32.const -64
|
||||
i32.sub
|
||||
local.get $7
|
||||
local.get $4
|
||||
local.get $11
|
||||
global.get $~lib/internal/number/_exp
|
||||
local.get $14
|
||||
i32.add
|
||||
i32.const -64
|
||||
i32.sub
|
||||
local.get $3
|
||||
local.get $13
|
||||
local.get $12
|
||||
call $~lib/internal/number/genDigits
|
||||
local.get $13
|
||||
local.get $12
|
||||
i32.sub
|
||||
global.get $~lib/internal/number/_K
|
||||
call $~lib/internal/number/prettify
|
||||
local.get $13
|
||||
local.get $12
|
||||
i32.add
|
||||
)
|
||||
(func $~lib/string/String#substring (; 53 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -476,6 +476,7 @@
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $1
|
||||
global.get $~lib/internal/arraybuffer/MAX_BLENGTH
|
||||
i32.gt_u
|
||||
@ -501,9 +502,11 @@
|
||||
local.set $4
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $1
|
||||
local.set $6
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $1
|
||||
local.get $6
|
||||
call $~lib/internal/memory/memset
|
||||
end
|
||||
local.get $3
|
||||
@ -819,10 +822,13 @@
|
||||
i32.const 0
|
||||
)
|
||||
(func $~lib/map/Map<String,usize>#has (; 16 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
block $~lib/internal/hash/HASH<String>|inlined.0 (result i32)
|
||||
local.get $1
|
||||
local.set $2
|
||||
local.get $2
|
||||
call $~lib/internal/hash/hashStr
|
||||
br $~lib/internal/hash/HASH<String>|inlined.0
|
||||
end
|
||||
@ -832,18 +838,21 @@
|
||||
)
|
||||
(func $~lib/map/Map<String,usize>#get (; 17 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
block $~lib/internal/hash/HASH<String>|inlined.1 (result i32)
|
||||
local.get $1
|
||||
local.set $2
|
||||
local.get $2
|
||||
call $~lib/internal/hash/hashStr
|
||||
br $~lib/internal/hash/HASH<String>|inlined.1
|
||||
end
|
||||
call $~lib/map/Map<String,usize>#find
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $3
|
||||
if (result i32)
|
||||
local.get $2
|
||||
local.get $3
|
||||
i32.load offset=4
|
||||
else
|
||||
unreachable
|
||||
@ -996,18 +1005,20 @@
|
||||
(local $6 i32)
|
||||
block $~lib/internal/hash/HASH<String>|inlined.2 (result i32)
|
||||
local.get $1
|
||||
local.set $3
|
||||
local.get $3
|
||||
call $~lib/internal/hash/hashStr
|
||||
br $~lib/internal/hash/HASH<String>|inlined.2
|
||||
end
|
||||
local.set $3
|
||||
local.set $4
|
||||
local.get $0
|
||||
local.get $1
|
||||
local.get $3
|
||||
call $~lib/map/Map<String,usize>#find
|
||||
local.set $4
|
||||
local.get $4
|
||||
call $~lib/map/Map<String,usize>#find
|
||||
local.set $5
|
||||
local.get $5
|
||||
if
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $2
|
||||
i32.store offset=4
|
||||
else
|
||||
@ -1042,8 +1053,8 @@
|
||||
end
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
local.set $5
|
||||
local.get $5
|
||||
local.set $3
|
||||
local.get $3
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
block (result i32)
|
||||
@ -1061,11 +1072,11 @@
|
||||
end
|
||||
i32.mul
|
||||
i32.add
|
||||
local.set $4
|
||||
local.get $4
|
||||
local.set $5
|
||||
local.get $5
|
||||
local.get $1
|
||||
i32.store
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $2
|
||||
i32.store offset=4
|
||||
local.get $0
|
||||
@ -1076,7 +1087,7 @@
|
||||
i32.store offset=20
|
||||
local.get $0
|
||||
i32.load
|
||||
local.get $3
|
||||
local.get $4
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
i32.and
|
||||
@ -1084,12 +1095,12 @@
|
||||
i32.mul
|
||||
i32.add
|
||||
local.set $6
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $6
|
||||
i32.load offset=8
|
||||
i32.store offset=8
|
||||
local.get $6
|
||||
local.get $4
|
||||
local.get $5
|
||||
i32.store offset=8
|
||||
end
|
||||
)
|
||||
@ -1333,18 +1344,20 @@
|
||||
(local $6 i32)
|
||||
block $~lib/internal/hash/HASH<usize>|inlined.0 (result i32)
|
||||
local.get $1
|
||||
local.set $3
|
||||
local.get $3
|
||||
call $~lib/internal/hash/hash32
|
||||
br $~lib/internal/hash/HASH<usize>|inlined.0
|
||||
end
|
||||
local.set $3
|
||||
local.set $4
|
||||
local.get $0
|
||||
local.get $1
|
||||
local.get $3
|
||||
call $~lib/map/Map<usize,String>#find
|
||||
local.set $4
|
||||
local.get $4
|
||||
call $~lib/map/Map<usize,String>#find
|
||||
local.set $5
|
||||
local.get $5
|
||||
if
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $2
|
||||
i32.store offset=4
|
||||
else
|
||||
@ -1379,8 +1392,8 @@
|
||||
end
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
local.set $5
|
||||
local.get $5
|
||||
local.set $3
|
||||
local.get $3
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
block (result i32)
|
||||
@ -1398,11 +1411,11 @@
|
||||
end
|
||||
i32.mul
|
||||
i32.add
|
||||
local.set $4
|
||||
local.get $4
|
||||
local.set $5
|
||||
local.get $5
|
||||
local.get $1
|
||||
i32.store
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $2
|
||||
i32.store offset=4
|
||||
local.get $0
|
||||
@ -1413,7 +1426,7 @@
|
||||
i32.store offset=20
|
||||
local.get $0
|
||||
i32.load
|
||||
local.get $3
|
||||
local.get $4
|
||||
local.get $0
|
||||
i32.load offset=4
|
||||
i32.and
|
||||
@ -1421,12 +1434,12 @@
|
||||
i32.mul
|
||||
i32.add
|
||||
local.set $6
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $6
|
||||
i32.load offset=8
|
||||
i32.store offset=8
|
||||
local.get $6
|
||||
local.get $4
|
||||
local.get $5
|
||||
i32.store offset=8
|
||||
end
|
||||
)
|
||||
@ -1478,10 +1491,13 @@
|
||||
local.get $2
|
||||
)
|
||||
(func $~lib/map/Map<usize,String>#has (; 25 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
block $~lib/internal/hash/HASH<usize>|inlined.2 (result i32)
|
||||
local.get $1
|
||||
local.set $2
|
||||
local.get $2
|
||||
call $~lib/internal/hash/hash32
|
||||
br $~lib/internal/hash/HASH<usize>|inlined.2
|
||||
end
|
||||
@ -1491,18 +1507,21 @@
|
||||
)
|
||||
(func $~lib/map/Map<usize,String>#get (; 26 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
local.get $0
|
||||
local.get $1
|
||||
block $~lib/internal/hash/HASH<usize>|inlined.3 (result i32)
|
||||
local.get $1
|
||||
local.set $2
|
||||
local.get $2
|
||||
call $~lib/internal/hash/hash32
|
||||
br $~lib/internal/hash/HASH<usize>|inlined.3
|
||||
end
|
||||
call $~lib/map/Map<usize,String>#find
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $3
|
||||
if (result i32)
|
||||
local.get $2
|
||||
local.get $3
|
||||
i32.load offset=4
|
||||
else
|
||||
unreachable
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user