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" reportNode.range, "1", typeArguments ? typeArguments.length.toString(10) : "0"
); );
return module.createUnreachable(); 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) { if (operands.length != 1) {
compiler.error( compiler.error(
@ -1963,11 +1956,11 @@ export function compileCall(
} }
arg0 = compiler.compileExpressionRetainType( arg0 = compiler.compileExpressionRetainType(
operands[0], operands[0],
compiler.options.usizeType, typeArguments[0],
WrapMode.NONE WrapMode.NONE
); );
compiler.currentType = typeArguments[0]; compiler.currentType = typeArguments[0];
if (compiler.currentType.kind != TypeKind.USIZE) { if (compiler.currentType.size != typeArguments[0].size) {
compiler.error( compiler.error(
DiagnosticCode.Operation_not_supported, DiagnosticCode.Operation_not_supported,
reportNode.range 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 // Compile the called function's body in the scope of the inlined flow
var bodyStatement = assert(declaration.body); 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; let statements = (<BlockStatement>bodyStatement).statements;
for (let i = 0, k = statements.length; i < k; ++i) { 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 { } else {
body.push(this.compileStatement(bodyStatement)); body.push(this.compileStatement(bodyStatement));
@ -5290,17 +5294,39 @@ export class Compiler extends DiagnosticEmitter {
var returnType = instance.signature.returnType; var returnType = instance.signature.returnType;
var isCallImport = instance.is(CommonFlags.MODULE_IMPORT); 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 (numOperands < maxOperands) {
if (!operands) { if (!operands) {
operands = new Array(maxOperands); operands = new Array(maxOperands);
operands.length = 0; operands.length = 0;
} }
let parameterTypes = instance.signature.parameterTypes; let parameterTypes = instance.signature.parameterTypes;
let parameterNodes = instance.prototype.declaration.signature.parameterTypes;
let allOptionalsAreConstant = true;
for (let i = numArguments; i < maxArguments; ++i) {
let initializer = assert(parameterNodes[i].initializer);
if (initializer.kind != NodeKind.LITERAL) {
// TODO: other kinds might be constant as well
allOptionalsAreConstant = false;
break;
}
}
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) { for (let i = numArguments; i < maxArguments; ++i) {
operands.push(parameterTypes[i].toNativeZero(module)); operands.push(parameterTypes[i].toNativeZero(module));
} }
if (!isCallImport) { // call the trampoline if (!isCallImport) {
let original = instance; let original = instance;
instance = this.ensureTrampoline(instance); instance = this.ensureTrampoline(instance);
if (!this.compileFunction(instance)) return module.createUnreachable(); if (!this.compileFunction(instance)) return module.createUnreachable();
@ -5314,6 +5340,7 @@ export class Compiler extends DiagnosticEmitter {
], nativeReturnType); ], nativeReturnType);
} }
} }
}
// otherwise just call through // otherwise just call through
this.currentType = returnType; this.currentType = returnType;
@ -6211,8 +6238,8 @@ export class Compiler extends DiagnosticEmitter {
getExpressionType(condExprPrecomp) == NativeType.I32 getExpressionType(condExprPrecomp) == NativeType.I32
) { ) {
return getConstValueI32(condExprPrecomp) return getConstValueI32(condExprPrecomp)
? this.compileExpression(ifThen, contextualType, ConversionKind.IMPLICIT, WrapMode.NONE) ? this.compileExpressionRetainType(ifThen, contextualType, WrapMode.NONE)
: this.compileExpression(ifElse, contextualType, ConversionKind.IMPLICIT, WrapMode.NONE); : this.compileExpressionRetainType(ifElse, contextualType, WrapMode.NONE);
// Otherwise recompile to the original and let the optimizer decide // Otherwise recompile to the original and let the optimizer decide
} else /* if (condExpr != condExprPrecomp) <- not guaranteed */ { } else /* if (condExpr != condExprPrecomp) <- not guaranteed */ {

View File

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

View File

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

View File

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

View File

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

View File

@ -2,60 +2,71 @@ import {
HEADER_SIZE as HEADER_SIZE_STR HEADER_SIZE as HEADER_SIZE_STR
} from "./string"; } 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/ // FNV-1a 32-bit as a starting point, see: http://isthe.com/chongo/tech/comp/fnv/
const FNV_OFFSET: u32 = 2166136261; const FNV_OFFSET: u32 = 2166136261;
const FNV_PRIME: u32 = 16777619; const FNV_PRIME: u32 = 16777619;
export function hash<T>(key: T): u32 { function hash8(key: u32): u32 {
var hash: u32 = FNV_OFFSET; return (FNV_OFFSET ^ key) * FNV_PRIME;
if (isString(key)) { }
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) { 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; v = (v ^ <u32>load<u8>(changetype<usize>(key) + i, HEADER_SIZE_STR)) * FNV_PRIME;
} }
} else if (isFloat(key)) { return v;
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;
} }

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -10,11 +10,10 @@
(start $start) (start $start)
(func $scoped/fn (; 0 ;) (type $iv) (param $0 i32) (func $scoped/fn (; 0 ;) (type $iv) (param $0 i32)
(local $1 i32) (local $1 i32)
(local $2 i32)
(set_local $1 (set_local $1
(i32.const 0) (i32.const 0)
) )
(set_local $2 (set_local $1
(get_local $0) (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 $iiii (func (param i32 i32 i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32))) (type $iiiiv (func (param i32 i32 i32 i32)))
(import "env" "abort" (func $abort (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) (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 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") (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) (func $std/array-access/stringArrayMethodCall (; 6 ;) (type $ii) (param $0 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 (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 (call $~lib/array/Array<Array<i32>>#__get
(get_local $0) (get_local $0)
(i32.const 0) (i32.const 0)
@ -244,7 +217,7 @@
(i32.const 0) (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 (i32.load
(call $~lib/array/Array<Array<i32>>#__get (call $~lib/array/Array<Array<i32>>#__get
(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) (func $std/array-access/stringArrayArrayMethodCall (; 8 ;) (type $ii) (param $0 i32) (result i32)
(set_global $~argc (call $~lib/string/String#startsWith
(i32.const 1)
)
(call $~lib/string/String#startsWith|trampoline
(call $~lib/array/Array<Array<i32>>#__get (call $~lib/array/Array<Array<i32>>#__get
(call $~lib/array/Array<Array<i32>>#__get (call $~lib/array/Array<Array<i32>>#__get
(get_local $0) (get_local $0)

View File

@ -9,7 +9,6 @@
(global $~lib/internal/allocator/AL_MASK i32 (i32.const 7)) (global $~lib/internal/allocator/AL_MASK i32 (i32.const 7))
(global $~lib/internal/arraybuffer/HEADER_SIZE i32 (i32.const 8)) (global $~lib/internal/arraybuffer/HEADER_SIZE i32 (i32.const 8))
(global $~lib/internal/string/HEADER_SIZE i32 (i32.const 4)) (global $~lib/internal/string/HEADER_SIZE i32 (i32.const 4))
(global $~argc (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 52)) (global $HEAP_BASE i32 (i32.const 52))
(memory $0 1) (memory $0 1)
(data (i32.const 4) "\00\00\00\00") (data (i32.const 4) "\00\00\00\00")
@ -321,36 +320,9 @@
) )
) )
) )
(func $~lib/string/String#startsWith|trampoline (; 8 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (func $std/array-access/stringArrayMethodCall (; 8 ;) (type $ii) (param $0 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 $std/array-access/stringArrayMethodCall (; 9 ;) (type $ii) (param $0 i32) (result i32)
(return (return
(block (result i32) (call $~lib/string/String#startsWith
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/String#startsWith|trampoline
(call $~lib/array/Array<String>#__get (call $~lib/array/Array<String>#__get
(get_local $0) (get_local $0)
(i32.const 0) (i32.const 0)
@ -360,8 +332,7 @@
) )
) )
) )
) (func $~lib/array/Array<Array<String>>#__get (; 9 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/array/Array<Array<String>>#__get (; 10 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32) (local $2 i32)
(set_local $2 (set_local $2
(i32.load (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 (return
(i32.load (i32.load
(call $~lib/array/Array<String>#__get (call $~lib/array/Array<String>#__get
@ -409,13 +380,9 @@
) )
) )
) )
(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 (return
(block (result i32) (call $~lib/string/String#startsWith
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/String#startsWith|trampoline
(call $~lib/array/Array<String>#__get (call $~lib/array/Array<String>#__get
(call $~lib/array/Array<Array<String>>#__get (call $~lib/array/Array<Array<String>>#__get
(get_local $0) (get_local $0)
@ -429,4 +396,3 @@
) )
) )
) )
)

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

View File

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

View File

@ -1,8 +1,7 @@
(module (module
(type $ii (func (param i32) (result i32))) (type $ii (func (param i32) (result i32)))
(type $iv (func (param i32))) (type $iv (func (param i32)))
(type $fi (func (param f32) (result i32))) (type $Ii (func (param i64) (result i32)))
(type $Fi (func (param f64) (result i32)))
(type $v (func)) (type $v (func))
(import "env" "logi" (func $std/hash/logi (param i32))) (import "env" "logi" (func $std/hash/logi (param i32)))
(global $~lib/internal/allocator/AL_BITS i32 (i32.const 3)) (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") (data (i32.const 24) "\03\00\00\00a\00b\00c\00")
(export "memory" (memory $0)) (export "memory" (memory $0))
(start $start) (start $start)
(func $~lib/internal/hash/hash<usize> (; 1 ;) (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)
(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)
(local $1 i32) (local $1 i32)
(local $2 i32) (local $2 i32)
(local $3 i32) (local $3 i32)
@ -150,24 +80,17 @@
(get_local $1) (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) (local $1 i32)
(local $2 i32)
(set_local $1 (set_local $1
(i32.const -2128831035) (i32.const -2128831035)
) )
(block
(set_local $2
(i32.reinterpret/f32
(get_local $0)
)
)
(set_local $1 (set_local $1
(i32.mul (i32.mul
(i32.xor (i32.xor
(get_local $1) (get_local $1)
(i32.and (i32.and
(get_local $2) (get_local $0)
(i32.const 255) (i32.const 255)
) )
) )
@ -180,7 +103,7 @@
(get_local $1) (get_local $1)
(i32.and (i32.and
(i32.shr_u (i32.shr_u
(get_local $2) (get_local $0)
(i32.const 8) (i32.const 8)
) )
(i32.const 255) (i32.const 255)
@ -195,7 +118,7 @@
(get_local $1) (get_local $1)
(i32.and (i32.and
(i32.shr_u (i32.shr_u
(get_local $2) (get_local $0)
(i32.const 16) (i32.const 16)
) )
(i32.const 255) (i32.const 255)
@ -209,64 +132,56 @@
(i32.xor (i32.xor
(get_local $1) (get_local $1)
(i32.shr_u (i32.shr_u
(get_local $2) (get_local $0)
(i32.const 24) (i32.const 24)
) )
) )
(i32.const 16777619) (i32.const 16777619)
) )
) )
)
(return (return
(get_local $1) (get_local $1)
) )
) )
(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 $1 i32)
(local $2 i64) (local $2 i32)
(local $3 i32) (local $3 i32)
(local $4 i32)
(set_local $1 (set_local $1
(i32.const -2128831035) (i32.wrap/i64
)
(block
(set_local $2
(i64.reinterpret/f64
(get_local $0) (get_local $0)
) )
) )
(set_local $3 (set_local $2
(i32.wrap/i64
(get_local $2)
)
)
(set_local $4
(i32.wrap/i64 (i32.wrap/i64
(i64.shr_u (i64.shr_u
(get_local $2) (get_local $0)
(i64.const 32) (i64.const 32)
) )
) )
) )
(set_local $1 (set_local $3
(i32.const -2128831035)
)
(set_local $3
(i32.mul (i32.mul
(i32.xor (i32.xor
(get_local $1)
(i32.and
(get_local $3) (get_local $3)
(i32.and
(get_local $1)
(i32.const 255) (i32.const 255)
) )
) )
(i32.const 16777619) (i32.const 16777619)
) )
) )
(set_local $1 (set_local $3
(i32.mul (i32.mul
(i32.xor (i32.xor
(get_local $1) (get_local $3)
(i32.and (i32.and
(i32.shr_u (i32.shr_u
(get_local $3) (get_local $1)
(i32.const 8) (i32.const 8)
) )
(i32.const 255) (i32.const 255)
@ -275,13 +190,13 @@
(i32.const 16777619) (i32.const 16777619)
) )
) )
(set_local $1 (set_local $3
(i32.mul (i32.mul
(i32.xor (i32.xor
(get_local $1) (get_local $3)
(i32.and (i32.and
(i32.shr_u (i32.shr_u
(get_local $3) (get_local $1)
(i32.const 16) (i32.const 16)
) )
(i32.const 255) (i32.const 255)
@ -290,37 +205,37 @@
(i32.const 16777619) (i32.const 16777619)
) )
) )
(set_local $1 (set_local $3
(i32.mul (i32.mul
(i32.xor (i32.xor
(get_local $1)
(i32.shr_u
(get_local $3) (get_local $3)
(i32.shr_u
(get_local $1)
(i32.const 24) (i32.const 24)
) )
) )
(i32.const 16777619) (i32.const 16777619)
) )
) )
(set_local $1 (set_local $3
(i32.mul (i32.mul
(i32.xor (i32.xor
(get_local $1) (get_local $3)
(i32.and (i32.and
(get_local $4) (get_local $2)
(i32.const 255) (i32.const 255)
) )
) )
(i32.const 16777619) (i32.const 16777619)
) )
) )
(set_local $1 (set_local $3
(i32.mul (i32.mul
(i32.xor (i32.xor
(get_local $1) (get_local $3)
(i32.and (i32.and
(i32.shr_u (i32.shr_u
(get_local $4) (get_local $2)
(i32.const 8) (i32.const 8)
) )
(i32.const 255) (i32.const 255)
@ -329,13 +244,13 @@
(i32.const 16777619) (i32.const 16777619)
) )
) )
(set_local $1 (set_local $3
(i32.mul (i32.mul
(i32.xor (i32.xor
(get_local $1) (get_local $3)
(i32.and (i32.and
(i32.shr_u (i32.shr_u
(get_local $4) (get_local $2)
(i32.const 16) (i32.const 16)
) )
(i32.const 255) (i32.const 255)
@ -344,108 +259,253 @@
(i32.const 16777619) (i32.const 16777619)
) )
) )
(set_local $1 (set_local $3
(i32.mul (i32.mul
(i32.xor (i32.xor
(get_local $1) (get_local $3)
(i32.shr_u (i32.shr_u
(get_local $4) (get_local $2)
(i32.const 24) (i32.const 24)
) )
) )
(i32.const 16777619) (i32.const 16777619)
) )
) )
)
(return (return
(get_local $3)
)
)
(func $start (; 4 ;) (type $v)
(local $0 i32)
(local $1 f32)
(local $2 f64)
(call $std/hash/logi
(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
(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
(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
(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
(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
(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) (get_local $1)
) )
) )
(func $start (; 5 ;) (type $v) )
(call $std/hash/logi
(call $~lib/internal/hash/hash<usize>
(i32.const 0)
) )
) )
(call $std/hash/logi (call $std/hash/logi
(call $~lib/internal/hash/hash<String> (block $~lib/internal/hash/hash<f32>|inlined.1 (result i32)
(i32.const 4) (set_local $1
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<String>
(i32.const 8)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<String>
(i32.const 16)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<String>
(i32.const 24)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f32>
(f32.const 0)
)
)
(call $std/hash/logi
(call $~lib/internal/hash/hash<f32>
(f32.const 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 $std/hash/logi
(call $~lib/internal/hash/hash<f32> (block $~lib/internal/hash/hash<f32>|inlined.2 (result i32)
(set_local $1
(f32.const 1.100000023841858) (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 $std/hash/logi
(call $~lib/internal/hash/hash<f32> (block $~lib/internal/hash/hash<f32>|inlined.3 (result i32)
(set_local $1
(f32.const 0) (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 $std/hash/logi
(call $~lib/internal/hash/hash<f32> (block $~lib/internal/hash/hash<f32>|inlined.4 (result i32)
(set_local $1
(f32.const inf) (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 $std/hash/logi
(call $~lib/internal/hash/hash<f32> (block $~lib/internal/hash/hash<f32>|inlined.5 (result i32)
(set_local $1
(f32.const nan:0x400000) (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 $std/hash/logi
(call $~lib/internal/hash/hash<f64> (block $~lib/internal/hash/hash<f64>|inlined.0 (result i32)
(set_local $2
(f64.const 0) (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 $std/hash/logi
(call $~lib/internal/hash/hash<f64> (block $~lib/internal/hash/hash<f64>|inlined.1 (result i32)
(set_local $2
(f64.const 1) (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 $std/hash/logi
(call $~lib/internal/hash/hash<f64> (block $~lib/internal/hash/hash<f64>|inlined.2 (result i32)
(set_local $2
(f64.const 1.1) (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 $std/hash/logi
(call $~lib/internal/hash/hash<f64> (block $~lib/internal/hash/hash<f64>|inlined.3 (result i32)
(set_local $2
(f64.const 0) (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 $std/hash/logi
(call $~lib/internal/hash/hash<f64> (block $~lib/internal/hash/hash<f64>|inlined.4 (result i32)
(set_local $2
(f64.const inf) (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 $std/hash/logi
(call $~lib/internal/hash/hash<f64> (block $~lib/internal/hash/hash<f64>|inlined.5 (result i32)
(set_local $2
(f64.const nan:0x8000000000000) (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) (call $~lib/math/JSMath.random)
) )
) )
(set_local $1 (set_local $0
(i32.const 0) (i32.const 0)
) )
(loop $continue|1 (loop $continue|1
(if (if
(f64.lt (f64.lt
(f64.convert_s/i32 (f64.convert_s/i32
(get_local $1) (get_local $0)
) )
(f64.const 1e6) (f64.const 1e6)
) )
@ -44310,7 +44310,7 @@
(if (if
(i32.eqz (i32.eqz
(if (result i32) (if (result i32)
(tee_local $0 (tee_local $1
(f32.ge (f32.ge
(tee_local $3 (tee_local $3
(call $~lib/math/NativeMathf.random) (call $~lib/math/NativeMathf.random)
@ -44322,7 +44322,7 @@
(get_local $3) (get_local $3)
(f32.const 1) (f32.const 1)
) )
(get_local $0) (get_local $1)
) )
) )
(block (block
@ -44335,9 +44335,9 @@
(unreachable) (unreachable)
) )
) )
(set_local $1 (set_local $0
(i32.add (i32.add
(get_local $1) (get_local $0)
(i32.const 1) (i32.const 1)
) )
) )

File diff suppressed because it is too large Load Diff

View File

@ -2767,7 +2767,7 @@
(if (if
(i32.eqz (i32.eqz
(if (result i32) (if (result i32)
(tee_local $0 (tee_local $1
(i32.eq (i32.eq
(i32.load (i32.load
(get_global $std/operator-overloading/ais) (get_global $std/operator-overloading/ais)
@ -2781,7 +2781,7 @@
) )
(i32.const 5) (i32.const 5)
) )
(get_local $0) (get_local $1)
) )
) )
(block (block
@ -2813,22 +2813,22 @@
(i32.const 0) (i32.const 0)
(i32.add (i32.add
(i32.load (i32.load
(tee_local $0 (tee_local $1
(get_global $std/operator-overloading/aii1) (get_global $std/operator-overloading/aii1)
) )
) )
(i32.load (i32.load
(tee_local $1 (tee_local $0
(get_global $std/operator-overloading/aii2) (get_global $std/operator-overloading/aii2)
) )
) )
) )
(i32.add (i32.add
(i32.load offset=4 (i32.load offset=4
(get_local $0) (get_local $1)
) )
(i32.load offset=4 (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) (func $~lib/string/String#endsWith (; 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)
(local $3 i32) (local $3 i32)
(if (if
(i32.eqz (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 $1of1
(block $0of1 (block $0of1
(block $oob (block $oob
@ -369,7 +346,7 @@
(get_local $2) (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 $3 i32)
(local $4 i32) (local $4 i32)
(local $5 i32) (local $5 i32)
@ -474,7 +451,7 @@
) )
(i32.const -1) (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 (i32.ne
(call $~lib/string/String#indexOf (call $~lib/string/String#indexOf
(get_local $0) (get_local $0)
@ -484,56 +461,10 @@
(i32.const -1) (i32.const -1)
) )
) )
(func $~lib/string/String#includes|trampoline (; 9 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (func $std/string/getString (; 8 ;) (type $i) (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)
(get_global $std/string/str) (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 $2 i32)
(local $3 i32) (local $3 i32)
(local $4 i32) (local $4 i32)
@ -879,35 +810,13 @@
(get_local $5) (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> (call $~lib/internal/string/parse<f64>
(get_local $0) (get_local $0)
(get_local $1) (get_local $1)
) )
) )
(func $~lib/string/parseInt|trampoline (; 14 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) (func $~lib/string/parseFloat (; 11 ;) (type $iF) (param $0 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)
(local $1 i32) (local $1 i32)
(local $2 i32) (local $2 i32)
(local $3 i32) (local $3 i32)
@ -1157,7 +1066,7 @@
(get_local $4) (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 $1 i32)
(local $2 i32) (local $2 i32)
(local $3 i32) (local $3 i32)
@ -1246,7 +1155,7 @@
) )
(i32.const 0) (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 $1 i32)
(if (if
(i32.eqz (i32.eqz
@ -1290,7 +1199,7 @@
) )
(get_local $1) (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 $3 i32)
(local $4 i32) (local $4 i32)
(loop $continue|0 (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) (local $3 i32)
(if (if
(i32.eq (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 $2 i32)
(local $3 i32) (local $3 i32)
(local $4 i32) (local $4 i32)
@ -3240,7 +3149,7 @@
) )
(get_local $2) (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 (if
(i32.eqz (i32.eqz
(get_local $0) (get_local $0)
@ -3254,7 +3163,7 @@
(get_local $1) (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) (local $2 i32)
(if (if
(i32.eq (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 (i32.eqz
(call $~lib/string/String.__eq (call $~lib/string/String.__eq
(get_local $0) (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 $2 i32)
(local $3 i32) (local $3 i32)
(if (if
@ -3399,7 +3308,7 @@
(i32.const 0) (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 $2 i32)
(local $3 i32) (local $3 i32)
(if (if
@ -3479,7 +3388,7 @@
(i32.const 0) (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 $2 i32)
(local $3 i32) (local $3 i32)
(if (if
@ -3557,7 +3466,7 @@
(i32.const 0) (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 $2 i32)
(local $3 i32) (local $3 i32)
(if (if
@ -3637,7 +3546,7 @@
(i32.const 0) (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 $2 i32)
(local $3 i32) (local $3 i32)
(local $4 i32) (local $4 i32)
@ -3767,26 +3676,7 @@
) )
(get_local $4) (get_local $4)
) )
(func $~lib/string/String#repeat|trampoline (; 29 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $start (; 25 ;) (type $v)
(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)
(set_global $~lib/allocator/arena/startOffset (set_global $~lib/allocator/arena/startOffset
(i32.and (i32.and
(i32.add (i32.add
@ -3850,18 +3740,13 @@
) )
) )
(if (if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(i32.eqz (i32.eqz
(call $~lib/string/String#startsWith|trampoline (call $~lib/string/String#startsWith
(get_global $std/string/str) (get_global $std/string/str)
(i32.const 104) (i32.const 104)
(i32.const 0) (i32.const 0)
) )
) )
)
(block (block
(call $abort (call $abort
(i32.const 0) (i32.const 0)
@ -3896,18 +3781,13 @@
) )
) )
(if (if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(i32.eqz (i32.eqz
(call $~lib/string/String#includes|trampoline (call $~lib/string/String#includes
(get_global $std/string/str) (get_global $std/string/str)
(i32.const 140) (i32.const 140)
(i32.const 0) (i32.const 0)
) )
) )
)
(block (block
(call $abort (call $abort
(i32.const 0) (i32.const 0)
@ -3919,19 +3799,14 @@
) )
) )
(if (if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(i32.ne (i32.ne
(call $~lib/string/String#indexOf|trampoline (call $~lib/string/String#indexOf
(get_global $std/string/str) (get_global $std/string/str)
(i32.const 152) (i32.const 152)
(i32.const 0) (i32.const 0)
) )
(i32.const 2) (i32.const 2)
) )
)
(block (block
(call $abort (call $abort
(i32.const 0) (i32.const 0)
@ -3943,19 +3818,14 @@
) )
) )
(if (if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(i32.ne (i32.ne
(call $~lib/string/String#indexOf|trampoline (call $~lib/string/String#indexOf
(get_global $std/string/str) (get_global $std/string/str)
(i32.const 160) (i32.const 160)
(i32.const 0) (i32.const 0)
) )
(i32.const -1) (i32.const -1)
) )
)
(block (block
(call $abort (call $abort
(i32.const 0) (i32.const 0)
@ -3967,18 +3837,13 @@
) )
) )
(if (if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(f64.ne (f64.ne
(call $~lib/string/parseInt|trampoline (call $~lib/string/parseInt
(i32.const 168) (i32.const 168)
(i32.const 0) (i32.const 0)
) )
(f64.const 0) (f64.const 0)
) )
)
(block (block
(call $abort (call $abort
(i32.const 0) (i32.const 0)
@ -3990,18 +3855,13 @@
) )
) )
(if (if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(f64.ne (f64.ne
(call $~lib/string/parseInt|trampoline (call $~lib/string/parseInt
(i32.const 176) (i32.const 176)
(i32.const 0) (i32.const 0)
) )
(f64.const 1) (f64.const 1)
) )
)
(block (block
(call $abort (call $abort
(i32.const 0) (i32.const 0)
@ -4013,18 +3873,13 @@
) )
) )
(if (if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(f64.ne (f64.ne
(call $~lib/string/parseInt|trampoline (call $~lib/string/parseInt
(i32.const 184) (i32.const 184)
(i32.const 0) (i32.const 0)
) )
(f64.const 5) (f64.const 5)
) )
)
(block (block
(call $abort (call $abort
(i32.const 0) (i32.const 0)
@ -4036,18 +3891,13 @@
) )
) )
(if (if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(f64.ne (f64.ne
(call $~lib/string/parseInt|trampoline (call $~lib/string/parseInt
(i32.const 200) (i32.const 200)
(i32.const 0) (i32.const 0)
) )
(f64.const 455) (f64.const 455)
) )
)
(block (block
(call $abort (call $abort
(i32.const 0) (i32.const 0)
@ -4059,18 +3909,13 @@
) )
) )
(if (if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(f64.ne (f64.ne
(call $~lib/string/parseInt|trampoline (call $~lib/string/parseInt
(i32.const 216) (i32.const 216)
(i32.const 0) (i32.const 0)
) )
(f64.const 3855) (f64.const 3855)
) )
)
(block (block
(call $abort (call $abort
(i32.const 0) (i32.const 0)
@ -4082,18 +3927,13 @@
) )
) )
(if (if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(f64.ne (f64.ne
(call $~lib/string/parseInt|trampoline (call $~lib/string/parseInt
(i32.const 232) (i32.const 232)
(i32.const 0) (i32.const 0)
) )
(f64.const 3855) (f64.const 3855)
) )
)
(block (block
(call $abort (call $abort
(i32.const 0) (i32.const 0)
@ -4105,18 +3945,13 @@
) )
) )
(if (if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(f64.ne (f64.ne
(call $~lib/string/parseInt|trampoline (call $~lib/string/parseInt
(i32.const 248) (i32.const 248)
(i32.const 0) (i32.const 0)
) )
(f64.const 11) (f64.const 11)
) )
)
(block (block
(call $abort (call $abort
(i32.const 0) (i32.const 0)
@ -4128,18 +3963,13 @@
) )
) )
(if (if
(block (result i32)
(set_global $~argc
(i32.const 1)
)
(f64.ne (f64.ne
(call $~lib/string/parseInt|trampoline (call $~lib/string/parseInt
(i32.const 260) (i32.const 260)
(i32.const 0) (i32.const 0)
) )
(f64.const 1) (f64.const 1)
) )
)
(block (block
(call $abort (call $abort
(i32.const 0) (i32.const 0)
@ -4624,15 +4454,10 @@
(if (if
(i32.eqz (i32.eqz
(call $~lib/string/String.__eq (call $~lib/string/String.__eq
(block (result i32) (call $~lib/string/String#repeat
(set_global $~argc
(i32.const 0)
)
(call $~lib/string/String#repeat|trampoline
(i32.const 316) (i32.const 316)
(i32.const 0) (i32.const 0)
) )
)
(i32.const 332) (i32.const 332)
) )
) )

View File

@ -18,8 +18,8 @@
(global $std/string/str (mut i32) (i32.const 4)) (global $std/string/str (mut i32) (i32.const 4))
(global $std/string/nullStr (mut i32) (i32.const 0)) (global $std/string/nullStr (mut i32) (i32.const 0))
(global $~lib/internal/string/HEADER_SIZE i32 (i32.const 4)) (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 $~lib/internal/string/MAX_LENGTH i32 (i32.const 536870910))
(global $~argc (mut i32) (i32.const 0))
(global $NaN f64 (f64.const nan:0x8000000000000)) (global $NaN f64 (f64.const nan:0x8000000000000))
(global $~lib/internal/string/CharCode.PLUS i32 (i32.const 43)) (global $~lib/internal/string/CharCode.PLUS i32 (i32.const 43))
(global $~lib/internal/string/CharCode.MINUS i32 (i32.const 45)) (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) (func $~lib/string/String#endsWith (; 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)
(local $3 i32) (local $3 i32)
(local $4 i32) (local $4 i32)
(local $5 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 $1of1
(block $0of1 (block $0of1
(block $oob (block $oob
@ -452,7 +429,7 @@
(get_local $2) (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 $3 i32)
(local $4 i32) (local $4 i32)
(local $5 i32) (local $5 i32)
@ -579,7 +556,7 @@
(i32.const -1) (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 (return
(i32.ne (i32.ne
(call $~lib/string/String#indexOf (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) (func $std/string/getString (; 8 ;) (type $i) (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)
(return (return
(get_global $std/string/str) (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 $2 i32)
(local $3 i32) (local $3 i32)
(local $4 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 (return
(call $~lib/internal/string/parse<f64> (call $~lib/internal/string/parse<f64>
(get_local $0) (get_local $0)
@ -1042,29 +973,7 @@
) )
) )
) )
(func $~lib/string/parseInt|trampoline (; 14 ;) (type $iiF) (param $0 i32) (param $1 i32) (result f64) (func $~lib/string/parseFloat (; 11 ;) (type $iF) (param $0 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)
(local $1 i32) (local $1 i32)
(local $2 i32) (local $2 i32)
(local $3 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 $1 i32)
(local $2 i32) (local $2 i32)
(local $3 i32) (local $3 i32)
@ -1453,7 +1362,7 @@
(i32.const 0) (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 $1 i32)
(local $2 i32) (local $2 i32)
(if (if
@ -1501,7 +1410,7 @@
(get_local $2) (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 $3 i32)
(local $4 i32) (local $4 i32)
(local $5 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) (local $3 i32)
(if (if
(i32.eq (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 $2 i32)
(local $3 i32) (local $3 i32)
(local $4 i32) (local $4 i32)
@ -3720,7 +3629,7 @@
(get_local $5) (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 (if
(i32.eqz (i32.eqz
(get_local $0) (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 $2 i32)
(local $3 i32) (local $3 i32)
(if (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 (return
(i32.eqz (i32.eqz
(call $~lib/string/String.__eq (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 $2 i32)
(local $3 i32) (local $3 i32)
(local $4 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 $2 i32)
(local $3 i32) (local $3 i32)
(local $4 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 $2 i32)
(local $3 i32) (local $3 i32)
(local $4 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 $2 i32)
(local $3 i32) (local $3 i32)
(local $4 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 $2 i32)
(local $3 i32) (local $3 i32)
(local $4 i32) (local $4 i32)
@ -4333,26 +4242,7 @@
(get_local $4) (get_local $4)
) )
) )
(func $~lib/string/String#repeat|trampoline (; 29 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (func $start (; 25 ;) (type $v)
(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)
(set_global $~lib/allocator/arena/startOffset (set_global $~lib/allocator/arena/startOffset
(i32.and (i32.and
(i32.add (i32.add
@ -4426,17 +4316,12 @@
) )
(if (if
(i32.eqz (i32.eqz
(block (result i32) (call $~lib/string/String#startsWith
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/String#startsWith|trampoline
(get_global $std/string/str) (get_global $std/string/str)
(i32.const 104) (i32.const 104)
(i32.const 0) (i32.const 0)
) )
) )
)
(block (block
(call $abort (call $abort
(i32.const 0) (i32.const 0)
@ -4472,17 +4357,12 @@
) )
(if (if
(i32.eqz (i32.eqz
(block (result i32) (call $~lib/string/String#includes
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/String#includes|trampoline
(get_global $std/string/str) (get_global $std/string/str)
(i32.const 140) (i32.const 140)
(i32.const 0) (i32.const 0)
) )
) )
)
(block (block
(call $abort (call $abort
(i32.const 0) (i32.const 0)
@ -4496,16 +4376,11 @@
(if (if
(i32.eqz (i32.eqz
(i32.eq (i32.eq
(block (result i32) (call $~lib/string/String#indexOf
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/String#indexOf|trampoline
(get_global $std/string/str) (get_global $std/string/str)
(i32.const 152) (i32.const 152)
(i32.const 0) (i32.const 0)
) )
)
(i32.const 2) (i32.const 2)
) )
) )
@ -4522,16 +4397,11 @@
(if (if
(i32.eqz (i32.eqz
(i32.eq (i32.eq
(block (result i32) (call $~lib/string/String#indexOf
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/String#indexOf|trampoline
(get_global $std/string/str) (get_global $std/string/str)
(i32.const 160) (i32.const 160)
(i32.const 0) (i32.const 0)
) )
)
(i32.const -1) (i32.const -1)
) )
) )
@ -4548,15 +4418,10 @@
(if (if
(i32.eqz (i32.eqz
(f64.eq (f64.eq
(block (result f64) (call $~lib/string/parseInt
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/parseInt|trampoline
(i32.const 168) (i32.const 168)
(i32.const 0) (i32.const 0)
) )
)
(f64.const 0) (f64.const 0)
) )
) )
@ -4573,15 +4438,10 @@
(if (if
(i32.eqz (i32.eqz
(f64.eq (f64.eq
(block (result f64) (call $~lib/string/parseInt
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/parseInt|trampoline
(i32.const 176) (i32.const 176)
(i32.const 0) (i32.const 0)
) )
)
(f64.const 1) (f64.const 1)
) )
) )
@ -4598,15 +4458,10 @@
(if (if
(i32.eqz (i32.eqz
(f64.eq (f64.eq
(block (result f64) (call $~lib/string/parseInt
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/parseInt|trampoline
(i32.const 184) (i32.const 184)
(i32.const 0) (i32.const 0)
) )
)
(f64.const 5) (f64.const 5)
) )
) )
@ -4623,15 +4478,10 @@
(if (if
(i32.eqz (i32.eqz
(f64.eq (f64.eq
(block (result f64) (call $~lib/string/parseInt
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/parseInt|trampoline
(i32.const 200) (i32.const 200)
(i32.const 0) (i32.const 0)
) )
)
(f64.const 455) (f64.const 455)
) )
) )
@ -4648,15 +4498,10 @@
(if (if
(i32.eqz (i32.eqz
(f64.eq (f64.eq
(block (result f64) (call $~lib/string/parseInt
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/parseInt|trampoline
(i32.const 216) (i32.const 216)
(i32.const 0) (i32.const 0)
) )
)
(f64.const 3855) (f64.const 3855)
) )
) )
@ -4673,15 +4518,10 @@
(if (if
(i32.eqz (i32.eqz
(f64.eq (f64.eq
(block (result f64) (call $~lib/string/parseInt
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/parseInt|trampoline
(i32.const 232) (i32.const 232)
(i32.const 0) (i32.const 0)
) )
)
(f64.const 3855) (f64.const 3855)
) )
) )
@ -4698,15 +4538,10 @@
(if (if
(i32.eqz (i32.eqz
(f64.eq (f64.eq
(block (result f64) (call $~lib/string/parseInt
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/parseInt|trampoline
(i32.const 248) (i32.const 248)
(i32.const 0) (i32.const 0)
) )
)
(f64.const 11) (f64.const 11)
) )
) )
@ -4723,15 +4558,10 @@
(if (if
(i32.eqz (i32.eqz
(f64.eq (f64.eq
(block (result f64) (call $~lib/string/parseInt
(set_global $~argc
(i32.const 1)
)
(call $~lib/string/parseInt|trampoline
(i32.const 260) (i32.const 260)
(i32.const 0) (i32.const 0)
) )
)
(f64.const 1) (f64.const 1)
) )
) )
@ -5259,15 +5089,10 @@
(if (if
(i32.eqz (i32.eqz
(call $~lib/string/String.__eq (call $~lib/string/String.__eq
(block (result i32) (call $~lib/string/String#repeat
(set_global $~argc
(i32.const 0)
)
(call $~lib/string/String#repeat|trampoline
(i32.const 316) (i32.const 316)
(i32.const 0) (i32.const 0)
) )
)
(i32.const 332) (i32.const 332)
) )
) )