Avoid trampolines where optional arguments are constant literals, see #102; Fix temporary local flags not being cleared; Fix inlined temporary locals not being free'd; Fix inlined flows not breaking after returns; Allow changetype of u32s, i.e. function pointers

This commit is contained in:
dcodeIO 2018-05-11 16:31:56 +02:00
parent ef9b43740d
commit e415377cda
35 changed files with 3424 additions and 4059 deletions

2
dist/asc.js vendored

File diff suppressed because one or more lines are too long

2
dist/asc.js.map vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1945,13 +1945,6 @@ export function compileCall(
reportNode.range, "1", typeArguments ? typeArguments.length.toString(10) : "0"
);
return module.createUnreachable();
} else if (typeArguments[0].kind != TypeKind.USIZE) { // any usize
compiler.error(
DiagnosticCode.Operation_not_supported,
reportNode.range
);
compiler.currentType = typeArguments[0];
return module.createUnreachable();
}
if (operands.length != 1) {
compiler.error(
@ -1963,11 +1956,11 @@ export function compileCall(
}
arg0 = compiler.compileExpressionRetainType(
operands[0],
compiler.options.usizeType,
typeArguments[0],
WrapMode.NONE
);
compiler.currentType = typeArguments[0];
if (compiler.currentType.kind != TypeKind.USIZE) {
if (compiler.currentType.size != typeArguments[0].size) {
compiler.error(
DiagnosticCode.Operation_not_supported,
reportNode.range

View File

@ -5073,10 +5073,14 @@ export class Compiler extends DiagnosticEmitter {
// Compile the called function's body in the scope of the inlined flow
var bodyStatement = assert(declaration.body);
if (bodyStatement.kind == NodeKind.BLOCK) { // it's ok to unwrap the block here
if (bodyStatement.kind == NodeKind.BLOCK) {
let statements = (<BlockStatement>bodyStatement).statements;
for (let i = 0, k = statements.length; i < k; ++i) {
body.push(this.compileStatement(statements[i]));
let stmt = this.compileStatement(statements[i]);
if (getExpressionId(stmt) != ExpressionId.Nop) {
body.push(stmt);
if (flow.isAny(FlowFlags.BREAKS | FlowFlags.CONTINUES | FlowFlags.RETURNS)) break;
}
}
} else {
body.push(this.compileStatement(bodyStatement));
@ -5290,28 +5294,51 @@ export class Compiler extends DiagnosticEmitter {
var returnType = instance.signature.returnType;
var isCallImport = instance.is(CommonFlags.MODULE_IMPORT);
// fill up omitted arguments with zeroes
// fill up omitted arguments with their initializers, if constant, otherwise with zeroes.
if (numOperands < maxOperands) {
if (!operands) {
operands = new Array(maxOperands);
operands.length = 0;
}
let parameterTypes = instance.signature.parameterTypes;
let parameterNodes = instance.prototype.declaration.signature.parameterTypes;
let allOptionalsAreConstant = true;
for (let i = numArguments; i < maxArguments; ++i) {
operands.push(parameterTypes[i].toNativeZero(module));
let initializer = assert(parameterNodes[i].initializer);
if (initializer.kind != NodeKind.LITERAL) {
// TODO: other kinds might be constant as well
allOptionalsAreConstant = false;
break;
}
}
if (!isCallImport) { // call the trampoline
let original = instance;
instance = this.ensureTrampoline(instance);
if (!this.compileFunction(instance)) return module.createUnreachable();
instance.flow.flags = original.flow.flags;
this.program.instancesLookup.set(instance.internalName, instance); // so canOverflow can find it
let nativeReturnType = returnType.toNativeType();
this.currentType = returnType;
return module.createBlock(null, [
module.createSetGlobal(this.ensureArgcVar(), module.createI32(numArguments)),
module.createCall(instance.internalName, operands, nativeReturnType)
], nativeReturnType);
if (allOptionalsAreConstant) { // inline into the call
for (let i = numArguments; i < maxArguments; ++i) {
operands.push(
this.compileExpression(
<Expression>parameterNodes[i].initializer,
parameterTypes[i],
ConversionKind.IMPLICIT,
WrapMode.NONE
)
);
}
} else { // otherwise fill up with zeroes and call the trampoline
for (let i = numArguments; i < maxArguments; ++i) {
operands.push(parameterTypes[i].toNativeZero(module));
}
if (!isCallImport) {
let original = instance;
instance = this.ensureTrampoline(instance);
if (!this.compileFunction(instance)) return module.createUnreachable();
instance.flow.flags = original.flow.flags;
this.program.instancesLookup.set(instance.internalName, instance); // so canOverflow can find it
let nativeReturnType = returnType.toNativeType();
this.currentType = returnType;
return module.createBlock(null, [
module.createSetGlobal(this.ensureArgcVar(), module.createI32(numArguments)),
module.createCall(instance.internalName, operands, nativeReturnType)
], nativeReturnType);
}
}
}
@ -6211,8 +6238,8 @@ export class Compiler extends DiagnosticEmitter {
getExpressionType(condExprPrecomp) == NativeType.I32
) {
return getConstValueI32(condExprPrecomp)
? this.compileExpression(ifThen, contextualType, ConversionKind.IMPLICIT, WrapMode.NONE)
: this.compileExpression(ifElse, contextualType, ConversionKind.IMPLICIT, WrapMode.NONE);
? this.compileExpressionRetainType(ifThen, contextualType, WrapMode.NONE)
: this.compileExpressionRetainType(ifElse, contextualType, WrapMode.NONE);
// Otherwise recompile to the original and let the optimizer decide
} else /* if (condExpr != condExprPrecomp) <- not guaranteed */ {

View File

@ -37,9 +37,11 @@ abstract class ExportsWalker {
/** Program reference. */
program: Program;
/** Whether to include private members */
private includePrivate: bool;
includePrivate: bool;
/** Elements still to do. */
todo: Element[] = [];
/** Already seen elements. */
private seen: Set<Element> = new Set();
seen: Set<Element> = new Set();
/** Constructs a new Element walker. */
constructor(program: Program, includePrivate: bool = false) {
@ -50,6 +52,8 @@ abstract class ExportsWalker {
/** Walks all exports and calls the respective handlers. */
walk(): void {
for (let element of this.program.moduleLevelExports.values()) this.visitElement(element);
var todo = this.todo;
for (let i = 0; i < todo.length; ) this.visitElement(todo[i]);
}
/** Visits an element.*/

View File

@ -239,7 +239,8 @@ export class MemorySegment {
export class Module {
ref: ModuleRef;
out: usize;
private cachedByValue: usize;
/** Maximum number of pages when targeting WASM32. */
static readonly MAX_MEMORY_WASM32: Index = 0xffff;
@ -250,7 +251,7 @@ export class Module {
static create(): Module {
var module = new Module();
module.ref = _BinaryenModuleCreate();
module.out = allocate_memory(16);
module.cachedByValue = allocate_memory(16);
return module;
}
@ -259,7 +260,7 @@ export class Module {
try {
let module = new Module();
module.ref = _BinaryenModuleRead(cArr, buffer.length);
module.out = allocate_memory(3 * 8); // LLVM C-ABI, max used is 3 * usize
module.cachedByValue = allocate_memory(3 * 8); // LLVM C-ABI, max used is 3 * usize
return module;
} finally {
free_memory(changetype<usize>(cArr));
@ -309,25 +310,25 @@ export class Module {
// constants
createI32(value: i32): ExpressionRef {
var out = this.out;
var out = this.cachedByValue;
_BinaryenLiteralInt32(out, value);
return _BinaryenConst(this.ref, out);
}
createI64(valueLow: i32, valueHigh: i32 = 0): ExpressionRef {
var out = this.out;
var out = this.cachedByValue;
_BinaryenLiteralInt64(out, valueLow, valueHigh);
return _BinaryenConst(this.ref, out);
}
createF32(value: f32): ExpressionRef {
var out = this.out;
var out = this.cachedByValue;
_BinaryenLiteralFloat32(out, value);
return _BinaryenConst(this.ref, out);
}
createF64(value: f64): ExpressionRef {
var out = this.out;
var out = this.cachedByValue;
_BinaryenLiteralFloat64(out, value);
return _BinaryenConst(this.ref, out);
}
@ -672,24 +673,25 @@ export class Module {
}
}
private tempName: usize = 0;
private hasTempFunc: bool = false;
private cachedTemporaryName: usize = 0;
private hasTemporaryFunction: bool = false;
addTemporaryFunction(result: NativeType, paramTypes: NativeType[] | null, body: ExpressionRef): FunctionRef {
this.hasTempFunc = assert(!this.hasTempFunc);
if (!this.tempName) this.tempName = allocString(""); // works because strings are interned
this.hasTemporaryFunction = assert(!this.hasTemporaryFunction);
var tempName = this.cachedTemporaryName;
if (!tempName) this.cachedTemporaryName = tempName = allocString(""); // works because strings are interned
var cArr = allocI32Array(paramTypes);
try {
let typeRef = _BinaryenAddFunctionType(this.ref, this.tempName, result, cArr, paramTypes ? paramTypes.length : 0);
return _BinaryenAddFunction(this.ref, this.tempName, typeRef, 0, 0, body);
let typeRef = _BinaryenAddFunctionType(this.ref, tempName, result, cArr, paramTypes ? paramTypes.length : 0);
return _BinaryenAddFunction(this.ref, tempName, typeRef, 0, 0, body);
} finally {
free_memory(cArr);
}
}
removeTemporaryFunction(): void {
this.hasTempFunc = !assert(this.hasTempFunc);
var tempName = assert(this.tempName);
this.hasTemporaryFunction = !assert(this.hasTemporaryFunction);
var tempName = assert(this.cachedTemporaryName);
_BinaryenRemoveFunction(this.ref, tempName);
_BinaryenRemoveFunctionType(this.ref, tempName);
}
@ -927,6 +929,19 @@ export class Module {
}
}
private cachedPrecomputeName: usize = 0;
private cachedPrecomputeNames: usize = 0;
precomputeFunction(func: FunctionRef): void {
var names = this.cachedPrecomputeNames;
if (!names) {
let name = allocString("precompute");
this.cachedPrecomputeName = name;
this.cachedPrecomputeNames = names = allocI32Array([ name ]);
}
_BinaryenFunctionRunPasses(func, this.ref, names, 1);
}
validate(): bool {
return _BinaryenModuleValidate(this.ref) == 1;
}
@ -936,7 +951,7 @@ export class Module {
}
toBinary(sourceMapUrl: string | null): BinaryModule {
var out = this.out;
var out = this.cachedByValue;
var cStr = allocString(sourceMapUrl);
var binaryPtr: usize = 0;
var sourceMapPtr: usize = 0;
@ -965,9 +980,13 @@ export class Module {
}
dispose(): void {
if (!this.ref) return; // sic
assert(this.ref);
free_memory(this.cachedByValue);
free_memory(this.cachedTemporaryName);
free_memory(this.cachedPrecomputeName);
free_memory(this.cachedPrecomputeNames);
_BinaryenModuleDispose(this.ref);
free_memory(this.out);
this.ref = 0;
}
createRelooper(): Relooper {
@ -1295,13 +1314,6 @@ export class Relooper {
var relooper = new Relooper();
relooper.module = module;
relooper.ref = _RelooperCreate();
return relooper;
}
static createStub(module: Module): Relooper {
var relooper = new Relooper();
relooper.module = module;
relooper.ref = 0;
return relooper;
}

View File

@ -2923,6 +2923,7 @@ export class Function extends Element {
if (temps && temps.length) {
local = temps.pop();
local.type = type;
local.flags = CommonFlags.NONE;
} else {
local = this.addLocal(type);
}
@ -3704,6 +3705,7 @@ export class Flow {
return existingLocal;
}
}
scopedLocal.set(CommonFlags.SCOPED);
this.scopedLocals.set(name, scopedLocal);
if (type.is(TypeFlags.SHORT | TypeFlags.INTEGER)) {
this.setLocalWrapped(scopedLocal.index, wrapped);

View File

@ -167,70 +167,170 @@ export enum Token {
}
export function tokenFromKeyword(text: string): Token {
switch (text) {
case "abstract": return Token.ABSTRACT;
case "as": return Token.AS;
case "async": return Token.ASYNC;
case "await": return Token.AWAIT;
case "break": return Token.BREAK;
case "case": return Token.CASE;
case "catch": return Token.CATCH;
case "class": return Token.CLASS;
case "continue": return Token.CONTINUE;
case "const": return Token.CONST;
case "constructor": return Token.CONSTRUCTOR;
case "debugger": return Token.DEBUGGER;
case "declare": return Token.DECLARE;
case "default": return Token.DEFAULT;
case "delete": return Token.DELETE;
case "do": return Token.DO;
case "else": return Token.ELSE;
case "enum": return Token.ENUM;
case "export": return Token.EXPORT;
case "extends": return Token.EXTENDS;
case "false": return Token.FALSE;
case "finally": return Token.FINALLY;
case "for": return Token.FOR;
case "from": return Token.FROM;
case "function": return Token.FUNCTION;
case "get": return Token.GET;
case "if": return Token.IF;
case "implements": return Token.IMPLEMENTS;
case "import": return Token.IMPORT;
case "in": return Token.IN;
case "instanceof": return Token.INSTANCEOF;
case "interface": return Token.INTERFACE;
case "is": return Token.IS;
case "keyof": return Token.KEYOF;
case "let": return Token.LET;
case "module": return Token.MODULE;
case "namespace": return Token.NAMESPACE;
case "new": return Token.NEW;
case "null": return Token.NULL;
case "of": return Token.OF;
case "package": return Token.PACKAGE;
case "private": return Token.PRIVATE;
case "protected": return Token.PROTECTED;
case "public": return Token.PUBLIC;
case "readonly": return Token.READONLY;
case "return": return Token.RETURN;
case "set": return Token.SET;
case "static": return Token.STATIC;
case "super": return Token.SUPER;
case "switch": return Token.SWITCH;
case "this": return Token.THIS;
case "throw": return Token.THROW;
case "true": return Token.TRUE;
case "try": return Token.TRY;
case "type": return Token.TYPE;
case "typeof": return Token.TYPEOF;
case "var": return Token.VAR;
case "void": return Token.VOID;
case "while": return Token.WHILE;
case "with": return Token.WITH;
case "yield": return Token.YIELD;
default: return Token.INVALID;
switch (text.length && text.charCodeAt(0)) {
case CharCode.a: {
switch (text) {
case "abstract": return Token.ABSTRACT;
case "as": return Token.AS;
case "async": return Token.ASYNC;
case "await": return Token.AWAIT;
}
break;
}
case CharCode.b: {
switch (text) {
case "break": return Token.BREAK;
}
break;
}
case CharCode.c: {
switch (text) {
case "case": return Token.CASE;
case "catch": return Token.CATCH;
case "class": return Token.CLASS;
case "continue": return Token.CONTINUE;
case "const": return Token.CONST;
case "constructor": return Token.CONSTRUCTOR;
}
break;
}
case CharCode.d: {
switch (text) {
case "debugger": return Token.DEBUGGER;
case "declare": return Token.DECLARE;
case "default": return Token.DEFAULT;
case "delete": return Token.DELETE;
case "do": return Token.DO;
}
break;
}
case CharCode.e: {
switch (text) {
case "else": return Token.ELSE;
case "enum": return Token.ENUM;
case "export": return Token.EXPORT;
case "extends": return Token.EXTENDS;
}
break;
}
case CharCode.f: {
switch (text) {
case "false": return Token.FALSE;
case "finally": return Token.FINALLY;
case "for": return Token.FOR;
case "from": return Token.FROM;
case "function": return Token.FUNCTION;
}
break;
}
case CharCode.g: {
switch (text) {
case "get": return Token.GET;
}
break;
}
case CharCode.i: {
switch (text) {
case "if": return Token.IF;
case "implements": return Token.IMPLEMENTS;
case "import": return Token.IMPORT;
case "in": return Token.IN;
case "instanceof": return Token.INSTANCEOF;
case "interface": return Token.INTERFACE;
case "is": return Token.IS;
}
break;
}
case CharCode.k: {
switch (text) {
case "keyof": return Token.KEYOF;
}
break;
}
case CharCode.l: {
switch (text) {
case "let": return Token.LET;
}
break;
}
case CharCode.m: {
switch (text) {
case "module": return Token.MODULE;
}
break;
}
case CharCode.n: {
switch (text) {
case "namespace": return Token.NAMESPACE;
case "new": return Token.NEW;
case "null": return Token.NULL;
}
break;
}
case CharCode.o: {
switch (text) {
case "of": return Token.OF;
}
break;
}
case CharCode.p: {
switch (text) {
case "package": return Token.PACKAGE;
case "private": return Token.PRIVATE;
case "protected": return Token.PROTECTED;
case "public": return Token.PUBLIC;
}
break;
}
case CharCode.r: {
switch (text) {
case "readonly": return Token.READONLY;
case "return": return Token.RETURN;
}
break;
}
case CharCode.s: {
switch (text) {
case "set": return Token.SET;
case "static": return Token.STATIC;
case "super": return Token.SUPER;
case "switch": return Token.SWITCH;
}
break;
}
case CharCode.t: {
switch (text) {
case "this": return Token.THIS;
case "throw": return Token.THROW;
case "true": return Token.TRUE;
case "try": return Token.TRY;
case "type": return Token.TYPE;
case "typeof": return Token.TYPEOF;
}
break;
}
case CharCode.v: {
switch (text) {
case "var": return Token.VAR;
case "void": return Token.VOID;
}
break;
}
case CharCode.w: {
switch (text) {
case "while": return Token.WHILE;
case "with": return Token.WITH;
}
break;
}
case CharCode.y: {
switch (text) {
case "yield": return Token.YIELD;
}
break;
}
}
return Token.INVALID;
}
export function tokenIsAlsoIdentifier(token: Token): bool {

View File

@ -2,60 +2,71 @@ import {
HEADER_SIZE as HEADER_SIZE_STR
} from "./string";
/** Computes the 32-bit hash of a value of any type. */
@inline
export function hash<T>(key: T): u32 {
// branch-level tree-shaking makes this a `(return (call ...))`
if (isString(key)) {
return hashStr(key);
} else if (isReference<T>()) {
if (sizeof<T>() == 4) return hash32(changetype<u32>(key));
if (sizeof<T>() == 8) return hash64(changetype<u64>(key));
} else if (isFloat<T>()) {
if (sizeof<T>() == 4) return hash32(reinterpret<u32>(key));
if (sizeof<T>() == 8) return hash64(reinterpret<u64>(key));
} else {
if (sizeof<T>() == 1) return hash8 (<u32>key);
if (sizeof<T>() == 2) return hash16(<u32>key);
if (sizeof<T>() == 4) return hash32(<u32>key);
if (sizeof<T>() == 8) return hash64(<u64>key);
}
unreachable();
}
// FNV-1a 32-bit as a starting point, see: http://isthe.com/chongo/tech/comp/fnv/
const FNV_OFFSET: u32 = 2166136261;
const FNV_PRIME: u32 = 16777619;
export function hash<T>(key: T): u32 {
var hash: u32 = FNV_OFFSET;
if (isString(key)) {
for (let i: usize = 0, k: usize = key.length << 1; i < k; ++i) {
hash = (hash ^ <u32>load<u8>(changetype<usize>(key) + i, HEADER_SIZE_STR)) * FNV_PRIME;
}
} else if (isFloat(key)) {
if (sizeof<T>() == 4) { // f32
let u = reinterpret<u32>(key);
hash = (hash ^ ( u & 0xff)) * FNV_PRIME;
hash = (hash ^ ((u >>> 8) & 0xff)) * FNV_PRIME;
hash = (hash ^ ((u >>> 16) & 0xff)) * FNV_PRIME;
hash = (hash ^ ( u >>> 24 )) * FNV_PRIME;
} else if (sizeof<T>() == 8) { // f64
let u = reinterpret<u64>(key);
let l = <u32> u;
let h = <u32>(u >>> 32);
hash = (hash ^ ( l & 0xff)) * FNV_PRIME;
hash = (hash ^ ((l >>> 8) & 0xff)) * FNV_PRIME;
hash = (hash ^ ((l >>> 16) & 0xff)) * FNV_PRIME;
hash = (hash ^ ( l >>> 24 )) * FNV_PRIME;
hash = (hash ^ ( h & 0xff)) * FNV_PRIME;
hash = (hash ^ ((h >>> 8) & 0xff)) * FNV_PRIME;
hash = (hash ^ ((h >>> 16) & 0xff)) * FNV_PRIME;
hash = (hash ^ ( h >>> 24 )) * FNV_PRIME;
} else unreachable();
} else if (sizeof<T>() == 1) { // bool, i8, u8
hash = (hash ^ (<u32>key & 0xff)) * FNV_PRIME;
} else if (sizeof<T>() == 2) { // i16, u16
let u = <u32>key;
hash = (hash ^ ( u & 0xff)) * FNV_PRIME;
hash = (hash ^ ( u >>> 8 )) * FNV_PRIME;
} else if (sizeof<T>() == 4) { // i32, u32
let u = <u32>key;
hash = (hash ^ ( u & 0xff)) * FNV_PRIME;
hash = (hash ^ ((u >>> 8) & 0xff)) * FNV_PRIME;
hash = (hash ^ ((u >>> 16) & 0xff)) * FNV_PRIME;
hash = (hash ^ ( u >>> 24 )) * FNV_PRIME;
} else if (sizeof<T>() == 8) { // i64, u64
let l = <u32> <u64>key;
let h = <u32>(<u64>key >>> 32);
hash = (hash ^ ( l & 0xff)) * FNV_PRIME;
hash = (hash ^ ((l >>> 8) & 0xff)) * FNV_PRIME;
hash = (hash ^ ((l >>> 16) & 0xff)) * FNV_PRIME;
hash = (hash ^ ( l >>> 24 )) * FNV_PRIME;
hash = (hash ^ ( h & 0xff)) * FNV_PRIME;
hash = (hash ^ ((h >>> 8) & 0xff)) * FNV_PRIME;
hash = (hash ^ ((h >>> 16) & 0xff)) * FNV_PRIME;
hash = (hash ^ ( h >>> 24 )) * FNV_PRIME;
} else unreachable();
return hash;
function hash8(key: u32): u32 {
return (FNV_OFFSET ^ key) * FNV_PRIME;
}
function hash16(key: u32): u32 {
var v = FNV_OFFSET;
v = (v ^ ( key & 0xff)) * FNV_PRIME;
v = (v ^ ( key >> 8 )) * FNV_PRIME;
return v;
}
function hash32(key: u32): u32 {
var v = FNV_OFFSET;
v = (v ^ ( key & 0xff)) * FNV_PRIME;
v = (v ^ ((key >> 8) & 0xff)) * FNV_PRIME;
v = (v ^ ((key >> 16) & 0xff)) * FNV_PRIME;
v = (v ^ ( key >> 24 )) * FNV_PRIME;
return v;
}
function hash64(key: u64): u32 {
var l = <u32> key;
var h = <u32>(key >>> 32);
var v = FNV_OFFSET;
v = (v ^ ( l & 0xff)) * FNV_PRIME;
v = (v ^ ((l >> 8) & 0xff)) * FNV_PRIME;
v = (v ^ ((l >> 16) & 0xff)) * FNV_PRIME;
v = (v ^ ( l >> 24 )) * FNV_PRIME;
v = (v ^ ( h & 0xff)) * FNV_PRIME;
v = (v ^ ((h >> 8) & 0xff)) * FNV_PRIME;
v = (v ^ ((h >> 16) & 0xff)) * FNV_PRIME;
v = (v ^ ( h >> 24 )) * FNV_PRIME;
return v;
}
function hashStr(key: string): u32 {
var v = FNV_OFFSET;
for (let i: usize = 0, k: usize = key.length << 1; i < k; ++i) {
v = (v ^ <u32>load<u8>(changetype<usize>(key) + i, HEADER_SIZE_STR)) * FNV_PRIME;
}
return v;
}

View File

@ -0,0 +1,23 @@
var binaryen = require("binaryen");
var mod = new binaryen.Module();
var funcType = mod.addFunctionType("v", binaryen.none, []);
var func = mod.addFunction("0", funcType, [],
mod.drop(
mod.block("label$1", [
mod.loop("label$2",
mod.unreachable()
)
], binaryen.i32)
)
);
mod.addExport("0", "0");
console.log(mod.emitText());
if (!mod.validate())
console.log("-> does not validate");
var bin = mod.emitBinary();
require("fs").writeFileSync(__dirname + "/unreachable-loop.wasm", bin);
var mod2 = binaryen.readBinary(bin);
console.log(mod2.emitText());

View File

@ -48,9 +48,6 @@
(func $start (; 5 ;) (type $v)
(local $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(drop
(call $abi/internal)
)
@ -87,16 +84,16 @@
)
)
(block
(set_local $1
(set_local $0
(i32.const 256)
)
(if
(get_global $abi/condition)
(set_local $1
(set_local $0
(i32.div_s
(i32.shr_s
(i32.shl
(get_local $1)
(get_local $0)
(i32.const 24)
)
(i32.const 24)
@ -104,11 +101,11 @@
(i32.const 2)
)
)
(set_local $1
(set_local $0
(i32.div_s
(i32.shr_s
(i32.shl
(get_local $1)
(get_local $0)
(i32.const 24)
)
(i32.const 24)
@ -122,7 +119,7 @@
(i32.eqz
(i32.shr_s
(i32.shl
(get_local $1)
(get_local $0)
(i32.const 24)
)
(i32.const 24)
@ -141,16 +138,16 @@
)
)
(block
(set_local $2
(set_local $0
(i32.const 256)
)
(if
(get_global $abi/condition)
(set_local $2
(set_local $0
(i32.shr_s
(i32.shr_s
(i32.shl
(get_local $2)
(get_local $0)
(i32.const 24)
)
(i32.const 24)
@ -158,9 +155,9 @@
(i32.const 24)
)
)
(set_local $2
(set_local $0
(i32.and
(get_local $2)
(get_local $0)
(i32.const 127)
)
)
@ -168,7 +165,7 @@
(if
(i32.eqz
(i32.eqz
(get_local $2)
(get_local $0)
)
)
(block
@ -210,7 +207,7 @@
)
)
(block
(set_local $3
(set_local $0
(i32.ctz
(i32.const 2)
)
@ -218,7 +215,7 @@
(if
(i32.eqz
(i32.and
(get_local $3)
(get_local $0)
(i32.const 1)
)
)
@ -232,7 +229,7 @@
(unreachable)
)
)
(set_local $3
(set_local $0
(i32.clz
(i32.const 1)
)
@ -240,7 +237,7 @@
(if
(i32.eqz
(i32.and
(get_local $3)
(get_local $0)
(i32.const 1)
)
)
@ -254,14 +251,14 @@
(unreachable)
)
)
(set_local $4
(set_local $1
(i32.ctz
(i32.const 2)
)
)
(if
(i32.eqz
(get_local $4)
(get_local $1)
)
(block
(call $abort
@ -273,14 +270,14 @@
(unreachable)
)
)
(set_local $4
(set_local $1
(i32.clz
(i32.const 1)
)
)
(if
(i32.eqz
(get_local $4)
(get_local $1)
)
(block
(call $abort

File diff suppressed because it is too large Load Diff

View File

@ -35,21 +35,6 @@
(local $5 i32)
(local $6 i32)
(local $7 i32)
(local $8 i32)
(local $9 i32)
(local $10 i32)
(local $11 i32)
(local $12 i32)
(local $13 i32)
(local $14 i32)
(local $15 i32)
(local $16 i32)
(local $17 i32)
(local $18 i32)
(local $19 i32)
(local $20 i32)
(local $21 i32)
(local $22 i32)
(block
(set_local $0
(f32.const -1)
@ -102,12 +87,12 @@
(i32.eqz
(i32.eq
(block $inlining/func_ii|inlined.1 (result i32)
(set_local $3
(set_local $2
(i32.const 41)
)
(if
(i32.eq
(get_local $3)
(get_local $2)
(i32.const 42)
)
(br $inlining/func_ii|inlined.1
@ -117,7 +102,7 @@
(br $inlining/func_ii|inlined.1
(if (result i32)
(i32.lt_s
(get_local $3)
(get_local $2)
(i32.const 42)
)
(i32.const 2)
@ -142,12 +127,12 @@
(i32.eqz
(i32.eq
(block $inlining/func_ii|inlined.2 (result i32)
(set_local $4
(set_local $2
(i32.const 43)
)
(if
(i32.eq
(get_local $4)
(get_local $2)
(i32.const 42)
)
(br $inlining/func_ii|inlined.2
@ -157,7 +142,7 @@
(br $inlining/func_ii|inlined.2
(if (result i32)
(i32.lt_s
(get_local $4)
(get_local $2)
(i32.const 42)
)
(i32.const 2)
@ -182,11 +167,11 @@
(i32.eqz
(i32.eq
(block $inlining/func_ii_opt|inlined.0 (result i32)
(set_local $5
(set_local $2
(i32.const 0)
)
(br $inlining/func_ii_opt|inlined.0
(get_local $5)
(get_local $2)
)
)
(i32.const 0)
@ -206,11 +191,11 @@
(i32.eqz
(i32.eq
(block $inlining/func_ii_opt|inlined.1 (result i32)
(set_local $6
(set_local $2
(i32.const 1)
)
(br $inlining/func_ii_opt|inlined.1
(get_local $6)
(get_local $2)
)
)
(i32.const 1)
@ -230,29 +215,28 @@
(i32.eqz
(i32.eq
(block $inlining/func_ii_loc|inlined.0 (result i32)
(set_local $7
(set_local $2
(i32.const 2)
)
(set_local $8
(get_local $7)
(set_local $3
(get_local $2)
)
(nop)
(block
(set_local $10
(get_local $8)
(set_local $5
(get_local $3)
)
(set_local $11
(get_local $10)
(set_local $6
(get_local $5)
)
(set_local $9
(set_local $4
(i32.add
(get_local $11)
(get_local $6)
(i32.const 1)
)
)
)
(br $inlining/func_ii_loc|inlined.0
(get_local $9)
(get_local $4)
)
)
(i32.const 3)
@ -272,29 +256,28 @@
(i32.eqz
(i32.eq
(block $inlining/func_ii_loc|inlined.1 (result i32)
(set_local $12
(set_local $4
(i32.const 3)
)
(set_local $13
(get_local $12)
(set_local $3
(get_local $4)
)
(nop)
(block
(set_local $15
(get_local $13)
(set_local $6
(get_local $3)
)
(set_local $16
(get_local $15)
(set_local $5
(get_local $6)
)
(set_local $14
(set_local $2
(i32.add
(get_local $16)
(get_local $5)
(i32.const 1)
)
)
)
(br $inlining/func_ii_loc|inlined.1
(get_local $14)
(get_local $2)
)
)
(i32.const 4)
@ -311,7 +294,7 @@
)
)
(block $inlining/func_iv|inlined.0
(set_local $17
(set_local $2
(i32.const 0)
)
)
@ -348,16 +331,16 @@
(i32.eqz
(i32.eq
(block $inlining/Foo.method_static|inlined.0 (result i32)
(set_local $18
(set_local $2
(i32.const 42)
)
(set_local $19
(set_local $3
(i32.const 2)
)
(br $inlining/Foo.method_static|inlined.0
(i32.add
(get_local $18)
(get_local $19)
(get_local $2)
(get_local $3)
)
)
)
@ -374,21 +357,21 @@
(unreachable)
)
)
(set_local $20
(set_local $7
(i32.const 123)
)
(if
(i32.eqz
(i32.eq
(block $inlining/Foo#method_this|inlined.0 (result i32)
(set_local $21
(set_local $3
(i32.const 43)
)
(set_local $22
(set_local $2
(i32.const 3)
)
(br $inlining/Foo#method_this|inlined.0
(get_local $20)
(get_local $7)
)
)
(i32.const 123)

View File

@ -370,13 +370,13 @@
(if
(f64.le
(f64.add
(tee_local $8
(tee_local $7
(f64.mul
(get_local $4)
(get_local $4)
)
)
(tee_local $7
(tee_local $8
(f64.mul
(get_local $5)
(get_local $5)
@ -401,8 +401,8 @@
(set_local $4
(f64.add
(f64.sub
(get_local $8)
(get_local $7)
(get_local $8)
)
(get_local $10)
)
@ -424,7 +424,7 @@
)
)
)
(set_local $8
(set_local $7
(f64.min
(f64.const 8)
(f64.convert_u/i32
@ -438,10 +438,10 @@
(f64.convert_u/i32
(get_local $6)
)
(get_local $8)
(get_local $7)
)
(block
(set_local $7
(set_local $8
(f64.add
(f64.sub
(f64.mul
@ -469,7 +469,7 @@
)
)
(set_local $4
(get_local $7)
(get_local $8)
)
(set_local $6
(i32.add

View File

@ -347,10 +347,7 @@
(local $14 i32)
(local $15 f64)
(local $16 f64)
(local $17 f64)
(local $18 f64)
(local $19 f64)
(local $20 i32)
(local $17 i32)
(set_local $4
(f64.div
(f64.convert_u/i32
@ -497,7 +494,7 @@
)
)
(block $break|2
(set_local $16
(set_local $15
(f64.min
(f64.const 8)
(f64.convert_u/i32
@ -511,11 +508,11 @@
(f64.convert_u/i32
(get_local $14)
)
(get_local $16)
(get_local $15)
)
(block
(block
(set_local $17
(set_local $16
(f64.add
(f64.sub
(f64.mul
@ -543,7 +540,7 @@
)
)
(set_local $10
(get_local $17)
(get_local $16)
)
)
(set_local $14
@ -557,12 +554,12 @@
)
)
)
(set_local $19
(set_local $15
(f64.div
(call $~lib/math/NativeMath.log
(call $~lib/math/NativeMath.log
(block $~lib/math/NativeMath.sqrt|inlined.0 (result f64)
(set_local $18
(set_local $15
(f64.add
(f64.mul
(get_local $10)
@ -576,7 +573,7 @@
)
(br $~lib/math/NativeMath.sqrt|inlined.0
(f64.sqrt
(get_local $18)
(get_local $15)
)
)
)
@ -585,10 +582,10 @@
(f64.const 0.6931471805599453)
)
)
(set_local $20
(set_local $17
(if (result i32)
(call $isFinite<f64>
(get_local $19)
(get_local $15)
)
(i32.trunc_u/f64
(f64.mul
@ -607,7 +604,7 @@
(i32.const 1)
)
)
(get_local $19)
(get_local $15)
)
(f64.convert_u/i32
(get_local $3)
@ -635,7 +632,7 @@
)
(i32.const 1)
)
(get_local $20)
(get_local $17)
)
)
(set_local $8

View File

@ -8,6 +8,7 @@
(start $start)
(func $start (; 1 ;) (type $v)
(local $0 i32)
(local $1 i32)
(if
(i32.ne
(tee_local $0
@ -48,15 +49,18 @@
(unreachable)
)
)
(set_local $0
(i32.add
(tee_local $1
(get_local $0)
)
(i32.const 1)
)
)
(if
(i32.ne
(i32.and
(tee_local $0
(i32.add
(get_local $0)
(i32.const 1)
)
)
(get_local $0)
(i32.const 255)
)
(i32.const 128)
@ -71,15 +75,18 @@
(unreachable)
)
)
(set_local $0
(i32.sub
(tee_local $1
(get_local $0)
)
(i32.const 1)
)
)
(if
(i32.ne
(i32.and
(tee_local $0
(i32.sub
(get_local $0)
(i32.const 1)
)
)
(get_local $0)
(i32.const 255)
)
(i32.const 127)
@ -247,15 +254,18 @@
(unreachable)
)
)
(set_local $0
(i32.add
(tee_local $1
(get_local $0)
)
(i32.const 1)
)
)
(if
(i32.ne
(i32.and
(tee_local $0
(i32.add
(get_local $0)
(i32.const 1)
)
)
(get_local $0)
(i32.const 65535)
)
(i32.const 32768)
@ -270,15 +280,18 @@
(unreachable)
)
)
(set_local $0
(i32.sub
(tee_local $1
(get_local $0)
)
(i32.const 1)
)
)
(if
(i32.ne
(i32.and
(tee_local $0
(i32.sub
(get_local $0)
(i32.const 1)
)
)
(get_local $0)
(i32.const 65535)
)
(i32.const 32767)
@ -446,15 +459,18 @@
(unreachable)
)
)
(set_local $0
(i32.sub
(tee_local $1
(get_local $0)
)
(i32.const 1)
)
)
(if
(i32.ne
(i32.and
(tee_local $0
(i32.sub
(get_local $0)
(i32.const 1)
)
)
(get_local $0)
(i32.const 255)
)
(i32.const 255)
@ -469,14 +485,17 @@
(unreachable)
)
)
(set_local $0
(i32.add
(tee_local $1
(get_local $0)
)
(i32.const 1)
)
)
(if
(i32.and
(tee_local $0
(i32.add
(get_local $0)
(i32.const 1)
)
)
(get_local $0)
(i32.const 255)
)
(block
@ -636,15 +655,18 @@
(unreachable)
)
)
(set_local $0
(i32.sub
(tee_local $1
(get_local $0)
)
(i32.const 1)
)
)
(if
(i32.ne
(i32.and
(tee_local $0
(i32.sub
(get_local $0)
(i32.const 1)
)
)
(get_local $0)
(i32.const 65535)
)
(i32.const 65535)
@ -659,14 +681,17 @@
(unreachable)
)
)
(set_local $0
(i32.add
(tee_local $1
(get_local $0)
)
(i32.const 1)
)
)
(if
(i32.and
(tee_local $0
(i32.add
(get_local $0)
(i32.const 1)
)
)
(get_local $0)
(i32.const 65535)
)
(block

View File

@ -11,12 +11,6 @@
(local $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
(local $8 i32)
(block
(set_local $0
(i32.const 127)
@ -301,12 +295,12 @@
)
)
(block
(set_local $2
(set_local $1
(i32.const 32767)
)
(set_local $2
(set_local $1
(i32.add
(get_local $2)
(get_local $1)
(i32.const 1)
)
)
@ -315,7 +309,7 @@
(i32.eq
(i32.shr_s
(i32.shl
(get_local $2)
(get_local $1)
(i32.const 16)
)
(i32.const 16)
@ -333,9 +327,9 @@
(unreachable)
)
)
(set_local $2
(set_local $1
(i32.sub
(get_local $2)
(get_local $1)
(i32.const 1)
)
)
@ -344,7 +338,7 @@
(i32.eq
(i32.shr_s
(i32.shl
(get_local $2)
(get_local $1)
(i32.const 16)
)
(i32.const 16)
@ -362,18 +356,18 @@
(unreachable)
)
)
(set_local $3
(set_local $0
(block (result i32)
(set_local $4
(get_local $2)
)
(set_local $2
(get_local $1)
)
(set_local $1
(i32.add
(get_local $4)
(get_local $2)
(i32.const 1)
)
)
(get_local $4)
(get_local $2)
)
)
(if
@ -381,7 +375,7 @@
(i32.eq
(i32.shr_s
(i32.shl
(get_local $2)
(get_local $1)
(i32.const 16)
)
(i32.const 16)
@ -399,18 +393,18 @@
(unreachable)
)
)
(set_local $3
(set_local $0
(block (result i32)
(set_local $4
(get_local $2)
)
(set_local $2
(get_local $1)
)
(set_local $1
(i32.sub
(get_local $4)
(get_local $2)
(i32.const 1)
)
)
(get_local $4)
(get_local $2)
)
)
(if
@ -418,7 +412,7 @@
(i32.eq
(i32.shr_s
(i32.shl
(get_local $2)
(get_local $1)
(i32.const 16)
)
(i32.const 16)
@ -436,9 +430,9 @@
(unreachable)
)
)
(set_local $2
(set_local $1
(i32.add
(get_local $2)
(get_local $1)
(i32.const 1)
)
)
@ -447,7 +441,7 @@
(i32.eq
(i32.shr_s
(i32.shl
(get_local $2)
(get_local $1)
(i32.const 16)
)
(i32.const 16)
@ -465,9 +459,9 @@
(unreachable)
)
)
(set_local $2
(set_local $1
(i32.sub
(get_local $2)
(get_local $1)
(i32.const 1)
)
)
@ -476,7 +470,7 @@
(i32.eq
(i32.shr_s
(i32.shl
(get_local $2)
(get_local $1)
(i32.const 16)
)
(i32.const 16)
@ -494,10 +488,10 @@
(unreachable)
)
)
(set_local $3
(tee_local $2
(set_local $0
(tee_local $1
(i32.add
(get_local $2)
(get_local $1)
(i32.const 1)
)
)
@ -507,7 +501,7 @@
(i32.eq
(i32.shr_s
(i32.shl
(get_local $2)
(get_local $1)
(i32.const 16)
)
(i32.const 16)
@ -525,10 +519,10 @@
(unreachable)
)
)
(set_local $3
(tee_local $2
(set_local $0
(tee_local $1
(i32.sub
(get_local $2)
(get_local $1)
(i32.const 1)
)
)
@ -538,7 +532,7 @@
(i32.eq
(i32.shr_s
(i32.shl
(get_local $2)
(get_local $1)
(i32.const 16)
)
(i32.const 16)
@ -562,7 +556,7 @@
(i32.shr_s
(i32.shl
(i32.add
(get_local $2)
(get_local $1)
(i32.const 1)
)
(i32.const 16)
@ -584,12 +578,12 @@
)
)
(block
(set_local $4
(set_local $0
(i32.const 0)
)
(set_local $4
(set_local $0
(i32.sub
(get_local $4)
(get_local $0)
(i32.const 1)
)
)
@ -597,7 +591,7 @@
(i32.eqz
(i32.eq
(i32.and
(get_local $4)
(get_local $0)
(i32.const 255)
)
(i32.const 255)
@ -613,9 +607,9 @@
(unreachable)
)
)
(set_local $4
(set_local $0
(i32.add
(get_local $4)
(get_local $0)
(i32.const 1)
)
)
@ -623,7 +617,7 @@
(i32.eqz
(i32.eq
(i32.and
(get_local $4)
(get_local $0)
(i32.const 255)
)
(i32.const 0)
@ -639,25 +633,25 @@
(unreachable)
)
)
(set_local $5
(set_local $1
(block (result i32)
(set_local $6
(get_local $4)
(set_local $2
(get_local $0)
)
(set_local $4
(set_local $0
(i32.sub
(get_local $6)
(get_local $2)
(i32.const 1)
)
)
(get_local $6)
(get_local $2)
)
)
(if
(i32.eqz
(i32.eq
(i32.and
(get_local $4)
(get_local $0)
(i32.const 255)
)
(i32.const 255)
@ -673,25 +667,25 @@
(unreachable)
)
)
(set_local $5
(set_local $1
(block (result i32)
(set_local $6
(get_local $4)
(set_local $2
(get_local $0)
)
(set_local $4
(set_local $0
(i32.add
(get_local $6)
(get_local $2)
(i32.const 1)
)
)
(get_local $6)
(get_local $2)
)
)
(if
(i32.eqz
(i32.eq
(i32.and
(get_local $4)
(get_local $0)
(i32.const 255)
)
(i32.const 0)
@ -707,9 +701,9 @@
(unreachable)
)
)
(set_local $4
(set_local $0
(i32.sub
(get_local $4)
(get_local $0)
(i32.const 1)
)
)
@ -717,7 +711,7 @@
(i32.eqz
(i32.eq
(i32.and
(get_local $4)
(get_local $0)
(i32.const 255)
)
(i32.const 255)
@ -733,9 +727,9 @@
(unreachable)
)
)
(set_local $4
(set_local $0
(i32.add
(get_local $4)
(get_local $0)
(i32.const 1)
)
)
@ -743,7 +737,7 @@
(i32.eqz
(i32.eq
(i32.and
(get_local $4)
(get_local $0)
(i32.const 255)
)
(i32.const 0)
@ -759,10 +753,10 @@
(unreachable)
)
)
(set_local $5
(tee_local $4
(set_local $1
(tee_local $0
(i32.sub
(get_local $4)
(get_local $0)
(i32.const 1)
)
)
@ -771,7 +765,7 @@
(i32.eqz
(i32.eq
(i32.and
(get_local $4)
(get_local $0)
(i32.const 255)
)
(i32.const 255)
@ -787,10 +781,10 @@
(unreachable)
)
)
(set_local $5
(tee_local $4
(set_local $1
(tee_local $0
(i32.add
(get_local $4)
(get_local $0)
(i32.const 1)
)
)
@ -799,7 +793,7 @@
(i32.eqz
(i32.eq
(i32.and
(get_local $4)
(get_local $0)
(i32.const 255)
)
(i32.const 0)
@ -820,7 +814,7 @@
(i32.eq
(i32.and
(i32.sub
(get_local $4)
(get_local $0)
(i32.const 1)
)
(i32.const 255)
@ -840,12 +834,12 @@
)
)
(block
(set_local $6
(set_local $1
(i32.const 0)
)
(set_local $6
(set_local $1
(i32.sub
(get_local $6)
(get_local $1)
(i32.const 1)
)
)
@ -853,7 +847,7 @@
(i32.eqz
(i32.eq
(i32.and
(get_local $6)
(get_local $1)
(i32.const 65535)
)
(i32.const 65535)
@ -869,9 +863,9 @@
(unreachable)
)
)
(set_local $6
(set_local $1
(i32.add
(get_local $6)
(get_local $1)
(i32.const 1)
)
)
@ -879,7 +873,7 @@
(i32.eqz
(i32.eq
(i32.and
(get_local $6)
(get_local $1)
(i32.const 65535)
)
(i32.const 0)
@ -895,25 +889,25 @@
(unreachable)
)
)
(set_local $7
(set_local $0
(block (result i32)
(set_local $8
(get_local $6)
(set_local $2
(get_local $1)
)
(set_local $6
(set_local $1
(i32.sub
(get_local $8)
(get_local $2)
(i32.const 1)
)
)
(get_local $8)
(get_local $2)
)
)
(if
(i32.eqz
(i32.eq
(i32.and
(get_local $6)
(get_local $1)
(i32.const 65535)
)
(i32.const 65535)
@ -929,25 +923,25 @@
(unreachable)
)
)
(set_local $7
(set_local $0
(block (result i32)
(set_local $8
(get_local $6)
(set_local $2
(get_local $1)
)
(set_local $6
(set_local $1
(i32.add
(get_local $8)
(get_local $2)
(i32.const 1)
)
)
(get_local $8)
(get_local $2)
)
)
(if
(i32.eqz
(i32.eq
(i32.and
(get_local $6)
(get_local $1)
(i32.const 65535)
)
(i32.const 0)
@ -963,9 +957,9 @@
(unreachable)
)
)
(set_local $6
(set_local $1
(i32.sub
(get_local $6)
(get_local $1)
(i32.const 1)
)
)
@ -973,7 +967,7 @@
(i32.eqz
(i32.eq
(i32.and
(get_local $6)
(get_local $1)
(i32.const 65535)
)
(i32.const 65535)
@ -989,9 +983,9 @@
(unreachable)
)
)
(set_local $6
(set_local $1
(i32.add
(get_local $6)
(get_local $1)
(i32.const 1)
)
)
@ -999,7 +993,7 @@
(i32.eqz
(i32.eq
(i32.and
(get_local $6)
(get_local $1)
(i32.const 65535)
)
(i32.const 0)
@ -1015,10 +1009,10 @@
(unreachable)
)
)
(set_local $7
(tee_local $6
(set_local $0
(tee_local $1
(i32.sub
(get_local $6)
(get_local $1)
(i32.const 1)
)
)
@ -1027,7 +1021,7 @@
(i32.eqz
(i32.eq
(i32.and
(get_local $6)
(get_local $1)
(i32.const 65535)
)
(i32.const 65535)
@ -1043,10 +1037,10 @@
(unreachable)
)
)
(set_local $7
(tee_local $6
(set_local $0
(tee_local $1
(i32.add
(get_local $6)
(get_local $1)
(i32.const 1)
)
)
@ -1055,7 +1049,7 @@
(i32.eqz
(i32.eq
(i32.and
(get_local $6)
(get_local $1)
(i32.const 65535)
)
(i32.const 0)
@ -1076,7 +1070,7 @@
(i32.eq
(i32.and
(i32.sub
(get_local $6)
(get_local $1)
(i32.const 1)
)
(i32.const 65535)

View File

@ -10,11 +10,10 @@
(start $start)
(func $scoped/fn (; 0 ;) (type $iv) (param $0 i32)
(local $1 i32)
(local $2 i32)
(set_local $1
(i32.const 0)
)
(set_local $2
(set_local $1
(get_local $0)
)
)

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,6 @@
(type $iiii (func (param i32 i32 i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
(global $~argc (mut i32) (i32.const 0))
(memory $0 1)
(data (i32.const 8) "\0e\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s")
(data (i32.const 40) "\04\00\00\00n\00u\00l\00l")
@ -208,34 +207,8 @@
)
)
)
(func $~lib/string/String#startsWith|trampoline (; 6 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(block $1of1
(block $0of1
(block $oob
(br_table $0of1 $1of1 $oob
(i32.sub
(get_global $~argc)
(i32.const 1)
)
)
)
(unreachable)
)
(set_local $2
(i32.const 0)
)
)
(func $std/array-access/stringArrayMethodCall (; 6 ;) (type $ii) (param $0 i32) (result i32)
(call $~lib/string/String#startsWith
(get_local $0)
(get_local $1)
(get_local $2)
)
)
(func $std/array-access/stringArrayMethodCall (; 7 ;) (type $ii) (param $0 i32) (result i32)
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/String#startsWith|trampoline
(call $~lib/array/Array<Array<i32>>#__get
(get_local $0)
(i32.const 0)
@ -244,7 +217,7 @@
(i32.const 0)
)
)
(func $std/array-access/stringArrayArrayPropertyAccess (; 8 ;) (type $ii) (param $0 i32) (result i32)
(func $std/array-access/stringArrayArrayPropertyAccess (; 7 ;) (type $ii) (param $0 i32) (result i32)
(i32.load
(call $~lib/array/Array<Array<i32>>#__get
(call $~lib/array/Array<Array<i32>>#__get
@ -255,11 +228,8 @@
)
)
)
(func $std/array-access/stringArrayArrayMethodCall (; 9 ;) (type $ii) (param $0 i32) (result i32)
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/String#startsWith|trampoline
(func $std/array-access/stringArrayArrayMethodCall (; 8 ;) (type $ii) (param $0 i32) (result i32)
(call $~lib/string/String#startsWith
(call $~lib/array/Array<Array<i32>>#__get
(call $~lib/array/Array<Array<i32>>#__get
(get_local $0)

View File

@ -9,7 +9,6 @@
(global $~lib/internal/allocator/AL_MASK i32 (i32.const 7))
(global $~lib/internal/arraybuffer/HEADER_SIZE i32 (i32.const 8))
(global $~lib/internal/string/HEADER_SIZE i32 (i32.const 4))
(global $~argc (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 52))
(memory $0 1)
(data (i32.const 4) "\00\00\00\00")
@ -321,47 +320,19 @@
)
)
)
(func $~lib/string/String#startsWith|trampoline (; 8 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(block $1of1
(block $0of1
(block $oob
(br_table $0of1 $1of1 $oob
(i32.sub
(get_global $~argc)
(i32.const 1)
)
)
(func $std/array-access/stringArrayMethodCall (; 8 ;) (type $ii) (param $0 i32) (result i32)
(return
(call $~lib/string/String#startsWith
(call $~lib/array/Array<String>#__get
(get_local $0)
(i32.const 0)
)
(unreachable)
)
(set_local $2
(i32.const 4)
(i32.const 0)
)
)
(call $~lib/string/String#startsWith
(get_local $0)
(get_local $1)
(get_local $2)
)
)
(func $std/array-access/stringArrayMethodCall (; 9 ;) (type $ii) (param $0 i32) (result i32)
(return
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/String#startsWith|trampoline
(call $~lib/array/Array<String>#__get
(get_local $0)
(i32.const 0)
)
(i32.const 4)
(i32.const 0)
)
)
)
)
(func $~lib/array/Array<Array<String>>#__get (; 10 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/array/Array<Array<String>>#__get (; 9 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(set_local $2
(i32.load
@ -396,7 +367,7 @@
)
)
)
(func $std/array-access/stringArrayArrayPropertyAccess (; 11 ;) (type $ii) (param $0 i32) (result i32)
(func $std/array-access/stringArrayArrayPropertyAccess (; 10 ;) (type $ii) (param $0 i32) (result i32)
(return
(i32.load
(call $~lib/array/Array<String>#__get
@ -409,23 +380,18 @@
)
)
)
(func $std/array-access/stringArrayArrayMethodCall (; 12 ;) (type $ii) (param $0 i32) (result i32)
(func $std/array-access/stringArrayArrayMethodCall (; 11 ;) (type $ii) (param $0 i32) (result i32)
(return
(block (result i32)
(set_global $~argc
(call $~lib/string/String#startsWith
(call $~lib/array/Array<String>#__get
(call $~lib/array/Array<Array<String>>#__get
(get_local $0)
(i32.const 0)
)
(i32.const 1)
)
(call $~lib/string/String#startsWith|trampoline
(call $~lib/array/Array<String>#__get
(call $~lib/array/Array<Array<String>>#__get
(get_local $0)
(i32.const 0)
)
(i32.const 1)
)
(i32.const 4)
(i32.const 0)
)
(i32.const 4)
(i32.const 0)
)
)
)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,7 @@
(module
(type $ii (func (param i32) (result i32)))
(type $iv (func (param i32)))
(type $fi (func (param f32) (result i32)))
(type $Fi (func (param f64) (result i32)))
(type $Ii (func (param i64) (result i32)))
(type $v (func))
(import "env" "logi" (func $std/hash/logi (param i32)))
(memory $0 1)
@ -11,55 +10,7 @@
(data (i32.const 24) "\03\00\00\00a\00b\00c")
(export "memory" (memory $0))
(start $start)
(func $~lib/internal/hash/hash<usize> (; 1 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(i32.mul
(i32.xor
(i32.mul
(i32.xor
(i32.mul
(i32.xor
(i32.mul
(i32.xor
(i32.and
(tee_local $1
(get_local $0)
)
(i32.const 255)
)
(i32.const -2128831035)
)
(i32.const 16777619)
)
(i32.and
(i32.shr_u
(get_local $1)
(i32.const 8)
)
(i32.const 255)
)
)
(i32.const 16777619)
)
(i32.and
(i32.shr_u
(get_local $1)
(i32.const 16)
)
(i32.const 255)
)
)
(i32.const 16777619)
)
(i32.shr_u
(get_local $1)
(i32.const 24)
)
)
(i32.const 16777619)
)
)
(func $~lib/internal/hash/hash<String> (; 2 ;) (type $ii) (param $0 i32) (result i32)
(func $~lib/internal/hash/hashStr (; 1 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@ -107,8 +58,7 @@
)
(get_local $2)
)
(func $~lib/internal/hash/hash<f32> (; 3 ;) (type $fi) (param $0 f32) (result i32)
(local $1 i32)
(func $~lib/internal/hash/hash32 (; 2 ;) (type $ii) (param $0 i32) (result i32)
(i32.mul
(i32.xor
(i32.mul
@ -118,11 +68,7 @@
(i32.mul
(i32.xor
(i32.and
(tee_local $1
(i32.reinterpret/f32
(get_local $0)
)
)
(get_local $0)
(i32.const 255)
)
(i32.const -2128831035)
@ -131,7 +77,7 @@
)
(i32.and
(i32.shr_u
(get_local $1)
(get_local $0)
(i32.const 8)
)
(i32.const 255)
@ -141,7 +87,7 @@
)
(i32.and
(i32.shr_u
(get_local $1)
(get_local $0)
(i32.const 16)
)
(i32.const 255)
@ -150,16 +96,15 @@
(i32.const 16777619)
)
(i32.shr_u
(get_local $1)
(get_local $0)
(i32.const 24)
)
)
(i32.const 16777619)
)
)
(func $~lib/internal/hash/hash<f64> (; 4 ;) (type $Fi) (param $0 f64) (result i32)
(func $~lib/internal/hash/hash64 (; 3 ;) (type $Ii) (param $0 i64) (result i32)
(local $1 i32)
(local $2 i64)
(i32.mul
(i32.xor
(i32.mul
@ -179,11 +124,7 @@
(i32.and
(tee_local $1
(i32.wrap/i64
(tee_local $2
(i64.reinterpret/f64
(get_local $0)
)
)
(get_local $0)
)
)
(i32.const 255)
@ -223,7 +164,7 @@
(tee_local $1
(i32.wrap/i64
(i64.shr_u
(get_local $2)
(get_local $0)
(i64.const 32)
)
)
@ -261,90 +202,90 @@
(i32.const 16777619)
)
)
(func $start (; 5 ;) (type $v)
(func $start (; 4 ;) (type $v)
(call $std/hash/logi
(call $~lib/internal/hash/hash<usize>
(call $~lib/internal/hash/hashStr
(i32.const 0)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<String>
(call $~lib/internal/hash/hashStr
(i32.const 4)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<String>
(call $~lib/internal/hash/hashStr
(i32.const 8)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<String>
(call $~lib/internal/hash/hashStr
(i32.const 16)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<String>
(call $~lib/internal/hash/hashStr
(i32.const 24)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f32>
(f32.const 0)
(call $~lib/internal/hash/hash32
(i32.const 0)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f32>
(f32.const 1)
(call $~lib/internal/hash/hash32
(i32.const 1065353216)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f32>
(f32.const 1.100000023841858)
(call $~lib/internal/hash/hash32
(i32.const 1066192077)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f32>
(f32.const 0)
(call $~lib/internal/hash/hash32
(i32.const 0)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f32>
(f32.const inf)
(call $~lib/internal/hash/hash32
(i32.const 2139095040)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f32>
(f32.const nan:0x400000)
(call $~lib/internal/hash/hash32
(i32.const 2143289344)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f64>
(f64.const 0)
(call $~lib/internal/hash/hash64
(i64.const 0)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f64>
(f64.const 1)
(call $~lib/internal/hash/hash64
(i64.const 4607182418800017408)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f64>
(f64.const 1.1)
(call $~lib/internal/hash/hash64
(i64.const 4607632778762754458)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f64>
(f64.const 0)
(call $~lib/internal/hash/hash64
(i64.const 0)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f64>
(f64.const inf)
(call $~lib/internal/hash/hash64
(i64.const 9218868437227405312)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f64>
(f64.const nan:0x8000000000000)
(call $~lib/internal/hash/hash64
(i64.const 9221120237041090560)
)
)
)

View File

@ -2,22 +2,22 @@ import { hash } from "internal/hash";
declare function logi(i: i32): void;
logi(hash(null));
logi(hash(""));
logi(hash("a"));
logi(hash("ab"));
logi(hash("abc"));
logi(hash<string>(null));
logi(hash<string>(""));
logi(hash<string>("a"));
logi(hash<string>("ab"));
logi(hash<string>("abc"));
logi(hash(<f32>0.0));
logi(hash(<f32>1.0));
logi(hash(<f32>1.1));
logi(hash(<f32>-0));
logi(hash(<f32>Infinity));
logi(hash(<f32>NaN));
logi(hash<f32>(0.0));
logi(hash<f32>(1.0));
logi(hash<f32>(1.1));
logi(hash<f32>(-0));
logi(hash<f32>(Infinity));
logi(hash<f32>(NaN));
logi(hash(<f64>0.0));
logi(hash(<f64>1.0));
logi(hash(<f64>1.1));
logi(hash(<f64>-0));
logi(hash(<f64>Infinity));
logi(hash(<f64>NaN));
logi(hash<f64>(0.0));
logi(hash<f64>(1.0));
logi(hash<f64>(1.1));
logi(hash<f64>(-0));
logi(hash<f64>(Infinity));
logi(hash<f64>(NaN));

View File

@ -1,8 +1,7 @@
(module
(type $ii (func (param i32) (result i32)))
(type $iv (func (param i32)))
(type $fi (func (param f32) (result i32)))
(type $Fi (func (param f64) (result i32)))
(type $Ii (func (param i64) (result i32)))
(type $v (func))
(import "env" "logi" (func $std/hash/logi (param i32)))
(global $~lib/internal/allocator/AL_BITS i32 (i32.const 3))
@ -24,76 +23,7 @@
(data (i32.const 24) "\03\00\00\00a\00b\00c\00")
(export "memory" (memory $0))
(start $start)
(func $~lib/internal/hash/hash<usize> (; 1 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(set_local $1
(i32.const -2128831035)
)
(block
(set_local $2
(get_local $0)
)
(set_local $1
(i32.mul
(i32.xor
(get_local $1)
(i32.and
(get_local $2)
(i32.const 255)
)
)
(i32.const 16777619)
)
)
(set_local $1
(i32.mul
(i32.xor
(get_local $1)
(i32.and
(i32.shr_u
(get_local $2)
(i32.const 8)
)
(i32.const 255)
)
)
(i32.const 16777619)
)
)
(set_local $1
(i32.mul
(i32.xor
(get_local $1)
(i32.and
(i32.shr_u
(get_local $2)
(i32.const 16)
)
(i32.const 255)
)
)
(i32.const 16777619)
)
)
(set_local $1
(i32.mul
(i32.xor
(get_local $1)
(i32.shr_u
(get_local $2)
(i32.const 24)
)
)
(i32.const 16777619)
)
)
)
(return
(get_local $1)
)
)
(func $~lib/internal/hash/hash<String> (; 2 ;) (type $ii) (param $0 i32) (result i32)
(func $~lib/internal/hash/hashStr (; 1 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@ -150,301 +80,431 @@
(get_local $1)
)
)
(func $~lib/internal/hash/hash<f32> (; 3 ;) (type $fi) (param $0 f32) (result i32)
(func $~lib/internal/hash/hash32 (; 2 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(set_local $1
(i32.const -2128831035)
)
(set_local $1
(i32.mul
(i32.xor
(get_local $1)
(i32.and
(get_local $0)
(i32.const 255)
)
)
(i32.const 16777619)
)
)
(set_local $1
(i32.mul
(i32.xor
(get_local $1)
(i32.and
(i32.shr_u
(get_local $0)
(i32.const 8)
)
(i32.const 255)
)
)
(i32.const 16777619)
)
)
(set_local $1
(i32.mul
(i32.xor
(get_local $1)
(i32.and
(i32.shr_u
(get_local $0)
(i32.const 16)
)
(i32.const 255)
)
)
(i32.const 16777619)
)
)
(set_local $1
(i32.mul
(i32.xor
(get_local $1)
(i32.shr_u
(get_local $0)
(i32.const 24)
)
)
(i32.const 16777619)
)
)
(return
(get_local $1)
)
)
(func $~lib/internal/hash/hash64 (; 3 ;) (type $Ii) (param $0 i64) (result i32)
(local $1 i32)
(local $2 i32)
(set_local $1
(i32.const -2128831035)
)
(block
(set_local $2
(i32.reinterpret/f32
(get_local $0)
)
)
(set_local $1
(i32.mul
(i32.xor
(get_local $1)
(i32.and
(get_local $2)
(i32.const 255)
)
)
(i32.const 16777619)
)
)
(set_local $1
(i32.mul
(i32.xor
(get_local $1)
(i32.and
(i32.shr_u
(get_local $2)
(i32.const 8)
)
(i32.const 255)
)
)
(i32.const 16777619)
)
)
(set_local $1
(i32.mul
(i32.xor
(get_local $1)
(i32.and
(i32.shr_u
(get_local $2)
(i32.const 16)
)
(i32.const 255)
)
)
(i32.const 16777619)
)
)
(set_local $1
(i32.mul
(i32.xor
(get_local $1)
(i32.shr_u
(get_local $2)
(i32.const 24)
)
)
(i32.const 16777619)
)
)
)
(return
(get_local $1)
)
)
(func $~lib/internal/hash/hash<f64> (; 4 ;) (type $Fi) (param $0 f64) (result i32)
(local $1 i32)
(local $2 i64)
(local $3 i32)
(local $4 i32)
(set_local $1
(i32.wrap/i64
(get_local $0)
)
)
(set_local $2
(i32.wrap/i64
(i64.shr_u
(get_local $0)
(i64.const 32)
)
)
)
(set_local $3
(i32.const -2128831035)
)
(block
(set_local $2
(i64.reinterpret/f64
(get_local $0)
(set_local $3
(i32.mul
(i32.xor
(get_local $3)
(i32.and
(get_local $1)
(i32.const 255)
)
)
(i32.const 16777619)
)
(set_local $3
(i32.wrap/i64
(get_local $2)
)
(set_local $3
(i32.mul
(i32.xor
(get_local $3)
(i32.and
(i32.shr_u
(get_local $1)
(i32.const 8)
)
(i32.const 255)
)
)
(i32.const 16777619)
)
(set_local $4
(i32.wrap/i64
(i64.shr_u
)
(set_local $3
(i32.mul
(i32.xor
(get_local $3)
(i32.and
(i32.shr_u
(get_local $1)
(i32.const 16)
)
(i32.const 255)
)
)
(i32.const 16777619)
)
)
(set_local $3
(i32.mul
(i32.xor
(get_local $3)
(i32.shr_u
(get_local $1)
(i32.const 24)
)
)
(i32.const 16777619)
)
)
(set_local $3
(i32.mul
(i32.xor
(get_local $3)
(i32.and
(get_local $2)
(i64.const 32)
(i32.const 255)
)
)
(i32.const 16777619)
)
(set_local $1
(i32.mul
(i32.xor
(get_local $1)
(i32.and
(get_local $3)
(i32.const 255)
)
)
(i32.const 16777619)
)
)
(set_local $1
(i32.mul
(i32.xor
(get_local $1)
(i32.and
(i32.shr_u
(get_local $3)
(i32.const 8)
)
(i32.const 255)
)
)
(i32.const 16777619)
)
)
(set_local $1
(i32.mul
(i32.xor
(get_local $1)
(i32.and
(i32.shr_u
(get_local $3)
(i32.const 16)
)
(i32.const 255)
)
)
(i32.const 16777619)
)
)
(set_local $1
(i32.mul
(i32.xor
(get_local $1)
)
(set_local $3
(i32.mul
(i32.xor
(get_local $3)
(i32.and
(i32.shr_u
(get_local $3)
(i32.const 24)
(get_local $2)
(i32.const 8)
)
(i32.const 255)
)
(i32.const 16777619)
)
(i32.const 16777619)
)
(set_local $1
(i32.mul
(i32.xor
(get_local $1)
(i32.and
(get_local $4)
(i32.const 255)
)
)
(i32.const 16777619)
)
)
(set_local $1
(i32.mul
(i32.xor
(get_local $1)
(i32.and
(i32.shr_u
(get_local $4)
(i32.const 8)
)
(i32.const 255)
)
)
(i32.const 16777619)
)
)
(set_local $1
(i32.mul
(i32.xor
(get_local $1)
(i32.and
(i32.shr_u
(get_local $4)
(i32.const 16)
)
(i32.const 255)
)
)
(i32.const 16777619)
)
)
(set_local $1
(i32.mul
(i32.xor
(get_local $1)
)
(set_local $3
(i32.mul
(i32.xor
(get_local $3)
(i32.and
(i32.shr_u
(get_local $4)
(i32.const 24)
(get_local $2)
(i32.const 16)
)
(i32.const 255)
)
(i32.const 16777619)
)
(i32.const 16777619)
)
)
(set_local $3
(i32.mul
(i32.xor
(get_local $3)
(i32.shr_u
(get_local $2)
(i32.const 24)
)
)
(i32.const 16777619)
)
)
(return
(get_local $1)
(get_local $3)
)
)
(func $start (; 5 ;) (type $v)
(func $start (; 4 ;) (type $v)
(local $0 i32)
(local $1 f32)
(local $2 f64)
(call $std/hash/logi
(call $~lib/internal/hash/hash<usize>
(i32.const 0)
(block $~lib/internal/hash/hash<String>|inlined.0 (result i32)
(set_local $0
(i32.const 0)
)
(br $~lib/internal/hash/hash<String>|inlined.0
(call $~lib/internal/hash/hashStr
(get_local $0)
)
)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<String>
(i32.const 4)
(block $~lib/internal/hash/hash<String>|inlined.1 (result i32)
(set_local $0
(i32.const 4)
)
(br $~lib/internal/hash/hash<String>|inlined.1
(call $~lib/internal/hash/hashStr
(get_local $0)
)
)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<String>
(i32.const 8)
(block $~lib/internal/hash/hash<String>|inlined.2 (result i32)
(set_local $0
(i32.const 8)
)
(br $~lib/internal/hash/hash<String>|inlined.2
(call $~lib/internal/hash/hashStr
(get_local $0)
)
)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<String>
(i32.const 16)
(block $~lib/internal/hash/hash<String>|inlined.3 (result i32)
(set_local $0
(i32.const 16)
)
(br $~lib/internal/hash/hash<String>|inlined.3
(call $~lib/internal/hash/hashStr
(get_local $0)
)
)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<String>
(i32.const 24)
(block $~lib/internal/hash/hash<String>|inlined.4 (result i32)
(set_local $0
(i32.const 24)
)
(br $~lib/internal/hash/hash<String>|inlined.4
(call $~lib/internal/hash/hashStr
(get_local $0)
)
)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f32>
(f32.const 0)
(block $~lib/internal/hash/hash<f32>|inlined.0 (result i32)
(set_local $1
(f32.const 0)
)
(br $~lib/internal/hash/hash<f32>|inlined.0
(call $~lib/internal/hash/hash32
(i32.reinterpret/f32
(get_local $1)
)
)
)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f32>
(f32.const 1)
(block $~lib/internal/hash/hash<f32>|inlined.1 (result i32)
(set_local $1
(f32.const 1)
)
(br $~lib/internal/hash/hash<f32>|inlined.1
(call $~lib/internal/hash/hash32
(i32.reinterpret/f32
(get_local $1)
)
)
)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f32>
(f32.const 1.100000023841858)
(block $~lib/internal/hash/hash<f32>|inlined.2 (result i32)
(set_local $1
(f32.const 1.100000023841858)
)
(br $~lib/internal/hash/hash<f32>|inlined.2
(call $~lib/internal/hash/hash32
(i32.reinterpret/f32
(get_local $1)
)
)
)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f32>
(f32.const 0)
(block $~lib/internal/hash/hash<f32>|inlined.3 (result i32)
(set_local $1
(f32.const 0)
)
(br $~lib/internal/hash/hash<f32>|inlined.3
(call $~lib/internal/hash/hash32
(i32.reinterpret/f32
(get_local $1)
)
)
)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f32>
(f32.const inf)
(block $~lib/internal/hash/hash<f32>|inlined.4 (result i32)
(set_local $1
(f32.const inf)
)
(br $~lib/internal/hash/hash<f32>|inlined.4
(call $~lib/internal/hash/hash32
(i32.reinterpret/f32
(get_local $1)
)
)
)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f32>
(f32.const nan:0x400000)
(block $~lib/internal/hash/hash<f32>|inlined.5 (result i32)
(set_local $1
(f32.const nan:0x400000)
)
(br $~lib/internal/hash/hash<f32>|inlined.5
(call $~lib/internal/hash/hash32
(i32.reinterpret/f32
(get_local $1)
)
)
)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f64>
(f64.const 0)
(block $~lib/internal/hash/hash<f64>|inlined.0 (result i32)
(set_local $2
(f64.const 0)
)
(br $~lib/internal/hash/hash<f64>|inlined.0
(call $~lib/internal/hash/hash64
(i64.reinterpret/f64
(get_local $2)
)
)
)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f64>
(f64.const 1)
(block $~lib/internal/hash/hash<f64>|inlined.1 (result i32)
(set_local $2
(f64.const 1)
)
(br $~lib/internal/hash/hash<f64>|inlined.1
(call $~lib/internal/hash/hash64
(i64.reinterpret/f64
(get_local $2)
)
)
)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f64>
(f64.const 1.1)
(block $~lib/internal/hash/hash<f64>|inlined.2 (result i32)
(set_local $2
(f64.const 1.1)
)
(br $~lib/internal/hash/hash<f64>|inlined.2
(call $~lib/internal/hash/hash64
(i64.reinterpret/f64
(get_local $2)
)
)
)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f64>
(f64.const 0)
(block $~lib/internal/hash/hash<f64>|inlined.3 (result i32)
(set_local $2
(f64.const 0)
)
(br $~lib/internal/hash/hash<f64>|inlined.3
(call $~lib/internal/hash/hash64
(i64.reinterpret/f64
(get_local $2)
)
)
)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f64>
(f64.const inf)
(block $~lib/internal/hash/hash<f64>|inlined.4 (result i32)
(set_local $2
(f64.const inf)
)
(br $~lib/internal/hash/hash<f64>|inlined.4
(call $~lib/internal/hash/hash64
(i64.reinterpret/f64
(get_local $2)
)
)
)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f64>
(f64.const nan:0x8000000000000)
(block $~lib/internal/hash/hash<f64>|inlined.5 (result i32)
(set_local $2
(f64.const nan:0x8000000000000)
)
(br $~lib/internal/hash/hash<f64>|inlined.5
(call $~lib/internal/hash/hash64
(i64.reinterpret/f64
(get_local $2)
)
)
)
)
)
)

File diff suppressed because it is too large Load Diff

View File

@ -44295,14 +44295,14 @@
(call $~lib/math/JSMath.random)
)
)
(set_local $1
(set_local $0
(i32.const 0)
)
(loop $continue|1
(if
(f64.lt
(f64.convert_s/i32
(get_local $1)
(get_local $0)
)
(f64.const 1e6)
)
@ -44310,7 +44310,7 @@
(if
(i32.eqz
(if (result i32)
(tee_local $0
(tee_local $1
(f32.ge
(tee_local $3
(call $~lib/math/NativeMathf.random)
@ -44322,7 +44322,7 @@
(get_local $3)
(f32.const 1)
)
(get_local $0)
(get_local $1)
)
)
(block
@ -44335,9 +44335,9 @@
(unreachable)
)
)
(set_local $1
(set_local $0
(i32.add
(get_local $1)
(get_local $0)
(i32.const 1)
)
)

File diff suppressed because it is too large Load Diff

View File

@ -2767,7 +2767,7 @@
(if
(i32.eqz
(if (result i32)
(tee_local $0
(tee_local $1
(i32.eq
(i32.load
(get_global $std/operator-overloading/ais)
@ -2781,7 +2781,7 @@
)
(i32.const 5)
)
(get_local $0)
(get_local $1)
)
)
(block
@ -2813,22 +2813,22 @@
(i32.const 0)
(i32.add
(i32.load
(tee_local $0
(tee_local $1
(get_global $std/operator-overloading/aii1)
)
)
(i32.load
(tee_local $1
(tee_local $0
(get_global $std/operator-overloading/aii2)
)
)
)
(i32.add
(i32.load offset=4
(get_local $0)
(get_local $1)
)
(i32.load offset=4
(get_local $1)
(get_local $0)
)
)
)

File diff suppressed because it is too large Load Diff

View File

@ -238,30 +238,7 @@
)
)
)
(func $~lib/string/String#startsWith|trampoline (; 4 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(block $1of1
(block $0of1
(block $oob
(br_table $0of1 $1of1 $oob
(i32.sub
(get_global $~argc)
(i32.const 1)
)
)
)
(unreachable)
)
(set_local $2
(i32.const 0)
)
)
(call $~lib/string/String#startsWith
(get_local $0)
(get_local $1)
(get_local $2)
)
)
(func $~lib/string/String#endsWith (; 5 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func $~lib/string/String#endsWith (; 4 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(if
(i32.eqz
@ -346,7 +323,7 @@
)
)
)
(func $~lib/string/String#endsWith|trampoline (; 6 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func $~lib/string/String#endsWith|trampoline (; 5 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(block $1of1
(block $0of1
(block $oob
@ -369,7 +346,7 @@
(get_local $2)
)
)
(func $~lib/string/String#indexOf (; 7 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func $~lib/string/String#indexOf (; 6 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@ -474,7 +451,7 @@
)
(i32.const -1)
)
(func $~lib/string/String#includes (; 8 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func $~lib/string/String#includes (; 7 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(i32.ne
(call $~lib/string/String#indexOf
(get_local $0)
@ -484,56 +461,10 @@
(i32.const -1)
)
)
(func $~lib/string/String#includes|trampoline (; 9 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(block $1of1
(block $0of1
(block $oob
(br_table $0of1 $1of1 $oob
(i32.sub
(get_global $~argc)
(i32.const 1)
)
)
)
(unreachable)
)
(set_local $2
(i32.const 0)
)
)
(call $~lib/string/String#includes
(get_local $0)
(get_local $1)
(get_local $2)
)
)
(func $~lib/string/String#indexOf|trampoline (; 10 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(block $1of1
(block $0of1
(block $oob
(br_table $0of1 $1of1 $oob
(i32.sub
(get_global $~argc)
(i32.const 1)
)
)
)
(unreachable)
)
(set_local $2
(i32.const 0)
)
)
(call $~lib/string/String#indexOf
(get_local $0)
(get_local $1)
(get_local $2)
)
)
(func $std/string/getString (; 11 ;) (type $i) (result i32)
(func $std/string/getString (; 8 ;) (type $i) (result i32)
(get_global $std/string/str)
)
(func $~lib/internal/string/parse<f64> (; 12 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64)
(func $~lib/internal/string/parse<f64> (; 9 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -879,35 +810,13 @@
(get_local $5)
)
)
(func $~lib/string/parseInt (; 13 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64)
(func $~lib/string/parseInt (; 10 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64)
(call $~lib/internal/string/parse<f64>
(get_local $0)
(get_local $1)
)
)
(func $~lib/string/parseInt|trampoline (; 14 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64)
(block $1of1
(block $0of1
(block $oob
(br_table $0of1 $1of1 $oob
(i32.sub
(get_global $~argc)
(i32.const 1)
)
)
)
(unreachable)
)
(set_local $1
(i32.const 0)
)
)
(call $~lib/string/parseInt
(get_local $0)
(get_local $1)
)
)
(func $~lib/string/parseFloat (; 15 ;) (type $iF) (param $0 i32) (result f64)
(func $~lib/string/parseFloat (; 11 ;) (type $iF) (param $0 i32) (result f64)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@ -1157,7 +1066,7 @@
(get_local $4)
)
)
(func $~lib/allocator/arena/allocate_memory (; 16 ;) (type $ii) (param $0 i32) (result i32)
(func $~lib/allocator/arena/allocate_memory (; 12 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@ -1246,7 +1155,7 @@
)
(i32.const 0)
)
(func $~lib/internal/string/allocate (; 17 ;) (type $ii) (param $0 i32) (result i32)
(func $~lib/internal/string/allocate (; 13 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(if
(i32.eqz
@ -1290,7 +1199,7 @@
)
(get_local $1)
)
(func $~lib/memory/copy_memory (; 18 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(func $~lib/memory/copy_memory (; 14 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(local $4 i32)
(loop $continue|0
@ -2866,7 +2775,7 @@
)
)
)
(func $~lib/memory/move_memory (; 19 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(func $~lib/memory/move_memory (; 15 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(if
(i32.eq
@ -3153,7 +3062,7 @@
)
)
)
(func $~lib/string/String#concat (; 20 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/string/String#concat (; 16 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -3240,7 +3149,7 @@
)
(get_local $2)
)
(func $~lib/string/String.__concat (; 21 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/string/String.__concat (; 17 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(if
(i32.eqz
(get_local $0)
@ -3254,7 +3163,7 @@
(get_local $1)
)
)
(func $~lib/string/String.__eq (; 22 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/string/String.__eq (; 18 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(if
(i32.eq
@ -3313,7 +3222,7 @@
)
)
)
(func $~lib/string/String.__ne (; 23 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/string/String.__ne (; 19 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(i32.eqz
(call $~lib/string/String.__eq
(get_local $0)
@ -3321,7 +3230,7 @@
)
)
)
(func $~lib/string/String.__gt (; 24 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/string/String.__gt (; 20 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(if
@ -3399,7 +3308,7 @@
(i32.const 0)
)
)
(func $~lib/string/String.__gte (; 25 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/string/String.__gte (; 21 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(if
@ -3479,7 +3388,7 @@
(i32.const 0)
)
)
(func $~lib/string/String.__lt (; 26 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/string/String.__lt (; 22 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(if
@ -3557,7 +3466,7 @@
(i32.const 0)
)
)
(func $~lib/string/String.__lte (; 27 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/string/String.__lte (; 23 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(if
@ -3637,7 +3546,7 @@
(i32.const 0)
)
)
(func $~lib/string/String#repeat (; 28 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/string/String#repeat (; 24 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -3767,26 +3676,7 @@
)
(get_local $4)
)
(func $~lib/string/String#repeat|trampoline (; 29 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(block $1of1
(block $0of1
(block $oob
(br_table $0of1 $1of1 $oob
(get_global $~argc)
)
)
(unreachable)
)
(set_local $1
(i32.const 0)
)
)
(call $~lib/string/String#repeat
(get_local $0)
(get_local $1)
)
)
(func $start (; 30 ;) (type $v)
(func $start (; 25 ;) (type $v)
(set_global $~lib/allocator/arena/startOffset
(i32.and
(i32.add
@ -3850,16 +3740,11 @@
)
)
(if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(i32.eqz
(call $~lib/string/String#startsWith|trampoline
(get_global $std/string/str)
(i32.const 104)
(i32.const 0)
)
(i32.eqz
(call $~lib/string/String#startsWith
(get_global $std/string/str)
(i32.const 104)
(i32.const 0)
)
)
(block
@ -3896,16 +3781,11 @@
)
)
(if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(i32.eqz
(call $~lib/string/String#includes|trampoline
(get_global $std/string/str)
(i32.const 140)
(i32.const 0)
)
(i32.eqz
(call $~lib/string/String#includes
(get_global $std/string/str)
(i32.const 140)
(i32.const 0)
)
)
(block
@ -3919,18 +3799,13 @@
)
)
(if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(i32.ne
(call $~lib/string/String#indexOf|trampoline
(get_global $std/string/str)
(i32.const 152)
(i32.const 0)
)
(i32.const 2)
(i32.ne
(call $~lib/string/String#indexOf
(get_global $std/string/str)
(i32.const 152)
(i32.const 0)
)
(i32.const 2)
)
(block
(call $abort
@ -3943,18 +3818,13 @@
)
)
(if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(i32.ne
(call $~lib/string/String#indexOf|trampoline
(get_global $std/string/str)
(i32.const 160)
(i32.const 0)
)
(i32.const -1)
(i32.ne
(call $~lib/string/String#indexOf
(get_global $std/string/str)
(i32.const 160)
(i32.const 0)
)
(i32.const -1)
)
(block
(call $abort
@ -3967,17 +3837,12 @@
)
)
(if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(f64.ne
(call $~lib/string/parseInt|trampoline
(i32.const 168)
(i32.const 0)
)
(f64.const 0)
(f64.ne
(call $~lib/string/parseInt
(i32.const 168)
(i32.const 0)
)
(f64.const 0)
)
(block
(call $abort
@ -3990,17 +3855,12 @@
)
)
(if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(f64.ne
(call $~lib/string/parseInt|trampoline
(i32.const 176)
(i32.const 0)
)
(f64.const 1)
(f64.ne
(call $~lib/string/parseInt
(i32.const 176)
(i32.const 0)
)
(f64.const 1)
)
(block
(call $abort
@ -4013,17 +3873,12 @@
)
)
(if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(f64.ne
(call $~lib/string/parseInt|trampoline
(i32.const 184)
(i32.const 0)
)
(f64.const 5)
(f64.ne
(call $~lib/string/parseInt
(i32.const 184)
(i32.const 0)
)
(f64.const 5)
)
(block
(call $abort
@ -4036,17 +3891,12 @@
)
)
(if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(f64.ne
(call $~lib/string/parseInt|trampoline
(i32.const 200)
(i32.const 0)
)
(f64.const 455)
(f64.ne
(call $~lib/string/parseInt
(i32.const 200)
(i32.const 0)
)
(f64.const 455)
)
(block
(call $abort
@ -4059,17 +3909,12 @@
)
)
(if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(f64.ne
(call $~lib/string/parseInt|trampoline
(i32.const 216)
(i32.const 0)
)
(f64.const 3855)
(f64.ne
(call $~lib/string/parseInt
(i32.const 216)
(i32.const 0)
)
(f64.const 3855)
)
(block
(call $abort
@ -4082,17 +3927,12 @@
)
)
(if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(f64.ne
(call $~lib/string/parseInt|trampoline
(i32.const 232)
(i32.const 0)
)
(f64.const 3855)
(f64.ne
(call $~lib/string/parseInt
(i32.const 232)
(i32.const 0)
)
(f64.const 3855)
)
(block
(call $abort
@ -4105,17 +3945,12 @@
)
)
(if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(f64.ne
(call $~lib/string/parseInt|trampoline
(i32.const 248)
(i32.const 0)
)
(f64.const 11)
(f64.ne
(call $~lib/string/parseInt
(i32.const 248)
(i32.const 0)
)
(f64.const 11)
)
(block
(call $abort
@ -4128,17 +3963,12 @@
)
)
(if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(f64.ne
(call $~lib/string/parseInt|trampoline
(i32.const 260)
(i32.const 0)
)
(f64.const 1)
(f64.ne
(call $~lib/string/parseInt
(i32.const 260)
(i32.const 0)
)
(f64.const 1)
)
(block
(call $abort
@ -4624,14 +4454,9 @@
(if
(i32.eqz
(call $~lib/string/String.__eq
(block (result i32)
(set_global $~argc
(i32.const 0)
)
(call $~lib/string/String#repeat|trampoline
(i32.const 316)
(i32.const 0)
)
(call $~lib/string/String#repeat
(i32.const 316)
(i32.const 0)
)
(i32.const 332)
)

View File

@ -18,8 +18,8 @@
(global $std/string/str (mut i32) (i32.const 4))
(global $std/string/nullStr (mut i32) (i32.const 0))
(global $~lib/internal/string/HEADER_SIZE i32 (i32.const 4))
(global $~argc (mut i32) (i32.const 0))
(global $~lib/internal/string/MAX_LENGTH i32 (i32.const 536870910))
(global $~argc (mut i32) (i32.const 0))
(global $NaN f64 (f64.const nan:0x8000000000000))
(global $~lib/internal/string/CharCode.PLUS i32 (i32.const 43))
(global $~lib/internal/string/CharCode.MINUS i32 (i32.const 45))
@ -302,30 +302,7 @@
)
)
)
(func $~lib/string/String#startsWith|trampoline (; 4 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(block $1of1
(block $0of1
(block $oob
(br_table $0of1 $1of1 $oob
(i32.sub
(get_global $~argc)
(i32.const 1)
)
)
)
(unreachable)
)
(set_local $2
(i32.const 0)
)
)
(call $~lib/string/String#startsWith
(get_local $0)
(get_local $1)
(get_local $2)
)
)
(func $~lib/string/String#endsWith (; 5 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func $~lib/string/String#endsWith (; 4 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@ -429,7 +406,7 @@
)
)
)
(func $~lib/string/String#endsWith|trampoline (; 6 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func $~lib/string/String#endsWith|trampoline (; 5 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(block $1of1
(block $0of1
(block $oob
@ -452,7 +429,7 @@
(get_local $2)
)
)
(func $~lib/string/String#indexOf (; 7 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func $~lib/string/String#indexOf (; 6 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@ -579,7 +556,7 @@
(i32.const -1)
)
)
(func $~lib/string/String#includes (; 8 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(func $~lib/string/String#includes (; 7 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(return
(i32.ne
(call $~lib/string/String#indexOf
@ -591,58 +568,12 @@
)
)
)
(func $~lib/string/String#includes|trampoline (; 9 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(block $1of1
(block $0of1
(block $oob
(br_table $0of1 $1of1 $oob
(i32.sub
(get_global $~argc)
(i32.const 1)
)
)
)
(unreachable)
)
(set_local $2
(i32.const 0)
)
)
(call $~lib/string/String#includes
(get_local $0)
(get_local $1)
(get_local $2)
)
)
(func $~lib/string/String#indexOf|trampoline (; 10 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(block $1of1
(block $0of1
(block $oob
(br_table $0of1 $1of1 $oob
(i32.sub
(get_global $~argc)
(i32.const 1)
)
)
)
(unreachable)
)
(set_local $2
(i32.const 0)
)
)
(call $~lib/string/String#indexOf
(get_local $0)
(get_local $1)
(get_local $2)
)
)
(func $std/string/getString (; 11 ;) (type $i) (result i32)
(func $std/string/getString (; 8 ;) (type $i) (result i32)
(return
(get_global $std/string/str)
)
)
(func $~lib/internal/string/parse<f64> (; 12 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64)
(func $~lib/internal/string/parse<f64> (; 9 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -1034,7 +965,7 @@
)
)
)
(func $~lib/string/parseInt (; 13 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64)
(func $~lib/string/parseInt (; 10 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64)
(return
(call $~lib/internal/string/parse<f64>
(get_local $0)
@ -1042,29 +973,7 @@
)
)
)
(func $~lib/string/parseInt|trampoline (; 14 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64)
(block $1of1
(block $0of1
(block $oob
(br_table $0of1 $1of1 $oob
(i32.sub
(get_global $~argc)
(i32.const 1)
)
)
)
(unreachable)
)
(set_local $1
(i32.const 0)
)
)
(call $~lib/string/parseInt
(get_local $0)
(get_local $1)
)
)
(func $~lib/string/parseFloat (; 15 ;) (type $iF) (param $0 i32) (result f64)
(func $~lib/string/parseFloat (; 11 ;) (type $iF) (param $0 i32) (result f64)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@ -1343,7 +1252,7 @@
)
)
)
(func $~lib/allocator/arena/allocate_memory (; 16 ;) (type $ii) (param $0 i32) (result i32)
(func $~lib/allocator/arena/allocate_memory (; 12 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
@ -1453,7 +1362,7 @@
(i32.const 0)
)
)
(func $~lib/internal/string/allocate (; 17 ;) (type $ii) (param $0 i32) (result i32)
(func $~lib/internal/string/allocate (; 13 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(if
@ -1501,7 +1410,7 @@
(get_local $2)
)
)
(func $~lib/memory/copy_memory (; 18 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(func $~lib/memory/copy_memory (; 14 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
@ -3303,7 +3212,7 @@
)
)
)
(func $~lib/memory/move_memory (; 19 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(func $~lib/memory/move_memory (; 15 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i32)
(if
(i32.eq
@ -3621,7 +3530,7 @@
)
)
)
(func $~lib/string/String#concat (; 20 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/string/String#concat (; 16 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -3720,7 +3629,7 @@
(get_local $5)
)
)
(func $~lib/string/String.__concat (; 21 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/string/String.__concat (; 17 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(if
(i32.eqz
(get_local $0)
@ -3736,7 +3645,7 @@
)
)
)
(func $~lib/string/String.__eq (; 22 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/string/String.__eq (; 18 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(if
@ -3801,7 +3710,7 @@
)
)
)
(func $~lib/string/String.__ne (; 23 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/string/String.__ne (; 19 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(return
(i32.eqz
(call $~lib/string/String.__eq
@ -3811,7 +3720,7 @@
)
)
)
(func $~lib/string/String.__gt (; 24 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/string/String.__gt (; 20 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -3904,7 +3813,7 @@
)
)
)
(func $~lib/string/String.__gte (; 25 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/string/String.__gte (; 21 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -3999,7 +3908,7 @@
)
)
)
(func $~lib/string/String.__lt (; 26 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/string/String.__lt (; 22 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -4092,7 +4001,7 @@
)
)
)
(func $~lib/string/String.__lte (; 27 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/string/String.__lte (; 23 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -4187,7 +4096,7 @@
)
)
)
(func $~lib/string/String#repeat (; 28 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/string/String#repeat (; 24 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
@ -4333,26 +4242,7 @@
(get_local $4)
)
)
(func $~lib/string/String#repeat|trampoline (; 29 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(block $1of1
(block $0of1
(block $oob
(br_table $0of1 $1of1 $oob
(get_global $~argc)
)
)
(unreachable)
)
(set_local $1
(i32.const 0)
)
)
(call $~lib/string/String#repeat
(get_local $0)
(get_local $1)
)
)
(func $start (; 30 ;) (type $v)
(func $start (; 25 ;) (type $v)
(set_global $~lib/allocator/arena/startOffset
(i32.and
(i32.add
@ -4426,15 +4316,10 @@
)
(if
(i32.eqz
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/String#startsWith|trampoline
(get_global $std/string/str)
(i32.const 104)
(i32.const 0)
)
(call $~lib/string/String#startsWith
(get_global $std/string/str)
(i32.const 104)
(i32.const 0)
)
)
(block
@ -4472,15 +4357,10 @@
)
(if
(i32.eqz
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/String#includes|trampoline
(get_global $std/string/str)
(i32.const 140)
(i32.const 0)
)
(call $~lib/string/String#includes
(get_global $std/string/str)
(i32.const 140)
(i32.const 0)
)
)
(block
@ -4496,15 +4376,10 @@
(if
(i32.eqz
(i32.eq
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/String#indexOf|trampoline
(get_global $std/string/str)
(i32.const 152)
(i32.const 0)
)
(call $~lib/string/String#indexOf
(get_global $std/string/str)
(i32.const 152)
(i32.const 0)
)
(i32.const 2)
)
@ -4522,15 +4397,10 @@
(if
(i32.eqz
(i32.eq
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/String#indexOf|trampoline
(get_global $std/string/str)
(i32.const 160)
(i32.const 0)
)
(call $~lib/string/String#indexOf
(get_global $std/string/str)
(i32.const 160)
(i32.const 0)
)
(i32.const -1)
)
@ -4548,14 +4418,9 @@
(if
(i32.eqz
(f64.eq
(block (result f64)
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/parseInt|trampoline
(i32.const 168)
(i32.const 0)
)
(call $~lib/string/parseInt
(i32.const 168)
(i32.const 0)
)
(f64.const 0)
)
@ -4573,14 +4438,9 @@
(if
(i32.eqz
(f64.eq
(block (result f64)
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/parseInt|trampoline
(i32.const 176)
(i32.const 0)
)
(call $~lib/string/parseInt
(i32.const 176)
(i32.const 0)
)
(f64.const 1)
)
@ -4598,14 +4458,9 @@
(if
(i32.eqz
(f64.eq
(block (result f64)
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/parseInt|trampoline
(i32.const 184)
(i32.const 0)
)
(call $~lib/string/parseInt
(i32.const 184)
(i32.const 0)
)
(f64.const 5)
)
@ -4623,14 +4478,9 @@
(if
(i32.eqz
(f64.eq
(block (result f64)
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/parseInt|trampoline
(i32.const 200)
(i32.const 0)
)
(call $~lib/string/parseInt
(i32.const 200)
(i32.const 0)
)
(f64.const 455)
)
@ -4648,14 +4498,9 @@
(if
(i32.eqz
(f64.eq
(block (result f64)
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/parseInt|trampoline
(i32.const 216)
(i32.const 0)
)
(call $~lib/string/parseInt
(i32.const 216)
(i32.const 0)
)
(f64.const 3855)
)
@ -4673,14 +4518,9 @@
(if
(i32.eqz
(f64.eq
(block (result f64)
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/parseInt|trampoline
(i32.const 232)
(i32.const 0)
)
(call $~lib/string/parseInt
(i32.const 232)
(i32.const 0)
)
(f64.const 3855)
)
@ -4698,14 +4538,9 @@
(if
(i32.eqz
(f64.eq
(block (result f64)
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/parseInt|trampoline
(i32.const 248)
(i32.const 0)
)
(call $~lib/string/parseInt
(i32.const 248)
(i32.const 0)
)
(f64.const 11)
)
@ -4723,14 +4558,9 @@
(if
(i32.eqz
(f64.eq
(block (result f64)
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/parseInt|trampoline
(i32.const 260)
(i32.const 0)
)
(call $~lib/string/parseInt
(i32.const 260)
(i32.const 0)
)
(f64.const 1)
)
@ -5259,14 +5089,9 @@
(if
(i32.eqz
(call $~lib/string/String.__eq
(block (result i32)
(set_global $~argc
(i32.const 0)
)
(call $~lib/string/String#repeat|trampoline
(i32.const 316)
(i32.const 0)
)
(call $~lib/string/String#repeat
(i32.const 316)
(i32.const 0)
)
(i32.const 332)
)