Initial compile time type check builtins

This commit is contained in:
dcodeIO 2018-03-17 12:54:37 +01:00
parent faac3c31eb
commit 2ed9fac171
15 changed files with 1158 additions and 657 deletions

View File

@ -63,14 +63,14 @@
"aliases": [ "a" ]
},
"idlFile": {
"desc": "Specifies the WebIDL output file (.idl).",
"desc": "Specifies the WebIDL output file (.webidl).",
"type": "string",
"aliases": [ "i" ]
},
"tsdFile": {
"desc": "Specifies the TypeScript definition output file (.d.ts).",
"type": "string",
"aliases": [ "d" ]
"aliases": [ "d", "dtsFile" ]
},
"sourceMap": {
"desc": [

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

@ -34,7 +34,8 @@ import {
FunctionPrototype,
Local,
Class,
ElementKind
ElementKind,
ClassPrototype
} from "./program";
/** Compiles a get of a built-in global. */
@ -100,6 +101,130 @@ export function compileCall(
switch (prototype.internalName) {
// types
case "isInteger": {
compiler.currentType = Type.bool;
if (typeArguments) {
compiler.error(
DiagnosticCode.Type_0_is_not_generic,
reportNode.range, prototype.internalName
); // recoverable
}
if (operands.length != 1) {
compiler.error(
DiagnosticCode.Expected_0_arguments_but_got_1,
reportNode.range, "1", operands.length.toString(10)
);
return module.createUnreachable();
}
compiler.compileExpressionRetainType(operands[0], Type.i32, false);
type = compiler.currentType;
compiler.currentType = Type.bool;
return type.is(TypeFlags.INTEGER) && !type.is(TypeFlags.REFERENCE)
? module.createI32(1)
: module.createI32(0);
}
case "isFloat": {
compiler.currentType = Type.bool;
if (typeArguments) {
compiler.error(
DiagnosticCode.Type_0_is_not_generic,
reportNode.range, prototype.internalName
); // recoverable
}
if (operands.length != 1) {
compiler.error(
DiagnosticCode.Expected_0_arguments_but_got_1,
reportNode.range, "1", operands.length.toString(10)
);
return module.createUnreachable();
}
compiler.compileExpressionRetainType(operands[0], Type.i32, false);
type = compiler.currentType;
compiler.currentType = Type.bool;
return type.is(TypeFlags.FLOAT)
? module.createI32(1)
: module.createI32(0);
}
case "isReference": {
compiler.currentType = Type.bool;
if (typeArguments) {
compiler.error(
DiagnosticCode.Type_0_is_not_generic,
reportNode.range, prototype.internalName
); // recoverable
}
if (operands.length != 1) {
compiler.error(
DiagnosticCode.Expected_0_arguments_but_got_1,
reportNode.range, "1", operands.length.toString(10)
);
return module.createUnreachable();
}
compiler.compileExpressionRetainType(operands[0], Type.i32, false);
type = compiler.currentType;
compiler.currentType = Type.bool;
return type.is(TypeFlags.REFERENCE)
? module.createI32(1)
: module.createI32(0);
}
case "isString": {
compiler.currentType = Type.bool;
if (typeArguments) {
compiler.error(
DiagnosticCode.Type_0_is_not_generic,
reportNode.range, prototype.internalName
); // recoverable
}
if (operands.length != 1) {
compiler.error(
DiagnosticCode.Expected_0_arguments_but_got_1,
reportNode.range, "1", operands.length.toString(10)
);
return module.createUnreachable();
}
compiler.compileExpressionRetainType(operands[0], Type.i32, false);
type = compiler.currentType;
compiler.currentType = Type.bool;
let classType = type.classType;
if (classType) {
let stringPrototype = compiler.program.elementsLookup.get("String");
if (stringPrototype) {
assert(stringPrototype.kind == ElementKind.CLASS_PROTOTYPE);
let stringInstance = (<ClassPrototype>stringPrototype).resolve(null);
if (!stringInstance) return module.createUnreachable();
if (classType.isAssignableTo(stringInstance)) {
return module.createI32(1);
}
}
}
return module.createI32(0);
}
case "isArray": {
compiler.currentType = Type.bool;
if (typeArguments) {
compiler.error(
DiagnosticCode.Type_0_is_not_generic,
reportNode.range, prototype.internalName
); // recoverable
}
if (operands.length != 1) {
compiler.error(
DiagnosticCode.Expected_0_arguments_but_got_1,
reportNode.range, "1", operands.length.toString(10)
);
return module.createUnreachable();
}
compiler.compileExpressionRetainType(operands[0], Type.i32, false);
type = compiler.currentType;
compiler.currentType = Type.bool;
let classType = type.classType;
return classType != null && classType.prototype.fnIndexedGet != null
? module.createI32(1)
: module.createI32(0);
}
// math
case "isNaN": { // isNaN<T?>(value: T) -> bool

10
std/assembly.d.ts vendored
View File

@ -194,6 +194,16 @@ declare function changetype<T>(value: any): T;
declare function isNaN<T = f32 | f64>(value: T): bool;
/** Tests if a 32-bit or 64-bit float is finite, that is not `NaN` or +/-`Infinity`. */
declare function isFinite<T = f32 | f64>(value: T): bool;
/** Tests if the specified expression is of an integer type and not a reference. Compiles to a constant. */
declare function isInteger(value: any): bool;
/** Tests if the specified expression is of a float type. Compiles to a constant. */
declare function isFloat(value: any): bool;
/** Tests if the specified expression is of a reference type. Compiles to a constant. */
declare function isReference(value: any): bool;
/** Tests if the specified expression can be used ass a string. Compiles to a constant. */
declare function isString(value: any): bool;
/** Tests if the specified expression can be used as an array. Compiles to a constant. */
declare function isArray(value: any): bool;
/** Traps if the specified value is not true-ish, otherwise returns the (non-nullable) value. */
declare function assert<T>(isTrueish: T, message?: string): T & object; // any better way to model `: T != null`?
/** Parses an integer string to a 64-bit float. */

View File

@ -1,3 +1,22 @@
// types
@builtin
export declare function isInteger(value: void): bool;
@builtin
export declare function isFloat(value: void): bool;
@builtin
export declare function isReference(value: void): bool;
@builtin
export declare function isString(value: void): bool;
@builtin
export declare function isArray(value: void): bool;
// math
@builtin
export declare const NaN: f64; // | f32

14
std/portable.d.ts vendored
View File

@ -136,6 +136,20 @@ declare function bswap16<T = i16 | u16 | i32 | u32>(value: T): T;
/** Changes the type of any value of `usize` kind to another one of `usize` kind. Useful for casting class instances to their pointer values and vice-versa. Beware that this is unsafe.*/
declare function changetype<T>(value: any): T;
/** Tests if a 32-bit or 64-bit float is `NaN`. */
declare function isNaN<T = f32 | f64>(value: T): bool;
/** Tests if a 32-bit or 64-bit float is finite, that is not `NaN` or +/-`Infinity`. */
declare function isFinite<T = f32 | f64>(value: T): bool;
/** Tests if the specified value is a valid integer. Can't distinguish an integer from an integral float. */
declare function isInteger(value: any): bool;
/** Tests if the specified value is a valid float. Can't distinguish a float from an integer. */
declare function isFloat(value: any): bool;
/** Tests if the specified value is of a reference type. */
declare function isReference(value: any): bool;
/** Tests if the specified value can be used as a string. */
declare function isString(value: any): bool;
/** Tests if the specified value can be used as an array. */
declare function isArray(value: any): bool;
/** Traps if the specified value is not true-ish, otherwise returns the value. */
declare function assert<T>(isTrueish: T | null, message?: string): T;
/** Parses an integer string to a 64-bit float. */

View File

@ -148,3 +148,19 @@ String["fromCharCodes"] = function fromCharCodes(arr) {
String["fromCodePoints"] = function fromCodePoints(arr) {
return String.fromCodePoint.apply(String, arr);
};
globalScope["isInteger"] = Number.isInteger;
globalScope["isFloat"] = function isFloat(arg) {
return typeof arg === "number";
};
globalScope["isReference"] = function isClass(arg) {
return typeof arg === "object" || typeof arg === "string";
};
globalScope["isString"] = function isString(arg) {
return typeof arg === "string" || arg instanceof String;
};
globalScope["isArray"] = Array.isArray;

View File

@ -12,6 +12,7 @@
(global $builtins/s (mut i32) (i32.const 0))
(memory $0 1)
(data (i32.const 4) "\0b\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s")
(data (i32.const 32) "\01\00\00\001")
(export "test" (func $builtins/test))
(export "memory" (memory $0))
(start $start)
@ -78,7 +79,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 21)
(i32.const 34)
(i32.const 19)
)
(unreachable)
@ -105,7 +106,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 22)
(i32.const 35)
(i32.const 20)
)
(unreachable)
@ -130,7 +131,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 23)
(i32.const 36)
(i32.const 20)
)
(unreachable)
@ -175,7 +176,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 39)
(i32.const 52)
(i32.const 19)
)
(unreachable)
@ -204,7 +205,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 40)
(i32.const 53)
(i32.const 20)
)
(unreachable)
@ -229,7 +230,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 41)
(i32.const 54)
(i32.const 20)
)
(unreachable)
@ -650,7 +651,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 222)
(i32.const 235)
(i32.const 0)
)
(unreachable)
@ -667,7 +668,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 223)
(i32.const 236)
(i32.const 0)
)
(unreachable)
@ -693,7 +694,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 224)
(i32.const 237)
(i32.const 0)
)
(unreachable)
@ -719,7 +720,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 225)
(i32.const 238)
(i32.const 0)
)
(unreachable)
@ -745,7 +746,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 226)
(i32.const 239)
(i32.const 0)
)
(unreachable)
@ -771,7 +772,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 227)
(i32.const 240)
(i32.const 0)
)
(unreachable)
@ -799,7 +800,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 228)
(i32.const 241)
(i32.const 0)
)
(unreachable)
@ -827,7 +828,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 229)
(i32.const 242)
(i32.const 0)
)
(unreachable)

View File

@ -1,5 +1,18 @@
var b: bool;
// types
assert(isInteger(<i32>1));
assert(!isInteger(<f32>1));
assert(isFloat(<f32>1));
assert(!isFloat(<i32>1));
assert(isReference(changetype<String>(null)));
assert(!isReference(changetype<usize>(null)));
assert(isString("1"));
assert(!isString(1));
assert(isArray(changetype<i32[]>(null)));
assert(!isArray(changetype<usize>(null)));
// integers
var i: i32;

View File

@ -12,9 +12,10 @@
(global $builtins/u (mut i32) (i32.const 0))
(global $builtins/U (mut i64) (i64.const 0))
(global $builtins/s (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 32))
(global $HEAP_BASE i32 (i32.const 40))
(memory $0 1)
(data (i32.const 4) "\0b\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s\00")
(data (i32.const 32) "\01\00\00\001\00")
(export "test" (func $builtins/test))
(export "memory" (memory $0))
(start $start)
@ -27,6 +28,156 @@
(local $3 i64)
(local $4 f32)
(local $5 f64)
(if
(i32.eqz
(i32.const 1)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 5)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eqz
(i32.const 0)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 6)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.const 1)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 7)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eqz
(i32.const 0)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 8)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.const 1)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 9)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eqz
(i32.const 0)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 10)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.const 1)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 11)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eqz
(i32.const 0)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 12)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.const 1)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 13)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eqz
(i32.const 0)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 14)
(i32.const 0)
)
(unreachable)
)
)
(drop
(i32.clz
(i32.const 1)
@ -150,7 +301,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 21)
(i32.const 34)
(i32.const 19)
)
(unreachable)
@ -181,7 +332,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 22)
(i32.const 35)
(i32.const 20)
)
(unreachable)
@ -212,7 +363,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 23)
(i32.const 36)
(i32.const 20)
)
(unreachable)
@ -313,7 +464,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 39)
(i32.const 52)
(i32.const 19)
)
(unreachable)
@ -344,7 +495,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 40)
(i32.const 53)
(i32.const 20)
)
(unreachable)
@ -375,7 +526,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 41)
(i32.const 54)
(i32.const 20)
)
(unreachable)
@ -1123,7 +1274,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 221)
(i32.const 234)
(i32.const 0)
)
(unreachable)
@ -1142,7 +1293,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 222)
(i32.const 235)
(i32.const 0)
)
(unreachable)
@ -1161,7 +1312,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 223)
(i32.const 236)
(i32.const 0)
)
(unreachable)
@ -1191,7 +1342,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 224)
(i32.const 237)
(i32.const 0)
)
(unreachable)
@ -1221,7 +1372,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 225)
(i32.const 238)
(i32.const 0)
)
(unreachable)
@ -1251,7 +1402,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 226)
(i32.const 239)
(i32.const 0)
)
(unreachable)
@ -1281,7 +1432,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 227)
(i32.const 240)
(i32.const 0)
)
(unreachable)
@ -1309,7 +1460,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 228)
(i32.const 241)
(i32.const 0)
)
(unreachable)
@ -1337,7 +1488,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 229)
(i32.const 242)
(i32.const 0)
)
(unreachable)
@ -1360,7 +1511,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 242)
(i32.const 255)
(i32.const 0)
)
(unreachable)
@ -1377,7 +1528,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 243)
(i32.const 256)
(i32.const 0)
)
(unreachable)
@ -1400,7 +1551,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 244)
(i32.const 257)
(i32.const 0)
)
(unreachable)
@ -1417,7 +1568,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 245)
(i32.const 258)
(i32.const 0)
)
(unreachable)
@ -1436,7 +1587,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 246)
(i32.const 259)
(i32.const 0)
)
(unreachable)
@ -1453,7 +1604,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 247)
(i32.const 260)
(i32.const 0)
)
(unreachable)
@ -1470,7 +1621,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 248)
(i32.const 261)
(i32.const 0)
)
(unreachable)
@ -1483,227 +1634,6 @@
(i64.const 9223372036854775807)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 249)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(i32.const 0)
(i32.const 0)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 251)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(i32.const 255)
(i32.const 255)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 252)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(i32.const 0)
(i32.const 0)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 253)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(i32.const 65535)
(i32.const 65535)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 254)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(i32.const 0)
(i32.const 0)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 255)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(i32.const -1)
(i32.const -1)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 256)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i64.eq
(i64.const 0)
(i64.const 0)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 257)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i64.eq
(i64.const -1)
(i64.const -1)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 258)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(i32.const 0)
(i32.const 0)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 259)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(i32.const 0)
(i32.const 0)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 259)
(i32.const 29)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(i32.const 1)
(i32.const 1)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 260)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(i32.const 1)
(i32.const 1)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 260)
(i32.const 29)
)
(unreachable)
)
)
(if
(i32.eqz
(f32.eq
(f32.const -3402823466385288598117041e14)
(f32.const -3402823466385288598117041e14)
)
)
(block
(call $abort
(i32.const 0)
@ -1716,27 +1646,10 @@
)
(if
(i32.eqz
(f32.eq
(f32.const 3402823466385288598117041e14)
(f32.const 3402823466385288598117041e14)
)
)
(block
(call $abort
(i32.eq
(i32.const 0)
(i32.const 4)
(i32.const 263)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(f32.eq
(f32.const -16777215)
(f32.const -16777215)
)
)
(block
(call $abort
@ -1750,9 +1663,9 @@
)
(if
(i32.eqz
(f32.eq
(f32.const 16777215)
(f32.const 16777215)
(i32.eq
(i32.const 255)
(i32.const 255)
)
)
(block
@ -1767,9 +1680,9 @@
)
(if
(i32.eqz
(f32.eq
(f32.const 1.1920928955078125e-07)
(f32.const 1.1920928955078125e-07)
(i32.eq
(i32.const 0)
(i32.const 0)
)
)
(block
@ -1784,9 +1697,9 @@
)
(if
(i32.eqz
(f64.eq
(f64.const -1797693134862315708145274e284)
(f64.const -1797693134862315708145274e284)
(i32.eq
(i32.const 65535)
(i32.const 65535)
)
)
(block
@ -1801,9 +1714,9 @@
)
(if
(i32.eqz
(f64.eq
(f64.const 1797693134862315708145274e284)
(f64.const 1797693134862315708145274e284)
(i32.eq
(i32.const 0)
(i32.const 0)
)
)
(block
@ -1818,9 +1731,9 @@
)
(if
(i32.eqz
(f64.eq
(f64.const -9007199254740991)
(f64.const -9007199254740991)
(i32.eq
(i32.const -1)
(i32.const -1)
)
)
(block
@ -1833,6 +1746,244 @@
(unreachable)
)
)
(if
(i32.eqz
(i64.eq
(i64.const 0)
(i64.const 0)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 270)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i64.eq
(i64.const -1)
(i64.const -1)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 271)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(i32.const 0)
(i32.const 0)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 272)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(i32.const 0)
(i32.const 0)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 272)
(i32.const 29)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(i32.const 1)
(i32.const 1)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 273)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(i32.eq
(i32.const 1)
(i32.const 1)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 273)
(i32.const 29)
)
(unreachable)
)
)
(if
(i32.eqz
(f32.eq
(f32.const -3402823466385288598117041e14)
(f32.const -3402823466385288598117041e14)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 275)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(f32.eq
(f32.const 3402823466385288598117041e14)
(f32.const 3402823466385288598117041e14)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 276)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(f32.eq
(f32.const -16777215)
(f32.const -16777215)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 277)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(f32.eq
(f32.const 16777215)
(f32.const 16777215)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 278)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(f32.eq
(f32.const 1.1920928955078125e-07)
(f32.const 1.1920928955078125e-07)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 279)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(f64.eq
(f64.const -1797693134862315708145274e284)
(f64.const -1797693134862315708145274e284)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 280)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(f64.eq
(f64.const 1797693134862315708145274e284)
(f64.const 1797693134862315708145274e284)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 281)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(f64.eq
(f64.const -9007199254740991)
(f64.const -9007199254740991)
)
)
(block
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 282)
(i32.const 0)
)
(unreachable)
)
)
(if
(i32.eqz
(f64.eq
@ -1844,7 +1995,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 270)
(i32.const 283)
(i32.const 0)
)
(unreachable)
@ -1861,7 +2012,7 @@
(call $abort
(i32.const 0)
(i32.const 4)
(i32.const 271)
(i32.const 284)
(i32.const 0)
)
(unreachable)

View File

@ -46,9 +46,10 @@
(memory $0 1)
(data (i32.const 4) "\n\00\00\00l\00o\00g\00i\00c\00a\00l\00.\00t\00s")
(data (i32.const 28) "\0b\00\00\00b\00u\00i\00l\00t\00i\00n\00s\00.\00t\00s")
(data (i32.const 56) "\0b\00\00\00s\00h\00o\00w\00c\00a\00s\00e\00.\00t\00s")
(data (i32.const 84) "\t\00\00\00m\00e\00m\00c\00p\00y\00.\00t\00s")
(data (i32.const 108) "\07\00\00\00f\00m\00o\00d\00.\00t\00s")
(data (i32.const 56) "\01\00\00\001")
(data (i32.const 64) "\0b\00\00\00s\00h\00o\00w\00c\00a\00s\00e\00.\00t\00s")
(data (i32.const 92) "\t\00\00\00m\00e\00m\00c\00p\00y\00.\00t\00s")
(data (i32.const 116) "\07\00\00\00f\00m\00o\00d\00.\00t\00s")
(export "anExportedConstantGlobal" (global $showcase/anExportedConstantGlobal))
(export "aConstantGlobal" (global $showcase/aConstantGlobal))
(export "anAliasedConstantGlobal" (global $showcase/anExportedConstantGlobal))
@ -3504,7 +3505,7 @@
(call $abort
(i32.const 0)
(i32.const 28)
(i32.const 21)
(i32.const 34)
(i32.const 19)
)
(unreachable)
@ -3531,7 +3532,7 @@
(call $abort
(i32.const 0)
(i32.const 28)
(i32.const 22)
(i32.const 35)
(i32.const 20)
)
(unreachable)
@ -3556,7 +3557,7 @@
(call $abort
(i32.const 0)
(i32.const 28)
(i32.const 23)
(i32.const 36)
(i32.const 20)
)
(unreachable)
@ -3601,7 +3602,7 @@
(call $abort
(i32.const 0)
(i32.const 28)
(i32.const 39)
(i32.const 52)
(i32.const 19)
)
(unreachable)
@ -3630,7 +3631,7 @@
(call $abort
(i32.const 0)
(i32.const 28)
(i32.const 40)
(i32.const 53)
(i32.const 20)
)
(unreachable)
@ -3655,7 +3656,7 @@
(call $abort
(i32.const 0)
(i32.const 28)
(i32.const 41)
(i32.const 54)
(i32.const 20)
)
(unreachable)
@ -4076,7 +4077,7 @@
(call $abort
(i32.const 0)
(i32.const 28)
(i32.const 222)
(i32.const 235)
(i32.const 0)
)
(unreachable)
@ -4093,7 +4094,7 @@
(call $abort
(i32.const 0)
(i32.const 28)
(i32.const 223)
(i32.const 236)
(i32.const 0)
)
(unreachable)
@ -4119,7 +4120,7 @@
(call $abort
(i32.const 0)
(i32.const 28)
(i32.const 224)
(i32.const 237)
(i32.const 0)
)
(unreachable)
@ -4145,7 +4146,7 @@
(call $abort
(i32.const 0)
(i32.const 28)
(i32.const 225)
(i32.const 238)
(i32.const 0)
)
(unreachable)
@ -4171,7 +4172,7 @@
(call $abort
(i32.const 0)
(i32.const 28)
(i32.const 226)
(i32.const 239)
(i32.const 0)
)
(unreachable)
@ -4197,7 +4198,7 @@
(call $abort
(i32.const 0)
(i32.const 28)
(i32.const 227)
(i32.const 240)
(i32.const 0)
)
(unreachable)
@ -4225,7 +4226,7 @@
(call $abort
(i32.const 0)
(i32.const 28)
(i32.const 228)
(i32.const 241)
(i32.const 0)
)
(unreachable)
@ -4253,7 +4254,7 @@
(call $abort
(i32.const 0)
(i32.const 28)
(i32.const 229)
(i32.const 242)
(i32.const 0)
)
(unreachable)
@ -4269,7 +4270,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 56)
(i32.const 64)
(i32.const 42)
(i32.const 0)
)
@ -4293,7 +4294,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 56)
(i32.const 64)
(i32.const 58)
(i32.const 0)
)
@ -4308,7 +4309,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 56)
(i32.const 64)
(i32.const 59)
(i32.const 0)
)
@ -4364,7 +4365,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 84)
(i32.const 92)
(i32.const 151)
(i32.const 0)
)
@ -4381,7 +4382,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 84)
(i32.const 92)
(i32.const 152)
(i32.const 0)
)
@ -4403,7 +4404,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 84)
(i32.const 92)
(i32.const 155)
(i32.const 0)
)
@ -4420,7 +4421,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 84)
(i32.const 92)
(i32.const 156)
(i32.const 0)
)
@ -4437,7 +4438,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 84)
(i32.const 92)
(i32.const 157)
(i32.const 0)
)
@ -4454,7 +4455,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 84)
(i32.const 92)
(i32.const 158)
(i32.const 0)
)
@ -4471,7 +4472,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 84)
(i32.const 92)
(i32.const 159)
(i32.const 0)
)
@ -4495,7 +4496,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 84)
(i32.const 92)
(i32.const 162)
(i32.const 0)
)
@ -4519,7 +4520,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 84)
(i32.const 92)
(i32.const 165)
(i32.const 0)
)
@ -4536,7 +4537,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 84)
(i32.const 92)
(i32.const 166)
(i32.const 0)
)
@ -4553,7 +4554,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 84)
(i32.const 92)
(i32.const 167)
(i32.const 0)
)
@ -4570,7 +4571,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 84)
(i32.const 92)
(i32.const 168)
(i32.const 0)
)
@ -4590,7 +4591,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 108)
(i32.const 116)
(i32.const 65)
(i32.const 0)
)
@ -4608,7 +4609,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 108)
(i32.const 116)
(i32.const 66)
(i32.const 0)
)
@ -4631,7 +4632,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 108)
(i32.const 116)
(i32.const 67)
(i32.const 0)
)
@ -4654,7 +4655,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 108)
(i32.const 116)
(i32.const 68)
(i32.const 0)
)
@ -4674,7 +4675,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 108)
(i32.const 116)
(i32.const 134)
(i32.const 0)
)
@ -4692,7 +4693,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 108)
(i32.const 116)
(i32.const 135)
(i32.const 0)
)
@ -4715,7 +4716,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 108)
(i32.const 116)
(i32.const 136)
(i32.const 0)
)
@ -4738,7 +4739,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 108)
(i32.const 116)
(i32.const 137)
(i32.const 0)
)
@ -4763,7 +4764,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 56)
(i32.const 64)
(i32.const 104)
(i32.const 0)
)
@ -4780,7 +4781,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 56)
(i32.const 64)
(i32.const 105)
(i32.const 0)
)
@ -4801,7 +4802,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 56)
(i32.const 64)
(i32.const 108)
(i32.const 0)
)
@ -4819,7 +4820,7 @@
(block
(call $abort
(i32.const 0)
(i32.const 56)
(i32.const 64)
(i32.const 111)
(i32.const 0)
)

File diff suppressed because it is too large Load Diff