mirror of https://github.com/tc39/test262.git
Remove the wasm folder from the contributed tests
All tests are feature specific and don't expose any identified coverage gap in Test262
This commit is contained in:
parent
0bdfdca007
commit
e49c676fd5
|
@ -1,779 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2016 Apple Inc. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import * as assert from 'assert.js';
|
||||
import * as BuildWebAssembly from 'Builder_WebAssemblyBinary.js';
|
||||
import * as LLB from 'LowLevelBinary.js';
|
||||
import * as WASM from 'WASM.js';
|
||||
import * as util from 'utilities.js';
|
||||
|
||||
const _isValidValue = (value, type) => {
|
||||
switch (type) {
|
||||
// We allow both signed and unsigned numbers.
|
||||
case "i32": return Math.round(value) === value && LLB.varint32Min <= value && value <= LLB.varuint32Max;
|
||||
case "i64": return true; // FIXME https://bugs.webkit.org/show_bug.cgi?id=163420 64-bit values
|
||||
case "f32": return typeof(value) === "number" && isFinite(value);
|
||||
case "f64": return typeof(value) === "number" && isFinite(value);
|
||||
default: throw new Error(`Implementation problem: unknown type ${type}`);
|
||||
}
|
||||
};
|
||||
const _unknownSectionId = 0;
|
||||
|
||||
const _normalizeFunctionSignature = (params, ret) => {
|
||||
assert.isArray(params);
|
||||
for (const p of params)
|
||||
assert.truthy(WASM.isValidValueType(p) || p === "void", `Type parameter ${p} needs a valid value type`);
|
||||
if (typeof(ret) === "undefined")
|
||||
ret = "void";
|
||||
assert.isNotArray(ret, `Multiple return values not supported by WebAssembly yet`);
|
||||
assert.truthy(WASM.isValidBlockType(ret), `Type return ${ret} must be valid block type`);
|
||||
return [params, ret];
|
||||
};
|
||||
|
||||
const _errorHandlingProxyFor = builder => builder["__isProxy"] ? builder : new Proxy(builder, {
|
||||
get: (target, property, receiver) => {
|
||||
if (property === "__isProxy")
|
||||
return true;
|
||||
if (target[property] === undefined)
|
||||
throw new Error(`WebAssembly builder received unknown property '${property}'`);
|
||||
return target[property];
|
||||
}
|
||||
});
|
||||
|
||||
const _maybeRegisterType = (builder, type) => {
|
||||
const typeSection = builder._getSection("Type");
|
||||
if (typeof(type) === "number") {
|
||||
// Type numbers already refer to the type section, no need to register them.
|
||||
if (builder._checked) {
|
||||
assert.isNotUndef(typeSection, `Can not use type ${type} if a type section is not present`);
|
||||
assert.isNotUndef(typeSection.data[type], `Type ${type} does not exist in type section`);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
assert.hasObjectProperty(type, "params", `Expected type to be a number or object with 'params' and optionally 'ret' fields`);
|
||||
const [params, ret] = _normalizeFunctionSignature(type.params, type.ret);
|
||||
assert.isNotUndef(typeSection, `Can not add type if a type section is not present`);
|
||||
// Try reusing an equivalent type from the type section.
|
||||
types:
|
||||
for (let i = 0; i !== typeSection.data.length; ++i) {
|
||||
const t = typeSection.data[i];
|
||||
if (t.ret === ret && params.length === t.params.length) {
|
||||
for (let j = 0; j !== t.params.length; ++j) {
|
||||
if (params[j] !== t.params[j])
|
||||
continue types;
|
||||
}
|
||||
type = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (typeof(type) !== "number") {
|
||||
// Couldn't reuse a pre-existing type, register this type in the type section.
|
||||
typeSection.data.push({ params: params, ret: ret });
|
||||
type = typeSection.data.length - 1;
|
||||
}
|
||||
return type;
|
||||
};
|
||||
|
||||
const _importFunctionContinuation = (builder, section, nextBuilder) => {
|
||||
return (module, field, type) => {
|
||||
assert.isString(module, `Import function module should be a string, got "${module}"`);
|
||||
assert.isString(field, `Import function field should be a string, got "${field}"`);
|
||||
const typeSection = builder._getSection("Type");
|
||||
type = _maybeRegisterType(builder, type);
|
||||
section.data.push({ field: field, type: type, kind: "Function", module: module });
|
||||
// Imports also count in the function index space. Map them as objects to avoid clashing with Code functions' names.
|
||||
builder._registerFunctionToIndexSpace({ module: module, field: field });
|
||||
return _errorHandlingProxyFor(nextBuilder);
|
||||
};
|
||||
};
|
||||
|
||||
const _importMemoryContinuation = (builder, section, nextBuilder) => {
|
||||
return (module, field, {initial, maximum}) => {
|
||||
assert.isString(module, `Import Memory module should be a string, got "${module}"`);
|
||||
assert.isString(field, `Import Memory field should be a string, got "${field}"`);
|
||||
section.data.push({module, field, kind: "Memory", memoryDescription: {initial, maximum}});
|
||||
return _errorHandlingProxyFor(nextBuilder);
|
||||
};
|
||||
};
|
||||
|
||||
const _importTableContinuation = (builder, section, nextBuilder) => {
|
||||
return (module, field, {initial, maximum, element}) => {
|
||||
assert.isString(module, `Import Table module should be a string, got "${module}"`);
|
||||
assert.isString(field, `Import Table field should be a string, got "${field}"`);
|
||||
section.data.push({module, field, kind: "Table", tableDescription: {initial, maximum, element}});
|
||||
return _errorHandlingProxyFor(nextBuilder);
|
||||
};
|
||||
};
|
||||
|
||||
const _exportFunctionContinuation = (builder, section, nextBuilder) => {
|
||||
return (field, index, type) => {
|
||||
assert.isString(field, `Export function field should be a string, got "${field}"`);
|
||||
const typeSection = builder._getSection("Type");
|
||||
if (typeof(type) !== "undefined") {
|
||||
// Exports can leave the type unspecified, letting the Code builder patch them up later.
|
||||
type = _maybeRegisterType(builder, type);
|
||||
}
|
||||
|
||||
// We can't check much about "index" here because the Code section succeeds the Export section. More work is done at Code().End() time.
|
||||
switch (typeof(index)) {
|
||||
case "string": break; // Assume it's a function name which will be revealed in the Code section.
|
||||
case "number": break; // Assume it's a number in the "function index space".
|
||||
case "object":
|
||||
// Re-exporting an import.
|
||||
assert.hasObjectProperty(index, "module", `Re-exporting "${field}" from an import`);
|
||||
assert.hasObjectProperty(index, "field", `Re-exporting "${field}" from an import`);
|
||||
break;
|
||||
case "undefined":
|
||||
// Assume it's the same as the field (i.e. it's not being renamed).
|
||||
index = field;
|
||||
break;
|
||||
default: throw new Error(`Export section's index must be a string or a number, got ${index}`);
|
||||
}
|
||||
|
||||
const correspondingImport = builder._getFunctionFromIndexSpace(index);
|
||||
const importSection = builder._getSection("Import");
|
||||
if (typeof(index) === "object") {
|
||||
// Re-exporting an import using its module+field name.
|
||||
assert.isNotUndef(correspondingImport, `Re-exporting "${field}" couldn't find import from module "${index.module}" field "${index.field}"`);
|
||||
index = correspondingImport;
|
||||
if (typeof(type) === "undefined")
|
||||
type = importSection.data[index].type;
|
||||
if (builder._checked)
|
||||
assert.eq(type, importSection.data[index].type, `Re-exporting import "${importSection.data[index].field}" as "${field}" has mismatching type`);
|
||||
} else if (typeof(correspondingImport) !== "undefined") {
|
||||
// Re-exporting an import using its index.
|
||||
let exportedImport;
|
||||
for (const i of importSection.data) {
|
||||
if (i.module === correspondingImport.module && i.field === correspondingImport.field) {
|
||||
exportedImport = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (typeof(type) === "undefined")
|
||||
type = exportedImport.type;
|
||||
if (builder._checked)
|
||||
assert.eq(type, exportedImport.type, `Re-exporting import "${exportedImport.field}" as "${field}" has mismatching type`);
|
||||
}
|
||||
section.data.push({ field: field, type: type, kind: "Function", index: index });
|
||||
return _errorHandlingProxyFor(nextBuilder);
|
||||
};
|
||||
};
|
||||
|
||||
const _normalizeMutability = (mutability) => {
|
||||
if (mutability === "mutable")
|
||||
return 1;
|
||||
else if (mutability === "immutable")
|
||||
return 0;
|
||||
else
|
||||
throw new Error(`mutability should be either "mutable" or "immutable", but got ${mutability}`);
|
||||
};
|
||||
|
||||
const _exportGlobalContinuation = (builder, section, nextBuilder) => {
|
||||
return (field, index) => {
|
||||
assert.isNumber(index, `Global exports only support number indices right now`);
|
||||
section.data.push({ field, kind: "Global", index });
|
||||
return _errorHandlingProxyFor(nextBuilder);
|
||||
}
|
||||
};
|
||||
|
||||
const _exportMemoryContinuation = (builder, section, nextBuilder) => {
|
||||
return (field, index) => {
|
||||
assert.isNumber(index, `Memory exports only support number indices`);
|
||||
section.data.push({field, kind: "Memory", index});
|
||||
return _errorHandlingProxyFor(nextBuilder);
|
||||
}
|
||||
};
|
||||
|
||||
const _exportTableContinuation = (builder, section, nextBuilder) => {
|
||||
return (field, index) => {
|
||||
assert.isNumber(index, `Table exports only support number indices`);
|
||||
section.data.push({field, kind: "Table", index});
|
||||
return _errorHandlingProxyFor(nextBuilder);
|
||||
}
|
||||
};
|
||||
|
||||
const _importGlobalContinuation = (builder, section, nextBuilder) => {
|
||||
return () => {
|
||||
const globalBuilder = {
|
||||
End: () => nextBuilder
|
||||
};
|
||||
for (let op of WASM.description.value_type) {
|
||||
globalBuilder[util.toJavaScriptName(op)] = (module, field, mutability) => {
|
||||
assert.isString(module, `Import global module should be a string, got "${module}"`);
|
||||
assert.isString(field, `Import global field should be a string, got "${field}"`);
|
||||
assert.isString(mutability, `Import global mutability should be a string, got "${mutability}"`);
|
||||
section.data.push({ globalDescription: { type: op, mutability: _normalizeMutability(mutability) }, module, field, kind: "Global" });
|
||||
return _errorHandlingProxyFor(globalBuilder);
|
||||
};
|
||||
}
|
||||
return _errorHandlingProxyFor(globalBuilder);
|
||||
};
|
||||
};
|
||||
|
||||
const _checkStackArgs = (op, param) => {
|
||||
for (let expect of param) {
|
||||
if (WASM.isValidType(expect)) {
|
||||
// FIXME implement stack checks for arguments. https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
} else {
|
||||
// Handle our own meta-types.
|
||||
switch (expect) {
|
||||
case "addr": break; // FIXME implement addr. https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
case "any": break; // FIXME implement any. https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
case "bool": break; // FIXME implement bool. https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
case "call": break; // FIXME implement call stack argument checks based on function signature. https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
case "global": break; // FIXME implement global. https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
case "local": break; // FIXME implement local. https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
case "prev": break; // FIXME implement prev, checking for whetever the previous value was. https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
case "size": break; // FIXME implement size. https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
default: throw new Error(`Implementation problem: unhandled meta-type "${expect}" on "${op}"`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const _checkStackReturn = (op, ret) => {
|
||||
for (let expect of ret) {
|
||||
if (WASM.isValidType(expect)) {
|
||||
// FIXME implement stack checks for return. https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
} else {
|
||||
// Handle our own meta-types.
|
||||
switch (expect) {
|
||||
case "any": break;
|
||||
case "bool": break; // FIXME implement bool. https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
case "call": break; // FIXME implement call stack return check based on function signature. https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
case "control": break; // FIXME implement control. https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
case "global": break; // FIXME implement global. https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
case "local": break; // FIXME implement local. https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
case "prev": break; // FIXME implement prev, checking for whetever the parameter type was. https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
case "size": break; // FIXME implement size. https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
default: throw new Error(`Implementation problem: unhandled meta-type "${expect}" on "${op}"`);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const _checkImms = (op, imms, expectedImms, ret) => {
|
||||
const minExpectedImms = expectedImms.filter(i => i.type.slice(-1) !== '*').length;
|
||||
if (minExpectedImms !== expectedImms.length)
|
||||
assert.ge(imms.length, minExpectedImms, `"${op}" expects at least ${minExpectedImms} immediate${minExpectedImms !== 1 ? 's' : ''}, got ${imms.length}`);
|
||||
else
|
||||
assert.eq(imms.length, minExpectedImms, `"${op}" expects exactly ${minExpectedImms} immediate${minExpectedImms !== 1 ? 's' : ''}, got ${imms.length}`);
|
||||
for (let idx = 0; idx !== expectedImms.length; ++idx) {
|
||||
const got = imms[idx];
|
||||
const expect = expectedImms[idx];
|
||||
switch (expect.name) {
|
||||
case "function_index":
|
||||
assert.truthy(_isValidValue(got, "i32") && got >= 0, `Invalid value on ${op}: got "${got}", expected non-negative i32`);
|
||||
// FIXME check function indices. https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
break;
|
||||
case "local_index": break; // improve checking https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
case "global_index": break; // improve checking https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
case "type_index": break; // improve checking https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
case "value":
|
||||
assert.truthy(_isValidValue(got, ret[0]), `Invalid value on ${op}: got "${got}", expected ${ret[0]}`);
|
||||
break;
|
||||
case "flags": break; // improve checking https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
case "offset": break; // improve checking https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
// Control:
|
||||
case "default_target": break; // improve checking https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
case "relative_depth": break; // improve checking https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
case "sig":
|
||||
assert.truthy(WASM.isValidBlockType(imms[idx]), `Invalid block type on ${op}: "${imms[idx]}"`);
|
||||
break;
|
||||
case "target_count": break; // improve checking https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
case "target_table": break; // improve checking https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
case "reserved": break; // improve checking https://bugs.webkit.org/show_bug.cgi?id=163421
|
||||
default: throw new Error(`Implementation problem: unhandled immediate "${expect.name}" on "${op}"`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const _createFunctionBuilder = (func, builder, previousBuilder) => {
|
||||
let functionBuilder = {};
|
||||
for (const op in WASM.description.opcode) {
|
||||
const name = util.toJavaScriptName(op);
|
||||
const value = WASM.description.opcode[op].value;
|
||||
const ret = WASM.description.opcode[op]["return"];
|
||||
const param = WASM.description.opcode[op].parameter;
|
||||
const imm = WASM.description.opcode[op].immediate;
|
||||
|
||||
const checkStackArgs = builder._checked ? _checkStackArgs : () => {};
|
||||
const checkStackReturn = builder._checked ? _checkStackReturn : () => {};
|
||||
const checkImms = builder._checked ? _checkImms : () => {};
|
||||
|
||||
functionBuilder[name] = (...args) => {
|
||||
let nextBuilder;
|
||||
switch (name) {
|
||||
default:
|
||||
nextBuilder = functionBuilder;
|
||||
break;
|
||||
case "End":
|
||||
nextBuilder = previousBuilder;
|
||||
break;
|
||||
case "Block":
|
||||
case "Loop":
|
||||
case "If":
|
||||
nextBuilder = _createFunctionBuilder(func, builder, functionBuilder);
|
||||
break;
|
||||
}
|
||||
|
||||
// Passing a function as the argument is a way to nest blocks lexically.
|
||||
const continuation = args[args.length - 1];
|
||||
const hasContinuation = typeof(continuation) === "function";
|
||||
const imms = hasContinuation ? args.slice(0, -1) : args; // FIXME: allow passing in stack values, as-if code were a stack machine. Just check for a builder to this function, and drop. https://bugs.webkit.org/show_bug.cgi?id=163422
|
||||
checkImms(op, imms, imm, ret);
|
||||
checkStackArgs(op, param);
|
||||
checkStackReturn(op, ret);
|
||||
const stackArgs = []; // FIXME https://bugs.webkit.org/show_bug.cgi?id=162706
|
||||
func.code.push({ name: op, value: value, arguments: stackArgs, immediates: imms });
|
||||
if (hasContinuation)
|
||||
return _errorHandlingProxyFor(continuation(nextBuilder).End());
|
||||
return _errorHandlingProxyFor(nextBuilder);
|
||||
};
|
||||
};
|
||||
|
||||
return _errorHandlingProxyFor(functionBuilder);
|
||||
}
|
||||
|
||||
const _createFunction = (section, builder, previousBuilder) => {
|
||||
return (...args) => {
|
||||
const nameOffset = (typeof(args[0]) === "string") >>> 0;
|
||||
const functionName = nameOffset ? args[0] : undefined;
|
||||
let signature = args[0 + nameOffset];
|
||||
const locals = args[1 + nameOffset] === undefined ? [] : args[1 + nameOffset];
|
||||
for (const local of locals)
|
||||
assert.truthy(WASM.isValidValueType(local), `Type of local: ${local} needs to be a valid value type`);
|
||||
|
||||
if (typeof(signature) === "undefined")
|
||||
signature = { params: [] };
|
||||
|
||||
let type;
|
||||
let params;
|
||||
if (typeof signature === "object") {
|
||||
assert.hasObjectProperty(signature, "params", `Expect function signature to be an object with a "params" field, got "${signature}"`);
|
||||
let ret;
|
||||
([params, ret] = _normalizeFunctionSignature(signature.params, signature.ret));
|
||||
signature = {params, ret};
|
||||
type = _maybeRegisterType(builder, signature);
|
||||
} else {
|
||||
assert.truthy(typeof signature === "number");
|
||||
const typeSection = builder._getSection("Type");
|
||||
assert.truthy(!!typeSection);
|
||||
// FIXME: we should allow indices that exceed this to be able to
|
||||
// test JSCs validator is correct. https://bugs.webkit.org/show_bug.cgi?id=165786
|
||||
assert.truthy(signature < typeSection.data.length);
|
||||
type = signature;
|
||||
signature = typeSection.data[signature];
|
||||
assert.hasObjectProperty(signature, "params", `Expect function signature to be an object with a "params" field, got "${signature}"`);
|
||||
params = signature.params;
|
||||
}
|
||||
|
||||
const func = {
|
||||
name: functionName,
|
||||
type,
|
||||
signature: signature,
|
||||
locals: params.concat(locals), // Parameters are the first locals.
|
||||
parameterCount: params.length,
|
||||
code: []
|
||||
};
|
||||
|
||||
const functionSection = builder._getSection("Function");
|
||||
if (functionSection)
|
||||
functionSection.data.push(func.type);
|
||||
|
||||
section.data.push(func);
|
||||
builder._registerFunctionToIndexSpace(functionName);
|
||||
|
||||
return _createFunctionBuilder(func, builder, previousBuilder);
|
||||
}
|
||||
};
|
||||
|
||||
export default class Builder {
|
||||
constructor() {
|
||||
this.setChecked(true);
|
||||
let preamble = {};
|
||||
for (const p of WASM.description.preamble)
|
||||
preamble[p.name] = p.value;
|
||||
this.setPreamble(preamble);
|
||||
this._sections = [];
|
||||
this._functionIndexSpace = new Map();
|
||||
this._functionIndexSpaceCount = 0;
|
||||
this._registerSectionBuilders();
|
||||
}
|
||||
setChecked(checked) {
|
||||
this._checked = checked;
|
||||
return this;
|
||||
}
|
||||
setPreamble(p) {
|
||||
this._preamble = Object.assign(this._preamble || {}, p);
|
||||
return this;
|
||||
}
|
||||
_functionIndexSpaceKeyHash(obj) {
|
||||
// We don't need a full hash, just something that has a defined order for Map. Objects we insert aren't nested.
|
||||
if (typeof(obj) !== 'object')
|
||||
return obj;
|
||||
const keys = Object.keys(obj).sort();
|
||||
let entries = [];
|
||||
for (let k in keys)
|
||||
entries.push([k, obj[k]]);
|
||||
return JSON.stringify(entries);
|
||||
}
|
||||
_registerFunctionToIndexSpace(name) {
|
||||
if (typeof(name) === "undefined") {
|
||||
// Registering a nameless function still adds it to the function index space. Register it as something that can't normally be registered.
|
||||
name = {};
|
||||
}
|
||||
const value = this._functionIndexSpaceCount++;
|
||||
// Collisions are fine: we'll simply count the function and forget the previous one.
|
||||
this._functionIndexSpace.set(this._functionIndexSpaceKeyHash(name), value);
|
||||
// Map it both ways, the number space is distinct from the name space.
|
||||
this._functionIndexSpace.set(this._functionIndexSpaceKeyHash(value), name);
|
||||
}
|
||||
_getFunctionFromIndexSpace(name) {
|
||||
return this._functionIndexSpace.get(this._functionIndexSpaceKeyHash(name));
|
||||
}
|
||||
_registerSectionBuilders() {
|
||||
for (const section in WASM.description.section) {
|
||||
switch (section) {
|
||||
case "Type":
|
||||
this[section] = function() {
|
||||
const s = this._addSection(section);
|
||||
const builder = this;
|
||||
const typeBuilder = {
|
||||
End: () => builder,
|
||||
Func: (params, ret) => {
|
||||
[params, ret] = _normalizeFunctionSignature(params, ret);
|
||||
s.data.push({ params: params, ret: ret });
|
||||
return _errorHandlingProxyFor(typeBuilder);
|
||||
},
|
||||
};
|
||||
return _errorHandlingProxyFor(typeBuilder);
|
||||
};
|
||||
break;
|
||||
|
||||
case "Import":
|
||||
this[section] = function() {
|
||||
const s = this._addSection(section);
|
||||
const importBuilder = {
|
||||
End: () => this,
|
||||
};
|
||||
importBuilder.Global = _importGlobalContinuation(this, s, importBuilder);
|
||||
importBuilder.Function = _importFunctionContinuation(this, s, importBuilder);
|
||||
importBuilder.Memory = _importMemoryContinuation(this, s, importBuilder);
|
||||
importBuilder.Table = _importTableContinuation(this, s, importBuilder);
|
||||
return _errorHandlingProxyFor(importBuilder);
|
||||
};
|
||||
break;
|
||||
|
||||
case "Function":
|
||||
this[section] = function() {
|
||||
const s = this._addSection(section);
|
||||
const functionBuilder = {
|
||||
End: () => this
|
||||
// FIXME: add ability to add this with whatever.
|
||||
};
|
||||
return _errorHandlingProxyFor(functionBuilder);
|
||||
};
|
||||
break;
|
||||
|
||||
case "Table":
|
||||
this[section] = function() {
|
||||
const s = this._addSection(section);
|
||||
const tableBuilder = {
|
||||
End: () => this,
|
||||
Table: ({initial, maximum, element}) => {
|
||||
s.data.push({tableDescription: {initial, maximum, element}});
|
||||
return _errorHandlingProxyFor(tableBuilder);
|
||||
}
|
||||
};
|
||||
return _errorHandlingProxyFor(tableBuilder);
|
||||
};
|
||||
break;
|
||||
|
||||
case "Memory":
|
||||
this[section] = function() {
|
||||
const s = this._addSection(section);
|
||||
const memoryBuilder = {
|
||||
End: () => this,
|
||||
InitialMaxPages: (initial, maximum) => {
|
||||
s.data.push({ initial, maximum });
|
||||
return _errorHandlingProxyFor(memoryBuilder);
|
||||
}
|
||||
};
|
||||
return _errorHandlingProxyFor(memoryBuilder);
|
||||
};
|
||||
break;
|
||||
|
||||
case "Global":
|
||||
this[section] = function() {
|
||||
const s = this._addSection(section);
|
||||
const globalBuilder = {
|
||||
End: () => this,
|
||||
GetGlobal: (type, initValue, mutability) => {
|
||||
s.data.push({ type, op: "get_global", mutability: _normalizeMutability(mutability), initValue });
|
||||
return _errorHandlingProxyFor(globalBuilder);
|
||||
}
|
||||
};
|
||||
for (let op of WASM.description.value_type) {
|
||||
globalBuilder[util.toJavaScriptName(op)] = (initValue, mutability) => {
|
||||
s.data.push({ type: op, op: op + ".const", mutability: _normalizeMutability(mutability), initValue });
|
||||
return _errorHandlingProxyFor(globalBuilder);
|
||||
};
|
||||
}
|
||||
return _errorHandlingProxyFor(globalBuilder);
|
||||
};
|
||||
break;
|
||||
|
||||
case "Export":
|
||||
this[section] = function() {
|
||||
const s = this._addSection(section);
|
||||
const exportBuilder = {
|
||||
End: () => this,
|
||||
};
|
||||
exportBuilder.Global = _exportGlobalContinuation(this, s, exportBuilder);
|
||||
exportBuilder.Function = _exportFunctionContinuation(this, s, exportBuilder);
|
||||
exportBuilder.Memory = _exportMemoryContinuation(this, s, exportBuilder);
|
||||
exportBuilder.Table = _exportTableContinuation(this, s, exportBuilder);
|
||||
return _errorHandlingProxyFor(exportBuilder);
|
||||
};
|
||||
break;
|
||||
|
||||
case "Start":
|
||||
this[section] = function(functionIndexOrName) {
|
||||
const s = this._addSection(section);
|
||||
const startBuilder = {
|
||||
End: () => this,
|
||||
};
|
||||
if (typeof(functionIndexOrName) !== "number" && typeof(functionIndexOrName) !== "string")
|
||||
throw new Error(`Start section's function index must either be a number or a string`);
|
||||
s.data.push(functionIndexOrName);
|
||||
return _errorHandlingProxyFor(startBuilder);
|
||||
};
|
||||
break;
|
||||
|
||||
case "Element":
|
||||
this[section] = function(...args) {
|
||||
if (args.length !== 0 && this._checked)
|
||||
throw new Error("You're doing it wrong. This element does not take arguments. You must chain the call with another Element()");
|
||||
|
||||
const s = this._addSection(section);
|
||||
const elementBuilder = {
|
||||
End: () => this,
|
||||
Element: ({tableIndex = 0, offset, functionIndices}) => {
|
||||
s.data.push({tableIndex, offset, functionIndices});
|
||||
return _errorHandlingProxyFor(elementBuilder);
|
||||
}
|
||||
};
|
||||
|
||||
return _errorHandlingProxyFor(elementBuilder);
|
||||
};
|
||||
break;
|
||||
|
||||
case "Code":
|
||||
this[section] = function() {
|
||||
const s = this._addSection(section);
|
||||
const builder = this;
|
||||
const codeBuilder = {
|
||||
End: () => {
|
||||
// We now have enough information to remap the export section's "type" and "index" according to the Code section we are currently ending.
|
||||
const typeSection = builder._getSection("Type");
|
||||
const importSection = builder._getSection("Import");
|
||||
const exportSection = builder._getSection("Export");
|
||||
const startSection = builder._getSection("Start");
|
||||
const codeSection = s;
|
||||
if (exportSection) {
|
||||
for (const e of exportSection.data) {
|
||||
if (e.kind !== "Function" || typeof(e.type) !== "undefined")
|
||||
continue;
|
||||
switch (typeof(e.index)) {
|
||||
default: throw new Error(`Unexpected export index "${e.index}"`);
|
||||
case "string": {
|
||||
const index = builder._getFunctionFromIndexSpace(e.index);
|
||||
assert.isNumber(index, `Export section contains undefined function "${e.index}"`);
|
||||
e.index = index;
|
||||
} // Fallthrough.
|
||||
case "number": {
|
||||
const index = builder._getFunctionFromIndexSpace(e.index);
|
||||
if (builder._checked)
|
||||
assert.isNotUndef(index, `Export "${e.field}" does not correspond to a defined value in the function index space`);
|
||||
} break;
|
||||
case "undefined":
|
||||
throw new Error(`Unimplemented: Function().End() with undefined export index`); // FIXME
|
||||
}
|
||||
if (typeof(e.type) === "undefined") {
|
||||
// This must be a function export from the Code section (re-exports were handled earlier).
|
||||
let functionIndexSpaceOffset = 0;
|
||||
if (importSection) {
|
||||
for (const {kind} of importSection.data) {
|
||||
if (kind === "Function")
|
||||
++functionIndexSpaceOffset;
|
||||
}
|
||||
}
|
||||
const functionIndex = e.index - functionIndexSpaceOffset;
|
||||
e.type = codeSection.data[functionIndex].type;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (startSection) {
|
||||
const start = startSection.data[0];
|
||||
let mapped = builder._getFunctionFromIndexSpace(start);
|
||||
if (!builder._checked) {
|
||||
if (typeof(mapped) === "undefined")
|
||||
mapped = start; // In unchecked mode, simply use what was provided if it's nonsensical.
|
||||
assert.isA(start, "number"); // It can't be too nonsensical, otherwise we can't create a binary.
|
||||
startSection.data[0] = start;
|
||||
} else {
|
||||
if (typeof(mapped) === "undefined")
|
||||
throw new Error(`Start section refers to non-existant function '${start}'`);
|
||||
if (typeof(start) === "string" || typeof(start) === "object")
|
||||
startSection.data[0] = mapped;
|
||||
// FIXME in checked mode, test that the type is acceptable for start function. We probably want _registerFunctionToIndexSpace to also register types per index. https://bugs.webkit.org/show_bug.cgi?id=165658
|
||||
}
|
||||
}
|
||||
return _errorHandlingProxyFor(builder);
|
||||
},
|
||||
|
||||
};
|
||||
codeBuilder.Function = _createFunction(s, builder, codeBuilder);
|
||||
return _errorHandlingProxyFor(codeBuilder);
|
||||
};
|
||||
break;
|
||||
|
||||
case "Data":
|
||||
this[section] = function() {
|
||||
const s = this._addSection(section);
|
||||
const dataBuilder = {
|
||||
End: () => this,
|
||||
Segment: data => {
|
||||
assert.isArray(data);
|
||||
for (const datum of data) {
|
||||
assert.isNumber(datum);
|
||||
assert.ge(datum, 0);
|
||||
assert.le(datum, 0xff);
|
||||
}
|
||||
s.data.push({ data: data, index: 0, offset: 0 });
|
||||
let thisSegment = s.data[s.data.length - 1];
|
||||
const segmentBuilder = {
|
||||
End: () => dataBuilder,
|
||||
Index: index => {
|
||||
assert.eq(index, 0); // Linear memory index must be zero in MVP.
|
||||
thisSegment.index = index;
|
||||
return _errorHandlingProxyFor(segmentBuilder);
|
||||
},
|
||||
Offset: offset => {
|
||||
// FIXME allow complex init_expr here. https://bugs.webkit.org/show_bug.cgi?id=165700
|
||||
assert.isNumber(offset);
|
||||
thisSegment.offset = offset;
|
||||
return _errorHandlingProxyFor(segmentBuilder);
|
||||
},
|
||||
};
|
||||
return _errorHandlingProxyFor(segmentBuilder);
|
||||
},
|
||||
};
|
||||
return _errorHandlingProxyFor(dataBuilder);
|
||||
};
|
||||
break;
|
||||
|
||||
default:
|
||||
this[section] = () => { throw new Error(`Unknown section type "${section}"`); };
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this.Unknown = function(name) {
|
||||
const s = this._addSection(name);
|
||||
const builder = this;
|
||||
const unknownBuilder = {
|
||||
End: () => builder,
|
||||
Byte: b => {
|
||||
assert.eq(b & 0xFF, b, `Unknown section expected byte, got: "${b}"`);
|
||||
s.data.push(b);
|
||||
return _errorHandlingProxyFor(unknownBuilder);
|
||||
}
|
||||
};
|
||||
return _errorHandlingProxyFor(unknownBuilder);
|
||||
};
|
||||
}
|
||||
_addSection(nameOrNumber, extraObject) {
|
||||
const name = typeof(nameOrNumber) === "string" ? nameOrNumber : "";
|
||||
const number = typeof(nameOrNumber) === "number" ? nameOrNumber : (WASM.description.section[name] ? WASM.description.section[name].value : _unknownSectionId);
|
||||
if (this._checked) {
|
||||
// Check uniqueness.
|
||||
for (const s of this._sections)
|
||||
if (number !== _unknownSectionId)
|
||||
assert.falsy(s.name === name && s.id === number, `Cannot have two sections with the same name "${name}" and ID ${number}`);
|
||||
// Check ordering.
|
||||
if ((number !== _unknownSectionId) && (this._sections.length !== 0)) {
|
||||
for (let i = this._sections.length - 1; i >= 0; --i) {
|
||||
if (this._sections[i].id === _unknownSectionId)
|
||||
continue;
|
||||
assert.le(this._sections[i].id, number, `Bad section ordering: "${this._sections[i].name}" cannot precede "${name}"`);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
const s = Object.assign({ name: name, id: number, data: [] }, extraObject || {});
|
||||
this._sections.push(s);
|
||||
return s;
|
||||
}
|
||||
_getSection(nameOrNumber) {
|
||||
switch (typeof(nameOrNumber)) {
|
||||
default: throw new Error(`Implementation problem: can not get section "${nameOrNumber}"`);
|
||||
case "string":
|
||||
for (const s of this._sections)
|
||||
if (s.name === nameOrNumber)
|
||||
return s;
|
||||
return undefined;
|
||||
case "number":
|
||||
for (const s of this._sections)
|
||||
if (s.id === nameOrNumber)
|
||||
return s;
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
optimize() {
|
||||
// FIXME Add more optimizations. https://bugs.webkit.org/show_bug.cgi?id=163424
|
||||
return this;
|
||||
}
|
||||
json() {
|
||||
const obj = {
|
||||
preamble: this._preamble,
|
||||
section: this._sections
|
||||
};
|
||||
// JSON.stringify serializes -0.0 as 0.0.
|
||||
const replacer = (key, value) => {
|
||||
if (value === 0.0 && 1.0 / value === -Infinity)
|
||||
return "NEGATIVE_ZERO";
|
||||
return value;
|
||||
};
|
||||
return JSON.stringify(obj, replacer);
|
||||
}
|
||||
AsmJS() {
|
||||
"use asm"; // For speed.
|
||||
// FIXME Create an asm.js equivalent string which can be eval'd. https://bugs.webkit.org/show_bug.cgi?id=163425
|
||||
throw new Error("asm.js not implemented yet");
|
||||
}
|
||||
WebAssembly() { return BuildWebAssembly.Binary(this._preamble, this._sections); }
|
||||
};
|
|
@ -1,261 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2016 Apple Inc. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import * as assert from 'assert.js';
|
||||
import LowLevelBinary from 'LowLevelBinary.js';
|
||||
import * as WASM from 'WASM.js';
|
||||
|
||||
const put = (bin, type, value) => bin[type](value);
|
||||
|
||||
const putResizableLimits = (bin, initial, maximum) => {
|
||||
assert.truthy(typeof initial === "number", "We expect 'initial' to be an integer");
|
||||
let hasMaximum = 0;
|
||||
if (typeof maximum === "number") {
|
||||
hasMaximum = 1;
|
||||
} else {
|
||||
assert.truthy(typeof maximum === "undefined", "We expect 'maximum' to be an integer if it's defined");
|
||||
}
|
||||
|
||||
put(bin, "varuint1", hasMaximum);
|
||||
put(bin, "varuint32", initial);
|
||||
if (hasMaximum)
|
||||
put(bin, "varuint32", maximum);
|
||||
};
|
||||
|
||||
const putTable = (bin, {initial, maximum, element}) => {
|
||||
assert.truthy(WASM.isValidType(element), "We expect 'element' to be a valid type. It was: " + element);
|
||||
put(bin, "varint7", WASM.typeValue[element]);
|
||||
|
||||
putResizableLimits(bin, initial, maximum);
|
||||
};
|
||||
|
||||
const valueType = WASM.description.type.i32.type
|
||||
|
||||
const putGlobalType = (bin, global) => {
|
||||
put(bin, valueType, WASM.typeValue[global.type]);
|
||||
put(bin, "varuint1", global.mutability);
|
||||
};
|
||||
|
||||
const putOp = (bin, op) => {
|
||||
put(bin, "uint8", op.value);
|
||||
if (op.arguments.length !== 0)
|
||||
throw new Error(`Unimplemented: arguments`); // FIXME https://bugs.webkit.org/show_bug.cgi?id=162706
|
||||
|
||||
switch (op.name) {
|
||||
default:
|
||||
for (let i = 0; i < op.immediates.length; ++i) {
|
||||
const type = WASM.description.opcode[op.name].immediate[i].type
|
||||
if (!bin[type])
|
||||
throw new TypeError(`Unknown type: ${type} in op: ${op.name}`);
|
||||
put(bin, type, op.immediates[i]);
|
||||
}
|
||||
break;
|
||||
case "i32.const": {
|
||||
assert.eq(op.immediates.length, 1);
|
||||
let imm = op.immediates[0];
|
||||
// Do a static cast to make large int32s signed.
|
||||
if (imm >= 2 ** 31)
|
||||
imm = imm - (2 ** 32);
|
||||
put(bin, "varint32", imm);
|
||||
break;
|
||||
}
|
||||
case "br_table":
|
||||
put(bin, "varuint32", op.immediates.length - 1);
|
||||
for (let imm of op.immediates)
|
||||
put(bin, "varuint32", imm);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
const putInitExpr = (bin, expr) => {
|
||||
putOp(bin, { value: WASM.description.opcode[expr.op].value, name: expr.op, immediates: [expr.initValue], arguments: [] });
|
||||
putOp(bin, { value: WASM.description.opcode.end.value, name: "end", immediates: [], arguments: [] });
|
||||
};
|
||||
|
||||
const emitters = {
|
||||
Type: (section, bin) => {
|
||||
put(bin, "varuint32", section.data.length);
|
||||
for (const entry of section.data) {
|
||||
put(bin, "varint7", WASM.typeValue["func"]);
|
||||
put(bin, "varuint32", entry.params.length);
|
||||
for (const param of entry.params)
|
||||
put(bin, "varint7", WASM.typeValue[param]);
|
||||
if (entry.ret === "void")
|
||||
put(bin, "varuint1", 0);
|
||||
else {
|
||||
put(bin, "varuint1", 1);
|
||||
put(bin, "varint7", WASM.typeValue[entry.ret]);
|
||||
}
|
||||
}
|
||||
},
|
||||
Import: (section, bin) => {
|
||||
put(bin, "varuint32", section.data.length);
|
||||
for (const entry of section.data) {
|
||||
put(bin, "string", entry.module);
|
||||
put(bin, "string", entry.field);
|
||||
put(bin, "uint8", WASM.externalKindValue[entry.kind]);
|
||||
switch (entry.kind) {
|
||||
default: throw new Error(`Implementation problem: unexpected kind ${entry.kind}`);
|
||||
case "Function": {
|
||||
put(bin, "varuint32", entry.type);
|
||||
break;
|
||||
}
|
||||
case "Table": {
|
||||
putTable(bin, entry.tableDescription);
|
||||
break;
|
||||
}
|
||||
case "Memory": {
|
||||
let {initial, maximum} = entry.memoryDescription;
|
||||
putResizableLimits(bin, initial, maximum);
|
||||
break;
|
||||
};
|
||||
case "Global":
|
||||
putGlobalType(bin, entry.globalDescription);
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Function: (section, bin) => {
|
||||
put(bin, "varuint32", section.data.length);
|
||||
for (const signature of section.data)
|
||||
put(bin, "varuint32", signature);
|
||||
},
|
||||
|
||||
Table: (section, bin) => {
|
||||
put(bin, "varuint32", section.data.length);
|
||||
for (const {tableDescription} of section.data) {
|
||||
putTable(bin, tableDescription);
|
||||
}
|
||||
},
|
||||
|
||||
Memory: (section, bin) => {
|
||||
// Flags, currently can only be [0,1]
|
||||
put(bin, "varuint1", section.data.length);
|
||||
for (const memory of section.data)
|
||||
putResizableLimits(bin, memory.initial, memory.maximum);
|
||||
},
|
||||
|
||||
Global: (section, bin) => {
|
||||
put(bin, "varuint32", section.data.length);
|
||||
for (const global of section.data) {
|
||||
putGlobalType(bin, global);
|
||||
putInitExpr(bin, global)
|
||||
}
|
||||
},
|
||||
|
||||
Export: (section, bin) => {
|
||||
put(bin, "varuint32", section.data.length);
|
||||
for (const entry of section.data) {
|
||||
put(bin, "string", entry.field);
|
||||
put(bin, "uint8", WASM.externalKindValue[entry.kind]);
|
||||
switch (entry.kind) {
|
||||
case "Global":
|
||||
case "Function":
|
||||
case "Memory":
|
||||
case "Table":
|
||||
put(bin, "varuint32", entry.index);
|
||||
break;
|
||||
default: throw new Error(`Implementation problem: unexpected kind ${entry.kind}`);
|
||||
}
|
||||
}
|
||||
},
|
||||
Start: (section, bin) => {
|
||||
put(bin, "varuint32", section.data[0]);
|
||||
},
|
||||
Element: (section, bin) => {
|
||||
const data = section.data;
|
||||
put(bin, "varuint32", data.length);
|
||||
for (const {tableIndex, offset, functionIndices} of data) {
|
||||
put(bin, "varuint32", tableIndex);
|
||||
|
||||
let initExpr;
|
||||
if (typeof offset === "number")
|
||||
initExpr = {op: "i32.const", initValue: offset};
|
||||
else
|
||||
initExpr = offset;
|
||||
putInitExpr(bin, initExpr);
|
||||
|
||||
put(bin, "varuint32", functionIndices.length);
|
||||
for (const functionIndex of functionIndices)
|
||||
put(bin, "varuint32", functionIndex);
|
||||
}
|
||||
},
|
||||
|
||||
Code: (section, bin) => {
|
||||
put(bin, "varuint32", section.data.length);
|
||||
for (const func of section.data) {
|
||||
let funcBin = bin.newPatchable("varuint32");
|
||||
const localCount = func.locals.length - func.parameterCount;
|
||||
put(funcBin, "varuint32", localCount);
|
||||
for (let i = func.parameterCount; i < func.locals.length; ++i) {
|
||||
put(funcBin, "varuint32", 1);
|
||||
put(funcBin, "varint7", WASM.typeValue[func.locals[i]]);
|
||||
}
|
||||
|
||||
for (const op of func.code)
|
||||
putOp(funcBin, op);
|
||||
|
||||
funcBin.apply();
|
||||
}
|
||||
},
|
||||
|
||||
Data: (section, bin) => {
|
||||
put(bin, "varuint32", section.data.length);
|
||||
for (const datum of section.data) {
|
||||
put(bin, "varuint32", datum.index);
|
||||
// FIXME allow complex init_expr here. https://bugs.webkit.org/show_bug.cgi?id=165700
|
||||
// For now we only handle i32.const as offset.
|
||||
put(bin, "uint8", WASM.description.opcode["i32.const"].value);
|
||||
put(bin, WASM.description.opcode["i32.const"].immediate[0].type, datum.offset);
|
||||
put(bin, "uint8", WASM.description.opcode["end"].value);
|
||||
put(bin, "varuint32", datum.data.length);
|
||||
for (const byte of datum.data)
|
||||
put(bin, "uint8", byte);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export const Binary = (preamble, sections) => {
|
||||
let wasmBin = new LowLevelBinary();
|
||||
for (const p of WASM.description.preamble)
|
||||
put(wasmBin, p.type, preamble[p.name]);
|
||||
for (const section of sections) {
|
||||
put(wasmBin, WASM.sectionEncodingType, section.id);
|
||||
let sectionBin = wasmBin.newPatchable("varuint32");
|
||||
const emitter = emitters[section.name];
|
||||
if (emitter)
|
||||
emitter(section, sectionBin);
|
||||
else {
|
||||
// Unknown section.
|
||||
put(sectionBin, "string", section.name);
|
||||
for (const byte of section.data)
|
||||
put(sectionBin, "uint8", byte);
|
||||
}
|
||||
sectionBin.apply();
|
||||
}
|
||||
wasmBin.trim();
|
||||
return wasmBin;
|
||||
};
|
|
@ -1,339 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2016 Apple Inc. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import * as assert from 'assert.js';
|
||||
import * as WASM from 'WASM.js';
|
||||
|
||||
const _initialAllocationSize = 1024;
|
||||
const _growAllocationSize = allocated => allocated * 2;
|
||||
|
||||
export const varuint32Min = 0;
|
||||
export const varint7Min = -0b1000000;
|
||||
export const varint7Max = 0b111111;
|
||||
export const varuint7Max = 0b1111111;
|
||||
export const varuint32Max = ((((1 << 31) >>> 0) - 1) * 2) + 1;
|
||||
export const varint32Min = -((1 << 31) >>> 0);
|
||||
export const varint32Max = ((1 << 31) - 1) >>> 0;
|
||||
export const varBitsMax = 5;
|
||||
|
||||
const _getterRangeCheck = (llb, at, size) => {
|
||||
if (0 > at || at + size > llb._used)
|
||||
throw new RangeError(`[${at}, ${at + size}) is out of buffer range [0, ${llb._used})`);
|
||||
};
|
||||
|
||||
const _hexdump = (buf, size) => {
|
||||
let s = "";
|
||||
const width = 16;
|
||||
const base = 16;
|
||||
for (let row = 0; row * width < size; ++row) {
|
||||
const address = (row * width).toString(base);
|
||||
s += "0".repeat(8 - address.length) + address;
|
||||
let chars = "";
|
||||
for (let col = 0; col !== width; ++col) {
|
||||
const idx = row * width + col;
|
||||
if (idx < size) {
|
||||
const byte = buf[idx];
|
||||
const bytestr = byte.toString(base);
|
||||
s += " " + (bytestr.length === 1 ? "0" + bytestr : bytestr);
|
||||
chars += 0x20 <= byte && byte < 0x7F ? String.fromCharCode(byte) : "·";
|
||||
} else {
|
||||
s += " ";
|
||||
chars += " ";
|
||||
}
|
||||
}
|
||||
s+= " |" + chars + "|\n";
|
||||
}
|
||||
return s;
|
||||
};
|
||||
|
||||
export default class LowLevelBinary {
|
||||
constructor() {
|
||||
this._buf = new Uint8Array(_initialAllocationSize);
|
||||
this._used = 0;
|
||||
}
|
||||
|
||||
newPatchable(type) { return new PatchableLowLevelBinary(type, this); }
|
||||
|
||||
// Utilities.
|
||||
get() { return this._buf; }
|
||||
trim() { this._buf = this._buf.slice(0, this._used); }
|
||||
|
||||
hexdump() { return _hexdump(this._buf, this._used); }
|
||||
_maybeGrow(bytes) {
|
||||
const allocated = this._buf.length;
|
||||
if (allocated - this._used < bytes) {
|
||||
let buf = new Uint8Array(_growAllocationSize(allocated));
|
||||
buf.set(this._buf);
|
||||
this._buf = buf;
|
||||
}
|
||||
}
|
||||
_push8(v) { this._buf[this._used] = v & 0xFF; this._used += 1; }
|
||||
|
||||
// Data types.
|
||||
uint8(v) {
|
||||
if ((v & 0xFF) >>> 0 !== v)
|
||||
throw new RangeError(`Invalid uint8 ${v}`);
|
||||
this._maybeGrow(1);
|
||||
this._push8(v);
|
||||
}
|
||||
uint16(v) {
|
||||
if ((v & 0xFFFF) >>> 0 !== v)
|
||||
throw new RangeError(`Invalid uint16 ${v}`);
|
||||
this._maybeGrow(2);
|
||||
this._push8(v);
|
||||
this._push8(v >>> 8);
|
||||
}
|
||||
uint24(v) {
|
||||
if ((v & 0xFFFFFF) >>> 0 !== v)
|
||||
throw new RangeError(`Invalid uint24 ${v}`);
|
||||
this._maybeGrow(3);
|
||||
this._push8(v);
|
||||
this._push8(v >>> 8);
|
||||
this._push8(v >>> 16);
|
||||
}
|
||||
uint32(v) {
|
||||
if ((v & 0xFFFFFFFF) >>> 0 !== v)
|
||||
throw new RangeError(`Invalid uint32 ${v}`);
|
||||
this._maybeGrow(4);
|
||||
this._push8(v);
|
||||
this._push8(v >>> 8);
|
||||
this._push8(v >>> 16);
|
||||
this._push8(v >>> 24);
|
||||
}
|
||||
float(v) {
|
||||
if (isNaN(v))
|
||||
throw new RangeError("unimplemented, NaNs");
|
||||
// Unfortunately, we cannot just view the actual buffer as a Float32Array since it needs to be 4 byte aligned
|
||||
let buffer = new ArrayBuffer(4);
|
||||
let floatView = new Float32Array(buffer);
|
||||
let int8View = new Uint8Array(buffer);
|
||||
floatView[0] = v;
|
||||
for (let byte of int8View)
|
||||
this._push8(byte);
|
||||
}
|
||||
|
||||
double(v) {
|
||||
if (isNaN(v))
|
||||
throw new RangeError("unimplemented, NaNs");
|
||||
// Unfortunately, we cannot just view the actual buffer as a Float64Array since it needs to be 4 byte aligned
|
||||
let buffer = new ArrayBuffer(8);
|
||||
let floatView = new Float64Array(buffer);
|
||||
let int8View = new Uint8Array(buffer);
|
||||
floatView[0] = v;
|
||||
for (let byte of int8View)
|
||||
this._push8(byte);
|
||||
}
|
||||
|
||||
varuint32(v) {
|
||||
assert.isNumber(v);
|
||||
if (v < varuint32Min || varuint32Max < v)
|
||||
throw new RangeError(`Invalid varuint32 ${v} range is [${varuint32Min}, ${varuint32Max}]`);
|
||||
while (v >= 0x80) {
|
||||
this.uint8(0x80 | (v & 0x7F));
|
||||
v >>>= 7;
|
||||
}
|
||||
this.uint8(v);
|
||||
}
|
||||
varint32(v) {
|
||||
assert.isNumber(v);
|
||||
if (v < varint32Min || varint32Max < v)
|
||||
throw new RangeError(`Invalid varint32 ${v} range is [${varint32Min}, ${varint32Max}]`);
|
||||
do {
|
||||
const b = v & 0x7F;
|
||||
v >>= 7;
|
||||
if ((v === 0 && ((b & 0x40) === 0)) || (v === -1 && ((b & 0x40) === 0x40))) {
|
||||
this.uint8(b & 0x7F);
|
||||
break;
|
||||
}
|
||||
this.uint8(0x80 | b);
|
||||
} while (true);
|
||||
}
|
||||
varuint64(v) {
|
||||
assert.isNumber(v);
|
||||
if (v < varuint32Min || varuint32Max < v)
|
||||
throw new RangeError(`unimplemented: varuint64 larger than 32-bit`);
|
||||
this.varuint32(v); // FIXME implement 64-bit var{u}int https://bugs.webkit.org/show_bug.cgi?id=163420
|
||||
}
|
||||
varint64(v) {
|
||||
assert.isNumber(v);
|
||||
if (v < varint32Min || varint32Max < v)
|
||||
throw new RangeError(`unimplemented: varint64 larger than 32-bit`);
|
||||
this.varint32(v); // FIXME implement 64-bit var{u}int https://bugs.webkit.org/show_bug.cgi?id=163420
|
||||
}
|
||||
varuint1(v) {
|
||||
if (v !== 0 && v !== 1)
|
||||
throw new RangeError(`Invalid varuint1 ${v} range is [0, 1]`);
|
||||
this.varuint32(v);
|
||||
}
|
||||
varint7(v) {
|
||||
if (v < varint7Min || varint7Max < v)
|
||||
throw new RangeError(`Invalid varint7 ${v} range is [${varint7Min}, ${varint7Max}]`);
|
||||
this.varint32(v);
|
||||
}
|
||||
varuint7(v) {
|
||||
if (v < varuint32Min || varuint7Max < v)
|
||||
throw new RangeError(`Invalid varuint7 ${v} range is [${varuint32Min}, ${varuint7Max}]`);
|
||||
this.varuint32(v);
|
||||
}
|
||||
block_type(v) {
|
||||
if (!WASM.isValidBlockType(v))
|
||||
throw new Error(`Invalid block type ${v}`);
|
||||
this.varint7(WASM.typeValue[v]);
|
||||
}
|
||||
string(str) {
|
||||
let patch = this.newPatchable("varuint32");
|
||||
for (const char of str) {
|
||||
// Encode UTF-8 2003 code points.
|
||||
const code = char.codePointAt();
|
||||
if (code <= 0x007F) {
|
||||
const utf8 = code;
|
||||
patch.uint8(utf8);
|
||||
} else if (code <= 0x07FF) {
|
||||
const utf8 = 0x80C0 | ((code & 0x7C0) >> 6) | ((code & 0x3F) << 8);
|
||||
patch.uint16(utf8);
|
||||
} else if (code <= 0xFFFF) {
|
||||
const utf8 = 0x8080E0 | ((code & 0xF000) >> 12) | ((code & 0xFC0) << 2) | ((code & 0x3F) << 16);
|
||||
patch.uint24(utf8);
|
||||
} else if (code <= 0x10FFFF) {
|
||||
const utf8 = (0x808080F0 | ((code & 0x1C0000) >> 18) | ((code & 0x3F000) >> 4) | ((code & 0xFC0) << 10) | ((code & 0x3F) << 24)) >>> 0;
|
||||
patch.uint32(utf8);
|
||||
} else
|
||||
throw new Error(`Unexpectedly large UTF-8 character code point '${char}' 0x${code.toString(16)}`);
|
||||
}
|
||||
patch.apply();
|
||||
}
|
||||
|
||||
// Getters.
|
||||
getSize() { return this._used; }
|
||||
getUint8(at) {
|
||||
_getterRangeCheck(this, at, 1);
|
||||
return this._buf[at];
|
||||
}
|
||||
getUint16(at) {
|
||||
_getterRangeCheck(this, at, 2);
|
||||
return this._buf[at] | (this._buf[at + 1] << 8);
|
||||
}
|
||||
getUint24(at) {
|
||||
_getterRangeCheck(this, at, 3);
|
||||
return this._buf[at] | (this._buf[at + 1] << 8) | (this._buf[at + 2] << 16);
|
||||
}
|
||||
getUint32(at) {
|
||||
_getterRangeCheck(this, at, 4);
|
||||
return (this._buf[at] | (this._buf[at + 1] << 8) | (this._buf[at + 2] << 16) | (this._buf[at + 3] << 24)) >>> 0;
|
||||
}
|
||||
getVaruint32(at) {
|
||||
let v = 0;
|
||||
let shift = 0;
|
||||
let byte = 0;
|
||||
do {
|
||||
byte = this.getUint8(at++);
|
||||
++read;
|
||||
v = (v | ((byte & 0x7F) << shift) >>> 0) >>> 0;
|
||||
shift += 7;
|
||||
} while ((byte & 0x80) !== 0);
|
||||
if (shift - 7 > 32) throw new RangeError(`Shifting too much at ${at}`);
|
||||
if ((shift == 35) && ((byte & 0xF0) != 0)) throw new Error(`Unexpected non-significant varuint32 bits in last byte 0x${byte.toString(16)}`);
|
||||
return { value: v, next: at };
|
||||
}
|
||||
getVarint32(at) {
|
||||
let v = 0;
|
||||
let shift = 0;
|
||||
let byte = 0;
|
||||
do {
|
||||
byte = this.getUint8(at++);
|
||||
v = (v | ((byte & 0x7F) << shift) >>> 0) >>> 0;
|
||||
shift += 7;
|
||||
} while ((byte & 0x80) !== 0);
|
||||
if (shift - 7 > 32) throw new RangeError(`Shifting too much at ${at}`);
|
||||
if ((shift == 35) && (((byte << 26) >> 30) != ((byte << 25) >> 31))) throw new Error(`Unexpected non-significant varint32 bits in last byte 0x${byte.toString(16)}`);
|
||||
if ((byte & 0x40) === 0x40) {
|
||||
const sext = shift < 32 ? 32 - shift : 0;
|
||||
v = (v << sext) >> sext;
|
||||
}
|
||||
return { value: v, next: at };
|
||||
}
|
||||
getVaruint1(at) {
|
||||
const res = this.getVaruint32(at);
|
||||
if (res.value !== 0 && res.value !== 1) throw new Error(`Expected a varuint1, got value ${res.value}`);
|
||||
return res;
|
||||
}
|
||||
getVaruint7(at) {
|
||||
const res = this.getVaruint32(at);
|
||||
if (res.value > varuint7Max) throw new Error(`Expected a varuint7, got value ${res.value}`);
|
||||
return res;
|
||||
}
|
||||
getString(at) {
|
||||
const size = this.getVaruint32(at);
|
||||
const last = size.next + size.value;
|
||||
let i = size.next;
|
||||
let str = "";
|
||||
while (i < last) {
|
||||
// Decode UTF-8 2003 code points.
|
||||
const peek = this.getUint8(i);
|
||||
let code;
|
||||
if ((peek & 0x80) === 0x0) {
|
||||
const utf8 = this.getUint8(i);
|
||||
assert.eq(utf8 & 0x80, 0x00);
|
||||
i += 1;
|
||||
code = utf8;
|
||||
} else if ((peek & 0xE0) === 0xC0) {
|
||||
const utf8 = this.getUint16(i);
|
||||
assert.eq(utf8 & 0xC0E0, 0x80C0);
|
||||
i += 2;
|
||||
code = ((utf8 & 0x1F) << 6) | ((utf8 & 0x3F00) >> 8);
|
||||
} else if ((peek & 0xF0) === 0xE0) {
|
||||
const utf8 = this.getUint24(i);
|
||||
assert.eq(utf8 & 0xC0C0F0, 0x8080E0);
|
||||
i += 3;
|
||||
code = ((utf8 & 0xF) << 12) | ((utf8 & 0x3F00) >> 2) | ((utf8 & 0x3F0000) >> 16);
|
||||
} else if ((peek & 0xF8) === 0xF0) {
|
||||
const utf8 = this.getUint32(i);
|
||||
assert.eq((utf8 & 0xC0C0C0F8) | 0, 0x808080F0 | 0);
|
||||
i += 4;
|
||||
code = ((utf8 & 0x7) << 18) | ((utf8 & 0x3F00) << 4) | ((utf8 & 0x3F0000) >> 10) | ((utf8 & 0x3F000000) >> 24);
|
||||
} else
|
||||
throw new Error(`Unexpectedly large UTF-8 initial byte 0x${peek.toString(16)}`);
|
||||
str += String.fromCodePoint(code);
|
||||
}
|
||||
if (i !== last)
|
||||
throw new Error(`String decoding read up to ${i}, expected ${last}, UTF-8 decoding was too greedy`);
|
||||
return str;
|
||||
}
|
||||
};
|
||||
|
||||
class PatchableLowLevelBinary extends LowLevelBinary {
|
||||
constructor(type, lowLevelBinary) {
|
||||
super();
|
||||
this.type = type;
|
||||
this.target = lowLevelBinary;
|
||||
this._buffered_bytes = 0;
|
||||
}
|
||||
_push8(v) { ++this._buffered_bytes; super._push8(v); }
|
||||
apply() {
|
||||
this.target[this.type](this._buffered_bytes);
|
||||
for (let i = 0; i < this._buffered_bytes; ++i)
|
||||
this.target.uint8(this._buf[i]);
|
||||
}
|
||||
};
|
|
@ -1,76 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2016-2017 Apple Inc. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import * as utilities from 'utilities.js';
|
||||
|
||||
const _mapValues = from => {
|
||||
let values = {};
|
||||
for (const key in from)
|
||||
values[key] = from[key].value;
|
||||
return values;
|
||||
};
|
||||
|
||||
export const description = utilities.json("wasm.json");
|
||||
export const type = Object.keys(description.type);
|
||||
const _typeSet = new Set(type);
|
||||
export const isValidType = v => _typeSet.has(v);
|
||||
export const typeValue = _mapValues(description.type);
|
||||
const _valueTypeSet = new Set(description.value_type);
|
||||
export const isValidValueType = v => _valueTypeSet.has(v);
|
||||
const _blockTypeSet = new Set(description.block_type);
|
||||
export const isValidBlockType = v => _blockTypeSet.has(v);
|
||||
export const externalKindValue = _mapValues(description.external_kind);
|
||||
export const sections = Object.keys(description.section);
|
||||
export const sectionEncodingType = description.section[sections[0]].type;
|
||||
|
||||
export function* opcodes(category = undefined) {
|
||||
for (let op in description.opcode)
|
||||
if (category !== undefined && description.opcode[op].category === category)
|
||||
yield { name: op, opcode: description.opcode[op] };
|
||||
};
|
||||
export const memoryAccessInfo = op => {
|
||||
// <-----------valueType-----------> <-------type-------><---------width--------> <--sign-->
|
||||
const classify = /((?:i32)|(?:i64)|(?:f32)|(?:f64))\.((?:load)|(?:store))((?:8)|(?:16)|(?:32))?_?((?:s|u)?)/;
|
||||
const found = op.name.match(classify);
|
||||
const valueType = found[1];
|
||||
const type = found[2];
|
||||
const width = parseInt(found[3] ? found[3] : valueType.slice(1));
|
||||
const sign = (() => {
|
||||
switch (found[4]) {
|
||||
case "s": return "signed";
|
||||
case "u": return "unsigned";
|
||||
default: return "agnostic";
|
||||
}
|
||||
})();
|
||||
return { valueType, type, width, sign };
|
||||
};
|
||||
|
||||
export const constForValueType = valueType => {
|
||||
for (let op in description.opcode)
|
||||
if (op.endsWith(".const") && description.opcode[op]["return"] == valueType)
|
||||
return op;
|
||||
throw new Error(`Implementation problem: no const type for ${valueType}`);
|
||||
};
|
||||
|
|
@ -1,197 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2016-2017 Apple Inc. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
const _fail = (msg, extra) => {
|
||||
throw new Error(msg + (extra ? ": " + extra : ""));
|
||||
};
|
||||
|
||||
export const isNotA = (v, t, msg) => {
|
||||
if (typeof v === t)
|
||||
_fail(`Shouldn't be ${t}`, msg);
|
||||
};
|
||||
|
||||
export const isA = (v, t, msg) => {
|
||||
if (typeof v !== t)
|
||||
_fail(`Should be ${t}, got ${typeof(v)}`, msg);
|
||||
};
|
||||
|
||||
export const isNotUndef = (v, msg) => isNotA(v, "undefined", msg);
|
||||
export const isUndef = (v, msg) => isA(v, "undefined", msg);
|
||||
export const notObject = (v, msg) => isNotA(v, "object", msg);
|
||||
export const isObject = (v, msg) => isA(v, "object", msg);
|
||||
export const notString = (v, msg) => isNotA(v, "string", msg);
|
||||
export const isString = (v, msg) => isA(v, "string", msg);
|
||||
export const notNumber = (v, msg) => isNotA(v, "number", msg);
|
||||
export const isNumber = (v, msg) => isA(v, "number", msg);
|
||||
export const notFunction = (v, msg) => isNotA(v, "function", msg);
|
||||
export const isFunction = (v, msg) => isA(v, "function", msg);
|
||||
|
||||
export const hasObjectProperty = (o, p, msg) => {
|
||||
isObject(o, msg);
|
||||
isNotUndef(o[p], msg, `expected object to have property ${p}`);
|
||||
};
|
||||
|
||||
export const isArray = (v, msg) => {
|
||||
if (!Array.isArray(v))
|
||||
_fail(`Expected an array, got ${typeof(v)}`, msg);
|
||||
};
|
||||
|
||||
export const isNotArray = (v, msg) => {
|
||||
if (Array.isArray(v))
|
||||
_fail(`Expected to not be an array`, msg);
|
||||
};
|
||||
|
||||
export const truthy = (v, msg) => {
|
||||
if (!v)
|
||||
_fail(`Expected truthy`, msg);
|
||||
};
|
||||
|
||||
export const falsy = (v, msg) => {
|
||||
if (v)
|
||||
_fail(`Expected falsy`, msg);
|
||||
};
|
||||
|
||||
export const eq = (lhs, rhs, msg) => {
|
||||
if (typeof lhs !== typeof rhs)
|
||||
_fail(`Not the same: "${lhs}" and "${rhs}"`, msg);
|
||||
if (Array.isArray(lhs) && Array.isArray(rhs) && (lhs.length === rhs.length)) {
|
||||
for (let i = 0; i !== lhs.length; ++i)
|
||||
eq(lhs[i], rhs[i], msg);
|
||||
} else if (lhs !== rhs) {
|
||||
if (typeof lhs === "number" && isNaN(lhs) && isNaN(rhs))
|
||||
return;
|
||||
_fail(`Not the same: "${lhs}" and "${rhs}"`, msg);
|
||||
} else {
|
||||
if (typeof lhs === "number" && (1.0 / lhs !== 1.0 / rhs)) // Distinguish -0.0 from 0.0.
|
||||
_fail(`Not the same: "${lhs}" and "${rhs}"`, msg);
|
||||
}
|
||||
};
|
||||
|
||||
export const matches = (lhs, rhs, msg) => {
|
||||
if (typeof lhs !== "string" || !(rhs instanceof RegExp))
|
||||
_fail(`Expected string and regex object, got ${typeof lhs} and ${typeof rhs}`, msg);
|
||||
if (!rhs.test(lhs))
|
||||
_fail(`"${msg}" does not match ${rhs}`, msg);
|
||||
};
|
||||
|
||||
const canonicalizeI32 = (number) => {
|
||||
if (Math.round(number) === number && number >= 2 ** 31)
|
||||
number = number - 2 ** 32;
|
||||
return number;
|
||||
}
|
||||
|
||||
export const eqI32 = (lhs, rhs, msg) => {
|
||||
return eq(canonicalizeI32(lhs), canonicalizeI32(rhs), msg);
|
||||
};
|
||||
|
||||
export const ge = (lhs, rhs, msg) => {
|
||||
isNotUndef(lhs);
|
||||
isNotUndef(rhs);
|
||||
if (!(lhs >= rhs))
|
||||
_fail(`Expected: "${lhs}" < "${rhs}"`, msg);
|
||||
};
|
||||
|
||||
export const le = (lhs, rhs, msg) => {
|
||||
isNotUndef(lhs);
|
||||
isNotUndef(rhs);
|
||||
if (!(lhs <= rhs))
|
||||
_fail(`Expected: "${lhs}" > "${rhs}"`, msg);
|
||||
};
|
||||
|
||||
const _throws = (func, type, message, ...args) => {
|
||||
try {
|
||||
func(...args);
|
||||
} catch (e) {
|
||||
if (e instanceof type) {
|
||||
if (e.message === message)
|
||||
return e;
|
||||
// Ignore source information at the end of the error message if the
|
||||
// expected message didn't specify that information. Sometimes it
|
||||
// changes, or it's tricky to get just right.
|
||||
const evaluatingIndex = e.message.indexOf(" (evaluating '");
|
||||
if (evaluatingIndex !== -1) {
|
||||
const cleanMessage = e.message.substring(0, evaluatingIndex);
|
||||
if (cleanMessage === message)
|
||||
return e;
|
||||
}
|
||||
}
|
||||
_fail(`Expected to throw a ${type.name} with message "${message}", got ${e.name} with message "${e.message}"`);
|
||||
}
|
||||
_fail(`Expected to throw a ${type.name} with message "${message}"`);
|
||||
};
|
||||
|
||||
export async function throwsAsync(promise, type, message) {
|
||||
try {
|
||||
await promise;
|
||||
} catch (e) {
|
||||
if (e instanceof type) {
|
||||
if (e.message === message)
|
||||
return e;
|
||||
// Ignore source information at the end of the error message if the
|
||||
// expected message didn't specify that information. Sometimes it
|
||||
// changes, or it's tricky to get just right.
|
||||
const evaluatingIndex = e.message.indexOf(" (evaluating '");
|
||||
if (evaluatingIndex !== -1) {
|
||||
const cleanMessage = e.message.substring(0, evaluatingIndex);
|
||||
if (cleanMessage === message)
|
||||
return e;
|
||||
}
|
||||
}
|
||||
_fail(`Expected to throw a ${type.name} with message "${message}", got ${e.name} with message "${e.message}"`);
|
||||
}
|
||||
_fail(`Expected to throw a ${type.name} with message "${message}"`);
|
||||
}
|
||||
|
||||
const _instanceof = (obj, type, msg) => {
|
||||
if (!(obj instanceof type))
|
||||
_fail(`Expected a ${typeof(type)}, got ${typeof obj}`);
|
||||
};
|
||||
|
||||
// Use underscore names to avoid clashing with builtin names.
|
||||
export {
|
||||
_throws as throws,
|
||||
_instanceof as instanceof,
|
||||
};
|
||||
|
||||
const asyncTestImpl = (promise, thenFunc, catchFunc) => {
|
||||
asyncTestStart(1);
|
||||
promise.then(thenFunc).catch(catchFunc);
|
||||
};
|
||||
|
||||
const printExn = (e) => {
|
||||
print("Failed: ", e);
|
||||
print(e.stack);
|
||||
};
|
||||
|
||||
export const asyncTest = (promise) => asyncTestImpl(promise, asyncTestPassed, printExn);
|
||||
export const asyncTestEq = (promise, expected) => {
|
||||
const thenCheck = (value) => {
|
||||
if (value === expected)
|
||||
return asyncTestPassed();
|
||||
print("Failed: got ", value, " but expected ", expected);
|
||||
|
||||
}
|
||||
asyncTestImpl(promise, thenCheck, printExn);
|
||||
};
|
Binary file not shown.
|
@ -1,93 +0,0 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
# Copyright (C) 2016 Apple Inc. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
|
||||
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
require 'fileutils'
|
||||
require 'getoptlong'
|
||||
require 'pathname'
|
||||
require 'rbconfig'
|
||||
require 'open3'
|
||||
|
||||
THIS_SCRIPT_PATH = Pathname.new(__FILE__).realpath
|
||||
WASM_PATH = THIS_SCRIPT_PATH.dirname
|
||||
raise unless WASM_PATH.basename.to_s == "wasm"
|
||||
raise unless WASM_PATH.dirname.basename.to_s == "JSTests"
|
||||
|
||||
def usage
|
||||
puts ""
|
||||
puts "usage:"
|
||||
puts " import-spec-tests.rb --spec <path-to-wasm-spec-git-repo> [-v]"
|
||||
puts ""
|
||||
puts " the wasm spec's git repo can be found here: https://github.com/WebAssembly/spec"
|
||||
puts ""
|
||||
exit 1
|
||||
end
|
||||
|
||||
$specDirectory = nil
|
||||
$verbose = false
|
||||
|
||||
GetoptLong.new(['--spec',GetoptLong::REQUIRED_ARGUMENT],
|
||||
['-v', GetoptLong::OPTIONAL_ARGUMENT],
|
||||
['--help', GetoptLong::OPTIONAL_ARGUMENT],
|
||||
).each {
|
||||
| opt, arg |
|
||||
case opt
|
||||
when '--help'
|
||||
usage
|
||||
when '--spec'
|
||||
$specDirectory = arg
|
||||
when '-v'
|
||||
$verbose = true
|
||||
end
|
||||
}
|
||||
|
||||
raise unless $specDirectory
|
||||
|
||||
$resultDirectory = File.join(WASM_PATH, "spec-tests")
|
||||
$harnessDirectory = File.join(WASM_PATH, "spec-harness")
|
||||
|
||||
$specTestDirectory = File.join($specDirectory, "test")
|
||||
|
||||
def removeDir(file)
|
||||
begin
|
||||
FileUtils.remove_dir(file)
|
||||
rescue
|
||||
puts "No directory: #{file}" if $verbose
|
||||
end
|
||||
end
|
||||
|
||||
removeDir($resultDirectory)
|
||||
removeDir($harnessDirectory)
|
||||
|
||||
FileUtils.mkdir($resultDirectory)
|
||||
FileUtils.cp_r(File.join($specTestDirectory, "harness"), $harnessDirectory)
|
||||
|
||||
$genScript = File.join($specTestDirectory, "build.py")
|
||||
stdout, stderr, status = Open3.capture3("#{$genScript} --js #{$resultDirectory}")
|
||||
if stderr != ""
|
||||
puts "failed to generate tests"
|
||||
puts "The error is:\n--------------\n #{stderr}\n--------------\n" if $verbose
|
||||
end
|
||||
puts stdout if $verbose
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
import * as assert from "../assert.js";
|
||||
|
||||
const fail = val => { throw new Error(`Expected promise to fail, instead got ${val}`); };
|
||||
const catcher = (errType, errMessage) => err => {
|
||||
assert.eq(errType, err);
|
||||
assert.eq(errMessage, err.message);
|
||||
};
|
||||
|
||||
let neuteredArray = new Uint8Array(1);
|
||||
transferArrayBuffer(neuteredArray.buffer);
|
||||
|
||||
const testAsyncFunction = func => {
|
||||
func(neuteredArray).then(fail).catch(catcher(TypeError, "underlying TypedArray has been detatched from the ArrayBuffer"));
|
||||
func(neuteredArray.buffer).then(fail).catch(catcher(TypeError, "underlying TypedArray has been detatched from the ArrayBuffer"));
|
||||
};
|
||||
|
||||
const testFunction = func => {
|
||||
assert.throws(() => func(neuteredArray), TypeError, "underlying TypedArray has been detatched from the ArrayBuffer");
|
||||
assert.throws(() => func(neuteredArray.buffer), TypeError, "underlying TypedArray has been detatched from the ArrayBuffer");
|
||||
};
|
||||
|
||||
const testConstructor = func => {
|
||||
assert.throws(() => new func(neuteredArray), TypeError, "underlying TypedArray has been detatched from the ArrayBuffer");
|
||||
assert.throws(() => new func(neuteredArray.buffer), TypeError, "underlying TypedArray has been detatched from the ArrayBuffer");
|
||||
};
|
||||
|
||||
testConstructor(WebAssembly.Module);
|
||||
testAsyncFunction(WebAssembly.compile);
|
||||
testFunction(WebAssembly.validate);
|
||||
testAsyncFunction(WebAssembly.instantiate);
|
|
@ -1,37 +0,0 @@
|
|||
import * as assert from '../assert.js';
|
||||
|
||||
const module = Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x1, 0x00, 0x00, 0x00);
|
||||
|
||||
let promises = [];
|
||||
|
||||
const runNearStackLimit = f => {
|
||||
const t = () => {
|
||||
try {
|
||||
return t();
|
||||
} catch (e) {
|
||||
return f();
|
||||
}
|
||||
};
|
||||
return t();
|
||||
};
|
||||
|
||||
const touchArgument = arg => promises.push(arg);
|
||||
|
||||
const compileMe = () => touchArgument(WebAssembly.compile(module));
|
||||
|
||||
async function testCompile() {
|
||||
await touchArgument(async function() {
|
||||
runNearStackLimit(compileMe);
|
||||
}());
|
||||
}
|
||||
|
||||
const instantiateMe = () => touchArgument(WebAssembly.instantiate(module));
|
||||
|
||||
async function testInstantiate() {
|
||||
await touchArgument(async function() {
|
||||
runNearStackLimit(instantiateMe);
|
||||
}());
|
||||
}
|
||||
|
||||
assert.asyncTest(testCompile());
|
||||
assert.asyncTest(testInstantiate());
|
Binary file not shown.
|
@ -1,2 +0,0 @@
|
|||
(module
|
||||
(global $constant (export "constant") i32 i32.const 42))
|
Binary file not shown.
|
@ -1,7 +0,0 @@
|
|||
(module
|
||||
(import "./t1.js" "default" (func $log))
|
||||
(type $t0 (func))
|
||||
(func $main (type $t0)
|
||||
)
|
||||
(start $main)
|
||||
)
|
|
@ -1 +0,0 @@
|
|||
import A from "./t1.js"
|
|
@ -1 +0,0 @@
|
|||
export * from "./t2.js"
|
|
@ -1 +0,0 @@
|
|||
export default function Cocoa() { }
|
|
@ -1,4 +0,0 @@
|
|||
import { sum } from "./sum.wasm"
|
||||
export function return42() {
|
||||
return 42;
|
||||
}
|
Binary file not shown.
|
@ -1,7 +0,0 @@
|
|||
(module
|
||||
(import "./entry.js" "return42" (func $return42 (result i32)))
|
||||
(type $t0 (func (param i32 i32) (result i32)))
|
||||
(func $sum (export "sum") (type $t0) (param $p0 i32) (param $p1 i32) (result i32)
|
||||
get_local $p1
|
||||
get_local $p0
|
||||
i32.add))
|
|
@ -1,11 +0,0 @@
|
|||
import * as sum from "./sum.wasm"
|
||||
import * as assert from '../assert.js';
|
||||
|
||||
assert.isObject(sum);
|
||||
assert.isFunction(sum.sum);
|
||||
assert.eq(sum.sum(32, 42), 74);
|
||||
assert.eq(sum.sum(-2, 42), 40);
|
||||
|
||||
assert.throws(() => {
|
||||
sum.sum = 32;
|
||||
}, TypeError, `Attempted to assign to readonly property.`);
|
|
@ -1,10 +0,0 @@
|
|||
import { sum } from "./sum.wasm"
|
||||
import * as assert from '../assert.js';
|
||||
|
||||
assert.isFunction(sum);
|
||||
assert.eq(sum(32, 42), 74);
|
||||
assert.eq(sum(-2, 42), 40);
|
||||
|
||||
assert.throws(() => {
|
||||
sum = 32;
|
||||
}, TypeError, `Attempted to assign to readonly property.`);
|
|
@ -1,8 +0,0 @@
|
|||
import * as constant from "./constant.wasm"
|
||||
import * as assert from '../assert.js';
|
||||
|
||||
assert.isNumber(constant.constant);
|
||||
assert.eq(constant.constant, 42);
|
||||
assert.throws(() => {
|
||||
constant.constant = 200;
|
||||
}, TypeError, `Attempted to assign to readonly property.`);
|
|
@ -1,8 +0,0 @@
|
|||
import { constant } from "./constant.wasm"
|
||||
import * as assert from '../assert.js';
|
||||
|
||||
assert.isNumber(constant);
|
||||
assert.eq(constant, 42);
|
||||
assert.throws(() => {
|
||||
constant = 200;
|
||||
}, TypeError, `Attempted to assign to readonly property.`);
|
|
@ -1,12 +0,0 @@
|
|||
import * as memory from "./memory.wasm"
|
||||
import * as assert from '../assert.js';
|
||||
|
||||
assert.instanceof(memory.memory, WebAssembly.Memory);
|
||||
let buffer = new Uint8Array(memory.memory.buffer);
|
||||
assert.eq(buffer[4], 0x10);
|
||||
assert.eq(buffer[5], 0x00);
|
||||
assert.eq(buffer[6], 0x10);
|
||||
assert.eq(buffer[7], 0x00);
|
||||
assert.throws(() => {
|
||||
memory.memory = 200;
|
||||
}, TypeError, `Attempted to assign to readonly property.`);
|
|
@ -1,12 +0,0 @@
|
|||
import { memory } from "./memory.wasm"
|
||||
import * as assert from '../assert.js';
|
||||
|
||||
assert.instanceof(memory, WebAssembly.Memory);
|
||||
let buffer = new Uint8Array(memory.buffer);
|
||||
assert.eq(buffer[4], 0x10);
|
||||
assert.eq(buffer[5], 0x00);
|
||||
assert.eq(buffer[6], 0x10);
|
||||
assert.eq(buffer[7], 0x00);
|
||||
assert.throws(() => {
|
||||
memory = 200;
|
||||
}, TypeError, `Attempted to assign to readonly property.`);
|
|
@ -1,15 +0,0 @@
|
|||
import * as table from "./table.wasm"
|
||||
import * as assert from '../assert.js';
|
||||
|
||||
assert.instanceof(table.table, WebAssembly.Table);
|
||||
assert.eq(table.table.length, 3);
|
||||
assert.isFunction(table.table.get(0));
|
||||
assert.isFunction(table.table.get(1));
|
||||
assert.eq(table.table.get(2), null);
|
||||
|
||||
assert.eq(table.table.get(0)(), 42);
|
||||
assert.eq(table.table.get(1)(), 83);
|
||||
|
||||
assert.throws(() => {
|
||||
table.table = 32;
|
||||
}, TypeError, `Attempted to assign to readonly property.`);
|
|
@ -1,15 +0,0 @@
|
|||
import { table } from "./table.wasm"
|
||||
import * as assert from '../assert.js';
|
||||
|
||||
assert.instanceof(table, WebAssembly.Table);
|
||||
assert.eq(table.length, 3);
|
||||
assert.isFunction(table.get(0));
|
||||
assert.isFunction(table.get(1));
|
||||
assert.eq(table.get(2), null);
|
||||
|
||||
assert.eq(table.get(0)(), 42);
|
||||
assert.eq(table.get(1)(), 83);
|
||||
|
||||
assert.throws(() => {
|
||||
table = 32;
|
||||
}, TypeError, `Attempted to assign to readonly property.`);
|
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
(module
|
||||
(memory $memory (export "memory") 17)
|
||||
(data (i32.const 4) "\10\00\10\00"))
|
Binary file not shown.
|
@ -1,7 +0,0 @@
|
|||
(module
|
||||
(import "./run-from-wasm/check.js" "check" (func $check (param i32)))
|
||||
(type $t0 (func))
|
||||
(func $main (type $t0)
|
||||
i32.const 42
|
||||
call $check)
|
||||
(start $main))
|
|
@ -1,6 +0,0 @@
|
|||
import * as assert from '../../assert.js';
|
||||
|
||||
export function check(value)
|
||||
{
|
||||
assert.eq(value, 42);
|
||||
}
|
Binary file not shown.
|
@ -1,12 +0,0 @@
|
|||
(module
|
||||
(global $g0 (mut i32) i32.const 0)
|
||||
(type $t0 (func))
|
||||
(func $increment (type $t0)
|
||||
get_global $g0
|
||||
i32.const 1
|
||||
i32.add
|
||||
set_global $g0)
|
||||
(start $increment)
|
||||
(type $t1 (func (result i32)))
|
||||
(func $get (export "get") (type $t1) (result i32)
|
||||
get_global $g0))
|
Binary file not shown.
|
@ -1,6 +0,0 @@
|
|||
(module
|
||||
(type $t0 (func (param i32 i32) (result i32)))
|
||||
(func $sum (export "sum") (type $t0) (param $p0 i32) (param $p1 i32) (result i32)
|
||||
get_local $p1
|
||||
get_local $p0
|
||||
i32.add))
|
Binary file not shown.
|
@ -1,5 +0,0 @@
|
|||
(module
|
||||
(table $table (export "table") 3 anyfunc)
|
||||
(func $f0 (result i32) i32.const 42)
|
||||
(func $f1 (result i32) i32.const 83)
|
||||
(elem (i32.const 0) $f0 $f1))
|
|
@ -1,7 +0,0 @@
|
|||
import { addOne } from "./wasm-imports-js-exports/imports.wasm"
|
||||
import * as assert from '../assert.js';
|
||||
|
||||
assert.isFunction(addOne);
|
||||
assert.eq(addOne(32), 33);
|
||||
assert.eq(addOne(-2), -1);
|
||||
assert.eq(addOne(0x7fffffff), -2147483648);
|
Binary file not shown.
|
@ -1,7 +0,0 @@
|
|||
(module
|
||||
(import "./sum.js" "sum" (func $sum (param i32 i32) (result i32)))
|
||||
(type $t0 (func (param i32) (result i32)))
|
||||
(func $addOne (export "addOne") (type $t0) (param $p0 i32) (result i32)
|
||||
i32.const 1
|
||||
get_local $p0
|
||||
call $sum))
|
|
@ -1,4 +0,0 @@
|
|||
export function sum(arg0, arg1)
|
||||
{
|
||||
return arg0 + arg1;
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
import { addOne, getAnswer, table } from "./wasm-imports-js-re-exports-wasm-exports/imports.wasm"
|
||||
import * as assert from '../assert.js';
|
||||
|
||||
assert.isFunction(addOne);
|
||||
assert.eq(addOne(32), 33);
|
||||
assert.eq(addOne(-2), -1);
|
||||
assert.eq(addOne(0x7fffffff), -2147483648);
|
||||
|
||||
assert.eq(getAnswer(), 42);
|
||||
|
||||
assert.eq(table.length, 4);
|
||||
assert.eq(table.get(0)(1, 2), 3);
|
||||
assert.eq(table.get(1)(-1), 0);
|
||||
assert.eq(table.get(2), null);
|
||||
assert.eq(table.get(3), null);
|
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
(module
|
||||
(import "./re-export.js" "sum" (func $sum (param i32 i32) (result i32)))
|
||||
(import "./re-export.js" "answer" (global i32))
|
||||
(import "./re-export.js" "table" (table $table 4 anyfunc))
|
||||
(export "table" (table $table))
|
||||
(type $t0 (func (param i32) (result i32)))
|
||||
(func $addOne (export "addOne") (type $t0) (param $p0 i32) (result i32)
|
||||
i32.const 1
|
||||
get_local $p0
|
||||
call $sum)
|
||||
(type $t1 (func (result i32)))
|
||||
(func $getAnswer (export "getAnswer") (type $t1) (result i32)
|
||||
get_global 0)
|
||||
(elem (i32.const 1) $addOne))
|
|
@ -1 +0,0 @@
|
|||
export { sum, answer, table } from "./sum.wasm"
|
Binary file not shown.
|
@ -1,9 +0,0 @@
|
|||
(module
|
||||
(type $t0 (func (param i32 i32) (result i32)))
|
||||
(func $sum (export "sum") (type $t0) (param $p0 i32) (param $p1 i32) (result i32)
|
||||
get_local $p1
|
||||
get_local $p0
|
||||
i32.add)
|
||||
(global (export "answer") i32 i32.const 42)
|
||||
(table $table (export "table") 4 anyfunc)
|
||||
(elem (i32.const 0) $sum))
|
Binary file not shown.
|
@ -1,2 +0,0 @@
|
|||
(module
|
||||
(global (export "answer") i64 i64.const 42))
|
Binary file not shown.
|
@ -1,2 +0,0 @@
|
|||
(module
|
||||
(import "./answer.wasm" "answer" (global i64)))
|
|
@ -1,22 +0,0 @@
|
|||
import { addOne, getAnswer, getAnswer1, getAnswer2, getAnswer3, getAnswer4, table } from "./wasm-imports-wasm-exports/imports.wasm"
|
||||
import { table as table2 } from "./wasm-imports-wasm-exports/sum.wasm"
|
||||
import * as assert from '../assert.js';
|
||||
|
||||
assert.isFunction(addOne);
|
||||
assert.eq(addOne(32), 33);
|
||||
assert.eq(addOne(-2), -1);
|
||||
assert.eq(addOne(0x7fffffff), -2147483648);
|
||||
|
||||
assert.eq(getAnswer(), 42);
|
||||
assert.eq(getAnswer1(), 0.5);
|
||||
assert.eq(getAnswer2(), 0.5);
|
||||
|
||||
assert.truthy(isPureNaN(getAnswer3()));
|
||||
assert.truthy(isPureNaN(getAnswer4()));
|
||||
|
||||
assert.eq(table, table2);
|
||||
assert.eq(table.length, 4);
|
||||
assert.eq(table.get(0)(1, 2), 3);
|
||||
assert.eq(table.get(1)(42), 43);
|
||||
assert.eq(table.get(2)(), 42);
|
||||
assert.eq(table.get(3)(), 0.5);
|
Binary file not shown.
|
@ -1,28 +0,0 @@
|
|||
(module
|
||||
(import "./sum.wasm" "sum" (func $sum (param i32 i32) (result i32)))
|
||||
(import "./sum.wasm" "answer" (global i32))
|
||||
(import "./sum.wasm" "answer1" (global f32))
|
||||
(import "./sum.wasm" "answer2" (global f64))
|
||||
(import "./sum.wasm" "answer3" (global f32))
|
||||
(import "./sum.wasm" "answer4" (global f64))
|
||||
(import "./sum.wasm" "table" (table $table 4 anyfunc))
|
||||
(type $t0 (func (param i32) (result i32)))
|
||||
(func $addOne (export "addOne") (type $t0) (param $p0 i32) (result i32)
|
||||
i32.const 1
|
||||
get_local $p0
|
||||
call $sum)
|
||||
(type $t1 (func (result i32)))
|
||||
(func $getAnswer (export "getAnswer") (type $t1) (result i32)
|
||||
get_global 0)
|
||||
(type $t2 (func (result f32)))
|
||||
(func $getAnswer1 (export "getAnswer1") (type $t2) (result f32)
|
||||
get_global 1)
|
||||
(type $t3 (func (result f64)))
|
||||
(func $getAnswer2 (export "getAnswer2") (type $t3) (result f64)
|
||||
get_global 2)
|
||||
(func $getAnswer3 (export "getAnswer3") (type $t2) (result f32)
|
||||
get_global 3)
|
||||
(func $getAnswer4 (export "getAnswer4") (type $t3) (result f64)
|
||||
get_global 4)
|
||||
(export "table" (table $table))
|
||||
(elem (i32.const 1) $addOne $getAnswer $getAnswer1))
|
Binary file not shown.
|
@ -1,13 +0,0 @@
|
|||
(module
|
||||
(table $table (export "table") 4 anyfunc)
|
||||
(type $t0 (func (param i32 i32) (result i32)))
|
||||
(func $sum (export "sum") (type $t0) (param $p0 i32) (param $p1 i32) (result i32)
|
||||
get_local $p1
|
||||
get_local $p0
|
||||
i32.add)
|
||||
(global (export "answer") i32 i32.const 42)
|
||||
(global (export "answer1") f32 f32.const 0.5)
|
||||
(global (export "answer2") f64 f64.const 0.5)
|
||||
(global (export "answer3") f32 f32.const nan)
|
||||
(global (export "answer4") f64 f64.const nan)
|
||||
(elem (i32.const 0) $sum))
|
|
@ -1,4 +0,0 @@
|
|||
import * as assert from '../assert.js'
|
||||
import { return42 } from "./wasm-js-cycle/entry.wasm"
|
||||
|
||||
assert.eq(return42(), 42);
|
Binary file not shown.
|
@ -1,7 +0,0 @@
|
|||
(module
|
||||
(import "./sum.js" "sum" (func $sum (param i32) (param i32) (result i32)))
|
||||
(type $t0 (func (result i32)))
|
||||
(func $return42 (export "return42") (type $t0) (result i32)
|
||||
i32.const 1
|
||||
i32.const 41
|
||||
call $sum))
|
|
@ -1,4 +0,0 @@
|
|||
import { return42 } from "./entry.wasm"
|
||||
export function sum(a, b) {
|
||||
return a + b;
|
||||
}
|
Binary file not shown.
|
@ -1,7 +0,0 @@
|
|||
(module
|
||||
(import "./sum.wasm" "sum" (func $sum (param i32) (param i32) (result i32)))
|
||||
(type $t0 (func (result i32)))
|
||||
(func $return42 (export "return42") (type $t0) (result i32)
|
||||
i32.const 1
|
||||
i32.const 41
|
||||
call $sum))
|
Binary file not shown.
|
@ -1,7 +0,0 @@
|
|||
(module
|
||||
(import "./entry.wasm" "return42" (func $return42 (result i32)))
|
||||
(type $t0 (func (param i32 i32) (result i32)))
|
||||
(func $sum (export "sum") (type $t0) (param $p0 i32) (param $p1 i32) (result i32)
|
||||
get_local $p1
|
||||
get_local $p0
|
||||
i32.add))
|
|
@ -1,2 +0,0 @@
|
|||
if (typeof WebAssembly !== "undefined")
|
||||
throw new Error("Expect WebAssembly global object is undefined if JIT is off");
|
Binary file not shown.
|
@ -1,11 +0,0 @@
|
|||
import LowLevelBinary from '../LowLevelBinary.js';
|
||||
|
||||
let b = new LowLevelBinary();
|
||||
|
||||
for (let i = 0; i !== 1024 * 3; ++i)
|
||||
b.uint32(i);
|
||||
for (let i = 0; i !== 1024 * 3; ++i) {
|
||||
let v = b.getUint32(i * 4);
|
||||
if (v !== i)
|
||||
throw new Error(`Wrote "${i}" and read back "${v}"`);
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
import LowLevelBinary from '../LowLevelBinary.js';
|
||||
|
||||
const values = [
|
||||
"",
|
||||
"0",
|
||||
"Hello, World!",
|
||||
"Il dit non avec la tête, mais il dit oui avec le cœur",
|
||||
"焼きたて!! ジャぱん",
|
||||
"(╯°□°)╯︵ ┻━┻",
|
||||
"$¢€𐍈<E282AC>",
|
||||
"👨❤️💋👨",
|
||||
];
|
||||
|
||||
for (const i of values) {
|
||||
let b = new LowLevelBinary();
|
||||
b.string(i);
|
||||
const v = b.getString(0);
|
||||
if (v !== i)
|
||||
throw new Error(`Wrote "${i}" and read back "${v}"`);
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
import LowLevelBinary from '../LowLevelBinary.js';
|
||||
|
||||
let values = [];
|
||||
for (let i = 0; i <= 0xFFFF; ++i) values.push(i);
|
||||
|
||||
for (const i of values) {
|
||||
let b = new LowLevelBinary();
|
||||
b.uint16(i);
|
||||
const v = b.getUint16(0);
|
||||
if (v !== i)
|
||||
throw new Error(`Wrote "${i}" and read back "${v}"`);
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
import LowLevelBinary from '../LowLevelBinary.js';
|
||||
|
||||
let values = [];
|
||||
for (let i = 0; i <= 0xFFFF; ++i) values.push(i);
|
||||
for (let i = 0xFFFFFF - 0xFFFF; i <= 0xFFFFFF; ++i) values.push(i);
|
||||
|
||||
for (const i of values) {
|
||||
let b = new LowLevelBinary();
|
||||
b.uint24(i);
|
||||
const v = b.getUint24(0);
|
||||
if (v !== i)
|
||||
throw new Error(`Wrote "${i}" and read back "${v}"`);
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
import LowLevelBinary from '../LowLevelBinary.js';
|
||||
|
||||
let values = [];
|
||||
for (let i = 0; i !== 0xFFFF + 1; ++i) values.push(i);
|
||||
for (let i = 0xFFFFFFFF; i !== 0xFFFFFFFF - 0xFFFF - 1; --i) values.push(i);
|
||||
|
||||
for (const i of values) {
|
||||
let b = new LowLevelBinary();
|
||||
b.uint32(i);
|
||||
const v = b.getUint32(0);
|
||||
if (v !== i)
|
||||
throw new Error(`Wrote "${i}" and read back "${v}"`);
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
import LowLevelBinary from '../LowLevelBinary.js';
|
||||
|
||||
let values = [];
|
||||
for (let i = 0; i <= 0xFF; ++i) values.push(i);
|
||||
|
||||
for (const i of values) {
|
||||
let b = new LowLevelBinary();
|
||||
b.uint8(i);
|
||||
const v = b.getUint8(0);
|
||||
if (v !== i)
|
||||
throw new Error(`Wrote "${i}" and read back "${v}"`);
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
import LowLevelBinary, * as LLB from '../LowLevelBinary.js';
|
||||
import * as assert from '../assert.js';
|
||||
|
||||
let values = [];
|
||||
for (let i = LLB.varint32Min; i !== LLB.varint32Min + 1024; ++i) values.push(i);
|
||||
for (let i = -2048; i !== 2048; ++i) values.push(i);
|
||||
for (let i = LLB.varint32Max; i !== LLB.varint32Max - 1024; --i) values.push(i);
|
||||
|
||||
for (const i of values) {
|
||||
let b = new LowLevelBinary();
|
||||
b.varint32(i);
|
||||
const v = b.getVarint32(0);
|
||||
if (v.value !== i)
|
||||
throw new Error(`Wrote "${i}" and read back "${v}"`);
|
||||
if (v.next !== b.getSize())
|
||||
throw new Error(`Size ${v.next}, expected ${b.getSize()}`);
|
||||
}
|
||||
|
||||
for (let i = 0; i < LLB.varBitsMax + 1; ++i) {
|
||||
let b = new LowLevelBinary();
|
||||
for (let j = 0; j < i; ++j)
|
||||
b.uint8(0x80);
|
||||
assert.throws(() => b.getVarint32(0), RangeError, `[${i}, ${i+1}) is out of buffer range [0, ${i})`);
|
||||
}
|
||||
|
||||
let b = new LowLevelBinary();
|
||||
for (let i = 0; i < LLB.varBitsMax; ++i)
|
||||
b.uint8(0x80);
|
||||
b.uint8(0x00);
|
||||
assert.throws(() => b.getVarint32(0), RangeError, `Shifting too much at 6`);
|
|
@ -1,14 +0,0 @@
|
|||
import LowLevelBinary, * as LLB from '../LowLevelBinary.js';
|
||||
|
||||
let values = [];
|
||||
for (let i = 0; i <= 1; ++i) values.push(i);
|
||||
|
||||
for (const i of values) {
|
||||
let b = new LowLevelBinary();
|
||||
b.varuint1(i);
|
||||
const v = b.getVaruint1(0);
|
||||
if (v.value !== i)
|
||||
throw new Error(`Wrote "${i}" and read back "${v}"`);
|
||||
if (v.next !== b.getSize())
|
||||
throw new Error(`Size ${v.next}, expected ${b.getSize()}`);
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
import LowLevelBinary, * as LLB from '../LowLevelBinary.js';
|
||||
import * as assert from '../assert.js';
|
||||
|
||||
let values = [];
|
||||
for (let i = LLB.varuint32Min; i !== LLB.varuint32Min + 1024; ++i) values.push(i);
|
||||
for (let i = LLB.varuint32Max; i !== LLB.varuint32Max - 1024; --i) values.push(i);
|
||||
|
||||
for (const i of values) {
|
||||
let b = new LowLevelBinary();
|
||||
b.varuint32(i);
|
||||
const v = b.getVaruint32(0);
|
||||
if (v.value !== i)
|
||||
throw new Error(`Wrote "${i}" and read back "${v}"`);
|
||||
if (v.next !== b.getSize())
|
||||
throw new Error(`Size ${v.next}, expected ${b.getSize()}`);
|
||||
}
|
||||
|
||||
for (let i = 0; i < LLB.varBitsMax + 1; ++i) {
|
||||
let b = new LowLevelBinary();
|
||||
for (let j = 0; j < i; ++j)
|
||||
b.uint8(0x80);
|
||||
assert.throws(() => b.getVarint32(0), RangeError, `[${i}, ${i+1}) is out of buffer range [0, ${i})`);
|
||||
}
|
||||
|
||||
let b = new LowLevelBinary();
|
||||
for (let i = 0; i < LLB.varBitsMax; ++i)
|
||||
b.uint8(0x80);
|
||||
b.uint8(0x00);
|
||||
assert.throws(() => b.getVarint32(0), RangeError, `Shifting too much at 6`);
|
|
@ -1,14 +0,0 @@
|
|||
import LowLevelBinary, * as LLB from '../LowLevelBinary.js';
|
||||
|
||||
let values = [];
|
||||
for (let i = LLB.varuintMin; i <= LLB.varuint7Max; ++i) values.push(i);
|
||||
|
||||
for (const i of values) {
|
||||
let b = new LowLevelBinary();
|
||||
b.varuint7(i);
|
||||
const v = b.getVaruint7(0);
|
||||
if (v.value !== i)
|
||||
throw new Error(`Wrote "${i}" and read back "${v}"`);
|
||||
if (v.next !== b.getSize())
|
||||
throw new Error(`Size ${v.next}, expected ${b.getSize()}`);
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
import * as assert from '../assert.js';
|
||||
import * as WASM from '../WASM.js';
|
||||
|
||||
assert.isNotUndef(WASM.description);
|
||||
assert.isNotUndef(WASM.type);
|
||||
assert.ge(WASM.type.length, 7);
|
||||
|
||||
for (const v of WASM.type)
|
||||
if (!WASM.isValidType(v))
|
||||
throw new Error(`Expected value ${v} to be a valid type`);
|
||||
|
||||
const expectedFields = [
|
||||
"preamble",
|
||||
"type",
|
||||
"external_kind",
|
||||
"section",
|
||||
"opcode",
|
||||
];
|
||||
for (const e of expectedFields) {
|
||||
assert.isNotUndef(WASM.description[e]);
|
||||
if (typeof(WASM.description[e]) !== "object")
|
||||
throw new Error(`Expected description to contain field "${e}"`);
|
||||
}
|
||||
|
||||
const expectedOpFields = [
|
||||
"category",
|
||||
"value",
|
||||
"return",
|
||||
"parameter",
|
||||
"immediate",
|
||||
];
|
||||
for (const op in WASM.description.opcode)
|
||||
for (const e of expectedOpFields)
|
||||
assert.isNotUndef(WASM.description.opcode[op][e]);
|
||||
|
||||
// FIXME: test for field "b3op" when all arithmetic/ comparison ops have them. https://bugs.webkit.org/show_bug.cgi?id=146064
|
||||
|
||||
assert.isNotUndef(WASM.sections);
|
||||
assert.isNotUndef(WASM.sectionEncodingType);
|
||||
for (const section of WASM.sections)
|
||||
assert.eq(WASM.sectionEncodingType, WASM.description.section[section].type);
|
|
@ -1,33 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
// This is our nifty way to make modules synchronous.
|
||||
let assert;
|
||||
import('assert.js').then((module) => {
|
||||
assert = module;
|
||||
});
|
||||
drainMicrotasks();
|
||||
|
||||
function test(func, description) {
|
||||
try {
|
||||
func();
|
||||
} catch (e) {
|
||||
print("Unexpected exception:", description);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
function promise_test(func, description) {
|
||||
assert.asyncTest(func());
|
||||
};
|
||||
|
||||
let assert_equals = assert.eq;
|
||||
let assert_true = (x) => assert.eq(x,true);
|
||||
let assert_false = (x) => assert.eq(x,false);
|
||||
let assert_unreached = () => {
|
||||
throw new Error("Should have been unreachable");
|
||||
};
|
||||
|
||||
// This is run from the spec-tests directory
|
||||
load("../spec-harness/index.js");
|
||||
load("../spec-harness/wasm-constants.js");
|
||||
load("../spec-harness/wasm-module-builder.js");
|
|
@ -1,377 +0,0 @@
|
|||
// Copyright 2015 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --expose-wasm
|
||||
|
||||
function bytes() {
|
||||
var buffer = new ArrayBuffer(arguments.length);
|
||||
var view = new Uint8Array(buffer);
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var val = arguments[i];
|
||||
if ((typeof val) == "string") val = val.charCodeAt(0);
|
||||
view[i] = val | 0;
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
|
||||
// Header declaration constants
|
||||
var kWasmH0 = 0;
|
||||
var kWasmH1 = 0x61;
|
||||
var kWasmH2 = 0x73;
|
||||
var kWasmH3 = 0x6d;
|
||||
|
||||
var kWasmV0 = 0x1;
|
||||
var kWasmV1 = 0;
|
||||
var kWasmV2 = 0;
|
||||
var kWasmV3 = 0;
|
||||
|
||||
var kHeaderSize = 8;
|
||||
var kPageSize = 65536;
|
||||
|
||||
function bytesWithHeader() {
|
||||
var buffer = new ArrayBuffer(kHeaderSize + arguments.length);
|
||||
var view = new Uint8Array(buffer);
|
||||
view[0] = kWasmH0;
|
||||
view[1] = kWasmH1;
|
||||
view[2] = kWasmH2;
|
||||
view[3] = kWasmH3;
|
||||
view[4] = kWasmV0;
|
||||
view[5] = kWasmV1;
|
||||
view[6] = kWasmV2;
|
||||
view[7] = kWasmV3;
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var val = arguments[i];
|
||||
if ((typeof val) == "string") val = val.charCodeAt(0);
|
||||
view[kHeaderSize + i] = val | 0;
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
|
||||
let kDeclNoLocals = 0;
|
||||
|
||||
// Section declaration constants
|
||||
let kUnknownSectionCode = 0;
|
||||
let kTypeSectionCode = 1; // Function signature declarations
|
||||
let kImportSectionCode = 2; // Import declarations
|
||||
let kFunctionSectionCode = 3; // Function declarations
|
||||
let kTableSectionCode = 4; // Indirect function table and other tables
|
||||
let kMemorySectionCode = 5; // Memory attributes
|
||||
let kGlobalSectionCode = 6; // Global declarations
|
||||
let kExportSectionCode = 7; // Exports
|
||||
let kStartSectionCode = 8; // Start function declaration
|
||||
let kElementSectionCode = 9; // Elements section
|
||||
let kCodeSectionCode = 10; // Function code
|
||||
let kDataSectionCode = 11; // Data segments
|
||||
let kNameSectionCode = 12; // Name section (encoded as string)
|
||||
|
||||
// Name section types
|
||||
let kModuleNameCode = 0;
|
||||
let kFunctionNamesCode = 1;
|
||||
let kLocalNamesCode = 2;
|
||||
|
||||
let kWasmFunctionTypeForm = 0x60;
|
||||
let kWasmAnyFunctionTypeForm = 0x70;
|
||||
|
||||
let kResizableMaximumFlag = 1;
|
||||
|
||||
// Function declaration flags
|
||||
let kDeclFunctionName = 0x01;
|
||||
let kDeclFunctionImport = 0x02;
|
||||
let kDeclFunctionLocals = 0x04;
|
||||
let kDeclFunctionExport = 0x08;
|
||||
|
||||
// Local types
|
||||
let kWasmStmt = 0x40;
|
||||
let kWasmI32 = 0x7f;
|
||||
let kWasmI64 = 0x7e;
|
||||
let kWasmF32 = 0x7d;
|
||||
let kWasmF64 = 0x7c;
|
||||
let kWasmS128 = 0x7b;
|
||||
|
||||
let kExternalFunction = 0;
|
||||
let kExternalTable = 1;
|
||||
let kExternalMemory = 2;
|
||||
let kExternalGlobal = 3;
|
||||
|
||||
let kTableZero = 0;
|
||||
let kMemoryZero = 0;
|
||||
|
||||
// Useful signatures
|
||||
let kSig_i_i = makeSig([kWasmI32], [kWasmI32]);
|
||||
let kSig_l_l = makeSig([kWasmI64], [kWasmI64]);
|
||||
let kSig_i_l = makeSig([kWasmI64], [kWasmI32]);
|
||||
let kSig_i_ii = makeSig([kWasmI32, kWasmI32], [kWasmI32]);
|
||||
let kSig_i_iii = makeSig([kWasmI32, kWasmI32, kWasmI32], [kWasmI32]);
|
||||
let kSig_d_dd = makeSig([kWasmF64, kWasmF64], [kWasmF64]);
|
||||
let kSig_l_ll = makeSig([kWasmI64, kWasmI64], [kWasmI64]);
|
||||
let kSig_i_dd = makeSig([kWasmF64, kWasmF64], [kWasmI32]);
|
||||
let kSig_v_v = makeSig([], []);
|
||||
let kSig_i_v = makeSig([], [kWasmI32]);
|
||||
let kSig_l_v = makeSig([], [kWasmI64]);
|
||||
let kSig_f_v = makeSig([], [kWasmF64]);
|
||||
let kSig_d_v = makeSig([], [kWasmF64]);
|
||||
let kSig_v_i = makeSig([kWasmI32], []);
|
||||
let kSig_v_ii = makeSig([kWasmI32, kWasmI32], []);
|
||||
let kSig_v_iii = makeSig([kWasmI32, kWasmI32, kWasmI32], []);
|
||||
let kSig_v_l = makeSig([kWasmI64], []);
|
||||
let kSig_v_d = makeSig([kWasmF64], []);
|
||||
let kSig_v_dd = makeSig([kWasmF64, kWasmF64], []);
|
||||
let kSig_v_ddi = makeSig([kWasmF64, kWasmF64, kWasmI32], []);
|
||||
let kSig_s_v = makeSig([], [kWasmS128]);
|
||||
|
||||
function makeSig(params, results) {
|
||||
return {params: params, results: results};
|
||||
}
|
||||
|
||||
function makeSig_v_x(x) {
|
||||
return makeSig([x], []);
|
||||
}
|
||||
|
||||
function makeSig_v_xx(x) {
|
||||
return makeSig([x, x], []);
|
||||
}
|
||||
|
||||
function makeSig_r_v(r) {
|
||||
return makeSig([], [r]);
|
||||
}
|
||||
|
||||
function makeSig_r_x(r, x) {
|
||||
return makeSig([x], [r]);
|
||||
}
|
||||
|
||||
function makeSig_r_xx(r, x) {
|
||||
return makeSig([x, x], [r]);
|
||||
}
|
||||
|
||||
// Opcodes
|
||||
let kExprUnreachable = 0x00;
|
||||
let kExprNop = 0x01;
|
||||
let kExprBlock = 0x02;
|
||||
let kExprLoop = 0x03;
|
||||
let kExprIf = 0x04;
|
||||
let kExprElse = 0x05;
|
||||
let kExprTry = 0x06;
|
||||
let kExprCatch = 0x07;
|
||||
let kExprThrow = 0x08;
|
||||
let kExprEnd = 0x0b;
|
||||
let kExprBr = 0x0c;
|
||||
let kExprBrIf = 0x0d;
|
||||
let kExprBrTable = 0x0e;
|
||||
let kExprReturn = 0x0f;
|
||||
let kExprCallFunction = 0x10;
|
||||
let kExprCallIndirect = 0x11;
|
||||
let kExprDrop = 0x1a;
|
||||
let kExprSelect = 0x1b;
|
||||
let kExprGetLocal = 0x20;
|
||||
let kExprSetLocal = 0x21;
|
||||
let kExprTeeLocal = 0x22;
|
||||
let kExprGetGlobal = 0x23;
|
||||
let kExprSetGlobal = 0x24;
|
||||
let kExprI32Const = 0x41;
|
||||
let kExprI64Const = 0x42;
|
||||
let kExprF32Const = 0x43;
|
||||
let kExprF64Const = 0x44;
|
||||
let kExprI32LoadMem = 0x28;
|
||||
let kExprI64LoadMem = 0x29;
|
||||
let kExprF32LoadMem = 0x2a;
|
||||
let kExprF64LoadMem = 0x2b;
|
||||
let kExprI32LoadMem8S = 0x2c;
|
||||
let kExprI32LoadMem8U = 0x2d;
|
||||
let kExprI32LoadMem16S = 0x2e;
|
||||
let kExprI32LoadMem16U = 0x2f;
|
||||
let kExprI64LoadMem8S = 0x30;
|
||||
let kExprI64LoadMem8U = 0x31;
|
||||
let kExprI64LoadMem16S = 0x32;
|
||||
let kExprI64LoadMem16U = 0x33;
|
||||
let kExprI64LoadMem32S = 0x34;
|
||||
let kExprI64LoadMem32U = 0x35;
|
||||
let kExprI32StoreMem = 0x36;
|
||||
let kExprI64StoreMem = 0x37;
|
||||
let kExprF32StoreMem = 0x38;
|
||||
let kExprF64StoreMem = 0x39;
|
||||
let kExprI32StoreMem8 = 0x3a;
|
||||
let kExprI32StoreMem16 = 0x3b;
|
||||
let kExprI64StoreMem8 = 0x3c;
|
||||
let kExprI64StoreMem16 = 0x3d;
|
||||
let kExprI64StoreMem32 = 0x3e;
|
||||
let kExprMemorySize = 0x3f;
|
||||
let kExprGrowMemory = 0x40;
|
||||
let kExprI32Eqz = 0x45;
|
||||
let kExprI32Eq = 0x46;
|
||||
let kExprI32Ne = 0x47;
|
||||
let kExprI32LtS = 0x48;
|
||||
let kExprI32LtU = 0x49;
|
||||
let kExprI32GtS = 0x4a;
|
||||
let kExprI32GtU = 0x4b;
|
||||
let kExprI32LeS = 0x4c;
|
||||
let kExprI32LeU = 0x4d;
|
||||
let kExprI32GeS = 0x4e;
|
||||
let kExprI32GeU = 0x4f;
|
||||
let kExprI64Eqz = 0x50;
|
||||
let kExprI64Eq = 0x51;
|
||||
let kExprI64Ne = 0x52;
|
||||
let kExprI64LtS = 0x53;
|
||||
let kExprI64LtU = 0x54;
|
||||
let kExprI64GtS = 0x55;
|
||||
let kExprI64GtU = 0x56;
|
||||
let kExprI64LeS = 0x57;
|
||||
let kExprI64LeU = 0x58;
|
||||
let kExprI64GeS = 0x59;
|
||||
let kExprI64GeU = 0x5a;
|
||||
let kExprF32Eq = 0x5b;
|
||||
let kExprF32Ne = 0x5c;
|
||||
let kExprF32Lt = 0x5d;
|
||||
let kExprF32Gt = 0x5e;
|
||||
let kExprF32Le = 0x5f;
|
||||
let kExprF32Ge = 0x60;
|
||||
let kExprF64Eq = 0x61;
|
||||
let kExprF64Ne = 0x62;
|
||||
let kExprF64Lt = 0x63;
|
||||
let kExprF64Gt = 0x64;
|
||||
let kExprF64Le = 0x65;
|
||||
let kExprF64Ge = 0x66;
|
||||
let kExprI32Clz = 0x67;
|
||||
let kExprI32Ctz = 0x68;
|
||||
let kExprI32Popcnt = 0x69;
|
||||
let kExprI32Add = 0x6a;
|
||||
let kExprI32Sub = 0x6b;
|
||||
let kExprI32Mul = 0x6c;
|
||||
let kExprI32DivS = 0x6d;
|
||||
let kExprI32DivU = 0x6e;
|
||||
let kExprI32RemS = 0x6f;
|
||||
let kExprI32RemU = 0x70;
|
||||
let kExprI32And = 0x71;
|
||||
let kExprI32Ior = 0x72;
|
||||
let kExprI32Xor = 0x73;
|
||||
let kExprI32Shl = 0x74;
|
||||
let kExprI32ShrS = 0x75;
|
||||
let kExprI32ShrU = 0x76;
|
||||
let kExprI32Rol = 0x77;
|
||||
let kExprI32Ror = 0x78;
|
||||
let kExprI64Clz = 0x79;
|
||||
let kExprI64Ctz = 0x7a;
|
||||
let kExprI64Popcnt = 0x7b;
|
||||
let kExprI64Add = 0x7c;
|
||||
let kExprI64Sub = 0x7d;
|
||||
let kExprI64Mul = 0x7e;
|
||||
let kExprI64DivS = 0x7f;
|
||||
let kExprI64DivU = 0x80;
|
||||
let kExprI64RemS = 0x81;
|
||||
let kExprI64RemU = 0x82;
|
||||
let kExprI64And = 0x83;
|
||||
let kExprI64Ior = 0x84;
|
||||
let kExprI64Xor = 0x85;
|
||||
let kExprI64Shl = 0x86;
|
||||
let kExprI64ShrS = 0x87;
|
||||
let kExprI64ShrU = 0x88;
|
||||
let kExprI64Rol = 0x89;
|
||||
let kExprI64Ror = 0x8a;
|
||||
let kExprF32Abs = 0x8b;
|
||||
let kExprF32Neg = 0x8c;
|
||||
let kExprF32Ceil = 0x8d;
|
||||
let kExprF32Floor = 0x8e;
|
||||
let kExprF32Trunc = 0x8f;
|
||||
let kExprF32NearestInt = 0x90;
|
||||
let kExprF32Sqrt = 0x91;
|
||||
let kExprF32Add = 0x92;
|
||||
let kExprF32Sub = 0x93;
|
||||
let kExprF32Mul = 0x94;
|
||||
let kExprF32Div = 0x95;
|
||||
let kExprF32Min = 0x96;
|
||||
let kExprF32Max = 0x97;
|
||||
let kExprF32CopySign = 0x98;
|
||||
let kExprF64Abs = 0x99;
|
||||
let kExprF64Neg = 0x9a;
|
||||
let kExprF64Ceil = 0x9b;
|
||||
let kExprF64Floor = 0x9c;
|
||||
let kExprF64Trunc = 0x9d;
|
||||
let kExprF64NearestInt = 0x9e;
|
||||
let kExprF64Sqrt = 0x9f;
|
||||
let kExprF64Add = 0xa0;
|
||||
let kExprF64Sub = 0xa1;
|
||||
let kExprF64Mul = 0xa2;
|
||||
let kExprF64Div = 0xa3;
|
||||
let kExprF64Min = 0xa4;
|
||||
let kExprF64Max = 0xa5;
|
||||
let kExprF64CopySign = 0xa6;
|
||||
let kExprI32ConvertI64 = 0xa7;
|
||||
let kExprI32SConvertF32 = 0xa8;
|
||||
let kExprI32UConvertF32 = 0xa9;
|
||||
let kExprI32SConvertF64 = 0xaa;
|
||||
let kExprI32UConvertF64 = 0xab;
|
||||
let kExprI64SConvertI32 = 0xac;
|
||||
let kExprI64UConvertI32 = 0xad;
|
||||
let kExprI64SConvertF32 = 0xae;
|
||||
let kExprI64UConvertF32 = 0xaf;
|
||||
let kExprI64SConvertF64 = 0xb0;
|
||||
let kExprI64UConvertF64 = 0xb1;
|
||||
let kExprF32SConvertI32 = 0xb2;
|
||||
let kExprF32UConvertI32 = 0xb3;
|
||||
let kExprF32SConvertI64 = 0xb4;
|
||||
let kExprF32UConvertI64 = 0xb5;
|
||||
let kExprF32ConvertF64 = 0xb6;
|
||||
let kExprF64SConvertI32 = 0xb7;
|
||||
let kExprF64UConvertI32 = 0xb8;
|
||||
let kExprF64SConvertI64 = 0xb9;
|
||||
let kExprF64UConvertI64 = 0xba;
|
||||
let kExprF64ConvertF32 = 0xbb;
|
||||
let kExprI32ReinterpretF32 = 0xbc;
|
||||
let kExprI64ReinterpretF64 = 0xbd;
|
||||
let kExprF32ReinterpretI32 = 0xbe;
|
||||
let kExprF64ReinterpretI64 = 0xbf;
|
||||
|
||||
let kTrapUnreachable = 0;
|
||||
let kTrapMemOutOfBounds = 1;
|
||||
let kTrapDivByZero = 2;
|
||||
let kTrapDivUnrepresentable = 3;
|
||||
let kTrapRemByZero = 4;
|
||||
let kTrapFloatUnrepresentable = 5;
|
||||
let kTrapFuncInvalid = 6;
|
||||
let kTrapFuncSigMismatch = 7;
|
||||
let kTrapInvalidIndex = 8;
|
||||
|
||||
let kTrapMsgs = [
|
||||
"unreachable",
|
||||
"memory access out of bounds",
|
||||
"divide by zero",
|
||||
"divide result unrepresentable",
|
||||
"remainder by zero",
|
||||
"integer result unrepresentable",
|
||||
"invalid function",
|
||||
"function signature mismatch",
|
||||
"invalid index into function table"
|
||||
];
|
||||
|
||||
function assertTraps(trap, code) {
|
||||
try {
|
||||
if (typeof code === 'function') {
|
||||
code();
|
||||
} else {
|
||||
eval(code);
|
||||
}
|
||||
} catch (e) {
|
||||
assertEquals('object', typeof e);
|
||||
assertEquals(kTrapMsgs[trap], e.message);
|
||||
// Success.
|
||||
return;
|
||||
}
|
||||
throw new MjsUnitAssertionError('Did not trap, expected: ' + kTrapMsgs[trap]);
|
||||
}
|
||||
|
||||
function assertWasmThrows(value, code) {
|
||||
assertEquals('number', typeof value);
|
||||
try {
|
||||
if (typeof code === 'function') {
|
||||
code();
|
||||
} else {
|
||||
eval(code);
|
||||
}
|
||||
} catch (e) {
|
||||
assertEquals('number', typeof e);
|
||||
assertEquals(value, e);
|
||||
// Success.
|
||||
return;
|
||||
}
|
||||
throw new MjsUnitAssertionError('Did not throw, expected: ' + value);
|
||||
}
|
File diff suppressed because one or more lines are too long
|
@ -1,21 +0,0 @@
|
|||
|
||||
// address.wast:1
|
||||
let $1 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x01\x7f\x00\x02\x92\x80\x80\x80\x00\x01\x08\x73\x70\x65\x63\x74\x65\x73\x74\x05\x70\x72\x69\x6e\x74\x00\x00\x03\x83\x80\x80\x80\x00\x02\x00\x00\x05\x83\x80\x80\x80\x00\x01\x00\x01\x07\x8e\x80\x80\x80\x00\x02\x04\x67\x6f\x6f\x64\x00\x01\x03\x62\x61\x64\x00\x02\x0a\xf4\x80\x80\x80\x00\x02\xdd\x80\x80\x80\x00\x00\x20\x00\x2d\x00\x00\x10\x00\x20\x00\x2d\x00\x01\x10\x00\x20\x00\x2d\x00\x02\x10\x00\x20\x00\x2d\x00\x19\x10\x00\x20\x00\x2f\x01\x00\x10\x00\x20\x00\x2f\x00\x00\x10\x00\x20\x00\x2f\x00\x01\x10\x00\x20\x00\x2f\x01\x02\x10\x00\x20\x00\x2f\x00\x19\x10\x00\x20\x00\x28\x02\x00\x10\x00\x20\x00\x28\x00\x01\x10\x00\x20\x00\x28\x01\x02\x10\x00\x20\x00\x28\x00\x19\x10\x00\x0b\x8c\x80\x80\x80\x00\x00\x20\x00\x28\x02\xff\xff\xff\xff\x0f\x1a\x0b\x0b\xa0\x80\x80\x80\x00\x01\x00\x41\x00\x0b\x1a\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a");
|
||||
|
||||
// address.wast:30
|
||||
run(() => call($1, "good", [0]));
|
||||
|
||||
// address.wast:31
|
||||
run(() => call($1, "good", [65507]));
|
||||
|
||||
// address.wast:32
|
||||
assert_trap(() => call($1, "good", [65508]));
|
||||
|
||||
// address.wast:33
|
||||
assert_trap(() => call($1, "bad", [0]));
|
||||
|
||||
// address.wast:34
|
||||
assert_trap(() => call($1, "bad", [1]));
|
||||
|
||||
// address.wast:36
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
|
@ -1,18 +0,0 @@
|
|||
|
||||
// align.wast:1
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// align.wast:7
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// align.wast:13
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x05\x83\x80\x80\x80\x00\x01\x00\x00\x0a\x8e\x80\x80\x80\x00\x01\x88\x80\x80\x80\x00\x00\x41\x00\x29\x04\x00\x1a\x0b");
|
||||
|
||||
// align.wast:18
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// align.wast:24
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// align.wast:30
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x05\x83\x80\x80\x80\x00\x01\x00\x00\x0a\x8f\x80\x80\x80\x00\x01\x89\x80\x80\x80\x00\x00\x41\x00\x42\x00\x37\x04\x00\x0b");
|
|
@ -1,98 +0,0 @@
|
|||
|
||||
// binary.wast:1
|
||||
let $1 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00");
|
||||
|
||||
// binary.wast:2
|
||||
let $2 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00");
|
||||
|
||||
// binary.wast:3
|
||||
let $3 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00");
|
||||
let $M1 = $3;
|
||||
|
||||
// binary.wast:4
|
||||
let $4 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00");
|
||||
let $M2 = $4;
|
||||
|
||||
// binary.wast:6
|
||||
assert_malformed("");
|
||||
|
||||
// binary.wast:7
|
||||
assert_malformed("\x01");
|
||||
|
||||
// binary.wast:8
|
||||
assert_malformed("\x00\x61\x73");
|
||||
|
||||
// binary.wast:9
|
||||
assert_malformed("\x61\x73\x6d\x00");
|
||||
|
||||
// binary.wast:10
|
||||
assert_malformed("\x6d\x73\x61\x00");
|
||||
|
||||
// binary.wast:11
|
||||
assert_malformed("\x6d\x73\x61\x00\x01\x00\x00\x00");
|
||||
|
||||
// binary.wast:12
|
||||
assert_malformed("\x6d\x73\x61\x00\x00\x00\x00\x01");
|
||||
|
||||
// binary.wast:13
|
||||
assert_malformed("\x61\x73\x6d\x01\x00\x00\x00\x00");
|
||||
|
||||
// binary.wast:14
|
||||
assert_malformed("\x77\x61\x73\x6d\x01\x00\x00\x00");
|
||||
|
||||
// binary.wast:15
|
||||
assert_malformed("\x7f\x61\x73\x6d\x01\x00\x00\x00");
|
||||
|
||||
// binary.wast:16
|
||||
assert_malformed("\x80\x61\x73\x6d\x01\x00\x00\x00");
|
||||
|
||||
// binary.wast:17
|
||||
assert_malformed("\x82\x61\x73\x6d\x01\x00\x00\x00");
|
||||
|
||||
// binary.wast:18
|
||||
assert_malformed("\xff\x61\x73\x6d\x01\x00\x00\x00");
|
||||
|
||||
// binary.wast:21
|
||||
assert_malformed("\x00\x00\x00\x01\x6d\x73\x61\x00");
|
||||
|
||||
// binary.wast:24
|
||||
assert_malformed("\x61\x00\x6d\x73\x00\x01\x00\x00");
|
||||
|
||||
// binary.wast:25
|
||||
assert_malformed("\x73\x6d\x00\x61\x00\x00\x01\x00");
|
||||
|
||||
// binary.wast:28
|
||||
assert_malformed("\x00\x41\x53\x4d\x01\x00\x00\x00");
|
||||
|
||||
// binary.wast:31
|
||||
assert_malformed("\x00\x81\xa2\x94\x01\x00\x00\x00");
|
||||
|
||||
// binary.wast:34
|
||||
assert_malformed("\xef\xbb\xbf\x00\x61\x73\x6d\x01\x00\x00\x00");
|
||||
|
||||
// binary.wast:36
|
||||
assert_malformed("\x00\x61\x73\x6d");
|
||||
|
||||
// binary.wast:37
|
||||
assert_malformed("\x00\x61\x73\x6d\x01");
|
||||
|
||||
// binary.wast:38
|
||||
assert_malformed("\x00\x61\x73\x6d\x01\x00\x00");
|
||||
|
||||
// binary.wast:39
|
||||
assert_malformed("\x00\x61\x73\x6d\x00\x00\x00\x00");
|
||||
|
||||
// binary.wast:40
|
||||
assert_malformed("\x00\x61\x73\x6d\x0d\x00\x00\x00");
|
||||
|
||||
// binary.wast:41
|
||||
assert_malformed("\x00\x61\x73\x6d\x0e\x00\x00\x00");
|
||||
|
||||
// binary.wast:42
|
||||
assert_malformed("\x00\x61\x73\x6d\x00\x01\x00\x00");
|
||||
|
||||
// binary.wast:43
|
||||
assert_malformed("\x00\x61\x73\x6d\x00\x00\x01\x00");
|
||||
|
||||
// binary.wast:44
|
||||
assert_malformed("\x00\x61\x73\x6d\x00\x00\x00\x01");
|
|
@ -1,117 +0,0 @@
|
|||
|
||||
// block.wast:3
|
||||
let $1 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x00\x60\x00\x01\x7f\x03\x90\x80\x80\x80\x00\x0f\x00\x00\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x07\xbe\x81\x80\x80\x00\x0e\x05\x65\x6d\x70\x74\x79\x00\x01\x08\x73\x69\x6e\x67\x75\x6c\x61\x72\x00\x02\x05\x6d\x75\x6c\x74\x69\x00\x03\x06\x6e\x65\x73\x74\x65\x64\x00\x04\x04\x64\x65\x65\x70\x00\x05\x10\x61\x73\x2d\x75\x6e\x61\x72\x79\x2d\x6f\x70\x65\x72\x61\x6e\x64\x00\x06\x11\x61\x73\x2d\x62\x69\x6e\x61\x72\x79\x2d\x6f\x70\x65\x72\x61\x6e\x64\x00\x07\x0f\x61\x73\x2d\x74\x65\x73\x74\x2d\x6f\x70\x65\x72\x61\x6e\x64\x00\x08\x12\x61\x73\x2d\x63\x6f\x6d\x70\x61\x72\x65\x2d\x6f\x70\x65\x72\x61\x6e\x64\x00\x09\x0a\x62\x72\x65\x61\x6b\x2d\x62\x61\x72\x65\x00\x0a\x0b\x62\x72\x65\x61\x6b\x2d\x76\x61\x6c\x75\x65\x00\x0b\x0e\x62\x72\x65\x61\x6b\x2d\x72\x65\x70\x65\x61\x74\x65\x64\x00\x0c\x0b\x62\x72\x65\x61\x6b\x2d\x69\x6e\x6e\x65\x72\x00\x0d\x07\x65\x66\x66\x65\x63\x74\x73\x00\x0e\x0a\x99\x84\x80\x80\x00\x0f\x82\x80\x80\x80\x00\x00\x0b\x88\x80\x80\x80\x00\x00\x02\x40\x0b\x02\x40\x0b\x0b\x8b\x80\x80\x80\x00\x00\x02\x40\x01\x0b\x02\x7f\x41\x07\x0b\x0b\x98\x80\x80\x80\x00\x00\x02\x40\x10\x00\x10\x00\x10\x00\x10\x00\x0b\x02\x7f\x10\x00\x10\x00\x10\x00\x41\x08\x0b\x0b\x95\x80\x80\x80\x00\x00\x02\x7f\x02\x40\x10\x00\x02\x40\x0b\x01\x0b\x02\x7f\x10\x00\x41\x09\x0b\x0b\x0b\xf9\x80\x80\x80\x00\x00\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x02\x7f\x10\x00\x41\x96\x01\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x8a\x80\x80\x80\x00\x00\x02\x7f\x10\x00\x41\x0d\x0b\x68\x0b\x91\x80\x80\x80\x00\x00\x02\x7f\x10\x00\x41\x03\x0b\x02\x7f\x10\x00\x41\x04\x0b\x6c\x0b\x8a\x80\x80\x80\x00\x00\x02\x7f\x10\x00\x41\x0d\x0b\x45\x0b\x97\x80\x80\x80\x00\x00\x02\x7d\x10\x00\x43\x00\x00\x40\x40\x0b\x02\x7d\x10\x00\x43\x00\x00\x40\x40\x0b\x5e\x0b\xa6\x80\x80\x80\x00\x00\x02\x40\x0c\x00\x00\x0b\x02\x40\x41\x01\x0d\x00\x00\x0b\x02\x40\x41\x00\x0e\x00\x00\x00\x0b\x02\x40\x41\x01\x0e\x02\x00\x00\x00\x00\x0b\x41\x13\x0b\x8b\x80\x80\x80\x00\x00\x02\x7f\x41\x12\x0c\x00\x41\x13\x0b\x0b\xb1\x80\x80\x80\x00\x00\x02\x7f\x41\x12\x0c\x00\x41\x13\x0c\x00\x41\x14\x41\x00\x0d\x00\x1a\x41\x14\x41\x01\x0d\x00\x1a\x41\x15\x0c\x00\x41\x16\x41\x04\x0e\x00\x00\x41\x17\x41\x01\x0e\x02\x00\x00\x00\x41\x15\x0b\x0b\xc5\x80\x80\x80\x00\x01\x01\x7f\x41\x00\x21\x00\x20\x00\x02\x7f\x02\x7f\x41\x01\x0c\x01\x0b\x0b\x6a\x21\x00\x20\x00\x02\x7f\x02\x40\x0c\x00\x0b\x41\x02\x0b\x6a\x21\x00\x20\x00\x02\x7f\x41\x04\x0c\x00\x68\x0b\x6a\x21\x00\x20\x00\x02\x7f\x02\x7f\x41\x08\x0c\x01\x0b\x68\x0b\x6a\x21\x00\x20\x00\x0b\xaf\x80\x80\x80\x00\x01\x01\x7f\x02\x40\x41\x01\x21\x00\x20\x00\x41\x03\x6c\x21\x00\x20\x00\x41\x05\x6b\x21\x00\x20\x00\x41\x07\x6c\x21\x00\x0c\x00\x20\x00\x41\xe4\x00\x6c\x21\x00\x0b\x20\x00\x41\x72\x46\x0b");
|
||||
|
||||
// block.wast:140
|
||||
assert_return(() => call($1, "empty", []));
|
||||
|
||||
// block.wast:141
|
||||
assert_return(() => call($1, "singular", []), 7);
|
||||
|
||||
// block.wast:142
|
||||
assert_return(() => call($1, "multi", []), 8);
|
||||
|
||||
// block.wast:143
|
||||
assert_return(() => call($1, "nested", []), 9);
|
||||
|
||||
// block.wast:144
|
||||
assert_return(() => call($1, "deep", []), 150);
|
||||
|
||||
// block.wast:146
|
||||
assert_return(() => call($1, "as-unary-operand", []), 0);
|
||||
|
||||
// block.wast:147
|
||||
assert_return(() => call($1, "as-binary-operand", []), 12);
|
||||
|
||||
// block.wast:148
|
||||
assert_return(() => call($1, "as-test-operand", []), 0);
|
||||
|
||||
// block.wast:149
|
||||
assert_return(() => call($1, "as-compare-operand", []), 0);
|
||||
|
||||
// block.wast:151
|
||||
assert_return(() => call($1, "break-bare", []), 19);
|
||||
|
||||
// block.wast:152
|
||||
assert_return(() => call($1, "break-value", []), 18);
|
||||
|
||||
// block.wast:153
|
||||
assert_return(() => call($1, "break-repeated", []), 18);
|
||||
|
||||
// block.wast:154
|
||||
assert_return(() => call($1, "break-inner", []), 15);
|
||||
|
||||
// block.wast:156
|
||||
assert_return(() => call($1, "effects", []), 1);
|
||||
|
||||
// block.wast:158
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8b\x80\x80\x80\x00\x01\x85\x80\x80\x80\x00\x00\x02\x40\x0b\x0b");
|
||||
|
||||
// block.wast:162
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7e\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8b\x80\x80\x80\x00\x01\x85\x80\x80\x80\x00\x00\x02\x40\x0b\x0b");
|
||||
|
||||
// block.wast:166
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7d\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8b\x80\x80\x80\x00\x01\x85\x80\x80\x80\x00\x00\x02\x40\x0b\x0b");
|
||||
|
||||
// block.wast:170
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7c\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8b\x80\x80\x80\x00\x01\x85\x80\x80\x80\x00\x00\x02\x40\x0b\x0b");
|
||||
|
||||
// block.wast:175
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8d\x80\x80\x80\x00\x01\x87\x80\x80\x80\x00\x00\x02\x40\x41\x01\x0b\x0b");
|
||||
|
||||
// block.wast:181
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8b\x80\x80\x80\x00\x01\x85\x80\x80\x80\x00\x00\x02\x7f\x0b\x0b");
|
||||
|
||||
// block.wast:187
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8c\x80\x80\x80\x00\x01\x86\x80\x80\x80\x00\x00\x02\x7f\x01\x0b\x0b");
|
||||
|
||||
// block.wast:193
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x90\x80\x80\x80\x00\x01\x8a\x80\x80\x80\x00\x00\x02\x7f\x43\x00\x00\x00\x00\x0b\x0b");
|
||||
|
||||
// block.wast:199
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8f\x80\x80\x80\x00\x01\x89\x80\x80\x80\x00\x00\x02\x7e\x00\x00\x00\x1b\x0b\x0b");
|
||||
|
||||
// block.wast:206
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8d\x80\x80\x80\x00\x01\x87\x80\x80\x80\x00\x00\x02\x7f\x0c\x00\x0b\x0b");
|
||||
|
||||
// block.wast:212
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8f\x80\x80\x80\x00\x01\x89\x80\x80\x80\x00\x00\x02\x7f\x0c\x00\x41\x01\x0b\x0b");
|
||||
|
||||
// block.wast:219
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x90\x80\x80\x80\x00\x01\x8a\x80\x80\x80\x00\x00\x02\x7f\x01\x0c\x00\x41\x01\x0b\x0b");
|
||||
|
||||
// block.wast:225
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x91\x80\x80\x80\x00\x01\x8b\x80\x80\x80\x00\x00\x02\x7f\x42\x01\x0c\x00\x41\x01\x0b\x0b");
|
||||
|
||||
// block.wast:231
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x92\x80\x80\x80\x00\x01\x8c\x80\x80\x80\x00\x00\x02\x7f\x01\x0c\x00\x41\x01\x0c\x00\x0b\x0b");
|
||||
|
||||
// block.wast:237
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x93\x80\x80\x80\x00\x01\x8d\x80\x80\x80\x00\x00\x02\x7f\x42\x01\x0c\x00\x41\x01\x0c\x00\x0b\x0b");
|
||||
|
||||
// block.wast:244
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x94\x80\x80\x80\x00\x01\x8e\x80\x80\x80\x00\x00\x02\x7f\x02\x7f\x41\x01\x0c\x01\x0b\x0c\x00\x0b\x0b");
|
||||
|
||||
// block.wast:250
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x94\x80\x80\x80\x00\x01\x8e\x80\x80\x80\x00\x00\x02\x7f\x02\x40\x0c\x01\x0b\x41\x01\x0c\x00\x0b\x0b");
|
||||
|
||||
// block.wast:257
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x95\x80\x80\x80\x00\x01\x8f\x80\x80\x80\x00\x00\x02\x7f\x02\x7f\x01\x0c\x01\x0b\x41\x01\x0c\x00\x0b\x0b");
|
||||
|
||||
// block.wast:263
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x96\x80\x80\x80\x00\x01\x90\x80\x80\x80\x00\x00\x02\x7f\x02\x7f\x42\x01\x0c\x01\x0b\x41\x01\x0c\x00\x0b\x0b");
|
||||
|
||||
// block.wast:272
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8e\x80\x80\x80\x00\x01\x88\x80\x80\x80\x00\x00\x02\x40\x0c\x00\x0b\x68\x0b");
|
||||
|
||||
// block.wast:278
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8f\x80\x80\x80\x00\x01\x89\x80\x80\x80\x00\x00\x02\x40\x01\x0c\x00\x0b\x7a\x0b");
|
||||
|
||||
// block.wast:284
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x90\x80\x80\x80\x00\x01\x8a\x80\x80\x80\x00\x00\x02\x40\x42\x09\x0c\x00\x0b\x7a\x0b");
|
||||
|
||||
// block.wast:292
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// block.wast:296
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
File diff suppressed because one or more lines are too long
|
@ -1,177 +0,0 @@
|
|||
|
||||
// br_if.wast:3
|
||||
let $1 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x92\x80\x80\x80\x00\x04\x60\x00\x00\x60\x01\x7f\x01\x7f\x60\x01\x7f\x00\x60\x02\x7f\x7f\x00\x03\x93\x80\x80\x80\x00\x12\x00\x01\x01\x02\x01\x01\x01\x01\x01\x02\x03\x03\x01\x01\x01\x01\x01\x01\x07\xc6\x82\x80\x80\x00\x11\x0e\x61\x73\x2d\x62\x6c\x6f\x63\x6b\x2d\x66\x69\x72\x73\x74\x00\x01\x0c\x61\x73\x2d\x62\x6c\x6f\x63\x6b\x2d\x6d\x69\x64\x00\x02\x0d\x61\x73\x2d\x62\x6c\x6f\x63\x6b\x2d\x6c\x61\x73\x74\x00\x03\x14\x61\x73\x2d\x62\x6c\x6f\x63\x6b\x2d\x66\x69\x72\x73\x74\x2d\x76\x61\x6c\x75\x65\x00\x04\x12\x61\x73\x2d\x62\x6c\x6f\x63\x6b\x2d\x6d\x69\x64\x2d\x76\x61\x6c\x75\x65\x00\x05\x13\x61\x73\x2d\x62\x6c\x6f\x63\x6b\x2d\x6c\x61\x73\x74\x2d\x76\x61\x6c\x75\x65\x00\x06\x0d\x61\x73\x2d\x6c\x6f\x6f\x70\x2d\x66\x69\x72\x73\x74\x00\x07\x0b\x61\x73\x2d\x6c\x6f\x6f\x70\x2d\x6d\x69\x64\x00\x08\x0c\x61\x73\x2d\x6c\x6f\x6f\x70\x2d\x6c\x61\x73\x74\x00\x09\x0a\x61\x73\x2d\x69\x66\x2d\x74\x68\x65\x6e\x00\x0a\x0a\x61\x73\x2d\x69\x66\x2d\x65\x6c\x73\x65\x00\x0b\x12\x6e\x65\x73\x74\x65\x64\x2d\x62\x6c\x6f\x63\x6b\x2d\x76\x61\x6c\x75\x65\x00\x0c\x0f\x6e\x65\x73\x74\x65\x64\x2d\x62\x72\x2d\x76\x61\x6c\x75\x65\x00\x0d\x12\x6e\x65\x73\x74\x65\x64\x2d\x62\x72\x5f\x69\x66\x2d\x76\x61\x6c\x75\x65\x00\x0e\x17\x6e\x65\x73\x74\x65\x64\x2d\x62\x72\x5f\x69\x66\x2d\x76\x61\x6c\x75\x65\x2d\x63\x6f\x6e\x64\x00\x0f\x15\x6e\x65\x73\x74\x65\x64\x2d\x62\x72\x5f\x74\x61\x62\x6c\x65\x2d\x76\x61\x6c\x75\x65\x00\x10\x1b\x6e\x65\x73\x74\x65\x64\x2d\x62\x72\x5f\x74\x61\x62\x6c\x65\x2d\x76\x61\x6c\x75\x65\x2d\x69\x6e\x64\x65\x78\x00\x11\x0a\xb5\x83\x80\x80\x00\x12\x82\x80\x80\x80\x00\x00\x0b\x8e\x80\x80\x80\x00\x00\x02\x40\x20\x00\x0d\x00\x41\x02\x0f\x0b\x41\x03\x0b\x90\x80\x80\x80\x00\x00\x02\x40\x10\x00\x20\x00\x0d\x00\x41\x02\x0f\x0b\x41\x03\x0b\x8d\x80\x80\x80\x00\x00\x02\x40\x10\x00\x10\x00\x20\x00\x0d\x00\x0b\x0b\x8f\x80\x80\x80\x00\x00\x02\x7f\x41\x0a\x20\x00\x0d\x00\x1a\x41\x0b\x0f\x0b\x0b\x91\x80\x80\x80\x00\x00\x02\x7f\x10\x00\x41\x14\x20\x00\x0d\x00\x1a\x41\x15\x0f\x0b\x0b\x8f\x80\x80\x80\x00\x00\x02\x7f\x10\x00\x10\x00\x41\x0b\x20\x00\x0d\x00\x0b\x0b\x91\x80\x80\x80\x00\x00\x02\x40\x03\x40\x20\x00\x0d\x01\x41\x02\x0f\x0b\x0b\x41\x03\x0b\x93\x80\x80\x80\x00\x00\x02\x40\x03\x40\x10\x00\x20\x00\x0d\x01\x41\x02\x0f\x0b\x0b\x41\x04\x0b\x8b\x80\x80\x80\x00\x00\x03\x40\x10\x00\x20\x00\x0d\x01\x0b\x0b\x91\x80\x80\x80\x00\x00\x02\x40\x20\x00\x04\x40\x20\x01\x0d\x01\x05\x10\x00\x0b\x0b\x0b\x91\x80\x80\x80\x00\x00\x02\x40\x20\x00\x04\x40\x10\x00\x05\x20\x01\x0d\x01\x0b\x0b\x0b\x9a\x80\x80\x80\x00\x00\x41\x01\x02\x7f\x41\x02\x1a\x41\x04\x02\x7f\x41\x08\x20\x00\x0d\x01\x1a\x41\x10\x0b\x6a\x0b\x6a\x0b\x9b\x80\x80\x80\x00\x00\x41\x01\x02\x7f\x41\x02\x1a\x02\x7f\x41\x08\x20\x00\x0d\x01\x1a\x41\x04\x0b\x0c\x00\x41\x10\x0b\x6a\x0b\x9e\x80\x80\x80\x00\x00\x41\x01\x02\x7f\x41\x02\x1a\x02\x7f\x41\x08\x20\x00\x0d\x01\x1a\x41\x04\x0b\x41\x01\x0d\x00\x1a\x41\x10\x0b\x6a\x0b\x9e\x80\x80\x80\x00\x00\x41\x01\x02\x7f\x41\x02\x1a\x41\x04\x02\x7f\x41\x08\x20\x00\x0d\x01\x1a\x41\x01\x0b\x0d\x00\x1a\x41\x10\x0b\x6a\x0b\x9e\x80\x80\x80\x00\x00\x41\x01\x02\x7f\x41\x02\x1a\x02\x7f\x41\x08\x20\x00\x0d\x01\x1a\x41\x04\x0b\x41\x01\x0e\x00\x00\x41\x10\x0b\x6a\x0b\x9e\x80\x80\x80\x00\x00\x41\x01\x02\x7f\x41\x02\x1a\x41\x04\x02\x7f\x41\x08\x20\x00\x0d\x01\x1a\x41\x01\x0b\x0e\x00\x00\x41\x10\x0b\x6a\x0b");
|
||||
|
||||
// br_if.wast:152
|
||||
assert_return(() => call($1, "as-block-first", [0]), 2);
|
||||
|
||||
// br_if.wast:153
|
||||
assert_return(() => call($1, "as-block-first", [1]), 3);
|
||||
|
||||
// br_if.wast:154
|
||||
assert_return(() => call($1, "as-block-mid", [0]), 2);
|
||||
|
||||
// br_if.wast:155
|
||||
assert_return(() => call($1, "as-block-mid", [1]), 3);
|
||||
|
||||
// br_if.wast:156
|
||||
assert_return(() => call($1, "as-block-last", [0]));
|
||||
|
||||
// br_if.wast:157
|
||||
assert_return(() => call($1, "as-block-last", [1]));
|
||||
|
||||
// br_if.wast:158
|
||||
assert_return(() => call($1, "as-block-last-value", [0]), 11);
|
||||
|
||||
// br_if.wast:159
|
||||
assert_return(() => call($1, "as-block-last-value", [1]), 11);
|
||||
|
||||
// br_if.wast:161
|
||||
assert_return(() => call($1, "as-loop-first", [0]), 2);
|
||||
|
||||
// br_if.wast:162
|
||||
assert_return(() => call($1, "as-loop-first", [1]), 3);
|
||||
|
||||
// br_if.wast:163
|
||||
assert_return(() => call($1, "as-loop-mid", [0]), 2);
|
||||
|
||||
// br_if.wast:164
|
||||
assert_return(() => call($1, "as-loop-mid", [1]), 4);
|
||||
|
||||
// br_if.wast:165
|
||||
assert_return(() => call($1, "as-loop-last", [0]));
|
||||
|
||||
// br_if.wast:166
|
||||
assert_return(() => call($1, "as-loop-last", [1]));
|
||||
|
||||
// br_if.wast:168
|
||||
assert_return(() => call($1, "as-if-then", [0, 0]));
|
||||
|
||||
// br_if.wast:169
|
||||
assert_return(() => call($1, "as-if-then", [4, 0]));
|
||||
|
||||
// br_if.wast:170
|
||||
assert_return(() => call($1, "as-if-then", [0, 1]));
|
||||
|
||||
// br_if.wast:171
|
||||
assert_return(() => call($1, "as-if-then", [4, 1]));
|
||||
|
||||
// br_if.wast:172
|
||||
assert_return(() => call($1, "as-if-else", [0, 0]));
|
||||
|
||||
// br_if.wast:173
|
||||
assert_return(() => call($1, "as-if-else", [3, 0]));
|
||||
|
||||
// br_if.wast:174
|
||||
assert_return(() => call($1, "as-if-else", [0, 1]));
|
||||
|
||||
// br_if.wast:175
|
||||
assert_return(() => call($1, "as-if-else", [3, 1]));
|
||||
|
||||
// br_if.wast:177
|
||||
assert_return(() => call($1, "nested-block-value", [0]), 21);
|
||||
|
||||
// br_if.wast:178
|
||||
assert_return(() => call($1, "nested-block-value", [1]), 9);
|
||||
|
||||
// br_if.wast:179
|
||||
assert_return(() => call($1, "nested-br-value", [0]), 5);
|
||||
|
||||
// br_if.wast:180
|
||||
assert_return(() => call($1, "nested-br-value", [1]), 9);
|
||||
|
||||
// br_if.wast:181
|
||||
assert_return(() => call($1, "nested-br_if-value", [0]), 5);
|
||||
|
||||
// br_if.wast:182
|
||||
assert_return(() => call($1, "nested-br_if-value", [1]), 9);
|
||||
|
||||
// br_if.wast:183
|
||||
assert_return(() => call($1, "nested-br_if-value-cond", [0]), 5);
|
||||
|
||||
// br_if.wast:184
|
||||
assert_return(() => call($1, "nested-br_if-value-cond", [1]), 9);
|
||||
|
||||
// br_if.wast:185
|
||||
assert_return(() => call($1, "nested-br_table-value", [0]), 5);
|
||||
|
||||
// br_if.wast:186
|
||||
assert_return(() => call($1, "nested-br_table-value", [1]), 9);
|
||||
|
||||
// br_if.wast:187
|
||||
assert_return(() => call($1, "nested-br_table-value-index", [0]), 5);
|
||||
|
||||
// br_if.wast:188
|
||||
assert_return(() => call($1, "nested-br_table-value-index", [1]), 9);
|
||||
|
||||
// br_if.wast:190
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x90\x80\x80\x80\x00\x01\x8a\x80\x80\x80\x00\x00\x02\x40\x41\x00\x0d\x00\x68\x0b\x0b");
|
||||
|
||||
// br_if.wast:194
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x90\x80\x80\x80\x00\x01\x8a\x80\x80\x80\x00\x00\x02\x40\x41\x00\x0d\x00\x7a\x0b\x0b");
|
||||
|
||||
// br_if.wast:198
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x90\x80\x80\x80\x00\x01\x8a\x80\x80\x80\x00\x00\x02\x40\x41\x00\x0d\x00\x8c\x0b\x0b");
|
||||
|
||||
// br_if.wast:202
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x90\x80\x80\x80\x00\x01\x8a\x80\x80\x80\x00\x00\x02\x40\x41\x00\x0d\x00\x9a\x0b\x0b");
|
||||
|
||||
// br_if.wast:207
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x90\x80\x80\x80\x00\x01\x8a\x80\x80\x80\x00\x00\x02\x40\x41\x01\x0d\x00\x68\x0b\x0b");
|
||||
|
||||
// br_if.wast:211
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x90\x80\x80\x80\x00\x01\x8a\x80\x80\x80\x00\x00\x02\x40\x42\x01\x0d\x00\x7a\x0b\x0b");
|
||||
|
||||
// br_if.wast:215
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x93\x80\x80\x80\x00\x01\x8d\x80\x80\x80\x00\x00\x02\x40\x43\x00\x00\x80\x3f\x0d\x00\x8c\x0b\x0b");
|
||||
|
||||
// br_if.wast:219
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x90\x80\x80\x80\x00\x01\x8a\x80\x80\x80\x00\x00\x02\x40\x42\x01\x0d\x00\x9a\x0b\x0b");
|
||||
|
||||
// br_if.wast:224
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x91\x80\x80\x80\x00\x01\x8b\x80\x80\x80\x00\x00\x02\x7f\x41\x00\x0d\x00\x41\x01\x0b\x0b");
|
||||
|
||||
// br_if.wast:230
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x91\x80\x80\x80\x00\x01\x8b\x80\x80\x80\x00\x00\x02\x7f\x41\x01\x0d\x00\x41\x01\x0b\x0b");
|
||||
|
||||
// br_if.wast:236
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x91\x80\x80\x80\x00\x01\x8b\x80\x80\x80\x00\x00\x02\x40\x41\x00\x41\x00\x0d\x00\x0b\x0b");
|
||||
|
||||
// br_if.wast:242
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x91\x80\x80\x80\x00\x01\x8b\x80\x80\x80\x00\x00\x02\x40\x41\x00\x41\x01\x0d\x00\x0b\x0b");
|
||||
|
||||
// br_if.wast:249
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x92\x80\x80\x80\x00\x01\x8c\x80\x80\x80\x00\x00\x02\x7f\x01\x41\x00\x0d\x00\x41\x01\x0b\x0b");
|
||||
|
||||
// br_if.wast:255
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x92\x80\x80\x80\x00\x01\x8c\x80\x80\x80\x00\x00\x02\x7f\x01\x41\x01\x0d\x00\x41\x01\x0b\x0b");
|
||||
|
||||
// br_if.wast:261
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x94\x80\x80\x80\x00\x01\x8e\x80\x80\x80\x00\x00\x02\x7f\x42\x01\x41\x00\x0d\x00\x1a\x41\x01\x0b\x0b");
|
||||
|
||||
// br_if.wast:269
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x94\x80\x80\x80\x00\x01\x8e\x80\x80\x80\x00\x00\x02\x7f\x42\x01\x41\x00\x0d\x00\x1a\x41\x01\x0b\x0b");
|
||||
|
||||
// br_if.wast:278
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8e\x80\x80\x80\x00\x01\x88\x80\x80\x80\x00\x00\x02\x40\x01\x0d\x00\x0b\x0b");
|
||||
|
||||
// br_if.wast:284
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8f\x80\x80\x80\x00\x01\x89\x80\x80\x80\x00\x00\x02\x40\x42\x00\x0d\x00\x0b\x0b");
|
||||
|
||||
// br_if.wast:290
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x92\x80\x80\x80\x00\x01\x8c\x80\x80\x80\x00\x00\x02\x7f\x41\x00\x01\x0d\x00\x41\x01\x0b\x0b");
|
||||
|
||||
// br_if.wast:296
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x94\x80\x80\x80\x00\x01\x8e\x80\x80\x80\x00\x00\x02\x7f\x41\x00\x02\x40\x41\x01\x0d\x01\x0b\x0b\x0b");
|
||||
|
||||
// br_if.wast:302
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x00\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x93\x80\x80\x80\x00\x01\x8d\x80\x80\x80\x00\x00\x02\x7f\x41\x00\x42\x00\x0d\x00\x41\x01\x0b\x0b");
|
||||
|
||||
// br_if.wast:309
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8c\x80\x80\x80\x00\x01\x86\x80\x80\x80\x00\x00\x41\x01\x0d\x01\x0b");
|
||||
|
||||
// br_if.wast:313
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x92\x80\x80\x80\x00\x01\x8c\x80\x80\x80\x00\x00\x02\x40\x02\x40\x41\x01\x0d\x05\x0b\x0b\x0b");
|
||||
|
||||
// br_if.wast:317
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x90\x80\x80\x80\x00\x01\x8a\x80\x80\x80\x00\x00\x41\x01\x0d\x81\x80\x80\x80\x01\x0b");
|
File diff suppressed because one or more lines are too long
|
@ -1,12 +0,0 @@
|
|||
|
||||
// break-drop.wast:1
|
||||
let $1 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x84\x80\x80\x80\x00\x03\x00\x00\x00\x07\x99\x80\x80\x80\x00\x03\x02\x62\x72\x00\x00\x05\x62\x72\x5f\x69\x66\x00\x01\x08\x62\x72\x5f\x74\x61\x62\x6c\x65\x00\x02\x0a\xaa\x80\x80\x80\x00\x03\x87\x80\x80\x80\x00\x00\x02\x40\x0c\x00\x0b\x0b\x89\x80\x80\x80\x00\x00\x02\x40\x41\x01\x0d\x00\x0b\x0b\x8a\x80\x80\x80\x00\x00\x02\x40\x41\x00\x0e\x00\x00\x0b\x0b");
|
||||
|
||||
// break-drop.wast:7
|
||||
assert_return(() => call($1, "br", []));
|
||||
|
||||
// break-drop.wast:8
|
||||
assert_return(() => call($1, "br_if", []));
|
||||
|
||||
// break-drop.wast:9
|
||||
assert_return(() => call($1, "br_table", []));
|
|
@ -1,144 +0,0 @@
|
|||
|
||||
// call.wast:3
|
||||
let $1 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\xcb\x80\x80\x80\x00\x0f\x60\x00\x01\x7f\x60\x00\x01\x7e\x60\x00\x01\x7d\x60\x00\x01\x7c\x60\x01\x7f\x01\x7f\x60\x01\x7e\x01\x7e\x60\x01\x7d\x01\x7d\x60\x01\x7c\x01\x7c\x60\x02\x7d\x7f\x01\x7f\x60\x02\x7f\x7e\x01\x7e\x60\x02\x7c\x7d\x01\x7d\x60\x02\x7e\x7c\x01\x7c\x60\x02\x7e\x7e\x01\x7e\x60\x01\x7e\x01\x7f\x60\x00\x00\x03\xa1\x80\x80\x80\x00\x20\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x00\x01\x02\x03\x00\x01\x02\x03\x00\x01\x02\x03\x05\x0c\x05\x0d\x0d\x0e\x0e\x0e\x07\xf7\x81\x80\x80\x00\x13\x08\x74\x79\x70\x65\x2d\x69\x33\x32\x00\x0c\x08\x74\x79\x70\x65\x2d\x69\x36\x34\x00\x0d\x08\x74\x79\x70\x65\x2d\x66\x33\x32\x00\x0e\x08\x74\x79\x70\x65\x2d\x66\x36\x34\x00\x0f\x0e\x74\x79\x70\x65\x2d\x66\x69\x72\x73\x74\x2d\x69\x33\x32\x00\x10\x0e\x74\x79\x70\x65\x2d\x66\x69\x72\x73\x74\x2d\x69\x36\x34\x00\x11\x0e\x74\x79\x70\x65\x2d\x66\x69\x72\x73\x74\x2d\x66\x33\x32\x00\x12\x0e\x74\x79\x70\x65\x2d\x66\x69\x72\x73\x74\x2d\x66\x36\x34\x00\x13\x0f\x74\x79\x70\x65\x2d\x73\x65\x63\x6f\x6e\x64\x2d\x69\x33\x32\x00\x14\x0f\x74\x79\x70\x65\x2d\x73\x65\x63\x6f\x6e\x64\x2d\x69\x36\x34\x00\x15\x0f\x74\x79\x70\x65\x2d\x73\x65\x63\x6f\x6e\x64\x2d\x66\x33\x32\x00\x16\x0f\x74\x79\x70\x65\x2d\x73\x65\x63\x6f\x6e\x64\x2d\x66\x36\x34\x00\x17\x03\x66\x61\x63\x00\x18\x07\x66\x61\x63\x2d\x61\x63\x63\x00\x19\x03\x66\x69\x62\x00\x1a\x04\x65\x76\x65\x6e\x00\x1b\x03\x6f\x64\x64\x00\x1c\x07\x72\x75\x6e\x61\x77\x61\x79\x00\x1d\x0e\x6d\x75\x74\x75\x61\x6c\x2d\x72\x75\x6e\x61\x77\x61\x79\x00\x1e\x0a\xbf\x83\x80\x80\x00\x20\x85\x80\x80\x80\x00\x00\x41\xb2\x02\x0b\x85\x80\x80\x80\x00\x00\x42\xe4\x02\x0b\x87\x80\x80\x80\x00\x00\x43\x00\x20\x73\x45\x0b\x8b\x80\x80\x80\x00\x00\x44\x00\x00\x00\x00\x00\xc8\xae\x40\x0b\x84\x80\x80\x80\x00\x00\x20\x00\x0b\x84\x80\x80\x80\x00\x00\x20\x00\x0b\x84\x80\x80\x80\x00\x00\x20\x00\x0b\x84\x80\x80\x80\x00\x00\x20\x00\x0b\x84\x80\x80\x80\x00\x00\x20\x01\x0b\x84\x80\x80\x80\x00\x00\x20\x01\x0b\x84\x80\x80\x80\x00\x00\x20\x01\x0b\x84\x80\x80\x80\x00\x00\x20\x01\x0b\x84\x80\x80\x80\x00\x00\x10\x00\x0b\x84\x80\x80\x80\x00\x00\x10\x01\x0b\x84\x80\x80\x80\x00\x00\x10\x02\x0b\x84\x80\x80\x80\x00\x00\x10\x03\x0b\x86\x80\x80\x80\x00\x00\x41\x20\x10\x04\x0b\x87\x80\x80\x80\x00\x00\x42\xc0\x00\x10\x05\x0b\x89\x80\x80\x80\x00\x00\x43\xc3\xf5\xa8\x3f\x10\x06\x0b\x8d\x80\x80\x80\x00\x00\x44\x3d\x0a\xd7\xa3\x70\x3d\xfa\x3f\x10\x07\x0b\x8b\x80\x80\x80\x00\x00\x43\x66\x66\x00\x42\x41\x20\x10\x08\x0b\x89\x80\x80\x80\x00\x00\x41\x20\x42\xc0\x00\x10\x09\x0b\x92\x80\x80\x80\x00\x00\x44\x00\x00\x00\x00\x00\x00\x50\x40\x43\x00\x00\x00\x42\x10\x0a\x0b\x90\x80\x80\x80\x00\x00\x42\xc0\x00\x44\x66\x66\x66\x66\x66\x06\x50\x40\x10\x0b\x0b\x95\x80\x80\x80\x00\x00\x20\x00\x50\x04\x7e\x42\x01\x05\x20\x00\x20\x00\x42\x01\x7d\x10\x18\x7e\x0b\x0b\x97\x80\x80\x80\x00\x00\x20\x00\x50\x04\x7e\x20\x01\x05\x20\x00\x42\x01\x7d\x20\x00\x20\x01\x7e\x10\x19\x0b\x0b\x9c\x80\x80\x80\x00\x00\x20\x00\x42\x01\x58\x04\x7e\x42\x01\x05\x20\x00\x42\x02\x7d\x10\x1a\x20\x00\x42\x01\x7d\x10\x1a\x7c\x0b\x0b\x92\x80\x80\x80\x00\x00\x20\x00\x50\x04\x7f\x41\x2c\x05\x20\x00\x42\x01\x7d\x10\x1c\x0b\x0b\x93\x80\x80\x80\x00\x00\x20\x00\x50\x04\x7f\x41\xe3\x00\x05\x20\x00\x42\x01\x7d\x10\x1b\x0b\x0b\x84\x80\x80\x80\x00\x00\x10\x1d\x0b\x84\x80\x80\x80\x00\x00\x10\x1f\x0b\x84\x80\x80\x80\x00\x00\x10\x1e\x0b");
|
||||
|
||||
// call.wast:111
|
||||
assert_return(() => call($1, "type-i32", []), 306);
|
||||
|
||||
// call.wast:112
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x00\x60\x00\x01\x7e\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x74\x79\x70\x65\x2d\x69\x36\x34\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x98\x80\x80\x80\x00\x01\x92\x80\x80\x80\x00\x00\x02\x40\x10\x00\x01\x42\xe4\x02\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "type-i64", []), int64("356"))
|
||||
|
||||
// call.wast:113
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x00\x60\x00\x01\x7d\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x74\x79\x70\x65\x2d\x66\x33\x32\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9a\x80\x80\x80\x00\x01\x94\x80\x80\x80\x00\x00\x02\x40\x10\x00\xbc\x43\x00\x20\x73\x45\xbc\x46\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "type-f32", []), 3890.)
|
||||
|
||||
// call.wast:114
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x00\x60\x00\x01\x7c\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x74\x79\x70\x65\x2d\x66\x36\x34\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9e\x80\x80\x80\x00\x01\x98\x80\x80\x80\x00\x00\x02\x40\x10\x00\xbd\x44\x00\x00\x00\x00\x00\xc8\xae\x40\xbd\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "type-f64", []), 3940.)
|
||||
|
||||
// call.wast:116
|
||||
assert_return(() => call($1, "type-first-i32", []), 32);
|
||||
|
||||
// call.wast:117
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x00\x60\x00\x01\x7e\x02\x95\x80\x80\x80\x00\x01\x02\x24\x31\x0e\x74\x79\x70\x65\x2d\x66\x69\x72\x73\x74\x2d\x69\x36\x34\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x98\x80\x80\x80\x00\x01\x92\x80\x80\x80\x00\x00\x02\x40\x10\x00\x01\x42\xc0\x00\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "type-first-i64", []), int64("64"))
|
||||
|
||||
// call.wast:118
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x00\x60\x00\x01\x7d\x02\x95\x80\x80\x80\x00\x01\x02\x24\x31\x0e\x74\x79\x70\x65\x2d\x66\x69\x72\x73\x74\x2d\x66\x33\x32\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9a\x80\x80\x80\x00\x01\x94\x80\x80\x80\x00\x00\x02\x40\x10\x00\xbc\x43\xc3\xf5\xa8\x3f\xbc\x46\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "type-first-f32", []), 1.32000005245)
|
||||
|
||||
// call.wast:119
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x00\x60\x00\x01\x7c\x02\x95\x80\x80\x80\x00\x01\x02\x24\x31\x0e\x74\x79\x70\x65\x2d\x66\x69\x72\x73\x74\x2d\x66\x36\x34\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9e\x80\x80\x80\x00\x01\x98\x80\x80\x80\x00\x00\x02\x40\x10\x00\xbd\x44\x3d\x0a\xd7\xa3\x70\x3d\xfa\x3f\xbd\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "type-first-f64", []), 1.64)
|
||||
|
||||
// call.wast:121
|
||||
assert_return(() => call($1, "type-second-i32", []), 32);
|
||||
|
||||
// call.wast:122
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x00\x60\x00\x01\x7e\x02\x96\x80\x80\x80\x00\x01\x02\x24\x31\x0f\x74\x79\x70\x65\x2d\x73\x65\x63\x6f\x6e\x64\x2d\x69\x36\x34\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x98\x80\x80\x80\x00\x01\x92\x80\x80\x80\x00\x00\x02\x40\x10\x00\x01\x42\xc0\x00\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "type-second-i64", []), int64("64"))
|
||||
|
||||
// call.wast:123
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x00\x60\x00\x01\x7d\x02\x96\x80\x80\x80\x00\x01\x02\x24\x31\x0f\x74\x79\x70\x65\x2d\x73\x65\x63\x6f\x6e\x64\x2d\x66\x33\x32\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9a\x80\x80\x80\x00\x01\x94\x80\x80\x80\x00\x00\x02\x40\x10\x00\xbc\x43\x00\x00\x00\x42\xbc\x46\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "type-second-f32", []), 32.)
|
||||
|
||||
// call.wast:124
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x00\x60\x00\x01\x7c\x02\x96\x80\x80\x80\x00\x01\x02\x24\x31\x0f\x74\x79\x70\x65\x2d\x73\x65\x63\x6f\x6e\x64\x2d\x66\x36\x34\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9e\x80\x80\x80\x00\x01\x98\x80\x80\x80\x00\x00\x02\x40\x10\x00\xbd\x44\x66\x66\x66\x66\x66\x06\x50\x40\xbd\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "type-second-f64", []), 64.1)
|
||||
|
||||
// call.wast:126
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x8a\x80\x80\x80\x00\x01\x02\x24\x31\x03\x66\x61\x63\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x99\x80\x80\x80\x00\x01\x93\x80\x80\x80\x00\x00\x02\x40\x42\x00\x10\x00\x01\x42\x01\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "fac", [int64("0")]), int64("1"))
|
||||
|
||||
// call.wast:127
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x8a\x80\x80\x80\x00\x01\x02\x24\x31\x03\x66\x61\x63\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x99\x80\x80\x80\x00\x01\x93\x80\x80\x80\x00\x00\x02\x40\x42\x01\x10\x00\x01\x42\x01\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "fac", [int64("1")]), int64("1"))
|
||||
|
||||
// call.wast:128
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x8a\x80\x80\x80\x00\x01\x02\x24\x31\x03\x66\x61\x63\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9a\x80\x80\x80\x00\x01\x94\x80\x80\x80\x00\x00\x02\x40\x42\x05\x10\x00\x01\x42\xf8\x00\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "fac", [int64("5")]), int64("120"))
|
||||
|
||||
// call.wast:129
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x8a\x80\x80\x80\x00\x01\x02\x24\x31\x03\x66\x61\x63\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\xa2\x80\x80\x80\x00\x01\x9c\x80\x80\x80\x00\x00\x02\x40\x42\x19\x10\x00\x01\x42\x80\x80\x80\xde\x87\x92\xec\xcf\xe1\x00\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "fac", [int64("25")]), int64("7034535277573963776"))
|
||||
|
||||
// call.wast:130
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x8a\x80\x80\x80\x00\x02\x60\x00\x00\x60\x02\x7e\x7e\x01\x7e\x02\x8e\x80\x80\x80\x00\x01\x02\x24\x31\x07\x66\x61\x63\x2d\x61\x63\x63\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9b\x80\x80\x80\x00\x01\x95\x80\x80\x80\x00\x00\x02\x40\x42\x00\x42\x01\x10\x00\x01\x42\x01\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "fac-acc", [int64("0"), int64("1")]), int64("1"))
|
||||
|
||||
// call.wast:131
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x8a\x80\x80\x80\x00\x02\x60\x00\x00\x60\x02\x7e\x7e\x01\x7e\x02\x8e\x80\x80\x80\x00\x01\x02\x24\x31\x07\x66\x61\x63\x2d\x61\x63\x63\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9b\x80\x80\x80\x00\x01\x95\x80\x80\x80\x00\x00\x02\x40\x42\x01\x42\x01\x10\x00\x01\x42\x01\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "fac-acc", [int64("1"), int64("1")]), int64("1"))
|
||||
|
||||
// call.wast:132
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x8a\x80\x80\x80\x00\x02\x60\x00\x00\x60\x02\x7e\x7e\x01\x7e\x02\x8e\x80\x80\x80\x00\x01\x02\x24\x31\x07\x66\x61\x63\x2d\x61\x63\x63\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9c\x80\x80\x80\x00\x01\x96\x80\x80\x80\x00\x00\x02\x40\x42\x05\x42\x01\x10\x00\x01\x42\xf8\x00\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "fac-acc", [int64("5"), int64("1")]), int64("120"))
|
||||
|
||||
// call.wast:133
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x8a\x80\x80\x80\x00\x02\x60\x00\x00\x60\x02\x7e\x7e\x01\x7e\x02\x8e\x80\x80\x80\x00\x01\x02\x24\x31\x07\x66\x61\x63\x2d\x61\x63\x63\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\xa4\x80\x80\x80\x00\x01\x9e\x80\x80\x80\x00\x00\x02\x40\x42\x19\x42\x01\x10\x00\x01\x42\x80\x80\x80\xde\x87\x92\xec\xcf\xe1\x00\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "fac-acc", [int64("25"), int64("1")]), int64("7034535277573963776"))
|
||||
|
||||
// call.wast:138
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x8a\x80\x80\x80\x00\x01\x02\x24\x31\x03\x66\x69\x62\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x99\x80\x80\x80\x00\x01\x93\x80\x80\x80\x00\x00\x02\x40\x42\x00\x10\x00\x01\x42\x01\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "fib", [int64("0")]), int64("1"))
|
||||
|
||||
// call.wast:139
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x8a\x80\x80\x80\x00\x01\x02\x24\x31\x03\x66\x69\x62\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x99\x80\x80\x80\x00\x01\x93\x80\x80\x80\x00\x00\x02\x40\x42\x01\x10\x00\x01\x42\x01\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "fib", [int64("1")]), int64("1"))
|
||||
|
||||
// call.wast:140
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x8a\x80\x80\x80\x00\x01\x02\x24\x31\x03\x66\x69\x62\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x99\x80\x80\x80\x00\x01\x93\x80\x80\x80\x00\x00\x02\x40\x42\x02\x10\x00\x01\x42\x02\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "fib", [int64("2")]), int64("2"))
|
||||
|
||||
// call.wast:141
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x8a\x80\x80\x80\x00\x01\x02\x24\x31\x03\x66\x69\x62\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x99\x80\x80\x80\x00\x01\x93\x80\x80\x80\x00\x00\x02\x40\x42\x05\x10\x00\x01\x42\x08\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "fib", [int64("5")]), int64("8"))
|
||||
|
||||
// call.wast:142
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x8a\x80\x80\x80\x00\x01\x02\x24\x31\x03\x66\x69\x62\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9b\x80\x80\x80\x00\x01\x95\x80\x80\x80\x00\x00\x02\x40\x42\x14\x10\x00\x01\x42\xc2\xd5\x00\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "fib", [int64("20")]), int64("10946"))
|
||||
|
||||
// call.wast:144
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7f\x02\x8b\x80\x80\x80\x00\x01\x02\x24\x31\x04\x65\x76\x65\x6e\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x99\x80\x80\x80\x00\x01\x93\x80\x80\x80\x00\x00\x02\x40\x42\x00\x10\x00\x01\x41\x2c\x01\x46\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "even", [int64("0")]), 44)
|
||||
|
||||
// call.wast:145
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7f\x02\x8b\x80\x80\x80\x00\x01\x02\x24\x31\x04\x65\x76\x65\x6e\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9a\x80\x80\x80\x00\x01\x94\x80\x80\x80\x00\x00\x02\x40\x42\x01\x10\x00\x01\x41\xe3\x00\x01\x46\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "even", [int64("1")]), 99)
|
||||
|
||||
// call.wast:146
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7f\x02\x8b\x80\x80\x80\x00\x01\x02\x24\x31\x04\x65\x76\x65\x6e\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9a\x80\x80\x80\x00\x01\x94\x80\x80\x80\x00\x00\x02\x40\x42\xe4\x00\x10\x00\x01\x41\x2c\x01\x46\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "even", [int64("100")]), 44)
|
||||
|
||||
// call.wast:147
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7f\x02\x8b\x80\x80\x80\x00\x01\x02\x24\x31\x04\x65\x76\x65\x6e\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9b\x80\x80\x80\x00\x01\x95\x80\x80\x80\x00\x00\x02\x40\x42\xcd\x00\x10\x00\x01\x41\xe3\x00\x01\x46\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "even", [int64("77")]), 99)
|
||||
|
||||
// call.wast:148
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7f\x02\x8a\x80\x80\x80\x00\x01\x02\x24\x31\x03\x6f\x64\x64\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9a\x80\x80\x80\x00\x01\x94\x80\x80\x80\x00\x00\x02\x40\x42\x00\x10\x00\x01\x41\xe3\x00\x01\x46\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "odd", [int64("0")]), 99)
|
||||
|
||||
// call.wast:149
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7f\x02\x8a\x80\x80\x80\x00\x01\x02\x24\x31\x03\x6f\x64\x64\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x99\x80\x80\x80\x00\x01\x93\x80\x80\x80\x00\x00\x02\x40\x42\x01\x10\x00\x01\x41\x2c\x01\x46\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "odd", [int64("1")]), 44)
|
||||
|
||||
// call.wast:150
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7f\x02\x8a\x80\x80\x80\x00\x01\x02\x24\x31\x03\x6f\x64\x64\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9b\x80\x80\x80\x00\x01\x95\x80\x80\x80\x00\x00\x02\x40\x42\xc8\x01\x10\x00\x01\x41\xe3\x00\x01\x46\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "odd", [int64("200")]), 99)
|
||||
|
||||
// call.wast:151
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7f\x02\x8a\x80\x80\x80\x00\x01\x02\x24\x31\x03\x6f\x64\x64\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9a\x80\x80\x80\x00\x01\x94\x80\x80\x80\x00\x00\x02\x40\x42\xcd\x00\x10\x00\x01\x41\x2c\x01\x46\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "odd", [int64("77")]), 44)
|
||||
|
||||
// call.wast:153
|
||||
assert_exhaustion(() => call($1, "runaway", []));
|
||||
|
||||
// call.wast:154
|
||||
assert_exhaustion(() => call($1, "mutual-runaway", []));
|
||||
|
||||
// call.wast:159
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x83\x80\x80\x80\x00\x02\x00\x00\x0a\x92\x80\x80\x80\x00\x02\x85\x80\x80\x80\x00\x00\x10\x01\x45\x0b\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// call.wast:166
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x00\x60\x00\x01\x7e\x03\x83\x80\x80\x80\x00\x02\x00\x01\x0a\x94\x80\x80\x80\x00\x02\x85\x80\x80\x80\x00\x00\x10\x01\x45\x0b\x84\x80\x80\x80\x00\x00\x42\x01\x0b");
|
||||
|
||||
// call.wast:174
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7f\x00\x03\x83\x80\x80\x80\x00\x02\x00\x01\x0a\x91\x80\x80\x80\x00\x02\x84\x80\x80\x80\x00\x00\x10\x01\x0b\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// call.wast:181
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x02\x7c\x7f\x00\x03\x83\x80\x80\x80\x00\x02\x00\x01\x0a\x91\x80\x80\x80\x00\x02\x84\x80\x80\x80\x00\x00\x10\x01\x0b\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// call.wast:188
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x83\x80\x80\x80\x00\x02\x00\x00\x0a\x93\x80\x80\x80\x00\x02\x86\x80\x80\x80\x00\x00\x41\x01\x10\x01\x0b\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// call.wast:195
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x83\x80\x80\x80\x00\x02\x00\x00\x0a\x9c\x80\x80\x80\x00\x02\x8f\x80\x80\x80\x00\x00\x44\x00\x00\x00\x00\x00\x00\x00\x40\x41\x01\x10\x01\x0b\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// call.wast:203
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x02\x7f\x7f\x00\x03\x83\x80\x80\x80\x00\x02\x00\x01\x0a\x94\x80\x80\x80\x00\x02\x87\x80\x80\x80\x00\x00\x01\x41\x01\x10\x01\x0b\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// call.wast:210
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x02\x7f\x7f\x00\x03\x83\x80\x80\x80\x00\x02\x00\x01\x0a\x94\x80\x80\x80\x00\x02\x87\x80\x80\x80\x00\x00\x41\x01\x01\x10\x01\x0b\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// call.wast:217
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x02\x7f\x7c\x00\x03\x83\x80\x80\x80\x00\x02\x00\x01\x0a\x9c\x80\x80\x80\x00\x02\x8f\x80\x80\x80\x00\x00\x44\x00\x00\x00\x00\x00\x00\xf0\x3f\x41\x01\x10\x01\x0b\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// call.wast:224
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x02\x7c\x7f\x00\x03\x83\x80\x80\x80\x00\x02\x00\x01\x0a\x9c\x80\x80\x80\x00\x02\x8f\x80\x80\x80\x00\x00\x41\x01\x44\x00\x00\x00\x00\x00\x00\xf0\x3f\x10\x01\x0b\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// call.wast:235
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8a\x80\x80\x80\x00\x01\x84\x80\x80\x80\x00\x00\x10\x01\x0b");
|
||||
|
||||
// call.wast:239
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8e\x80\x80\x80\x00\x01\x88\x80\x80\x80\x00\x00\x10\x94\x98\xdb\xe2\x03\x0b");
|
|
@ -1,204 +0,0 @@
|
|||
|
||||
// call_indirect.wast:3
|
||||
let $1 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\xd9\x80\x80\x80\x00\x12\x60\x00\x00\x60\x00\x01\x7f\x60\x00\x01\x7e\x60\x00\x01\x7d\x60\x00\x01\x7c\x60\x01\x7f\x01\x7f\x60\x01\x7e\x01\x7e\x60\x01\x7d\x01\x7d\x60\x01\x7c\x01\x7c\x60\x02\x7d\x7f\x01\x7f\x60\x02\x7f\x7e\x01\x7e\x60\x02\x7c\x7d\x01\x7d\x60\x02\x7e\x7c\x01\x7c\x60\x01\x7f\x01\x7f\x60\x01\x7e\x01\x7e\x60\x01\x7d\x01\x7d\x60\x01\x7c\x01\x7c\x60\x01\x7f\x01\x7e\x03\xa7\x80\x80\x80\x00\x26\x01\x02\x03\x04\x05\x06\x07\x08\x0a\x0c\x09\x0b\x0d\x0e\x0f\x10\x01\x02\x03\x04\x02\x01\x02\x03\x04\x01\x02\x03\x04\x0a\x11\x06\x06\x05\x05\x00\x00\x00\x04\x85\x80\x80\x80\x00\x01\x70\x01\x17\x17\x07\x9b\x82\x80\x80\x00\x15\x08\x74\x79\x70\x65\x2d\x69\x33\x32\x00\x10\x08\x74\x79\x70\x65\x2d\x69\x36\x34\x00\x11\x08\x74\x79\x70\x65\x2d\x66\x33\x32\x00\x12\x08\x74\x79\x70\x65\x2d\x66\x36\x34\x00\x13\x0a\x74\x79\x70\x65\x2d\x69\x6e\x64\x65\x78\x00\x14\x0e\x74\x79\x70\x65\x2d\x66\x69\x72\x73\x74\x2d\x69\x33\x32\x00\x15\x0e\x74\x79\x70\x65\x2d\x66\x69\x72\x73\x74\x2d\x69\x36\x34\x00\x16\x0e\x74\x79\x70\x65\x2d\x66\x69\x72\x73\x74\x2d\x66\x33\x32\x00\x17\x0e\x74\x79\x70\x65\x2d\x66\x69\x72\x73\x74\x2d\x66\x36\x34\x00\x18\x0f\x74\x79\x70\x65\x2d\x73\x65\x63\x6f\x6e\x64\x2d\x69\x33\x32\x00\x19\x0f\x74\x79\x70\x65\x2d\x73\x65\x63\x6f\x6e\x64\x2d\x69\x36\x34\x00\x1a\x0f\x74\x79\x70\x65\x2d\x73\x65\x63\x6f\x6e\x64\x2d\x66\x33\x32\x00\x1b\x0f\x74\x79\x70\x65\x2d\x73\x65\x63\x6f\x6e\x64\x2d\x66\x36\x34\x00\x1c\x08\x64\x69\x73\x70\x61\x74\x63\x68\x00\x1d\x13\x64\x69\x73\x70\x61\x74\x63\x68\x2d\x73\x74\x72\x75\x63\x74\x75\x72\x61\x6c\x00\x1e\x03\x66\x61\x63\x00\x1f\x03\x66\x69\x62\x00\x20\x04\x65\x76\x65\x6e\x00\x21\x03\x6f\x64\x64\x00\x22\x07\x72\x75\x6e\x61\x77\x61\x79\x00\x23\x0e\x6d\x75\x74\x75\x61\x6c\x2d\x72\x75\x6e\x61\x77\x61\x79\x00\x24\x09\x9d\x80\x80\x80\x00\x01\x00\x41\x00\x0b\x17\x00\x01\x02\x03\x04\x05\x06\x07\x0a\x08\x0b\x09\x1f\x20\x21\x22\x23\x24\x25\x0c\x0d\x0e\x0f\x0a\xae\x84\x80\x80\x00\x26\x85\x80\x80\x80\x00\x00\x41\xb2\x02\x0b\x85\x80\x80\x80\x00\x00\x42\xe4\x02\x0b\x87\x80\x80\x80\x00\x00\x43\x00\x20\x73\x45\x0b\x8b\x80\x80\x80\x00\x00\x44\x00\x00\x00\x00\x00\xc8\xae\x40\x0b\x84\x80\x80\x80\x00\x00\x20\x00\x0b\x84\x80\x80\x80\x00\x00\x20\x00\x0b\x84\x80\x80\x80\x00\x00\x20\x00\x0b\x84\x80\x80\x80\x00\x00\x20\x00\x0b\x84\x80\x80\x80\x00\x00\x20\x01\x0b\x84\x80\x80\x80\x00\x00\x20\x01\x0b\x84\x80\x80\x80\x00\x00\x20\x01\x0b\x84\x80\x80\x80\x00\x00\x20\x01\x0b\x84\x80\x80\x80\x00\x00\x20\x00\x0b\x84\x80\x80\x80\x00\x00\x20\x00\x0b\x84\x80\x80\x80\x00\x00\x20\x00\x0b\x84\x80\x80\x80\x00\x00\x20\x00\x0b\x87\x80\x80\x80\x00\x00\x41\x00\x11\x01\x00\x0b\x87\x80\x80\x80\x00\x00\x41\x01\x11\x02\x00\x0b\x87\x80\x80\x80\x00\x00\x41\x02\x11\x03\x00\x0b\x87\x80\x80\x80\x00\x00\x41\x03\x11\x04\x00\x0b\x8a\x80\x80\x80\x00\x00\x42\xe4\x00\x41\x05\x11\x06\x00\x0b\x89\x80\x80\x80\x00\x00\x41\x20\x41\x04\x11\x05\x00\x0b\x8a\x80\x80\x80\x00\x00\x42\xc0\x00\x41\x05\x11\x06\x00\x0b\x8c\x80\x80\x80\x00\x00\x43\xc3\xf5\xa8\x3f\x41\x06\x11\x07\x00\x0b\x90\x80\x80\x80\x00\x00\x44\x3d\x0a\xd7\xa3\x70\x3d\xfa\x3f\x41\x07\x11\x08\x00\x0b\x8e\x80\x80\x80\x00\x00\x43\x66\x66\x00\x42\x41\x20\x41\x08\x11\x09\x00\x0b\x8c\x80\x80\x80\x00\x00\x41\x20\x42\xc0\x00\x41\x09\x11\x0a\x00\x0b\x95\x80\x80\x80\x00\x00\x44\x00\x00\x00\x00\x00\x00\x50\x40\x43\x00\x00\x00\x42\x41\x0a\x11\x0b\x00\x0b\x93\x80\x80\x80\x00\x00\x42\xc0\x00\x44\x66\x66\x66\x66\x66\x06\x50\x40\x41\x0b\x11\x0c\x00\x0b\x89\x80\x80\x80\x00\x00\x20\x01\x20\x00\x11\x06\x00\x0b\x89\x80\x80\x80\x00\x00\x42\x09\x20\x00\x11\x0e\x00\x0b\x98\x80\x80\x80\x00\x00\x20\x00\x50\x04\x7e\x42\x01\x05\x20\x00\x20\x00\x42\x01\x7d\x41\x0c\x11\x06\x00\x7e\x0b\x0b\xa2\x80\x80\x80\x00\x00\x20\x00\x42\x01\x58\x04\x7e\x42\x01\x05\x20\x00\x42\x02\x7d\x41\x0d\x11\x06\x00\x20\x00\x42\x01\x7d\x41\x0d\x11\x06\x00\x7c\x0b\x0b\x95\x80\x80\x80\x00\x00\x20\x00\x45\x04\x7f\x41\x2c\x05\x20\x00\x41\x01\x6b\x41\x0f\x11\x05\x00\x0b\x0b\x96\x80\x80\x80\x00\x00\x20\x00\x45\x04\x7f\x41\xe3\x00\x05\x20\x00\x41\x01\x6b\x41\x0e\x11\x05\x00\x0b\x0b\x87\x80\x80\x80\x00\x00\x41\x10\x11\x00\x00\x0b\x87\x80\x80\x80\x00\x00\x41\x12\x11\x00\x00\x0b\x87\x80\x80\x80\x00\x00\x41\x11\x11\x00\x00\x0b");
|
||||
|
||||
// call_indirect.wast:175
|
||||
assert_return(() => call($1, "type-i32", []), 306);
|
||||
|
||||
// call_indirect.wast:176
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x00\x60\x00\x01\x7e\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x74\x79\x70\x65\x2d\x69\x36\x34\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x98\x80\x80\x80\x00\x01\x92\x80\x80\x80\x00\x00\x02\x40\x10\x00\x01\x42\xe4\x02\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "type-i64", []), int64("356"))
|
||||
|
||||
// call_indirect.wast:177
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x00\x60\x00\x01\x7d\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x74\x79\x70\x65\x2d\x66\x33\x32\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9a\x80\x80\x80\x00\x01\x94\x80\x80\x80\x00\x00\x02\x40\x10\x00\xbc\x43\x00\x20\x73\x45\xbc\x46\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "type-f32", []), 3890.)
|
||||
|
||||
// call_indirect.wast:178
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x00\x60\x00\x01\x7c\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x74\x79\x70\x65\x2d\x66\x36\x34\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9e\x80\x80\x80\x00\x01\x98\x80\x80\x80\x00\x00\x02\x40\x10\x00\xbd\x44\x00\x00\x00\x00\x00\xc8\xae\x40\xbd\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "type-f64", []), 3940.)
|
||||
|
||||
// call_indirect.wast:180
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x00\x60\x00\x01\x7e\x02\x91\x80\x80\x80\x00\x01\x02\x24\x31\x0a\x74\x79\x70\x65\x2d\x69\x6e\x64\x65\x78\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x98\x80\x80\x80\x00\x01\x92\x80\x80\x80\x00\x00\x02\x40\x10\x00\x01\x42\xe4\x00\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "type-index", []), int64("100"))
|
||||
|
||||
// call_indirect.wast:182
|
||||
assert_return(() => call($1, "type-first-i32", []), 32);
|
||||
|
||||
// call_indirect.wast:183
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x00\x60\x00\x01\x7e\x02\x95\x80\x80\x80\x00\x01\x02\x24\x31\x0e\x74\x79\x70\x65\x2d\x66\x69\x72\x73\x74\x2d\x69\x36\x34\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x98\x80\x80\x80\x00\x01\x92\x80\x80\x80\x00\x00\x02\x40\x10\x00\x01\x42\xc0\x00\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "type-first-i64", []), int64("64"))
|
||||
|
||||
// call_indirect.wast:184
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x00\x60\x00\x01\x7d\x02\x95\x80\x80\x80\x00\x01\x02\x24\x31\x0e\x74\x79\x70\x65\x2d\x66\x69\x72\x73\x74\x2d\x66\x33\x32\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9a\x80\x80\x80\x00\x01\x94\x80\x80\x80\x00\x00\x02\x40\x10\x00\xbc\x43\xc3\xf5\xa8\x3f\xbc\x46\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "type-first-f32", []), 1.32000005245)
|
||||
|
||||
// call_indirect.wast:185
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x00\x60\x00\x01\x7c\x02\x95\x80\x80\x80\x00\x01\x02\x24\x31\x0e\x74\x79\x70\x65\x2d\x66\x69\x72\x73\x74\x2d\x66\x36\x34\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9e\x80\x80\x80\x00\x01\x98\x80\x80\x80\x00\x00\x02\x40\x10\x00\xbd\x44\x3d\x0a\xd7\xa3\x70\x3d\xfa\x3f\xbd\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "type-first-f64", []), 1.64)
|
||||
|
||||
// call_indirect.wast:187
|
||||
assert_return(() => call($1, "type-second-i32", []), 32);
|
||||
|
||||
// call_indirect.wast:188
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x00\x60\x00\x01\x7e\x02\x96\x80\x80\x80\x00\x01\x02\x24\x31\x0f\x74\x79\x70\x65\x2d\x73\x65\x63\x6f\x6e\x64\x2d\x69\x36\x34\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x98\x80\x80\x80\x00\x01\x92\x80\x80\x80\x00\x00\x02\x40\x10\x00\x01\x42\xc0\x00\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "type-second-i64", []), int64("64"))
|
||||
|
||||
// call_indirect.wast:189
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x00\x60\x00\x01\x7d\x02\x96\x80\x80\x80\x00\x01\x02\x24\x31\x0f\x74\x79\x70\x65\x2d\x73\x65\x63\x6f\x6e\x64\x2d\x66\x33\x32\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9a\x80\x80\x80\x00\x01\x94\x80\x80\x80\x00\x00\x02\x40\x10\x00\xbc\x43\x00\x00\x00\x42\xbc\x46\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "type-second-f32", []), 32.)
|
||||
|
||||
// call_indirect.wast:190
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x00\x60\x00\x01\x7c\x02\x96\x80\x80\x80\x00\x01\x02\x24\x31\x0f\x74\x79\x70\x65\x2d\x73\x65\x63\x6f\x6e\x64\x2d\x66\x36\x34\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9e\x80\x80\x80\x00\x01\x98\x80\x80\x80\x00\x00\x02\x40\x10\x00\xbd\x44\x66\x66\x66\x66\x66\x06\x50\x40\xbd\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "type-second-f64", []), 64.1)
|
||||
|
||||
// call_indirect.wast:192
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x8a\x80\x80\x80\x00\x02\x60\x00\x00\x60\x02\x7f\x7e\x01\x7e\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x64\x69\x73\x70\x61\x74\x63\x68\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9b\x80\x80\x80\x00\x01\x95\x80\x80\x80\x00\x00\x02\x40\x41\x05\x42\x02\x10\x00\x01\x42\x02\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "dispatch", [5, int64("2")]), int64("2"))
|
||||
|
||||
// call_indirect.wast:193
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x8a\x80\x80\x80\x00\x02\x60\x00\x00\x60\x02\x7f\x7e\x01\x7e\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x64\x69\x73\x70\x61\x74\x63\x68\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9b\x80\x80\x80\x00\x01\x95\x80\x80\x80\x00\x00\x02\x40\x41\x05\x42\x05\x10\x00\x01\x42\x05\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "dispatch", [5, int64("5")]), int64("5"))
|
||||
|
||||
// call_indirect.wast:194
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x8a\x80\x80\x80\x00\x02\x60\x00\x00\x60\x02\x7f\x7e\x01\x7e\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x64\x69\x73\x70\x61\x74\x63\x68\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9c\x80\x80\x80\x00\x01\x96\x80\x80\x80\x00\x00\x02\x40\x41\x0c\x42\x05\x10\x00\x01\x42\xf8\x00\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "dispatch", [12, int64("5")]), int64("120"))
|
||||
|
||||
// call_indirect.wast:195
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x8a\x80\x80\x80\x00\x02\x60\x00\x00\x60\x02\x7f\x7e\x01\x7e\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x64\x69\x73\x70\x61\x74\x63\x68\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9b\x80\x80\x80\x00\x01\x95\x80\x80\x80\x00\x00\x02\x40\x41\x0d\x42\x05\x10\x00\x01\x42\x08\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "dispatch", [13, int64("5")]), int64("8"))
|
||||
|
||||
// call_indirect.wast:196
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x8a\x80\x80\x80\x00\x02\x60\x00\x00\x60\x02\x7f\x7e\x01\x7e\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x64\x69\x73\x70\x61\x74\x63\x68\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9b\x80\x80\x80\x00\x01\x95\x80\x80\x80\x00\x00\x02\x40\x41\x14\x42\x02\x10\x00\x01\x42\x02\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "dispatch", [20, int64("2")]), int64("2"))
|
||||
|
||||
// call_indirect.wast:197
|
||||
assert_trap(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x8a\x80\x80\x80\x00\x02\x60\x00\x00\x60\x02\x7f\x7e\x01\x7e\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x64\x69\x73\x70\x61\x74\x63\x68\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x93\x80\x80\x80\x00\x01\x8d\x80\x80\x80\x00\x00\x02\x40\x41\x00\x42\x02\x10\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_trap(() => call($1, "dispatch", [0, int64("2")]))
|
||||
|
||||
// call_indirect.wast:198
|
||||
assert_trap(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x8a\x80\x80\x80\x00\x02\x60\x00\x00\x60\x02\x7f\x7e\x01\x7e\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x64\x69\x73\x70\x61\x74\x63\x68\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x93\x80\x80\x80\x00\x01\x8d\x80\x80\x80\x00\x00\x02\x40\x41\x0f\x42\x02\x10\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_trap(() => call($1, "dispatch", [15, int64("2")]))
|
||||
|
||||
// call_indirect.wast:199
|
||||
assert_trap(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x8a\x80\x80\x80\x00\x02\x60\x00\x00\x60\x02\x7f\x7e\x01\x7e\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x64\x69\x73\x70\x61\x74\x63\x68\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x93\x80\x80\x80\x00\x01\x8d\x80\x80\x80\x00\x00\x02\x40\x41\x17\x42\x02\x10\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_trap(() => call($1, "dispatch", [23, int64("2")]))
|
||||
|
||||
// call_indirect.wast:200
|
||||
assert_trap(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x8a\x80\x80\x80\x00\x02\x60\x00\x00\x60\x02\x7f\x7e\x01\x7e\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x64\x69\x73\x70\x61\x74\x63\x68\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x93\x80\x80\x80\x00\x01\x8d\x80\x80\x80\x00\x00\x02\x40\x41\x7f\x42\x02\x10\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_trap(() => call($1, "dispatch", [-1, int64("2")]))
|
||||
|
||||
// call_indirect.wast:201
|
||||
assert_trap(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x8a\x80\x80\x80\x00\x02\x60\x00\x00\x60\x02\x7f\x7e\x01\x7e\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x64\x69\x73\x70\x61\x74\x63\x68\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x97\x80\x80\x80\x00\x01\x91\x80\x80\x80\x00\x00\x02\x40\x41\xe7\x84\xce\xc2\x04\x42\x02\x10\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_trap(() => call($1, "dispatch", [1213432423, int64("2")]))
|
||||
|
||||
// call_indirect.wast:203
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7f\x01\x7e\x02\x9a\x80\x80\x80\x00\x01\x02\x24\x31\x13\x64\x69\x73\x70\x61\x74\x63\x68\x2d\x73\x74\x72\x75\x63\x74\x75\x72\x61\x6c\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x99\x80\x80\x80\x00\x01\x93\x80\x80\x80\x00\x00\x02\x40\x41\x05\x10\x00\x01\x42\x09\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "dispatch-structural", [5]), int64("9"))
|
||||
|
||||
// call_indirect.wast:204
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7f\x01\x7e\x02\x9a\x80\x80\x80\x00\x01\x02\x24\x31\x13\x64\x69\x73\x70\x61\x74\x63\x68\x2d\x73\x74\x72\x75\x63\x74\x75\x72\x61\x6c\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x99\x80\x80\x80\x00\x01\x93\x80\x80\x80\x00\x00\x02\x40\x41\x05\x10\x00\x01\x42\x09\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "dispatch-structural", [5]), int64("9"))
|
||||
|
||||
// call_indirect.wast:205
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7f\x01\x7e\x02\x9a\x80\x80\x80\x00\x01\x02\x24\x31\x13\x64\x69\x73\x70\x61\x74\x63\x68\x2d\x73\x74\x72\x75\x63\x74\x75\x72\x61\x6c\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9b\x80\x80\x80\x00\x01\x95\x80\x80\x80\x00\x00\x02\x40\x41\x0c\x10\x00\x01\x42\x80\x93\x16\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "dispatch-structural", [12]), int64("362880"))
|
||||
|
||||
// call_indirect.wast:206
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7f\x01\x7e\x02\x9a\x80\x80\x80\x00\x01\x02\x24\x31\x13\x64\x69\x73\x70\x61\x74\x63\x68\x2d\x73\x74\x72\x75\x63\x74\x75\x72\x61\x6c\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x99\x80\x80\x80\x00\x01\x93\x80\x80\x80\x00\x00\x02\x40\x41\x14\x10\x00\x01\x42\x09\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "dispatch-structural", [20]), int64("9"))
|
||||
|
||||
// call_indirect.wast:207
|
||||
assert_trap(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7f\x01\x7e\x02\x9a\x80\x80\x80\x00\x01\x02\x24\x31\x13\x64\x69\x73\x70\x61\x74\x63\x68\x2d\x73\x74\x72\x75\x63\x74\x75\x72\x61\x6c\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x91\x80\x80\x80\x00\x01\x8b\x80\x80\x80\x00\x00\x02\x40\x41\x0b\x10\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_trap(() => call($1, "dispatch-structural", [11]))
|
||||
|
||||
// call_indirect.wast:208
|
||||
assert_trap(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7f\x01\x7e\x02\x9a\x80\x80\x80\x00\x01\x02\x24\x31\x13\x64\x69\x73\x70\x61\x74\x63\x68\x2d\x73\x74\x72\x75\x63\x74\x75\x72\x61\x6c\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x91\x80\x80\x80\x00\x01\x8b\x80\x80\x80\x00\x00\x02\x40\x41\x16\x10\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_trap(() => call($1, "dispatch-structural", [22]))
|
||||
|
||||
// call_indirect.wast:210
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x8a\x80\x80\x80\x00\x01\x02\x24\x31\x03\x66\x61\x63\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x99\x80\x80\x80\x00\x01\x93\x80\x80\x80\x00\x00\x02\x40\x42\x00\x10\x00\x01\x42\x01\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "fac", [int64("0")]), int64("1"))
|
||||
|
||||
// call_indirect.wast:211
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x8a\x80\x80\x80\x00\x01\x02\x24\x31\x03\x66\x61\x63\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x99\x80\x80\x80\x00\x01\x93\x80\x80\x80\x00\x00\x02\x40\x42\x01\x10\x00\x01\x42\x01\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "fac", [int64("1")]), int64("1"))
|
||||
|
||||
// call_indirect.wast:212
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x8a\x80\x80\x80\x00\x01\x02\x24\x31\x03\x66\x61\x63\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9a\x80\x80\x80\x00\x01\x94\x80\x80\x80\x00\x00\x02\x40\x42\x05\x10\x00\x01\x42\xf8\x00\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "fac", [int64("5")]), int64("120"))
|
||||
|
||||
// call_indirect.wast:213
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x8a\x80\x80\x80\x00\x01\x02\x24\x31\x03\x66\x61\x63\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\xa2\x80\x80\x80\x00\x01\x9c\x80\x80\x80\x00\x00\x02\x40\x42\x19\x10\x00\x01\x42\x80\x80\x80\xde\x87\x92\xec\xcf\xe1\x00\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "fac", [int64("25")]), int64("7034535277573963776"))
|
||||
|
||||
// call_indirect.wast:215
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x8a\x80\x80\x80\x00\x01\x02\x24\x31\x03\x66\x69\x62\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x99\x80\x80\x80\x00\x01\x93\x80\x80\x80\x00\x00\x02\x40\x42\x00\x10\x00\x01\x42\x01\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "fib", [int64("0")]), int64("1"))
|
||||
|
||||
// call_indirect.wast:216
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x8a\x80\x80\x80\x00\x01\x02\x24\x31\x03\x66\x69\x62\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x99\x80\x80\x80\x00\x01\x93\x80\x80\x80\x00\x00\x02\x40\x42\x01\x10\x00\x01\x42\x01\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "fib", [int64("1")]), int64("1"))
|
||||
|
||||
// call_indirect.wast:217
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x8a\x80\x80\x80\x00\x01\x02\x24\x31\x03\x66\x69\x62\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x99\x80\x80\x80\x00\x01\x93\x80\x80\x80\x00\x00\x02\x40\x42\x02\x10\x00\x01\x42\x02\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "fib", [int64("2")]), int64("2"))
|
||||
|
||||
// call_indirect.wast:218
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x8a\x80\x80\x80\x00\x01\x02\x24\x31\x03\x66\x69\x62\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x99\x80\x80\x80\x00\x01\x93\x80\x80\x80\x00\x00\x02\x40\x42\x05\x10\x00\x01\x42\x08\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "fib", [int64("5")]), int64("8"))
|
||||
|
||||
// call_indirect.wast:219
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x8a\x80\x80\x80\x00\x01\x02\x24\x31\x03\x66\x69\x62\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9b\x80\x80\x80\x00\x01\x95\x80\x80\x80\x00\x00\x02\x40\x42\x14\x10\x00\x01\x42\xc2\xd5\x00\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "fib", [int64("20")]), int64("10946"))
|
||||
|
||||
// call_indirect.wast:221
|
||||
assert_return(() => call($1, "even", [0]), 44);
|
||||
|
||||
// call_indirect.wast:222
|
||||
assert_return(() => call($1, "even", [1]), 99);
|
||||
|
||||
// call_indirect.wast:223
|
||||
assert_return(() => call($1, "even", [100]), 44);
|
||||
|
||||
// call_indirect.wast:224
|
||||
assert_return(() => call($1, "even", [77]), 99);
|
||||
|
||||
// call_indirect.wast:225
|
||||
assert_return(() => call($1, "odd", [0]), 99);
|
||||
|
||||
// call_indirect.wast:226
|
||||
assert_return(() => call($1, "odd", [1]), 44);
|
||||
|
||||
// call_indirect.wast:227
|
||||
assert_return(() => call($1, "odd", [200]), 99);
|
||||
|
||||
// call_indirect.wast:228
|
||||
assert_return(() => call($1, "odd", [77]), 44);
|
||||
|
||||
// call_indirect.wast:230
|
||||
assert_exhaustion(() => call($1, "runaway", []));
|
||||
|
||||
// call_indirect.wast:231
|
||||
assert_exhaustion(() => call($1, "mutual-runaway", []));
|
||||
|
||||
// call_indirect.wast:236
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8d\x80\x80\x80\x00\x01\x87\x80\x80\x80\x00\x00\x41\x00\x11\x00\x00\x0b");
|
||||
|
||||
// call_indirect.wast:244
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x0a\x8e\x80\x80\x80\x00\x01\x88\x80\x80\x80\x00\x00\x41\x00\x11\x00\x00\x45\x0b");
|
||||
|
||||
// call_indirect.wast:252
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x00\x01\x7e\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x01\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x0a\x8e\x80\x80\x80\x00\x01\x88\x80\x80\x80\x00\x00\x41\x00\x11\x00\x00\x45\x0b");
|
||||
|
||||
// call_indirect.wast:261
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x01\x7f\x00\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x01\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x0a\x8d\x80\x80\x80\x00\x01\x87\x80\x80\x80\x00\x00\x41\x00\x11\x00\x00\x0b");
|
||||
|
||||
// call_indirect.wast:269
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x02\x7c\x7f\x00\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x01\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x0a\x8d\x80\x80\x80\x00\x01\x87\x80\x80\x80\x00\x00\x41\x00\x11\x00\x00\x0b");
|
||||
|
||||
// call_indirect.wast:277
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x0a\x8f\x80\x80\x80\x00\x01\x89\x80\x80\x80\x00\x00\x41\x01\x41\x00\x11\x00\x00\x0b");
|
||||
|
||||
// call_indirect.wast:285
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x0a\x98\x80\x80\x80\x00\x01\x92\x80\x80\x80\x00\x00\x44\x00\x00\x00\x00\x00\x00\x00\x40\x41\x01\x41\x00\x11\x00\x00\x0b");
|
||||
|
||||
// call_indirect.wast:296
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x01\x7f\x00\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x01\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x0a\x8e\x80\x80\x80\x00\x01\x88\x80\x80\x80\x00\x00\x41\x01\x01\x11\x00\x00\x0b");
|
||||
|
||||
// call_indirect.wast:304
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x88\x80\x80\x80\x00\x02\x60\x01\x7f\x00\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x01\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x0a\x8f\x80\x80\x80\x00\x01\x89\x80\x80\x80\x00\x00\x41\x00\x42\x01\x11\x00\x00\x0b");
|
||||
|
||||
// call_indirect.wast:313
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x02\x7f\x7f\x00\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x01\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x0a\x90\x80\x80\x80\x00\x01\x8a\x80\x80\x80\x00\x00\x01\x41\x01\x41\x00\x11\x00\x00\x0b");
|
||||
|
||||
// call_indirect.wast:323
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x02\x7f\x7f\x00\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x01\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x0a\x90\x80\x80\x80\x00\x01\x8a\x80\x80\x80\x00\x00\x41\x01\x01\x41\x00\x11\x00\x00\x0b");
|
||||
|
||||
// call_indirect.wast:333
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x02\x7f\x7c\x00\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x01\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x0a\x98\x80\x80\x80\x00\x01\x92\x80\x80\x80\x00\x00\x44\x00\x00\x00\x00\x00\x00\xf0\x3f\x41\x01\x41\x00\x11\x00\x00\x0b");
|
||||
|
||||
// call_indirect.wast:343
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x02\x7c\x7f\x00\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x01\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x0a\x98\x80\x80\x80\x00\x01\x92\x80\x80\x80\x00\x00\x41\x01\x44\x00\x00\x00\x00\x00\x00\xf0\x3f\x41\x00\x11\x00\x00\x0b");
|
||||
|
||||
// call_indirect.wast:357
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x0a\x8d\x80\x80\x80\x00\x01\x87\x80\x80\x80\x00\x00\x41\x00\x11\x01\x00\x0b");
|
||||
|
||||
// call_indirect.wast:364
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x0a\x91\x80\x80\x80\x00\x01\x8b\x80\x80\x80\x00\x00\x41\x00\x11\x94\x98\xdb\xe2\x03\x00\x0b");
|
||||
|
||||
// call_indirect.wast:375
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x04\x85\x80\x80\x80\x00\x01\x70\x01\x02\x02\x09\x88\x80\x80\x80\x00\x01\x00\x41\x00\x0b\x02\x00\x00");
|
||||
|
||||
// call_indirect.wast:383
|
||||
assert_unlinkable("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x04\x84\x80\x80\x80\x00\x01\x70\x00\x0a\x09\x87\x80\x80\x80\x00\x01\x00\x41\x0a\x0b\x01\x00\x0a\x88\x80\x80\x80\x00\x01\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// call_indirect.wast:392
|
||||
assert_unlinkable("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x04\x84\x80\x80\x80\x00\x01\x70\x00\x0a\x09\x87\x80\x80\x80\x00\x01\x00\x41\x7f\x0b\x01\x00\x0a\x88\x80\x80\x80\x00\x01\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// call_indirect.wast:401
|
||||
assert_unlinkable("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x04\x84\x80\x80\x80\x00\x01\x70\x00\x0a\x09\x87\x80\x80\x80\x00\x01\x00\x41\x76\x0b\x01\x00\x0a\x88\x80\x80\x80\x00\x01\x82\x80\x80\x80\x00\x00\x0b");
|
|
@ -1,12 +0,0 @@
|
|||
|
||||
// comments.wast:9
|
||||
let $1 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00");
|
||||
|
||||
// comments.wast:51
|
||||
let $2 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00");
|
||||
|
||||
// comments.wast:62
|
||||
let $3 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00");
|
||||
|
||||
// comments.wast:71
|
||||
let $4 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00");
|
|
@ -1,156 +0,0 @@
|
|||
|
||||
// const.wast:5
|
||||
let $1 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8b\x80\x80\x80\x00\x01\x85\x80\x80\x80\x00\x00\x41\x7f\x1a\x0b");
|
||||
|
||||
// const.wast:6
|
||||
let $2 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8f\x80\x80\x80\x00\x01\x89\x80\x80\x80\x00\x00\x41\x80\x80\x80\x80\x78\x1a\x0b");
|
||||
|
||||
// const.wast:7
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// const.wast:11
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// const.wast:16
|
||||
let $3 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8b\x80\x80\x80\x00\x01\x85\x80\x80\x80\x00\x00\x41\x7f\x1a\x0b");
|
||||
|
||||
// const.wast:17
|
||||
let $4 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8f\x80\x80\x80\x00\x01\x89\x80\x80\x80\x00\x00\x41\x80\x80\x80\x80\x78\x1a\x0b");
|
||||
|
||||
// const.wast:18
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// const.wast:22
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// const.wast:27
|
||||
let $5 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8b\x80\x80\x80\x00\x01\x85\x80\x80\x80\x00\x00\x42\x7f\x1a\x0b");
|
||||
|
||||
// const.wast:28
|
||||
let $6 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x94\x80\x80\x80\x00\x01\x8e\x80\x80\x80\x00\x00\x42\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7f\x1a\x0b");
|
||||
|
||||
// const.wast:29
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// const.wast:33
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// const.wast:38
|
||||
let $7 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8b\x80\x80\x80\x00\x01\x85\x80\x80\x80\x00\x00\x42\x7f\x1a\x0b");
|
||||
|
||||
// const.wast:39
|
||||
let $8 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x94\x80\x80\x80\x00\x01\x8e\x80\x80\x80\x00\x00\x42\x80\x80\x80\x80\x80\x80\x80\x80\x80\x7f\x1a\x0b");
|
||||
|
||||
// const.wast:40
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// const.wast:44
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// const.wast:49
|
||||
let $9 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8e\x80\x80\x80\x00\x01\x88\x80\x80\x80\x00\x00\x43\x00\x00\x00\x7f\x1a\x0b");
|
||||
|
||||
// const.wast:50
|
||||
let $10 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8e\x80\x80\x80\x00\x01\x88\x80\x80\x80\x00\x00\x43\x00\x00\x00\xff\x1a\x0b");
|
||||
|
||||
// const.wast:51
|
||||
let $11 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8e\x80\x80\x80\x00\x01\x88\x80\x80\x80\x00\x00\x43\xff\xff\x7f\x7f\x1a\x0b");
|
||||
|
||||
// const.wast:52
|
||||
let $12 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8e\x80\x80\x80\x00\x01\x88\x80\x80\x80\x00\x00\x43\xff\xff\x7f\xff\x1a\x0b");
|
||||
|
||||
// const.wast:53
|
||||
let $13 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8e\x80\x80\x80\x00\x01\x88\x80\x80\x80\x00\x00\x43\xff\xff\x7f\x7f\x1a\x0b");
|
||||
|
||||
// const.wast:54
|
||||
let $14 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8e\x80\x80\x80\x00\x01\x88\x80\x80\x80\x00\x00\x43\xff\xff\x7f\xff\x1a\x0b");
|
||||
|
||||
// const.wast:55
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// const.wast:59
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// const.wast:63
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// const.wast:67
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// const.wast:72
|
||||
let $15 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8e\x80\x80\x80\x00\x01\x88\x80\x80\x80\x00\x00\x43\x99\x76\x96\x7e\x1a\x0b");
|
||||
|
||||
// const.wast:73
|
||||
let $16 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8e\x80\x80\x80\x00\x01\x88\x80\x80\x80\x00\x00\x43\x99\x76\x96\xfe\x1a\x0b");
|
||||
|
||||
// const.wast:74
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// const.wast:78
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// const.wast:83
|
||||
let $17 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8e\x80\x80\x80\x00\x01\x88\x80\x80\x80\x00\x00\x43\xff\xff\x7f\x7f\x1a\x0b");
|
||||
|
||||
// const.wast:84
|
||||
let $18 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x8e\x80\x80\x80\x00\x01\x88\x80\x80\x80\x00\x00\x43\xff\xff\x7f\xff\x1a\x0b");
|
||||
|
||||
// const.wast:85
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// const.wast:89
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// const.wast:94
|
||||
let $19 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x92\x80\x80\x80\x00\x01\x8c\x80\x80\x80\x00\x00\x44\x00\x00\x00\x00\x00\x00\xe0\x7f\x1a\x0b");
|
||||
|
||||
// const.wast:95
|
||||
let $20 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x92\x80\x80\x80\x00\x01\x8c\x80\x80\x80\x00\x00\x44\x00\x00\x00\x00\x00\x00\xe0\xff\x1a\x0b");
|
||||
|
||||
// const.wast:96
|
||||
let $21 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x92\x80\x80\x80\x00\x01\x8c\x80\x80\x80\x00\x00\x44\xff\xff\xff\xff\xff\xff\xef\x7f\x1a\x0b");
|
||||
|
||||
// const.wast:97
|
||||
let $22 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x92\x80\x80\x80\x00\x01\x8c\x80\x80\x80\x00\x00\x44\xff\xff\xff\xff\xff\xff\xef\xff\x1a\x0b");
|
||||
|
||||
// const.wast:98
|
||||
let $23 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x92\x80\x80\x80\x00\x01\x8c\x80\x80\x80\x00\x00\x44\xff\xff\xff\xff\xff\xff\xef\x7f\x1a\x0b");
|
||||
|
||||
// const.wast:99
|
||||
let $24 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x92\x80\x80\x80\x00\x01\x8c\x80\x80\x80\x00\x00\x44\xff\xff\xff\xff\xff\xff\xef\xff\x1a\x0b");
|
||||
|
||||
// const.wast:100
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// const.wast:104
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// const.wast:108
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// const.wast:112
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// const.wast:117
|
||||
let $25 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x92\x80\x80\x80\x00\x01\x8c\x80\x80\x80\x00\x00\x44\xa0\xc8\xeb\x85\xf3\xcc\xe1\x7f\x1a\x0b");
|
||||
|
||||
// const.wast:118
|
||||
let $26 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x92\x80\x80\x80\x00\x01\x8c\x80\x80\x80\x00\x00\x44\xa0\xc8\xeb\x85\xf3\xcc\xe1\xff\x1a\x0b");
|
||||
|
||||
// const.wast:119
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// const.wast:123
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// const.wast:128
|
||||
let $27 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x92\x80\x80\x80\x00\x01\x8c\x80\x80\x80\x00\x00\x44\xff\xff\xff\xff\xff\xff\xef\x7f\x1a\x0b");
|
||||
|
||||
// const.wast:129
|
||||
let $28 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x0a\x92\x80\x80\x80\x00\x01\x8c\x80\x80\x80\x00\x00\x44\xff\xff\xff\xff\xff\xff\xef\xff\x1a\x0b");
|
||||
|
||||
// const.wast:130
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
||||
|
||||
// const.wast:134
|
||||
assert_malformed("\x3c\x6d\x61\x6c\x66\x6f\x72\x6d\x65\x64\x20\x71\x75\x6f\x74\x65\x3e");
|
File diff suppressed because it is too large
Load Diff
|
@ -1,27 +0,0 @@
|
|||
|
||||
// custom_section.wast:1
|
||||
let $1 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x00\x24\x10\x61\x20\x63\x75\x73\x74\x6f\x6d\x20\x73\x65\x63\x74\x69\x6f\x6e\x74\x68\x69\x73\x20\x69\x73\x20\x74\x68\x65\x20\x70\x61\x79\x6c\x6f\x61\x64\x00\x20\x10\x61\x20\x63\x75\x73\x74\x6f\x6d\x20\x73\x65\x63\x74\x69\x6f\x6e\x74\x68\x69\x73\x20\x69\x73\x20\x70\x61\x79\x6c\x6f\x61\x64\x00\x11\x10\x61\x20\x63\x75\x73\x74\x6f\x6d\x20\x73\x65\x63\x74\x69\x6f\x6e\x00\x10\x00\x74\x68\x69\x73\x20\x69\x73\x20\x70\x61\x79\x6c\x6f\x61\x64\x00\x01\x00\x00\x24\x10\x00\x00\x63\x75\x73\x74\x6f\x6d\x20\x73\x65\x63\x74\x69\x6f\x00\x74\x68\x69\x73\x20\x69\x73\x20\x74\x68\x65\x20\x70\x61\x79\x6c\x6f\x61\x64\x00\x24\x10\xef\xbb\xbf\x61\x20\x63\x75\x73\x74\x6f\x6d\x20\x73\x65\x63\x74\x74\x68\x69\x73\x20\x69\x73\x20\x74\x68\x65\x20\x70\x61\x79\x6c\x6f\x61\x64\x00\x24\x10\x61\x20\x63\x75\x73\x74\x6f\x6d\x20\x73\x65\x63\x74\xe2\x8c\xa3\x74\x68\x69\x73\x20\x69\x73\x20\x74\x68\x65\x20\x70\x61\x79\x6c\x6f\x61\x64\x00\x1f\x16\x6d\x6f\x64\x75\x6c\x65\x20\x77\x69\x74\x68\x69\x6e\x20\x61\x20\x6d\x6f\x64\x75\x6c\x65\x00\x61\x73\x6d\x01\x00\x00\x00");
|
||||
|
||||
// custom_section.wast:14
|
||||
let $2 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x01\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x02\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x03\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x04\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x05\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x06\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x07\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x09\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x0a\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x0b\x01\x00\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64\x00\x0e\x06\x63\x75\x73\x74\x6f\x6d\x70\x61\x79\x6c\x6f\x61\x64");
|
||||
|
||||
// custom_section.wast:50
|
||||
let $3 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x07\x01\x60\x02\x7f\x7f\x01\x7f\x00\x1a\x06\x63\x75\x73\x74\x6f\x6d\x74\x68\x69\x73\x20\x69\x73\x20\x74\x68\x65\x20\x70\x61\x79\x6c\x6f\x61\x64\x03\x02\x01\x00\x07\x0a\x01\x06\x61\x64\x64\x54\x77\x6f\x00\x00\x0a\x09\x01\x07\x00\x20\x00\x20\x01\x6a\x0b\x00\x1b\x07\x63\x75\x73\x74\x6f\x6d\x32\x74\x68\x69\x73\x20\x69\x73\x20\x74\x68\x65\x20\x70\x61\x79\x6c\x6f\x61\x64");
|
||||
|
||||
// custom_section.wast:60
|
||||
assert_malformed("\x00\x61\x73\x6d\x01\x00\x00\x00\x00");
|
||||
|
||||
// custom_section.wast:68
|
||||
assert_malformed("\x00\x61\x73\x6d\x01\x00\x00\x00\x00\x00");
|
||||
|
||||
// custom_section.wast:76
|
||||
assert_malformed("\x00\x61\x73\x6d\x01\x00\x00\x00\x00\x26\x10\x61\x20\x63\x75\x73\x74\x6f\x6d\x20\x73\x65\x63\x74\x69\x6f\x6e\x74\x68\x69\x73\x20\x69\x73\x20\x74\x68\x65\x20\x70\x61\x79\x6c\x6f\x61\x64");
|
||||
|
||||
// custom_section.wast:84
|
||||
assert_malformed("\x00\x61\x73\x6d\x01\x00\x00\x00\x00\x25\x10\x61\x20\x63\x75\x73\x74\x6f\x6d\x20\x73\x65\x63\x74\x69\x6f\x6e\x74\x68\x69\x73\x20\x69\x73\x20\x74\x68\x65\x20\x70\x61\x79\x6c\x6f\x61\x64\x00\x24\x10\x61\x20\x63\x75\x73\x74\x6f\x6d\x20\x73\x65\x63\x74\x69\x6f\x6e\x74\x68\x69\x73\x20\x69\x73\x20\x74\x68\x65\x20\x70\x61\x79\x6c\x6f\x61\x64");
|
||||
|
||||
// custom_section.wast:93
|
||||
assert_malformed("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x07\x01\x60\x02\x7f\x7f\x01\x7f\x00\x25\x10\x61\x20\x63\x75\x73\x74\x6f\x6d\x20\x73\x65\x63\x74\x69\x6f\x6e\x74\x68\x69\x73\x20\x69\x73\x20\x74\x68\x65\x20\x70\x61\x79\x6c\x6f\x61\x64\x03\x02\x01\x00\x0a\x09\x01\x07\x00\x20\x00\x20\x01\x6a\x0b\x00\x1b\x07\x63\x75\x73\x74\x6f\x6d\x32\x74\x68\x69\x73\x20\x69\x73\x20\x74\x68\x65\x20\x70\x61\x79\x6c\x6f\x61\x64");
|
||||
|
||||
// custom_section.wast:106
|
||||
assert_malformed("\x00\x61\x73\x6d\x01\x00\x00\x00\x00\x61\x73\x6d\x01\x00\x00\x00");
|
|
@ -1,207 +0,0 @@
|
|||
|
||||
// endianness.wast:1
|
||||
let $1 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\xa4\x80\x80\x80\x00\x07\x60\x02\x7f\x7f\x00\x60\x02\x7f\x7e\x00\x60\x01\x7f\x01\x7f\x60\x01\x7f\x01\x7e\x60\x01\x7e\x01\x7e\x60\x01\x7d\x01\x7d\x60\x01\x7c\x01\x7c\x03\x98\x80\x80\x80\x00\x17\x00\x00\x01\x02\x02\x03\x02\x02\x02\x04\x04\x04\x04\x04\x05\x06\x02\x02\x04\x04\x04\x05\x06\x05\x83\x80\x80\x80\x00\x01\x00\x01\x07\xe1\x81\x80\x80\x00\x11\x0c\x69\x33\x32\x5f\x6c\x6f\x61\x64\x31\x36\x5f\x73\x00\x06\x0c\x69\x33\x32\x5f\x6c\x6f\x61\x64\x31\x36\x5f\x75\x00\x07\x08\x69\x33\x32\x5f\x6c\x6f\x61\x64\x00\x08\x0c\x69\x36\x34\x5f\x6c\x6f\x61\x64\x31\x36\x5f\x73\x00\x09\x0c\x69\x36\x34\x5f\x6c\x6f\x61\x64\x31\x36\x5f\x75\x00\x0a\x0c\x69\x36\x34\x5f\x6c\x6f\x61\x64\x33\x32\x5f\x73\x00\x0b\x0c\x69\x36\x34\x5f\x6c\x6f\x61\x64\x33\x32\x5f\x75\x00\x0c\x08\x69\x36\x34\x5f\x6c\x6f\x61\x64\x00\x0d\x08\x66\x33\x32\x5f\x6c\x6f\x61\x64\x00\x0e\x08\x66\x36\x34\x5f\x6c\x6f\x61\x64\x00\x0f\x0b\x69\x33\x32\x5f\x73\x74\x6f\x72\x65\x31\x36\x00\x10\x09\x69\x33\x32\x5f\x73\x74\x6f\x72\x65\x00\x11\x0b\x69\x36\x34\x5f\x73\x74\x6f\x72\x65\x31\x36\x00\x12\x0b\x69\x36\x34\x5f\x73\x74\x6f\x72\x65\x33\x32\x00\x13\x09\x69\x36\x34\x5f\x73\x74\x6f\x72\x65\x00\x14\x09\x66\x33\x32\x5f\x73\x74\x6f\x72\x65\x00\x15\x09\x66\x36\x34\x5f\x73\x74\x6f\x72\x65\x00\x16\x0a\xd2\x83\x80\x80\x00\x17\x96\x80\x80\x80\x00\x00\x20\x00\x20\x01\x3a\x00\x00\x20\x00\x41\x01\x6a\x20\x01\x41\x08\x76\x3a\x00\x00\x0b\x94\x80\x80\x80\x00\x00\x20\x00\x20\x01\x10\x00\x20\x00\x41\x02\x6a\x20\x01\x41\x10\x76\x10\x00\x0b\x96\x80\x80\x80\x00\x00\x20\x00\x20\x01\xa7\x10\x01\x20\x00\x41\x04\x6a\x20\x01\x42\x20\x88\xa7\x10\x01\x0b\x93\x80\x80\x80\x00\x00\x20\x00\x2d\x00\x00\x20\x00\x41\x01\x6a\x2d\x00\x00\x41\x08\x74\x72\x0b\x91\x80\x80\x80\x00\x00\x20\x00\x10\x03\x20\x00\x41\x02\x6a\x10\x03\x41\x10\x74\x72\x0b\x93\x80\x80\x80\x00\x00\x20\x00\x10\x04\xad\x20\x00\x41\x04\x6a\x10\x04\xad\x42\x20\x86\x84\x0b\x8d\x80\x80\x80\x00\x00\x41\x00\x20\x00\x10\x00\x41\x00\x2e\x01\x00\x0b\x8d\x80\x80\x80\x00\x00\x41\x00\x20\x00\x10\x00\x41\x00\x2f\x01\x00\x0b\x8d\x80\x80\x80\x00\x00\x41\x00\x20\x00\x10\x01\x41\x00\x28\x02\x00\x0b\x8e\x80\x80\x80\x00\x00\x41\x00\x20\x00\xa7\x10\x00\x41\x00\x32\x01\x00\x0b\x8e\x80\x80\x80\x00\x00\x41\x00\x20\x00\xa7\x10\x00\x41\x00\x33\x01\x00\x0b\x8e\x80\x80\x80\x00\x00\x41\x00\x20\x00\xa7\x10\x01\x41\x00\x34\x02\x00\x0b\x8e\x80\x80\x80\x00\x00\x41\x00\x20\x00\xa7\x10\x01\x41\x00\x35\x02\x00\x0b\x8d\x80\x80\x80\x00\x00\x41\x00\x20\x00\x10\x02\x41\x00\x29\x03\x00\x0b\x8e\x80\x80\x80\x00\x00\x41\x00\x20\x00\xbc\x10\x01\x41\x00\x2a\x02\x00\x0b\x8e\x80\x80\x80\x00\x00\x41\x00\x20\x00\xbd\x10\x02\x41\x00\x2b\x03\x00\x0b\x8d\x80\x80\x80\x00\x00\x41\x00\x20\x00\x3b\x01\x00\x41\x00\x10\x03\x0b\x8d\x80\x80\x80\x00\x00\x41\x00\x20\x00\x36\x02\x00\x41\x00\x10\x04\x0b\x8e\x80\x80\x80\x00\x00\x41\x00\x20\x00\x3d\x01\x00\x41\x00\x10\x03\xad\x0b\x8e\x80\x80\x80\x00\x00\x41\x00\x20\x00\x3e\x02\x00\x41\x00\x10\x04\xad\x0b\x8d\x80\x80\x80\x00\x00\x41\x00\x20\x00\x37\x03\x00\x41\x00\x10\x05\x0b\x8e\x80\x80\x80\x00\x00\x41\x00\x20\x00\x38\x02\x00\x41\x00\x10\x04\xbe\x0b\x8e\x80\x80\x80\x00\x00\x41\x00\x20\x00\x39\x03\x00\x41\x00\x10\x05\xbf\x0b");
|
||||
|
||||
// endianness.wast:133
|
||||
assert_return(() => call($1, "i32_load16_s", [-1]), -1);
|
||||
|
||||
// endianness.wast:134
|
||||
assert_return(() => call($1, "i32_load16_s", [-4242]), -4242);
|
||||
|
||||
// endianness.wast:135
|
||||
assert_return(() => call($1, "i32_load16_s", [42]), 42);
|
||||
|
||||
// endianness.wast:136
|
||||
assert_return(() => call($1, "i32_load16_s", [12816]), 12816);
|
||||
|
||||
// endianness.wast:138
|
||||
assert_return(() => call($1, "i32_load16_u", [-1]), 65535);
|
||||
|
||||
// endianness.wast:139
|
||||
assert_return(() => call($1, "i32_load16_u", [-4242]), 61294);
|
||||
|
||||
// endianness.wast:140
|
||||
assert_return(() => call($1, "i32_load16_u", [42]), 42);
|
||||
|
||||
// endianness.wast:141
|
||||
assert_return(() => call($1, "i32_load16_u", [51966]), 51966);
|
||||
|
||||
// endianness.wast:143
|
||||
assert_return(() => call($1, "i32_load", [-1]), -1);
|
||||
|
||||
// endianness.wast:144
|
||||
assert_return(() => call($1, "i32_load", [-42424242]), -42424242);
|
||||
|
||||
// endianness.wast:145
|
||||
assert_return(() => call($1, "i32_load", [42424242]), 42424242);
|
||||
|
||||
// endianness.wast:146
|
||||
assert_return(() => call($1, "i32_load", [-1414717974]), -1414717974);
|
||||
|
||||
// endianness.wast:148
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x93\x80\x80\x80\x00\x01\x02\x24\x31\x0c\x69\x36\x34\x5f\x6c\x6f\x61\x64\x31\x36\x5f\x73\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x99\x80\x80\x80\x00\x01\x93\x80\x80\x80\x00\x00\x02\x40\x42\x7f\x10\x00\x01\x42\x7f\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_load16_s", [int64("-1")]), int64("-1"))
|
||||
|
||||
// endianness.wast:149
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x93\x80\x80\x80\x00\x01\x02\x24\x31\x0c\x69\x36\x34\x5f\x6c\x6f\x61\x64\x31\x36\x5f\x73\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9b\x80\x80\x80\x00\x01\x95\x80\x80\x80\x00\x00\x02\x40\x42\xee\x5e\x10\x00\x01\x42\xee\x5e\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_load16_s", [int64("-4242")]), int64("-4242"))
|
||||
|
||||
// endianness.wast:150
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x93\x80\x80\x80\x00\x01\x02\x24\x31\x0c\x69\x36\x34\x5f\x6c\x6f\x61\x64\x31\x36\x5f\x73\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x99\x80\x80\x80\x00\x01\x93\x80\x80\x80\x00\x00\x02\x40\x42\x2a\x10\x00\x01\x42\x2a\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_load16_s", [int64("42")]), int64("42"))
|
||||
|
||||
// endianness.wast:151
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x93\x80\x80\x80\x00\x01\x02\x24\x31\x0c\x69\x36\x34\x5f\x6c\x6f\x61\x64\x31\x36\x5f\x73\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9d\x80\x80\x80\x00\x01\x97\x80\x80\x80\x00\x00\x02\x40\x42\x90\xe4\x00\x10\x00\x01\x42\x90\xe4\x00\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_load16_s", [int64("12816")]), int64("12816"))
|
||||
|
||||
// endianness.wast:153
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x93\x80\x80\x80\x00\x01\x02\x24\x31\x0c\x69\x36\x34\x5f\x6c\x6f\x61\x64\x31\x36\x5f\x75\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9b\x80\x80\x80\x00\x01\x95\x80\x80\x80\x00\x00\x02\x40\x42\x7f\x10\x00\x01\x42\xff\xff\x03\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_load16_u", [int64("-1")]), int64("65535"))
|
||||
|
||||
// endianness.wast:154
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x93\x80\x80\x80\x00\x01\x02\x24\x31\x0c\x69\x36\x34\x5f\x6c\x6f\x61\x64\x31\x36\x5f\x75\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9c\x80\x80\x80\x00\x01\x96\x80\x80\x80\x00\x00\x02\x40\x42\xee\x5e\x10\x00\x01\x42\xee\xde\x03\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_load16_u", [int64("-4242")]), int64("61294"))
|
||||
|
||||
// endianness.wast:155
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x93\x80\x80\x80\x00\x01\x02\x24\x31\x0c\x69\x36\x34\x5f\x6c\x6f\x61\x64\x31\x36\x5f\x75\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x99\x80\x80\x80\x00\x01\x93\x80\x80\x80\x00\x00\x02\x40\x42\x2a\x10\x00\x01\x42\x2a\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_load16_u", [int64("42")]), int64("42"))
|
||||
|
||||
// endianness.wast:156
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x93\x80\x80\x80\x00\x01\x02\x24\x31\x0c\x69\x36\x34\x5f\x6c\x6f\x61\x64\x31\x36\x5f\x75\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9d\x80\x80\x80\x00\x01\x97\x80\x80\x80\x00\x00\x02\x40\x42\xfe\x95\x03\x10\x00\x01\x42\xfe\x95\x03\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_load16_u", [int64("51966")]), int64("51966"))
|
||||
|
||||
// endianness.wast:158
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x93\x80\x80\x80\x00\x01\x02\x24\x31\x0c\x69\x36\x34\x5f\x6c\x6f\x61\x64\x33\x32\x5f\x73\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x99\x80\x80\x80\x00\x01\x93\x80\x80\x80\x00\x00\x02\x40\x42\x7f\x10\x00\x01\x42\x7f\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_load32_s", [int64("-1")]), int64("-1"))
|
||||
|
||||
// endianness.wast:159
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x93\x80\x80\x80\x00\x01\x02\x24\x31\x0c\x69\x36\x34\x5f\x6c\x6f\x61\x64\x33\x32\x5f\x73\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9f\x80\x80\x80\x00\x01\x99\x80\x80\x80\x00\x00\x02\x40\x42\xce\xd0\xe2\x6b\x10\x00\x01\x42\xce\xd0\xe2\x6b\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_load32_s", [int64("-42424242")]), int64("-42424242"))
|
||||
|
||||
// endianness.wast:160
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x93\x80\x80\x80\x00\x01\x02\x24\x31\x0c\x69\x36\x34\x5f\x6c\x6f\x61\x64\x33\x32\x5f\x73\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9f\x80\x80\x80\x00\x01\x99\x80\x80\x80\x00\x00\x02\x40\x42\xb2\xaf\x9d\x14\x10\x00\x01\x42\xb2\xaf\x9d\x14\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_load32_s", [int64("42424242")]), int64("42424242"))
|
||||
|
||||
// endianness.wast:161
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x93\x80\x80\x80\x00\x01\x02\x24\x31\x0c\x69\x36\x34\x5f\x6c\x6f\x61\x64\x33\x32\x5f\x73\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\xa1\x80\x80\x80\x00\x01\x9b\x80\x80\x80\x00\x00\x02\x40\x42\xf8\xac\xd1\x91\x01\x10\x00\x01\x42\xf8\xac\xd1\x91\x01\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_load32_s", [int64("305419896")]), int64("305419896"))
|
||||
|
||||
// endianness.wast:163
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x93\x80\x80\x80\x00\x01\x02\x24\x31\x0c\x69\x36\x34\x5f\x6c\x6f\x61\x64\x33\x32\x5f\x75\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9d\x80\x80\x80\x00\x01\x97\x80\x80\x80\x00\x00\x02\x40\x42\x7f\x10\x00\x01\x42\xff\xff\xff\xff\x0f\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_load32_u", [int64("-1")]), int64("4294967295"))
|
||||
|
||||
// endianness.wast:164
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x93\x80\x80\x80\x00\x01\x02\x24\x31\x0c\x69\x36\x34\x5f\x6c\x6f\x61\x64\x33\x32\x5f\x75\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\xa0\x80\x80\x80\x00\x01\x9a\x80\x80\x80\x00\x00\x02\x40\x42\xce\xd0\xe2\x6b\x10\x00\x01\x42\xce\xd0\xe2\xeb\x0f\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_load32_u", [int64("-42424242")]), int64("4252543054"))
|
||||
|
||||
// endianness.wast:165
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x93\x80\x80\x80\x00\x01\x02\x24\x31\x0c\x69\x36\x34\x5f\x6c\x6f\x61\x64\x33\x32\x5f\x75\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9f\x80\x80\x80\x00\x01\x99\x80\x80\x80\x00\x00\x02\x40\x42\xb2\xaf\x9d\x14\x10\x00\x01\x42\xb2\xaf\x9d\x14\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_load32_u", [int64("42424242")]), int64("42424242"))
|
||||
|
||||
// endianness.wast:166
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x93\x80\x80\x80\x00\x01\x02\x24\x31\x0c\x69\x36\x34\x5f\x6c\x6f\x61\x64\x33\x32\x5f\x75\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\xa1\x80\x80\x80\x00\x01\x9b\x80\x80\x80\x00\x00\x02\x40\x42\xea\xbb\xb4\xdd\x0a\x10\x00\x01\x42\xea\xbb\xb4\xdd\x0a\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_load32_u", [int64("2880249322")]), int64("2880249322"))
|
||||
|
||||
// endianness.wast:168
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x69\x36\x34\x5f\x6c\x6f\x61\x64\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x99\x80\x80\x80\x00\x01\x93\x80\x80\x80\x00\x00\x02\x40\x42\x7f\x10\x00\x01\x42\x7f\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_load", [int64("-1")]), int64("-1"))
|
||||
|
||||
// endianness.wast:169
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x69\x36\x34\x5f\x6c\x6f\x61\x64\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9f\x80\x80\x80\x00\x01\x99\x80\x80\x80\x00\x00\x02\x40\x42\xce\xd0\xe2\x6b\x10\x00\x01\x42\xce\xd0\xe2\x6b\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_load", [int64("-42424242")]), int64("-42424242"))
|
||||
|
||||
// endianness.wast:170
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x69\x36\x34\x5f\x6c\x6f\x61\x64\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\xa1\x80\x80\x80\x00\x01\x9b\x80\x80\x80\x00\x00\x02\x40\x42\xea\xbb\xb4\xdd\x0a\x10\x00\x01\x42\xea\xbb\xb4\xdd\x0a\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_load", [int64("2880249322")]), int64("2880249322"))
|
||||
|
||||
// endianness.wast:171
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x69\x36\x34\x5f\x6c\x6f\x61\x64\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\xab\x80\x80\x80\x00\x01\xa5\x80\x80\x80\x00\x00\x02\x40\x42\xea\xbb\xb4\xf5\xed\xdf\xf2\xd6\xab\x7f\x10\x00\x01\x42\xea\xbb\xb4\xf5\xed\xdf\xf2\xd6\xab\x7f\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_load", [int64("-6075977126246539798")]), int64("-6075977126246539798"))
|
||||
|
||||
// endianness.wast:173
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7d\x01\x7d\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x66\x33\x32\x5f\x6c\x6f\x61\x64\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9f\x80\x80\x80\x00\x01\x99\x80\x80\x80\x00\x00\x02\x40\x43\x00\x00\x80\xbf\x10\x00\xbc\x43\x00\x00\x80\xbf\xbc\x46\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "f32_load", [-1.]), -1.)
|
||||
|
||||
// endianness.wast:174
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7d\x01\x7d\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x66\x33\x32\x5f\x6c\x6f\x61\x64\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9f\x80\x80\x80\x00\x01\x99\x80\x80\x80\x00\x00\x02\x40\x43\xb6\x2d\x4a\x3c\x10\x00\xbc\x43\xb6\x2d\x4a\x3c\xbc\x46\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "f32_load", [0.0123399998993]), 0.0123399998993)
|
||||
|
||||
// endianness.wast:175
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7d\x01\x7d\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x66\x33\x32\x5f\x6c\x6f\x61\x64\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9f\x80\x80\x80\x00\x01\x99\x80\x80\x80\x00\x00\x02\x40\x43\x65\x93\x84\x45\x10\x00\xbc\x43\x65\x93\x84\x45\xbc\x46\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "f32_load", [4242.42431641]), 4242.42431641)
|
||||
|
||||
// endianness.wast:176
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7d\x01\x7d\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x66\x33\x32\x5f\x6c\x6f\x61\x64\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9f\x80\x80\x80\x00\x01\x99\x80\x80\x80\x00\x00\x02\x40\x43\xff\xff\x7f\x7f\x10\x00\xbc\x43\xff\xff\x7f\x7f\xbc\x46\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "f32_load", [3.40282346639e+38]), 3.40282346639e+38)
|
||||
|
||||
// endianness.wast:178
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7c\x01\x7c\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x66\x36\x34\x5f\x6c\x6f\x61\x64\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\xa7\x80\x80\x80\x00\x01\xa1\x80\x80\x80\x00\x00\x02\x40\x44\x00\x00\x00\x00\x00\x00\xf0\xbf\x10\x00\xbd\x44\x00\x00\x00\x00\x00\x00\xf0\xbf\xbd\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "f64_load", [-1.]), -1.)
|
||||
|
||||
// endianness.wast:179
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7c\x01\x7c\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x66\x36\x34\x5f\x6c\x6f\x61\x64\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\xa7\x80\x80\x80\x00\x01\xa1\x80\x80\x80\x00\x00\x02\x40\x44\xe7\xc6\xf4\x84\x45\x4a\x93\x40\x10\x00\xbd\x44\xe7\xc6\xf4\x84\x45\x4a\x93\x40\xbd\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "f64_load", [1234.56789]), 1234.56789)
|
||||
|
||||
// endianness.wast:180
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7c\x01\x7c\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x66\x36\x34\x5f\x6c\x6f\x61\x64\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\xa7\x80\x80\x80\x00\x01\xa1\x80\x80\x80\x00\x00\x02\x40\x44\xae\x7e\x6c\xb2\xc9\xe4\x19\x41\x10\x00\xbd\x44\xae\x7e\x6c\xb2\xc9\xe4\x19\x41\xbd\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "f64_load", [424242.424242]), 424242.424242)
|
||||
|
||||
// endianness.wast:181
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7c\x01\x7c\x02\x8f\x80\x80\x80\x00\x01\x02\x24\x31\x08\x66\x36\x34\x5f\x6c\x6f\x61\x64\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\xa7\x80\x80\x80\x00\x01\xa1\x80\x80\x80\x00\x00\x02\x40\x44\xff\xff\xff\xff\xff\xff\xef\x7f\x10\x00\xbd\x44\xff\xff\xff\xff\xff\xff\xef\x7f\xbd\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "f64_load", [1.79769313486e+308]), 1.79769313486e+308)
|
||||
|
||||
// endianness.wast:184
|
||||
assert_return(() => call($1, "i32_store16", [-1]), 65535);
|
||||
|
||||
// endianness.wast:185
|
||||
assert_return(() => call($1, "i32_store16", [-4242]), 61294);
|
||||
|
||||
// endianness.wast:186
|
||||
assert_return(() => call($1, "i32_store16", [42]), 42);
|
||||
|
||||
// endianness.wast:187
|
||||
assert_return(() => call($1, "i32_store16", [51966]), 51966);
|
||||
|
||||
// endianness.wast:189
|
||||
assert_return(() => call($1, "i32_store", [-1]), -1);
|
||||
|
||||
// endianness.wast:190
|
||||
assert_return(() => call($1, "i32_store", [-4242]), -4242);
|
||||
|
||||
// endianness.wast:191
|
||||
assert_return(() => call($1, "i32_store", [42424242]), 42424242);
|
||||
|
||||
// endianness.wast:192
|
||||
assert_return(() => call($1, "i32_store", [-559035650]), -559035650);
|
||||
|
||||
// endianness.wast:194
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x92\x80\x80\x80\x00\x01\x02\x24\x31\x0b\x69\x36\x34\x5f\x73\x74\x6f\x72\x65\x31\x36\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9b\x80\x80\x80\x00\x01\x95\x80\x80\x80\x00\x00\x02\x40\x42\x7f\x10\x00\x01\x42\xff\xff\x03\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_store16", [int64("-1")]), int64("65535"))
|
||||
|
||||
// endianness.wast:195
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x92\x80\x80\x80\x00\x01\x02\x24\x31\x0b\x69\x36\x34\x5f\x73\x74\x6f\x72\x65\x31\x36\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9c\x80\x80\x80\x00\x01\x96\x80\x80\x80\x00\x00\x02\x40\x42\xee\x5e\x10\x00\x01\x42\xee\xde\x03\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_store16", [int64("-4242")]), int64("61294"))
|
||||
|
||||
// endianness.wast:196
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x92\x80\x80\x80\x00\x01\x02\x24\x31\x0b\x69\x36\x34\x5f\x73\x74\x6f\x72\x65\x31\x36\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x99\x80\x80\x80\x00\x01\x93\x80\x80\x80\x00\x00\x02\x40\x42\x2a\x10\x00\x01\x42\x2a\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_store16", [int64("42")]), int64("42"))
|
||||
|
||||
// endianness.wast:197
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x92\x80\x80\x80\x00\x01\x02\x24\x31\x0b\x69\x36\x34\x5f\x73\x74\x6f\x72\x65\x31\x36\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9d\x80\x80\x80\x00\x01\x97\x80\x80\x80\x00\x00\x02\x40\x42\xfe\x95\x03\x10\x00\x01\x42\xfe\x95\x03\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_store16", [int64("51966")]), int64("51966"))
|
||||
|
||||
// endianness.wast:199
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x92\x80\x80\x80\x00\x01\x02\x24\x31\x0b\x69\x36\x34\x5f\x73\x74\x6f\x72\x65\x33\x32\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9d\x80\x80\x80\x00\x01\x97\x80\x80\x80\x00\x00\x02\x40\x42\x7f\x10\x00\x01\x42\xff\xff\xff\xff\x0f\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_store32", [int64("-1")]), int64("4294967295"))
|
||||
|
||||
// endianness.wast:200
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x92\x80\x80\x80\x00\x01\x02\x24\x31\x0b\x69\x36\x34\x5f\x73\x74\x6f\x72\x65\x33\x32\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9e\x80\x80\x80\x00\x01\x98\x80\x80\x80\x00\x00\x02\x40\x42\xee\x5e\x10\x00\x01\x42\xee\xde\xff\xff\x0f\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_store32", [int64("-4242")]), int64("4294963054"))
|
||||
|
||||
// endianness.wast:201
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x92\x80\x80\x80\x00\x01\x02\x24\x31\x0b\x69\x36\x34\x5f\x73\x74\x6f\x72\x65\x33\x32\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9f\x80\x80\x80\x00\x01\x99\x80\x80\x80\x00\x00\x02\x40\x42\xb2\xaf\x9d\x14\x10\x00\x01\x42\xb2\xaf\x9d\x14\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_store32", [int64("42424242")]), int64("42424242"))
|
||||
|
||||
// endianness.wast:202
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x92\x80\x80\x80\x00\x01\x02\x24\x31\x0b\x69\x36\x34\x5f\x73\x74\x6f\x72\x65\x33\x32\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\xa1\x80\x80\x80\x00\x01\x9b\x80\x80\x80\x00\x00\x02\x40\x42\xfe\x95\xb7\xf5\x0d\x10\x00\x01\x42\xfe\x95\xb7\xf5\x0d\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_store32", [int64("3735931646")]), int64("3735931646"))
|
||||
|
||||
// endianness.wast:204
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x90\x80\x80\x80\x00\x01\x02\x24\x31\x09\x69\x36\x34\x5f\x73\x74\x6f\x72\x65\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x99\x80\x80\x80\x00\x01\x93\x80\x80\x80\x00\x00\x02\x40\x42\x7f\x10\x00\x01\x42\x7f\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_store", [int64("-1")]), int64("-1"))
|
||||
|
||||
// endianness.wast:205
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x90\x80\x80\x80\x00\x01\x02\x24\x31\x09\x69\x36\x34\x5f\x73\x74\x6f\x72\x65\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9f\x80\x80\x80\x00\x01\x99\x80\x80\x80\x00\x00\x02\x40\x42\xce\xd0\xe2\x6b\x10\x00\x01\x42\xce\xd0\xe2\x6b\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_store", [int64("-42424242")]), int64("-42424242"))
|
||||
|
||||
// endianness.wast:206
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x90\x80\x80\x80\x00\x01\x02\x24\x31\x09\x69\x36\x34\x5f\x73\x74\x6f\x72\x65\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\xa1\x80\x80\x80\x00\x01\x9b\x80\x80\x80\x00\x00\x02\x40\x42\xea\xbb\xb4\xdd\x0a\x10\x00\x01\x42\xea\xbb\xb4\xdd\x0a\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_store", [int64("2880249322")]), int64("2880249322"))
|
||||
|
||||
// endianness.wast:207
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7e\x01\x7e\x02\x90\x80\x80\x80\x00\x01\x02\x24\x31\x09\x69\x36\x34\x5f\x73\x74\x6f\x72\x65\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\xab\x80\x80\x80\x00\x01\xa5\x80\x80\x80\x00\x00\x02\x40\x42\xea\xbb\xb4\xf5\xed\xdf\xf2\xd6\xab\x7f\x10\x00\x01\x42\xea\xbb\xb4\xf5\xed\xdf\xf2\xd6\xab\x7f\x01\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "i64_store", [int64("-6075977126246539798")]), int64("-6075977126246539798"))
|
||||
|
||||
// endianness.wast:209
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7d\x01\x7d\x02\x90\x80\x80\x80\x00\x01\x02\x24\x31\x09\x66\x33\x32\x5f\x73\x74\x6f\x72\x65\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9f\x80\x80\x80\x00\x01\x99\x80\x80\x80\x00\x00\x02\x40\x43\x00\x00\x80\xbf\x10\x00\xbc\x43\x00\x00\x80\xbf\xbc\x46\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "f32_store", [-1.]), -1.)
|
||||
|
||||
// endianness.wast:210
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7d\x01\x7d\x02\x90\x80\x80\x80\x00\x01\x02\x24\x31\x09\x66\x33\x32\x5f\x73\x74\x6f\x72\x65\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9f\x80\x80\x80\x00\x01\x99\x80\x80\x80\x00\x00\x02\x40\x43\xb6\x2d\x4a\x3c\x10\x00\xbc\x43\xb6\x2d\x4a\x3c\xbc\x46\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "f32_store", [0.0123399998993]), 0.0123399998993)
|
||||
|
||||
// endianness.wast:211
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7d\x01\x7d\x02\x90\x80\x80\x80\x00\x01\x02\x24\x31\x09\x66\x33\x32\x5f\x73\x74\x6f\x72\x65\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9f\x80\x80\x80\x00\x01\x99\x80\x80\x80\x00\x00\x02\x40\x43\x65\x93\x84\x45\x10\x00\xbc\x43\x65\x93\x84\x45\xbc\x46\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "f32_store", [4242.42431641]), 4242.42431641)
|
||||
|
||||
// endianness.wast:212
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7d\x01\x7d\x02\x90\x80\x80\x80\x00\x01\x02\x24\x31\x09\x66\x33\x32\x5f\x73\x74\x6f\x72\x65\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\x9f\x80\x80\x80\x00\x01\x99\x80\x80\x80\x00\x00\x02\x40\x43\xff\xff\x7f\x7f\x10\x00\xbc\x43\xff\xff\x7f\x7f\xbc\x46\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "f32_store", [3.40282346639e+38]), 3.40282346639e+38)
|
||||
|
||||
// endianness.wast:214
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7c\x01\x7c\x02\x90\x80\x80\x80\x00\x01\x02\x24\x31\x09\x66\x36\x34\x5f\x73\x74\x6f\x72\x65\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\xa7\x80\x80\x80\x00\x01\xa1\x80\x80\x80\x00\x00\x02\x40\x44\x00\x00\x00\x00\x00\x00\xf0\xbf\x10\x00\xbd\x44\x00\x00\x00\x00\x00\x00\xf0\xbf\xbd\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "f64_store", [-1.]), -1.)
|
||||
|
||||
// endianness.wast:215
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7c\x01\x7c\x02\x90\x80\x80\x80\x00\x01\x02\x24\x31\x09\x66\x36\x34\x5f\x73\x74\x6f\x72\x65\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\xa7\x80\x80\x80\x00\x01\xa1\x80\x80\x80\x00\x00\x02\x40\x44\xe7\xc6\xf4\x84\x45\x4a\x93\x40\x10\x00\xbd\x44\xe7\xc6\xf4\x84\x45\x4a\x93\x40\xbd\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "f64_store", [1234.56789]), 1234.56789)
|
||||
|
||||
// endianness.wast:216
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7c\x01\x7c\x02\x90\x80\x80\x80\x00\x01\x02\x24\x31\x09\x66\x36\x34\x5f\x73\x74\x6f\x72\x65\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\xa7\x80\x80\x80\x00\x01\xa1\x80\x80\x80\x00\x00\x02\x40\x44\xae\x7e\x6c\xb2\xc9\xe4\x19\x41\x10\x00\xbd\x44\xae\x7e\x6c\xb2\xc9\xe4\x19\x41\xbd\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "f64_store", [424242.424242]), 424242.424242)
|
||||
|
||||
// endianness.wast:217
|
||||
run(() => call(instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x89\x80\x80\x80\x00\x02\x60\x00\x00\x60\x01\x7c\x01\x7c\x02\x90\x80\x80\x80\x00\x01\x02\x24\x31\x09\x66\x36\x34\x5f\x73\x74\x6f\x72\x65\x00\x01\x03\x82\x80\x80\x80\x00\x01\x00\x07\x87\x80\x80\x80\x00\x01\x03\x72\x75\x6e\x00\x01\x0a\xa7\x80\x80\x80\x00\x01\xa1\x80\x80\x80\x00\x00\x02\x40\x44\xff\xff\xff\xff\xff\xff\xef\x7f\x10\x00\xbd\x44\xff\xff\xff\xff\xff\xff\xef\x7f\xbd\x51\x45\x0d\x00\x0f\x0b\x00\x0b", exports("$1", $1)), "run", [])); // assert_return(() => call($1, "f64_store", [1.79769313486e+308]), 1.79769313486e+308)
|
|
@ -1,250 +0,0 @@
|
|||
|
||||
// exports.wast:3
|
||||
let $1 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x07\x85\x80\x80\x80\x00\x01\x01\x61\x00\x00\x0a\x88\x80\x80\x80\x00\x01\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// exports.wast:4
|
||||
let $2 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x07\x89\x80\x80\x80\x00\x02\x01\x61\x00\x00\x01\x62\x00\x00\x0a\x88\x80\x80\x80\x00\x01\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// exports.wast:5
|
||||
let $3 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x83\x80\x80\x80\x00\x02\x00\x00\x07\x89\x80\x80\x80\x00\x02\x01\x61\x00\x00\x01\x62\x00\x01\x0a\x8f\x80\x80\x80\x00\x02\x82\x80\x80\x80\x00\x00\x0b\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// exports.wast:7
|
||||
let $4 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x07\x85\x80\x80\x80\x00\x01\x01\x61\x00\x00\x0a\x88\x80\x80\x80\x00\x01\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// exports.wast:8
|
||||
let $5 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x07\x8d\x80\x80\x80\x00\x03\x01\x61\x00\x00\x01\x62\x00\x00\x01\x63\x00\x00\x0a\x88\x80\x80\x80\x00\x01\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// exports.wast:9
|
||||
let $6 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x85\x80\x80\x80\x00\x01\x60\x01\x7f\x00\x03\x82\x80\x80\x80\x00\x01\x00\x07\x89\x80\x80\x80\x00\x02\x01\x61\x00\x00\x01\x62\x00\x00\x0a\x88\x80\x80\x80\x00\x01\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// exports.wast:10
|
||||
let $7 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x07\x85\x80\x80\x80\x00\x01\x01\x61\x00\x00\x0a\x88\x80\x80\x80\x00\x01\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// exports.wast:11
|
||||
let $8 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x07\x85\x80\x80\x80\x00\x01\x01\x61\x00\x00\x0a\x88\x80\x80\x80\x00\x01\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// exports.wast:12
|
||||
let $9 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x07\x85\x80\x80\x80\x00\x01\x01\x61\x00\x00\x0a\x88\x80\x80\x80\x00\x01\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// exports.wast:13
|
||||
let $10 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x07\x85\x80\x80\x80\x00\x01\x01\x61\x00\x00\x0a\x88\x80\x80\x80\x00\x01\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// exports.wast:14
|
||||
let $11 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x07\x85\x80\x80\x80\x00\x01\x01\x61\x00\x00\x0a\x88\x80\x80\x80\x00\x01\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// exports.wast:16
|
||||
let $12 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x86\x80\x80\x80\x00\x01\x60\x01\x7f\x01\x7f\x03\x82\x80\x80\x80\x00\x01\x00\x07\x85\x80\x80\x80\x00\x01\x01\x65\x00\x00\x0a\x8e\x80\x80\x80\x00\x01\x88\x80\x80\x80\x00\x00\x20\x00\x41\x01\x6a\x0f\x0b");
|
||||
let $Func = $12;
|
||||
|
||||
// exports.wast:22
|
||||
assert_return(() => call($12, "e", [42]), 43);
|
||||
|
||||
// exports.wast:23
|
||||
assert_return(() => call($Func, "e", [42]), 43);
|
||||
|
||||
// exports.wast:24
|
||||
let $13 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00");
|
||||
|
||||
// exports.wast:25
|
||||
let $14 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00");
|
||||
let $Other1 = $14;
|
||||
|
||||
// exports.wast:26
|
||||
assert_return(() => call($Func, "e", [42]), 43);
|
||||
|
||||
// exports.wast:28
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x07\x85\x80\x80\x80\x00\x01\x01\x61\x00\x01\x0a\x88\x80\x80\x80\x00\x01\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// exports.wast:32
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x07\x89\x80\x80\x80\x00\x02\x01\x61\x00\x00\x01\x61\x00\x00\x0a\x88\x80\x80\x80\x00\x01\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// exports.wast:36
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x83\x80\x80\x80\x00\x02\x00\x00\x07\x89\x80\x80\x80\x00\x02\x01\x61\x00\x00\x01\x61\x00\x01\x0a\x8f\x80\x80\x80\x00\x02\x82\x80\x80\x80\x00\x00\x0b\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// exports.wast:40
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x06\x86\x80\x80\x80\x00\x01\x7f\x00\x41\x00\x0b\x07\x89\x80\x80\x80\x00\x02\x01\x61\x00\x00\x01\x61\x03\x00\x0a\x88\x80\x80\x80\x00\x01\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// exports.wast:44
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x07\x89\x80\x80\x80\x00\x02\x01\x61\x00\x00\x01\x61\x01\x00\x0a\x88\x80\x80\x80\x00\x01\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// exports.wast:48
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x05\x83\x80\x80\x80\x00\x01\x00\x00\x07\x89\x80\x80\x80\x00\x02\x01\x61\x00\x00\x01\x61\x02\x00\x0a\x88\x80\x80\x80\x00\x01\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// exports.wast:56
|
||||
let $15 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x06\x86\x80\x80\x80\x00\x01\x7f\x00\x41\x00\x0b\x07\x85\x80\x80\x80\x00\x01\x01\x61\x03\x00");
|
||||
|
||||
// exports.wast:57
|
||||
let $16 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x06\x86\x80\x80\x80\x00\x01\x7f\x00\x41\x00\x0b\x07\x89\x80\x80\x80\x00\x02\x01\x61\x03\x00\x01\x62\x03\x00");
|
||||
|
||||
// exports.wast:58
|
||||
let $17 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x06\x8b\x80\x80\x80\x00\x02\x7f\x00\x41\x00\x0b\x7f\x00\x41\x00\x0b\x07\x89\x80\x80\x80\x00\x02\x01\x61\x03\x00\x01\x62\x03\x01");
|
||||
|
||||
// exports.wast:60
|
||||
let $18 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x06\x86\x80\x80\x80\x00\x01\x7f\x00\x41\x00\x0b\x07\x85\x80\x80\x80\x00\x01\x01\x61\x03\x00");
|
||||
|
||||
// exports.wast:61
|
||||
let $19 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x06\x86\x80\x80\x80\x00\x01\x7f\x00\x41\x00\x0b\x07\x85\x80\x80\x80\x00\x01\x01\x61\x03\x00");
|
||||
|
||||
// exports.wast:62
|
||||
let $20 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x06\x86\x80\x80\x80\x00\x01\x7f\x00\x41\x00\x0b\x07\x85\x80\x80\x80\x00\x01\x01\x61\x03\x00");
|
||||
|
||||
// exports.wast:63
|
||||
let $21 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x06\x86\x80\x80\x80\x00\x01\x7f\x00\x41\x00\x0b\x07\x85\x80\x80\x80\x00\x01\x01\x61\x03\x00");
|
||||
|
||||
// exports.wast:64
|
||||
let $22 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x06\x86\x80\x80\x80\x00\x01\x7f\x00\x41\x00\x0b\x07\x85\x80\x80\x80\x00\x01\x01\x61\x03\x00");
|
||||
|
||||
// exports.wast:65
|
||||
let $23 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x06\x86\x80\x80\x80\x00\x01\x7f\x00\x41\x00\x0b\x07\x85\x80\x80\x80\x00\x01\x01\x61\x03\x00");
|
||||
|
||||
// exports.wast:67
|
||||
let $24 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x06\x86\x80\x80\x80\x00\x01\x7f\x00\x41\x2a\x0b\x07\x85\x80\x80\x80\x00\x01\x01\x65\x03\x00");
|
||||
let $Global = $24;
|
||||
|
||||
// exports.wast:71
|
||||
assert_return(() => get($24, "e"), 42);
|
||||
|
||||
// exports.wast:72
|
||||
assert_return(() => get($Global, "e"), 42);
|
||||
|
||||
// exports.wast:73
|
||||
let $25 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00");
|
||||
|
||||
// exports.wast:74
|
||||
let $26 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00");
|
||||
let $Other2 = $26;
|
||||
|
||||
// exports.wast:75
|
||||
assert_return(() => get($Global, "e"), 42);
|
||||
|
||||
// exports.wast:77
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x06\x86\x80\x80\x80\x00\x01\x7f\x00\x41\x00\x0b\x07\x85\x80\x80\x80\x00\x01\x01\x61\x03\x01");
|
||||
|
||||
// exports.wast:81
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x06\x86\x80\x80\x80\x00\x01\x7f\x00\x41\x00\x0b\x07\x89\x80\x80\x80\x00\x02\x01\x61\x03\x00\x01\x61\x03\x00");
|
||||
|
||||
// exports.wast:85
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x06\x8b\x80\x80\x80\x00\x02\x7f\x00\x41\x00\x0b\x7f\x00\x41\x00\x0b\x07\x89\x80\x80\x80\x00\x02\x01\x61\x03\x00\x01\x61\x03\x01");
|
||||
|
||||
// exports.wast:89
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x06\x86\x80\x80\x80\x00\x01\x7f\x00\x41\x00\x0b\x07\x89\x80\x80\x80\x00\x02\x01\x61\x03\x00\x01\x61\x00\x00\x0a\x88\x80\x80\x80\x00\x01\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// exports.wast:93
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x06\x86\x80\x80\x80\x00\x01\x7f\x00\x41\x00\x0b\x07\x89\x80\x80\x80\x00\x02\x01\x61\x03\x00\x01\x61\x01\x00");
|
||||
|
||||
// exports.wast:97
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x05\x83\x80\x80\x80\x00\x01\x00\x00\x06\x86\x80\x80\x80\x00\x01\x7f\x00\x41\x00\x0b\x07\x89\x80\x80\x80\x00\x02\x01\x61\x03\x00\x01\x61\x02\x00");
|
||||
|
||||
// exports.wast:105
|
||||
let $27 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x07\x85\x80\x80\x80\x00\x01\x01\x61\x01\x00");
|
||||
|
||||
// exports.wast:106
|
||||
let $28 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x07\x89\x80\x80\x80\x00\x02\x01\x61\x01\x00\x01\x62\x01\x00");
|
||||
|
||||
// exports.wast:110
|
||||
let $29 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x07\x85\x80\x80\x80\x00\x01\x01\x61\x01\x00");
|
||||
|
||||
// exports.wast:111
|
||||
let $30 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x04\x85\x80\x80\x80\x00\x01\x70\x01\x00\x01\x07\x85\x80\x80\x80\x00\x01\x01\x61\x01\x00");
|
||||
|
||||
// exports.wast:112
|
||||
let $31 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x07\x85\x80\x80\x80\x00\x01\x01\x61\x01\x00");
|
||||
|
||||
// exports.wast:113
|
||||
let $32 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x04\x85\x80\x80\x80\x00\x01\x70\x01\x00\x01\x07\x85\x80\x80\x80\x00\x01\x01\x61\x01\x00");
|
||||
|
||||
// exports.wast:114
|
||||
let $33 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x07\x85\x80\x80\x80\x00\x01\x01\x61\x01\x00");
|
||||
|
||||
// exports.wast:115
|
||||
let $34 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x04\x85\x80\x80\x80\x00\x01\x70\x01\x00\x01\x07\x85\x80\x80\x80\x00\x01\x01\x61\x01\x00");
|
||||
|
||||
// exports.wast:116
|
||||
let $35 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x07\x85\x80\x80\x80\x00\x01\x01\x61\x01\x00");
|
||||
|
||||
// exports.wast:117
|
||||
let $36 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x04\x85\x80\x80\x80\x00\x01\x70\x01\x00\x01\x07\x85\x80\x80\x80\x00\x01\x01\x61\x01\x00");
|
||||
|
||||
// exports.wast:118
|
||||
let $37 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x07\x85\x80\x80\x80\x00\x01\x01\x61\x01\x00");
|
||||
|
||||
// exports.wast:119
|
||||
let $38 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x04\x85\x80\x80\x80\x00\x01\x70\x01\x00\x01\x07\x85\x80\x80\x80\x00\x01\x01\x61\x01\x00");
|
||||
|
||||
// exports.wast:120
|
||||
let $39 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x07\x85\x80\x80\x80\x00\x01\x01\x61\x01\x00");
|
||||
|
||||
// exports.wast:121
|
||||
let $40 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x04\x85\x80\x80\x80\x00\x01\x70\x01\x00\x01\x07\x85\x80\x80\x80\x00\x01\x01\x61\x01\x00");
|
||||
|
||||
// exports.wast:125
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x07\x85\x80\x80\x80\x00\x01\x01\x61\x01\x01");
|
||||
|
||||
// exports.wast:129
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x07\x89\x80\x80\x80\x00\x02\x01\x61\x01\x00\x01\x61\x01\x00");
|
||||
|
||||
// exports.wast:138
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x07\x89\x80\x80\x80\x00\x02\x01\x61\x01\x00\x01\x61\x00\x00\x0a\x88\x80\x80\x80\x00\x01\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// exports.wast:142
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x06\x86\x80\x80\x80\x00\x01\x7f\x00\x41\x00\x0b\x07\x89\x80\x80\x80\x00\x02\x01\x61\x01\x00\x01\x61\x03\x00");
|
||||
|
||||
// exports.wast:146
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x05\x83\x80\x80\x80\x00\x01\x00\x00\x07\x89\x80\x80\x80\x00\x02\x01\x61\x01\x00\x01\x61\x02\x00");
|
||||
|
||||
// exports.wast:154
|
||||
let $41 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x05\x83\x80\x80\x80\x00\x01\x00\x00\x07\x85\x80\x80\x80\x00\x01\x01\x61\x02\x00");
|
||||
|
||||
// exports.wast:155
|
||||
let $42 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x05\x83\x80\x80\x80\x00\x01\x00\x00\x07\x89\x80\x80\x80\x00\x02\x01\x61\x02\x00\x01\x62\x02\x00");
|
||||
|
||||
// exports.wast:159
|
||||
let $43 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x05\x83\x80\x80\x80\x00\x01\x00\x00\x07\x85\x80\x80\x80\x00\x01\x01\x61\x02\x00");
|
||||
|
||||
// exports.wast:160
|
||||
let $44 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x05\x84\x80\x80\x80\x00\x01\x01\x00\x01\x07\x85\x80\x80\x80\x00\x01\x01\x61\x02\x00");
|
||||
|
||||
// exports.wast:161
|
||||
let $45 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x05\x83\x80\x80\x80\x00\x01\x00\x00\x07\x85\x80\x80\x80\x00\x01\x01\x61\x02\x00");
|
||||
|
||||
// exports.wast:162
|
||||
let $46 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x05\x84\x80\x80\x80\x00\x01\x01\x00\x01\x07\x85\x80\x80\x80\x00\x01\x01\x61\x02\x00");
|
||||
|
||||
// exports.wast:163
|
||||
let $47 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x05\x83\x80\x80\x80\x00\x01\x00\x00\x07\x85\x80\x80\x80\x00\x01\x01\x61\x02\x00");
|
||||
|
||||
// exports.wast:164
|
||||
let $48 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x05\x84\x80\x80\x80\x00\x01\x01\x00\x01\x07\x85\x80\x80\x80\x00\x01\x01\x61\x02\x00");
|
||||
|
||||
// exports.wast:165
|
||||
let $49 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x05\x83\x80\x80\x80\x00\x01\x00\x00\x07\x85\x80\x80\x80\x00\x01\x01\x61\x02\x00");
|
||||
|
||||
// exports.wast:166
|
||||
let $50 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x05\x84\x80\x80\x80\x00\x01\x01\x00\x01\x07\x85\x80\x80\x80\x00\x01\x01\x61\x02\x00");
|
||||
|
||||
// exports.wast:167
|
||||
let $51 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x05\x83\x80\x80\x80\x00\x01\x00\x00\x07\x85\x80\x80\x80\x00\x01\x01\x61\x02\x00");
|
||||
|
||||
// exports.wast:168
|
||||
let $52 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x05\x84\x80\x80\x80\x00\x01\x01\x00\x01\x07\x85\x80\x80\x80\x00\x01\x01\x61\x02\x00");
|
||||
|
||||
// exports.wast:169
|
||||
let $53 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x05\x83\x80\x80\x80\x00\x01\x00\x00\x07\x85\x80\x80\x80\x00\x01\x01\x61\x02\x00");
|
||||
|
||||
// exports.wast:170
|
||||
let $54 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x05\x84\x80\x80\x80\x00\x01\x01\x00\x01\x07\x85\x80\x80\x80\x00\x01\x01\x61\x02\x00");
|
||||
|
||||
// exports.wast:174
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x05\x83\x80\x80\x80\x00\x01\x00\x00\x07\x85\x80\x80\x80\x00\x01\x01\x61\x02\x01");
|
||||
|
||||
// exports.wast:178
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x05\x83\x80\x80\x80\x00\x01\x00\x00\x07\x89\x80\x80\x80\x00\x02\x01\x61\x02\x00\x01\x61\x02\x00");
|
||||
|
||||
// exports.wast:187
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x01\x84\x80\x80\x80\x00\x01\x60\x00\x00\x03\x82\x80\x80\x80\x00\x01\x00\x05\x83\x80\x80\x80\x00\x01\x00\x00\x07\x89\x80\x80\x80\x00\x02\x01\x61\x02\x00\x01\x61\x00\x00\x0a\x88\x80\x80\x80\x00\x01\x82\x80\x80\x80\x00\x00\x0b");
|
||||
|
||||
// exports.wast:191
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x05\x83\x80\x80\x80\x00\x01\x00\x00\x06\x86\x80\x80\x80\x00\x01\x7f\x00\x41\x00\x0b\x07\x89\x80\x80\x80\x00\x02\x01\x61\x02\x00\x01\x61\x03\x00");
|
||||
|
||||
// exports.wast:195
|
||||
assert_invalid("\x00\x61\x73\x6d\x01\x00\x00\x00\x04\x84\x80\x80\x80\x00\x01\x70\x00\x00\x05\x83\x80\x80\x80\x00\x01\x00\x00\x07\x89\x80\x80\x80\x00\x02\x01\x61\x02\x00\x01\x61\x01\x00");
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue