WebKit Bugzilla
Attachment 372416 Details for
Bug 198983
: [WASM-References] Rename anyfunc to funcref
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198983-20190618183917.patch (text/plain), 133.77 KB, created by
Justin Michaud
on 2019-06-18 18:39:17 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Justin Michaud
Created:
2019-06-18 18:39:17 PDT
Size:
133.77 KB
patch
obsolete
>Subversion Revision: 246578 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index b73d4e4b05ad9cbb75c9b5ac75d8b13225df48b3..e678b488da4020401273c5b82703830d6e8af751 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,53 @@ >+2019-06-18 Justin Michaud <justin_michaud@apple.com> >+ >+ [WASM-References] Rename anyfunc to funcref >+ https://bugs.webkit.org/show_bug.cgi?id=198983 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Anyfunc should become funcref since it was renamed in the spec. We should also support the string 'anyfunc' in the table constructor since this is >+ the only non-binary-format place where it is exposed to users. >+ >+ * wasm/WasmAirIRGenerator.cpp: >+ (JSC::Wasm::AirIRGenerator::gFuncref): >+ (JSC::Wasm::AirIRGenerator::tmpForType): >+ (JSC::Wasm::AirIRGenerator::emitCCall): >+ (JSC::Wasm::AirIRGenerator::moveOpForValueType): >+ (JSC::Wasm::AirIRGenerator::AirIRGenerator): >+ (JSC::Wasm::AirIRGenerator::addLocal): >+ (JSC::Wasm::AirIRGenerator::addConstant): >+ (JSC::Wasm::AirIRGenerator::addRefFunc): >+ (JSC::Wasm::AirIRGenerator::addReturn): >+ (JSC::Wasm::AirIRGenerator::gAnyfunc): Deleted. >+ * wasm/WasmCallingConvention.h: >+ (JSC::Wasm::CallingConventionAir::marshallArgument const): >+ (JSC::Wasm::CallingConventionAir::setupCall const): >+ * wasm/WasmExceptionType.h: >+ * wasm/WasmFormat.h: >+ (JSC::Wasm::isValueType): >+ (JSC::Wasm::isSubtype): >+ (JSC::Wasm::TableInformation::wasmType const): >+ * wasm/WasmFunctionParser.h: >+ (JSC::Wasm::FunctionParser<Context>::parseExpression): >+ * wasm/WasmSectionParser.cpp: >+ (JSC::Wasm::SectionParser::parseTableHelper): >+ (JSC::Wasm::SectionParser::parseElement): >+ (JSC::Wasm::SectionParser::parseInitExpr): >+ * wasm/WasmValidate.cpp: >+ (JSC::Wasm::Validate::addRefFunc): >+ * wasm/js/JSToWasm.cpp: >+ (JSC::Wasm::createJSToWasmWrapper): >+ * wasm/js/WasmToJS.cpp: >+ (JSC::Wasm::wasmToJS): >+ * wasm/js/WebAssemblyFunction.cpp: >+ (JSC::callWebAssemblyFunction): >+ (JSC::WebAssemblyFunction::jsCallEntrypointSlow): >+ * wasm/js/WebAssemblyModuleRecord.cpp: >+ (JSC::WebAssemblyModuleRecord::link): >+ * wasm/js/WebAssemblyTableConstructor.cpp: >+ (JSC::constructJSWebAssemblyTable): >+ * wasm/wasm.json: >+ > 2019-06-18 Yusuke Suzuki <ysuzuki@apple.com> > > [JSC] JSLock should be WebThread aware >diff --git a/Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp b/Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp >index 47b4ec6b47708609a74dca35fb2ac3dabb1ac0f1..d908d82ae45534ce1fa814c5467c184911f07079 100644 >--- a/Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp >+++ b/Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp >@@ -365,7 +365,7 @@ private: > TypedTmp g32() { return { newTmp(B3::GP), Type::I32 }; } > TypedTmp g64() { return { newTmp(B3::GP), Type::I64 }; } > TypedTmp gAnyref() { return { newTmp(B3::GP), Type::Anyref }; } >- TypedTmp gAnyfunc() { return { newTmp(B3::GP), Type::Anyfunc }; } >+ TypedTmp gFuncref() { return { newTmp(B3::GP), Type::Funcref }; } > TypedTmp f32() { return { newTmp(B3::FP), Type::F32 }; } > TypedTmp f64() { return { newTmp(B3::FP), Type::F64 }; } > >@@ -376,8 +376,8 @@ private: > return g32(); > case Type::I64: > return g64(); >- case Type::Anyfunc: >- return gAnyfunc(); >+ case Type::Funcref: >+ return gFuncref(); > case Type::Anyref: > return gAnyref(); > case Type::F32: >@@ -516,7 +516,7 @@ private: > break; > case Type::I64: > case Type::Anyref: >- case Type::Anyfunc: >+ case Type::Funcref: > resultType = B3::Int64; > break; > case Type::F32: >@@ -565,7 +565,7 @@ private: > return Move32; > case Type::I64: > case Type::Anyref: >- case Type::Anyfunc: >+ case Type::Funcref: > return Move; > case Type::F32: > return MoveFloat; >@@ -813,7 +813,7 @@ AirIRGenerator::AirIRGenerator(const ModuleInformation& info, B3::Procedure& pro > break; > case Type::I64: > case Type::Anyref: >- case Type::Anyfunc: >+ case Type::Funcref: > append(Move, arg, m_locals[i]); > break; > case Type::F32: >@@ -899,7 +899,7 @@ auto AirIRGenerator::addLocal(Type type, uint32_t count) -> PartialResult > m_locals.uncheckedAppend(local); > switch (type) { > case Type::Anyref: >- case Type::Anyfunc: >+ case Type::Funcref: > append(Move, Arg::imm(JSValue::encode(jsNull())), local); > break; > case Type::I32: >@@ -934,7 +934,7 @@ auto AirIRGenerator::addConstant(BasicBlock* block, Type type, uint64_t value) - > case Type::I32: > case Type::I64: > case Type::Anyref: >- case Type::Anyfunc: >+ case Type::Funcref: > append(block, Move, Arg::bigImm(value), result); > break; > case Type::F32: >@@ -973,7 +973,7 @@ auto AirIRGenerator::addRefIsNull(ExpressionType& value, ExpressionType& result) > auto AirIRGenerator::addRefFunc(uint32_t index, ExpressionType& result) -> PartialResult > { > // FIXME: Emit this inline <https://bugs.webkit.org/show_bug.cgi?id=198506>. >- result = tmpForType(Type::Anyfunc); >+ result = tmpForType(Type::Funcref); > emitCCall(&doWasmRefFunc, result, instanceValue(), addConstant(Type::I32, index)); > > return { }; >@@ -1699,7 +1699,7 @@ auto AirIRGenerator::addReturn(const ControlData& data, const ExpressionList& re > break; > case Type::I64: > case Type::Anyref: >- case Type::Anyfunc: >+ case Type::Funcref: > append(Move, returnValues[0], returnValueGPR); > append(Ret64, returnValueGPR); > break; >diff --git a/Source/JavaScriptCore/wasm/WasmCallingConvention.h b/Source/JavaScriptCore/wasm/WasmCallingConvention.h >index f7be38c67bee9eb35332113b23e6b243de94cdce..8192621e40d6c9de8d9229a6ceed15e19100160b 100644 >--- a/Source/JavaScriptCore/wasm/WasmCallingConvention.h >+++ b/Source/JavaScriptCore/wasm/WasmCallingConvention.h >@@ -236,7 +236,7 @@ private: > case Type::I32: > case Type::I64: > case Type::Anyref: >- case Wasm::Anyfunc: >+ case Wasm::Funcref: > marshallArgumentImpl(m_gprArgs, gpArgumentCount, stackOffset, regFunc, stackFunc); > break; > case Type::F32: >@@ -302,7 +302,7 @@ public: > case Type::I32: > case Type::I64: > case Type::Anyref: >- case Wasm::Anyfunc: >+ case Wasm::Funcref: > patchpoint->resultConstraint = B3::ValueRep::reg(GPRInfo::returnValueGPR); > break; > default: >diff --git a/Source/JavaScriptCore/wasm/WasmExceptionType.h b/Source/JavaScriptCore/wasm/WasmExceptionType.h >index 54dbe26a9526115ce2da3d29a2ddd5153cc82987..70b56997754280d55b3071df7ec00c706ac2eafd 100644 >--- a/Source/JavaScriptCore/wasm/WasmExceptionType.h >+++ b/Source/JavaScriptCore/wasm/WasmExceptionType.h >@@ -44,7 +44,7 @@ namespace Wasm { > macro(StackOverflow, "Stack overflow") \ > macro(I64ArgumentType, "WebAssembly function with an i64 argument can't be called from JavaScript") \ > macro(I64ReturnType, "WebAssembly function that returns i64 can't be called from JavaScript") \ >- macro(FuncrefNotWasm, "Anyfunc must be an exported wasm function") >+ macro(FuncrefNotWasm, "Funcref must be an exported wasm function") > > enum class ExceptionType : uint32_t { > #define MAKE_ENUM(enumName, error) enumName, >diff --git a/Source/JavaScriptCore/wasm/WasmFormat.h b/Source/JavaScriptCore/wasm/WasmFormat.h >index 4db28a4e2b6e9d552281688fa9faddf893e5fb9c..01a309cd8936465e87338a8487ca65cb62c47364 100644 >--- a/Source/JavaScriptCore/wasm/WasmFormat.h >+++ b/Source/JavaScriptCore/wasm/WasmFormat.h >@@ -68,7 +68,7 @@ inline bool isValueType(Type type) > case F64: > return true; > case Anyref: >- case Anyfunc: >+ case Funcref: > return Options::useWebAssemblyReferences(); > default: > break; >@@ -80,7 +80,7 @@ inline bool isSubtype(Type sub, Type parent) > { > if (sub == parent) > return true; >- return sub == Anyfunc && parent == Anyref; >+ return sub == Funcref && parent == Anyref; > } > > enum class ExternalKind : uint8_t { >@@ -245,7 +245,7 @@ public: > uint32_t initial() const { return m_initial; } > Optional<uint32_t> maximum() const { return m_maximum; } > TableElementType type() const { return m_type; } >- Wasm::Type wasmType() const { return m_type == TableElementType::Funcref ? Type::Anyfunc : Type::Anyref; } >+ Wasm::Type wasmType() const { return m_type == TableElementType::Funcref ? Type::Funcref : Type::Anyref; } > > private: > uint32_t m_initial; >diff --git a/Source/JavaScriptCore/wasm/WasmFunctionParser.h b/Source/JavaScriptCore/wasm/WasmFunctionParser.h >index 1a7658c1efd5afc87fe43d4e273e30c2906599fe..4c1901780739f9ec23a1dfee9efa4ef0a0e64ad9 100644 >--- a/Source/JavaScriptCore/wasm/WasmFunctionParser.h >+++ b/Source/JavaScriptCore/wasm/WasmFunctionParser.h >@@ -342,7 +342,7 @@ auto FunctionParser<Context>::parseExpression() -> PartialResult > > case RefNull: { > WASM_PARSER_FAIL_IF(!Options::useWebAssemblyReferences(), "references are not enabled"); >- m_expressionStack.append(m_context.addConstant(Anyfunc, JSValue::encode(jsNull()))); >+ m_expressionStack.append(m_context.addConstant(Funcref, JSValue::encode(jsNull()))); > return { }; > } > >@@ -443,7 +443,7 @@ auto FunctionParser<Context>::parseExpression() -> PartialResult > WASM_PARSER_FAIL_IF(!parseVarUInt32(tableIndex), "can't get call_indirect's table index"); > WASM_PARSER_FAIL_IF(tableIndex >= m_info.tableCount(), "call_indirect's table index ", tableIndex, " invalid, limit is ", m_info.tableCount()); > WASM_PARSER_FAIL_IF(m_info.usedSignatures.size() <= signatureIndex, "call_indirect's signature index ", signatureIndex, " exceeds known signatures ", m_info.usedSignatures.size()); >- WASM_PARSER_FAIL_IF(m_info.tables[tableIndex].type() != TableElementType::Funcref, "call_indirect is only valid when a table has type anyfunc"); >+ WASM_PARSER_FAIL_IF(m_info.tables[tableIndex].type() != TableElementType::Funcref, "call_indirect is only valid when a table has type funcref"); > > const Signature& calleeSignature = m_info.usedSignatures[signatureIndex].get(); > size_t argumentCount = calleeSignature.argumentCount() + 1; // Add the callee's index. >diff --git a/Source/JavaScriptCore/wasm/WasmSectionParser.cpp b/Source/JavaScriptCore/wasm/WasmSectionParser.cpp >index ef51216752a1265e1024d37e9289ec48baffdee4..14cf280c87484ea7e35a8fd2ab5a8af6d6be877d 100644 >--- a/Source/JavaScriptCore/wasm/WasmSectionParser.cpp >+++ b/Source/JavaScriptCore/wasm/WasmSectionParser.cpp >@@ -198,7 +198,7 @@ auto SectionParser::parseTableHelper(bool isImport) -> PartialResult > > int8_t type; > WASM_PARSER_FAIL_IF(!parseInt7(type), "can't parse Table type"); >- WASM_PARSER_FAIL_IF(type != Wasm::Anyfunc && type != Wasm::Anyref, "Table type should be anyfunc or anyref, got ", type); >+ WASM_PARSER_FAIL_IF(type != Wasm::Funcref && type != Wasm::Anyref, "Table type should be funcref or anyref, got ", type); > > uint32_t initial; > Optional<uint32_t> maximum; >@@ -209,7 +209,7 @@ auto SectionParser::parseTableHelper(bool isImport) -> PartialResult > > ASSERT(!maximum || *maximum >= initial); > >- TableElementType tableType = type == Wasm::Anyfunc ? TableElementType::Funcref : TableElementType::Anyref; >+ TableElementType tableType = type == Wasm::Funcref ? TableElementType::Funcref : TableElementType::Anyref; > m_info->tables.append(TableInformation(initial, maximum, isImport, tableType)); > > return { }; >@@ -378,7 +378,7 @@ auto SectionParser::parseElement() -> PartialResult > > WASM_PARSER_FAIL_IF(!parseVarUInt32(tableIndex), "can't get ", elementNum, "th Element table index"); > WASM_PARSER_FAIL_IF(tableIndex >= m_info->tableCount(), "Element section for Table ", tableIndex, " exceeds available Table ", m_info->tableCount()); >- WASM_PARSER_FAIL_IF(m_info->tables[tableIndex].type() != TableElementType::Funcref, "Table ", tableIndex, " must have type 'anyfunc' to have an element section"); >+ WASM_PARSER_FAIL_IF(m_info->tables[tableIndex].type() != TableElementType::Funcref, "Table ", tableIndex, " must have type 'funcref' to have an element section"); > Type initExprType; > WASM_FAIL_IF_HELPER_FAILS(parseInitExpr(initOpcode, initExprBits, initExprType)); > WASM_PARSER_FAIL_IF(initExprType != I32, "Element init_expr must produce an i32"); >@@ -481,7 +481,7 @@ auto SectionParser::parseInitExpr(uint8_t& opcode, uint64_t& bitsOrImportNumber, > } > > case RefNull: { >- resultType = Anyfunc; >+ resultType = Funcref; > bitsOrImportNumber = JSValue::encode(jsNull()); > break; > } >@@ -491,7 +491,7 @@ auto SectionParser::parseInitExpr(uint8_t& opcode, uint64_t& bitsOrImportNumber, > WASM_PARSER_FAIL_IF(!parseVarUInt32(index), "can't get ref.func index"); > WASM_PARSER_FAIL_IF(index >= m_info->functions.size(), "ref.func index", index, " exceeds the number of functions ", m_info->functions.size()); > >- resultType = Anyfunc; >+ resultType = Funcref; > bitsOrImportNumber = index; > break; > } >diff --git a/Source/JavaScriptCore/wasm/WasmValidate.cpp b/Source/JavaScriptCore/wasm/WasmValidate.cpp >index 6a0bd9ffb2f9c36e87c2e15fe1043d6a57c52ee2..bee09ea825f4cd7b4986bd960579ea10e5f6eee2 100644 >--- a/Source/JavaScriptCore/wasm/WasmValidate.cpp >+++ b/Source/JavaScriptCore/wasm/WasmValidate.cpp >@@ -238,7 +238,7 @@ auto Validate::addRefIsNull(ExpressionType& value, ExpressionType& result) -> Re > > auto Validate::addRefFunc(uint32_t index, ExpressionType& result) -> Result > { >- result = Type::Anyfunc; >+ result = Type::Funcref; > WASM_VALIDATOR_FAIL_IF(index >= m_module.functionIndexSpaceSize(), "ref.func index ", index, " is too large, max is ", m_module.functionIndexSpaceSize()); > m_module.addReferencedFunction(index); > >diff --git a/Source/JavaScriptCore/wasm/js/JSToWasm.cpp b/Source/JavaScriptCore/wasm/js/JSToWasm.cpp >index 685295789e36b7cfb5d6b908f4f514c72ccdd13f..5dd451bea84d590bbf0fcb076e26ffd3cc7b81ac 100644 >--- a/Source/JavaScriptCore/wasm/js/JSToWasm.cpp >+++ b/Source/JavaScriptCore/wasm/js/JSToWasm.cpp >@@ -84,7 +84,7 @@ std::unique_ptr<InternalFunction> createJSToWasmWrapper(CompilationContext& comp > FALLTHROUGH; > case Wasm::I32: > case Wasm::Anyref: >- case Wasm::Anyfunc: >+ case Wasm::Funcref: > if (numGPRs >= wasmCallingConvention().m_gprArgs.size()) > totalFrameSize += sizeof(void*); > ++numGPRs; >@@ -154,7 +154,7 @@ std::unique_ptr<InternalFunction> createJSToWasmWrapper(CompilationContext& comp > switch (signature.argument(i)) { > case Wasm::I32: > case Wasm::I64: >- case Wasm::Anyfunc: >+ case Wasm::Funcref: > case Wasm::Anyref: > if (numGPRs >= wasmCallingConvention().m_gprArgs.size()) { > if (signature.argument(i) == Wasm::I32) { >@@ -240,7 +240,7 @@ std::unique_ptr<InternalFunction> createJSToWasmWrapper(CompilationContext& comp > jit.moveTrustedValue(jsUndefined(), JSValueRegs { GPRInfo::returnValueGPR }); > break; > case Wasm::Anyref: >- case Wasm::Anyfunc: >+ case Wasm::Funcref: > break; > case Wasm::I32: > jit.zeroExtend32ToPtr(GPRInfo::returnValueGPR, GPRInfo::returnValueGPR); >diff --git a/Source/JavaScriptCore/wasm/js/WasmToJS.cpp b/Source/JavaScriptCore/wasm/js/WasmToJS.cpp >index 8e718ea600d718af5500909437619ad170ee5424..922c51a85023e4e49dc842badb3fb66754126fae 100644 >--- a/Source/JavaScriptCore/wasm/js/WasmToJS.cpp >+++ b/Source/JavaScriptCore/wasm/js/WasmToJS.cpp >@@ -165,7 +165,7 @@ Expected<MacroAssemblerCodeRef<WasmEntryPtrTag>, BindingFailure> wasmToJS(VM* vm > case I64: > RELEASE_ASSERT_NOT_REACHED(); > case Anyref: >- case Anyfunc: >+ case Funcref: > case I32: { > GPRReg gprReg; > if (marshalledGPRs < wasmCC.m_gprArgs.size()) >@@ -242,7 +242,7 @@ Expected<MacroAssemblerCodeRef<WasmEntryPtrTag>, BindingFailure> wasmToJS(VM* vm > case I32: > arg = jsNumber(static_cast<int32_t>(buffer[argNum])); > break; >- case Anyfunc: { >+ case Funcref: { > arg = JSValue::decode(buffer[argNum]); > ASSERT(isWebAssemblyHostFunction(*vm, arg) || arg.isNull()); > break; >@@ -280,7 +280,7 @@ Expected<MacroAssemblerCodeRef<WasmEntryPtrTag>, BindingFailure> wasmToJS(VM* vm > realResult = static_cast<uint64_t>(static_cast<uint32_t>(result.toInt32(exec))); > break; > } >- case Anyfunc: { >+ case Funcref: { > realResult = JSValue::encode(result); > ASSERT(result.isFunction(*vm) || result.isNull()); > break; >@@ -381,7 +381,7 @@ Expected<MacroAssemblerCodeRef<WasmEntryPtrTag>, BindingFailure> wasmToJS(VM* vm > case I64: > RELEASE_ASSERT_NOT_REACHED(); // Handled above. > case Anyref: >- case Anyfunc: >+ case Funcref: > case I32: { > GPRReg gprReg; > if (marshalledGPRs < wasmCC.m_gprArgs.size()) >@@ -450,7 +450,7 @@ Expected<MacroAssemblerCodeRef<WasmEntryPtrTag>, BindingFailure> wasmToJS(VM* vm > case I64: > RELEASE_ASSERT_NOT_REACHED(); // Handled above. > case Anyref: >- case Anyfunc: >+ case Funcref: > case I32: > // Skipped: handled above. > if (marshalledGPRs >= wasmCC.m_gprArgs.size()) >@@ -558,7 +558,7 @@ Expected<MacroAssemblerCodeRef<WasmEntryPtrTag>, BindingFailure> wasmToJS(VM* vm > done.link(&jit); > break; > } >- case Anyfunc: >+ case Funcref: > case Anyref: > break; > case F32: { >diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp b/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp >index d89715042605d73e3c7b4532b6399704c3f93558..63207151ceeb2ce4bd51b0318841617b86b93e34 100644 >--- a/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp >+++ b/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp >@@ -84,9 +84,9 @@ static EncodedJSValue JSC_HOST_CALL callWebAssemblyFunction(ExecState* exec) > case Wasm::I32: > arg = JSValue::decode(arg.toInt32(exec)); > break; >- case Wasm::Anyfunc: { >+ case Wasm::Funcref: { > if (!isWebAssemblyHostFunction(vm, arg) && !arg.isNull()) >- return JSValue::encode(throwException(exec, scope, createJSWebAssemblyRuntimeError(exec, vm, "Anyfunc must be an exported wasm function"))); >+ return JSValue::encode(throwException(exec, scope, createJSWebAssemblyRuntimeError(exec, vm, "Funcref must be an exported wasm function"))); > break; > } > case Wasm::Anyref: >@@ -232,7 +232,7 @@ MacroAssemblerCodePtr<JSEntryPtrTag> WebAssemblyFunction::jsCallEntrypointSlow() > argumentsIncludeI64 = true; > break; > case Wasm::Anyref: >- case Wasm::Anyfunc: >+ case Wasm::Funcref: > case Wasm::I32: > if (numGPRs >= Wasm::wasmCallingConvention().m_gprArgs.size()) > totalFrameSize += sizeof(CPURegister); >@@ -308,7 +308,7 @@ MacroAssemblerCodePtr<JSEntryPtrTag> WebAssemblyFunction::jsCallEntrypointSlow() > ++numGPRs; > } > break; >- case Wasm::Anyfunc: { >+ case Wasm::Funcref: { > // FIXME: Emit this inline <https://bugs.webkit.org/show_bug.cgi?id=198506>. > bool (*shouldThrow)(Wasm::Instance*, JSValue) = [] (Wasm::Instance* wasmInstance, JSValue arg) -> bool { > JSWebAssemblyInstance* instance = wasmInstance->owner<JSWebAssemblyInstance>(); >@@ -492,7 +492,7 @@ MacroAssemblerCodePtr<JSEntryPtrTag> WebAssemblyFunction::jsCallEntrypointSlow() > isNaN.link(&jit); > break; > } >- case Wasm::Anyfunc: >+ case Wasm::Funcref: > case Wasm::Anyref: > break; > case Wasm::I64: >diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp b/Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp >index 052d085896895b9d942b4890beb35609ab735f7f..a74423aaa768099e9e5bd2c91b2a9b7d9ef1bd60 100644 >--- a/Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp >+++ b/Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp >@@ -237,7 +237,7 @@ void WebAssemblyModuleRecord::link(ExecState* exec, JSValue, JSObject* importObj > return exception(createJSWebAssemblyLinkError(exec, vm, importFailMessage(import, "imported global", "must be a number"))); > // iii. Append ToWebAssemblyValue(v) to imports. > switch (moduleInformation.globals[import.kindIndex].type) { >- case Wasm::Anyfunc: >+ case Wasm::Funcref: > if (!isWebAssemblyHostFunction(vm, value) && !value.isNull()) > return exception(createJSWebAssemblyLinkError(exec, vm, importFailMessage(import, "imported global", "must be a wasm exported function or null"))); > m_instance->instance().setGlobal(import.kindIndex, value); >@@ -410,7 +410,7 @@ void WebAssemblyModuleRecord::link(ExecState* exec, JSValue, JSObject* importObj > // Return ToJSValue(v). > switch (global.type) { > case Wasm::Anyref: >- case Wasm::Anyfunc: >+ case Wasm::Funcref: > exportedValue = JSValue::decode(m_instance->instance().loadI64Global(exp.kindIndex)); > break; > >diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp b/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp >index ca8260a68e50abb88b42fe71d1a76cdde7d7676d..191e204a6aef04e2520b9784f8c27f326fab5513 100644 >--- a/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp >+++ b/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp >@@ -65,12 +65,12 @@ static EncodedJSValue JSC_HOST_CALL constructJSWebAssemblyTable(ExecState* exec) > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); > String elementString = elementValue.toWTFString(exec); > RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); >- if (elementString == "anyfunc") >+ if (elementString == "funcref" || elementString == "anyfunc") > type = Wasm::TableElementType::Funcref; > else if (elementString == "anyref") > type = Wasm::TableElementType::Anyref; > else >- return JSValue::encode(throwException(exec, throwScope, createTypeError(exec, "WebAssembly.Table expects its 'element' field to be the string 'anyfunc' or 'anyref'"_s))); >+ return JSValue::encode(throwException(exec, throwScope, createTypeError(exec, "WebAssembly.Table expects its 'element' field to be the string 'funcref' or 'anyref'"_s))); > } > > Identifier initialIdent = Identifier::fromString(&vm, "initial"); >diff --git a/Source/JavaScriptCore/wasm/wasm.json b/Source/JavaScriptCore/wasm/wasm.json >index 0d280ecd9944f742a82280eca6f56cab059733b1..7686d33c5fe0f4bbc9ce40913323f4bc05745597 100644 >--- a/Source/JavaScriptCore/wasm/wasm.json >+++ b/Source/JavaScriptCore/wasm/wasm.json >@@ -11,14 +11,14 @@ > "i64": { "type": "varint7", "value": -2, "b3type": "B3::Int64" }, > "f32": { "type": "varint7", "value": -3, "b3type": "B3::Float" }, > "f64": { "type": "varint7", "value": -4, "b3type": "B3::Double" }, >- "anyfunc": { "type": "varint7", "value": -16, "b3type": "B3::Int64" }, >+ "funcref": { "type": "varint7", "value": -16, "b3type": "B3::Int64" }, > "anyref": { "type": "varint7", "value": -17, "b3type": "B3::Int64" }, > "func": { "type": "varint7", "value": -32, "b3type": "B3::Void" }, > "void": { "type": "varint7", "value": -64, "b3type": "B3::Void" } > }, >- "value_type": ["i32", "i64", "f32", "f64", "anyref", "anyfunc"], >- "block_type": ["i32", "i64", "f32", "f64", "void", "anyref", "anyfunc"], >- "elem_type": ["anyfunc","anyref"], >+ "value_type": ["i32", "i64", "f32", "f64", "anyref", "funcref"], >+ "block_type": ["i32", "i64", "f32", "f64", "void", "anyref", "funcref"], >+ "elem_type": ["funcref","anyref"], > "external_kind": { > "Function": { "type": "uint8", "value": 0 }, > "Table": { "type": "uint8", "value": 1 }, >@@ -59,9 +59,9 @@ > "i64.const": { "category": "special", "value": 66, "return": ["i64"], "parameter": [], "immediate": [{"name": "value", "type": "varint64"}], "description": "a constant value interpreted as i64" }, > "f64.const": { "category": "special", "value": 68, "return": ["f64"], "parameter": [], "immediate": [{"name": "value", "type": "double"}], "description": "a constant value interpreted as f64" }, > "f32.const": { "category": "special", "value": 67, "return": ["f32"], "parameter": [], "immediate": [{"name": "value", "type": "float"}], "description": "a constant value interpreted as f32" }, >- "ref.null": { "category": "special", "value": 208, "return": ["anyfunc"], "parameter": [], "immediate": [], "description": "a constant null reference" }, >+ "ref.null": { "category": "special", "value": 208, "return": ["funcref"], "parameter": [], "immediate": [], "description": "a constant null reference" }, > "ref.is_null": { "category": "special", "value": 209, "return": ["i32"], "parameter": ["anyref"], "immediate": [], "description": "determine if a reference is null" }, >- "ref.func": { "category": "special", "value": 210, "return": ["anyfunc"], "parameter": [], "immediate": [{"name": "function_index", "type": "varuint32"}], "description": "return a reference to the function at the given index" }, >+ "ref.func": { "category": "special", "value": 210, "return": ["funcref"], "parameter": [], "immediate": [{"name": "function_index", "type": "varuint32"}], "description": "return a reference to the function at the given index" }, > "get_local": { "category": "special", "value": 32, "return": ["any"], "parameter": [], "immediate": [{"name": "local_index", "type": "varuint32"}], "description": "read a local variable or parameter" }, > "set_local": { "category": "special", "value": 33, "return": [], "parameter": ["any"], "immediate": [{"name": "local_index", "type": "varuint32"}], "description": "write a local variable or parameter" }, > "tee_local": { "category": "special", "value": 34, "return": ["any"], "parameter": ["any"], "immediate": [{"name": "local_index", "type": "varuint32"}], "description": "write a local variable or parameter and return the same value" }, >diff --git a/JSTests/ChangeLog b/JSTests/ChangeLog >index f9e51b6639bbbbd2e284fb145103faaaf803f81d..72f3150f2da13277894e36ba7be70980f8986d54 100644 >--- a/JSTests/ChangeLog >+++ b/JSTests/ChangeLog >@@ -1,3 +1,99 @@ >+2019-06-18 Justin Michaud <justin_michaud@apple.com> >+ >+ [WASM-References] Rename anyfunc to funcref >+ https://bugs.webkit.org/show_bug.cgi?id=198983 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * wasm/function-tests/basic-element.js: >+ * wasm/function-tests/context-switch.js: >+ (import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.makeInstance): >+ (makeInstance): >+ (assert.eq.makeInstance): >+ * wasm/function-tests/exceptions.js: >+ (import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.makeInstance): >+ * wasm/function-tests/grow-memory-2.js: >+ (assert.eq.instance.exports.foo): >+ * wasm/function-tests/nameSection.js: >+ (const.compile): >+ * wasm/function-tests/stack-overflow.js: >+ (import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.makeInstance): >+ (assertOverflows.makeInstance): >+ * wasm/function-tests/table-basic-2.js: >+ (import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.makeInstance): >+ * wasm/function-tests/table-basic.js: >+ (import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.makeInstance): >+ * wasm/function-tests/trap-from-start-async.js: >+ * wasm/function-tests/trap-from-start.js: >+ * wasm/js-api/Module.exports.js: >+ (assert.truthy): >+ * wasm/js-api/Module.imports.js: >+ (assert.truthy): >+ * wasm/js-api/call-indirect.js: >+ (const.oneTable): >+ (const.multiTable): >+ (multiTable.const.makeTable): >+ (multiTable): >+ (multiTable.Polyphic2Import): >+ (multiTable.VirtualImport): >+ * wasm/js-api/element-data.js: >+ * wasm/js-api/element.js: >+ (assert.throws.new.WebAssembly.Module.builder.WebAssembly): >+ (assert.throws): >+ (badInstantiation.makeModule): >+ (badInstantiation.test): >+ (badInstantiation): >+ * wasm/js-api/extension-MemoryMode.js: >+ * wasm/js-api/table.js: >+ (new.WebAssembly.Module): >+ (assert.throws): >+ (assertBadTableImport): >+ (assert.throws.WebAssembly.Table.prototype.grow): >+ (new.WebAssembly.Table): >+ (assertBadTable): >+ (assert.truthy): >+ * wasm/js-api/test_basic_api.js: >+ (const.c.in.constructorProperties.switch): >+ * wasm/js-api/unique-signature.js: >+ (CallIndirectWithDuplicateSignatures): >+ * wasm/js-api/wrapper-function.js: >+ * wasm/modules/table.wat: >+ * wasm/modules/wasm-imports-js-re-exports-wasm-exports/imports.wat: >+ * wasm/modules/wasm-imports-js-re-exports-wasm-exports/sum.wat: >+ * wasm/modules/wasm-imports-wasm-exports/imports.wat: >+ * wasm/modules/wasm-imports-wasm-exports/sum.wat: >+ * wasm/references/anyref_table.js: >+ * wasm/references/anyref_table_import.js: >+ (doSet): >+ (assert.throws): >+ * wasm/references/func_ref.js: >+ (makeFuncrefIdent): >+ (assert.eq.instance.exports.fix): >+ (GetLocal.0.I32Const.0.TableSet.0.End.End.WebAssembly.assert.throws): >+ (GetLocal.0.I32Const.0.TableSet.0.End.End.WebAssembly): >+ (let.importedFun.of): >+ (makeAnyfuncIdent): Deleted. >+ (makeAnyfuncIdent.fun): Deleted. >+ * wasm/references/multitable.js: >+ (assert.eq): >+ (assert.throws): >+ * wasm/references/table_misc.js: >+ (GetLocal.0.TableFill.0.End.End.WebAssembly): >+ * wasm/references/validation.js: >+ (assert.throws.new.WebAssembly.Module.bin): >+ (assert.throws): >+ * wasm/spec-harness/index.js: >+ * wasm/spec-harness/wasm-constants.js: >+ * wasm/spec-harness/wasm-module-builder.js: >+ (WasmModuleBuilder.prototype.toArray): >+ * wasm/spec-harness/wast.js: >+ (elem_type): >+ (string_of_elem_type): >+ (string_of_table_type): >+ * wasm/spec-tests/jsapi.js: >+ * wasm/stress/wasm-table-grow-initialize.js: >+ * wasm/wasm.json: >+ > 2019-06-18 Justin Michaud <justin_michaud@apple.com> > > [WASM-References] Add support for Table.size, grow and fill instructions >diff --git a/JSTests/wasm/function-tests/basic-element.js b/JSTests/wasm/function-tests/basic-element.js >index 114f3c814c06aa5d1be516c6217e24971211a290..3f5ddeca314e1f9b6c73b658def81c8b712cff9d 100644 >--- a/JSTests/wasm/function-tests/basic-element.js >+++ b/JSTests/wasm/function-tests/basic-element.js >@@ -2,7 +2,7 @@ import Builder from '../Builder.js'; > import * as assert from '../assert.js'; > > >-const tableDescription = {initial: 1, element: "anyfunc"}; >+const tableDescription = {initial: 1, element: "funcref"}; > const builder = new Builder() > .Type().End() > .Import() >diff --git a/JSTests/wasm/function-tests/context-switch.js b/JSTests/wasm/function-tests/context-switch.js >index 0595e6d9eecba8850c6b6c3ce21e0eb1adefa4da..7230a7c68941aee5a3320acef244c99648f7f227 100644 >--- a/JSTests/wasm/function-tests/context-switch.js >+++ b/JSTests/wasm/function-tests/context-switch.js >@@ -3,7 +3,7 @@ import * as assert from '../assert.js' > > { > function makeInstance() { >- const tableDescription = {initial: 1, element: "anyfunc"}; >+ const tableDescription = {initial: 1, element: "funcref"}; > const builder = new Builder() > .Type() > .Func([], "void") >@@ -82,7 +82,7 @@ import * as assert from '../assert.js' > > { > function makeInstance() { >- const tableDescription = {initial: 1, element: "anyfunc"}; >+ const tableDescription = {initial: 1, element: "funcref"}; > const builder = new Builder() > .Type() > .Func(["i32"], "void") >@@ -171,7 +171,7 @@ import * as assert from '../assert.js' > > { > function makeInstance() { >- const tableDescription = {initial: 1, element: "anyfunc"}; >+ const tableDescription = {initial: 1, element: "funcref"}; > const builder = new Builder() > .Type() > .Func(["i32"], "void") >diff --git a/JSTests/wasm/function-tests/exceptions.js b/JSTests/wasm/function-tests/exceptions.js >index 952513f265a3f06f9c679333aaefd4a976da9972..86384377b33c4cde4b86e201ad42a5c8f6e497be 100644 >--- a/JSTests/wasm/function-tests/exceptions.js >+++ b/JSTests/wasm/function-tests/exceptions.js >@@ -2,7 +2,7 @@ import Builder from '../Builder.js' > import * as assert from '../assert.js' > > function makeInstance() { >- const tableDescription = {initial: 1, element: "anyfunc"}; >+ const tableDescription = {initial: 1, element: "funcref"}; > const builder = new Builder() > .Type() > .Func(["i32", "i32"], "i32") >diff --git a/JSTests/wasm/function-tests/grow-memory-2.js b/JSTests/wasm/function-tests/grow-memory-2.js >index fba01318f8a4f9879f522e7f188d7332493b1143..714c67553016db37f711f24240f75708fc349cca 100644 >--- a/JSTests/wasm/function-tests/grow-memory-2.js >+++ b/JSTests/wasm/function-tests/grow-memory-2.js >@@ -37,7 +37,7 @@ import * as assert from '../assert.js'; > > { > const memoryDescription = {initial: 0, maximum: 2}; >- const tableDescription = {initial: 1, maximum: 1, element: "anyfunc"}; >+ const tableDescription = {initial: 1, maximum: 1, element: "funcref"}; > const builder = (new Builder()) > .Type() > .Func([], "void") >diff --git a/JSTests/wasm/function-tests/nameSection.js b/JSTests/wasm/function-tests/nameSection.js >index d4dcd35976905b1736684d8a5fedc4815f2b3174..6805e689f5c879e2ca509c88d3e7b376de09faaa 100644 >--- a/JSTests/wasm/function-tests/nameSection.js >+++ b/JSTests/wasm/function-tests/nameSection.js >@@ -38,7 +38,7 @@ const compile = (location, importObject = {}) => { > if (typeof importObject[imp.module][imp.name] === "undefined") { > switch (imp.kind) { > case "function": importObject[imp.module][imp.name] = () => {}; break; >- case "table": importObject[imp.module][imp.name] = new WebAssembly.Table({ initial: 6, maximum: 6, element: "anyfunc" }); break; >+ case "table": importObject[imp.module][imp.name] = new WebAssembly.Table({ initial: 6, maximum: 6, element: "funcref" }); break; > case "memory": importObject[imp.module][imp.name] = new WebAssembly.Memory({ initial: 16777216 / (64 * 1024), maximum: 16777216 / (64 * 1024) }); break; > case "global": importObject[imp.module][imp.name] = 0; break; > } >diff --git a/JSTests/wasm/function-tests/stack-overflow.js b/JSTests/wasm/function-tests/stack-overflow.js >index cfbb5eed4649a5ae45cb5e34b122342086fc076d..2578fda22b35c306ca174674e489a16d4c0d8fc6 100644 >--- a/JSTests/wasm/function-tests/stack-overflow.js >+++ b/JSTests/wasm/function-tests/stack-overflow.js >@@ -3,7 +3,7 @@ import * as assert from '../assert.js' > > { > function makeInstance() { >- const tableDescription = {initial: 1, element: "anyfunc"}; >+ const tableDescription = {initial: 1, element: "funcref"}; > const builder = new Builder() > .Type() > .Func(["i32"], "void") >@@ -57,7 +57,7 @@ import * as assert from '../assert.js' > > { > function makeInstance() { >- const tableDescription = {initial: 1, element: "anyfunc"}; >+ const tableDescription = {initial: 1, element: "funcref"}; > const builder = new Builder() > .Type() > .Func([], "void") >diff --git a/JSTests/wasm/function-tests/table-basic-2.js b/JSTests/wasm/function-tests/table-basic-2.js >index 27361f4939b9c1131991646d07ef612c384c3c7a..19a632a7fdbcbb8e5d3716aa4bf023d4af0a22bc 100644 >--- a/JSTests/wasm/function-tests/table-basic-2.js >+++ b/JSTests/wasm/function-tests/table-basic-2.js >@@ -8,7 +8,7 @@ function makeInstance(func) { > .Func(["i32"], "i32") > .End() > .Import() >- .Table("imp", "table", {initial: 20, element: "anyfunc"}) >+ .Table("imp", "table", {initial: 20, element: "funcref"}) > .Function("imp", "func", { params: ["i32"], ret: "i32" }) > .End() > .Function().End() >@@ -33,7 +33,7 @@ function makeInstance(func) { > > const bin = builder.WebAssembly().get(); > const module = new WebAssembly.Module(bin); >- const table = new WebAssembly.Table({initial: 20, element: "anyfunc"}); >+ const table = new WebAssembly.Table({initial: 20, element: "funcref"}); > return {instance: new WebAssembly.Instance(module, {imp: {table, func}}), table}; > } > >diff --git a/JSTests/wasm/function-tests/table-basic.js b/JSTests/wasm/function-tests/table-basic.js >index 0ff3b4766423d372e5b9723dd2d7c83d8ff4284c..47956d3e2b205a5ea6443053cca2c0073631496c 100644 >--- a/JSTests/wasm/function-tests/table-basic.js >+++ b/JSTests/wasm/function-tests/table-basic.js >@@ -8,7 +8,7 @@ function makeInstance() { > .Func(["i32"], "i32") > .End() > .Import() >- .Table("imp", "table", {initial: 20, element: "anyfunc"}) >+ .Table("imp", "table", {initial: 20, element: "funcref"}) > .End() > .Function().End() > .Export() >@@ -33,7 +33,7 @@ function makeInstance() { > > const bin = builder.WebAssembly().get(); > const module = new WebAssembly.Module(bin); >- const table = new WebAssembly.Table({initial: 20, element: "anyfunc"}); >+ const table = new WebAssembly.Table({initial: 20, element: "funcref"}); > return {instance: new WebAssembly.Instance(module, {imp: {table}}), table}; > } > >diff --git a/JSTests/wasm/function-tests/trap-from-start-async.js b/JSTests/wasm/function-tests/trap-from-start-async.js >index 83c7f8921a79fd06fedc7603983b6fd2a6aa6eec..b03b2fe886c88d18b9e3a9e63d84de3168a957b6 100644 >--- a/JSTests/wasm/function-tests/trap-from-start-async.js >+++ b/JSTests/wasm/function-tests/trap-from-start-async.js >@@ -2,7 +2,7 @@ import * as assert from '../assert.js'; > import Builder from '../Builder.js'; > > const memoryInfo = { initial: 2 }; >-const tableInfo = { element: "anyfunc", initial: 8 }; >+const tableInfo = { element: "funcref", initial: 8 }; > > async function StartTrapsAsync() { > const builder = (new Builder()) >diff --git a/JSTests/wasm/function-tests/trap-from-start.js b/JSTests/wasm/function-tests/trap-from-start.js >index ea5a0ac716c04acd911c01547841df0cc9828bfa..d7cc0dd9bda7c7675fb5cba576d4e7c0f80c2730 100644 >--- a/JSTests/wasm/function-tests/trap-from-start.js >+++ b/JSTests/wasm/function-tests/trap-from-start.js >@@ -2,7 +2,7 @@ import * as assert from '../assert.js'; > import Builder from '../Builder.js'; > > const memoryInfo = { initial: 2 }; >-const tableInfo = { element: "anyfunc", initial: 8 }; >+const tableInfo = { element: "funcref", initial: 8 }; > > (function StartTraps() { > const builder = (new Builder()) >diff --git a/JSTests/wasm/js-api/Module.exports.js b/JSTests/wasm/js-api/Module.exports.js >index 76e3fd3fa5c0ea2c66c64db49564b3115e0af59d..777fd06197b3c53d02eaa503e56c4a6b8619ba80 100644 >--- a/JSTests/wasm/js-api/Module.exports.js >+++ b/JSTests/wasm/js-api/Module.exports.js >@@ -17,7 +17,7 @@ assert.eq(WebAssembly.Module.exports.length, 1); > .Type().End() > .Function().End() > .Table() >- .Table({initial: 20, maximum: 30, element: "anyfunc"}) >+ .Table({initial: 20, maximum: 30, element: "funcref"}) > .End() > .Memory().InitialMaxPages(1, 1).End() > .Global().I32(42, "immutable").End() >diff --git a/JSTests/wasm/js-api/Module.imports.js b/JSTests/wasm/js-api/Module.imports.js >index 1fc2dd56b7a706ef9db7d40c1a42dc18d6bb4f33..b991c626502bcdde7fc56924984e76e8b0803b82 100644 >--- a/JSTests/wasm/js-api/Module.imports.js >+++ b/JSTests/wasm/js-api/Module.imports.js >@@ -17,7 +17,7 @@ assert.eq(WebAssembly.Module.imports.length, 1); > .Type().End() > .Import() > .Function("fooFunction", "barFunction", { params: [] }) >- .Table("fooTable", "barTable", {initial: 20, element: "anyfunc"}) >+ .Table("fooTable", "barTable", {initial: 20, element: "funcref"}) > .Memory("fooMemory", "barMemory", {initial: 20}) > .Global().I32("fooGlobal", "barGlobal", "immutable").End() > .End() >diff --git a/JSTests/wasm/js-api/call-indirect.js b/JSTests/wasm/js-api/call-indirect.js >index 2fafcc192b120539c7aa4551d443daae7bd81972..1545484984b2475a1579864955dbe20e43904d52 100644 >--- a/JSTests/wasm/js-api/call-indirect.js >+++ b/JSTests/wasm/js-api/call-indirect.js >@@ -6,7 +6,7 @@ const oneTable = () => { > .Type().End() > .Import() > .Function("imp", "func", { params: ["i32"] }) >- .Table("imp", "table", { initial: 1, maximum: 1, element: "anyfunc"}) >+ .Table("imp", "table", { initial: 1, maximum: 1, element: "funcref"}) > .End() > .Function().End() > .Export() >@@ -36,8 +36,8 @@ const multiTable = () => { > .Type().End() > .Import() > .Function("imp", "func", { params: ["i32"] }) >- .Table("imp", "table0", { initial: 0, maximum: 0, element: "anyfunc"}) >- .Table("imp", "table", { initial: 1, maximum: 1, element: "anyfunc"}) >+ .Table("imp", "table0", { initial: 0, maximum: 0, element: "funcref"}) >+ .Table("imp", "table", { initial: 1, maximum: 1, element: "funcref"}) > .End() > .Function().End() > .Export() >@@ -65,7 +65,7 @@ const multiTable = () => { > for (const wasmModuleWhichImportJS of [oneTable, multiTable]) { > > const makeTable = () => { >- return new WebAssembly.Table({initial: 1, maximum: 1, element: "anyfunc"}); >+ return new WebAssembly.Table({initial: 1, maximum: 1, element: "funcref"}); > }; > > (function MonomorphicImport() { >@@ -73,7 +73,7 @@ const makeTable = () => { > const counterSetter = v => counter = v; > const table = makeTable(); > const module = wasmModuleWhichImportJS(); >- const instance = new WebAssembly.Instance(module, { imp: { func: counterSetter, table, table0: new WebAssembly.Table({initial: 0, maximum: 0, element: "anyfunc"}) } }); >+ const instance = new WebAssembly.Instance(module, { imp: { func: counterSetter, table, table0: new WebAssembly.Table({initial: 0, maximum: 0, element: "funcref"}) } }); > table.set(0, instance.exports.callFunc); > for (let i = 0; i < 4096; ++i) { > // Invoke this a bunch of times to make sure the IC in the wasm -> JS stub works correctly. >@@ -90,11 +90,11 @@ const makeTable = () => { > const module = wasmModuleWhichImportJS(); > > const tableA = makeTable(); >- const instanceA = new WebAssembly.Instance(module, { imp: { func: counterASetter, table: tableA, table0: new WebAssembly.Table({initial: 0, maximum: 0, element: "anyfunc"}) } }); >+ const instanceA = new WebAssembly.Instance(module, { imp: { func: counterASetter, table: tableA, table0: new WebAssembly.Table({initial: 0, maximum: 0, element: "funcref"}) } }); > tableA.set(0, instanceA.exports.callFunc); > > const tableB = makeTable(); >- const instanceB = new WebAssembly.Instance(module, { imp: { func: counterBSetter, table: tableB, table0: new WebAssembly.Table({initial: 0, maximum: 0, element: "anyfunc"}) } }); >+ const instanceB = new WebAssembly.Instance(module, { imp: { func: counterBSetter, table: tableB, table0: new WebAssembly.Table({initial: 0, maximum: 0, element: "funcref"}) } }); > tableB.set(0, instanceB.exports.callFunc); > for (let i = 0; i < 2048; ++i) { > instanceA.exports.changeCounter(i, 0); >@@ -126,7 +126,7 @@ const makeTable = () => { > let instances = []; > for (let i = 0; i < num; ++i) { > let table = makeTable(); >- instances[i] = new WebAssembly.Instance(module, { imp: { func: counterSetters[i], table, table0: new WebAssembly.Table({initial: 0, maximum: 0, element: "anyfunc"}) } }); >+ instances[i] = new WebAssembly.Instance(module, { imp: { func: counterSetters[i], table, table0: new WebAssembly.Table({initial: 0, maximum: 0, element: "funcref"}) } }); > table.set(0, instances[i].exports.callFunc); > } > for (let i = 0; i < 2048; ++i) { >diff --git a/JSTests/wasm/js-api/element-data.js b/JSTests/wasm/js-api/element-data.js >index cb43f4f1ff4492a7be2f4ff6468f1f45af33f176..49f2867002dfba26b0cd012d912a4ef765ea816c 100644 >--- a/JSTests/wasm/js-api/element-data.js >+++ b/JSTests/wasm/js-api/element-data.js >@@ -10,7 +10,7 @@ const memoryDescription = { initial: memSizeInPages, maximum: memSizeInPages }; > .Type().End() > .Import() > .Memory("imp", "memory", memoryDescription) >- .Table("imp", "table", {element: "anyfunc", initial: 19}) // unspecified maximum. >+ .Table("imp", "table", {element: "funcref", initial: 19}) // unspecified maximum. > .End() > .Function().End() > .Element() >@@ -30,7 +30,7 @@ const memoryDescription = { initial: memSizeInPages, maximum: memSizeInPages }; > const bin = builder.WebAssembly().get(); > const module = new WebAssembly.Module(bin); > const memory = new WebAssembly.Memory(memoryDescription); >- const table = new WebAssembly.Table({element: "anyfunc", initial: 19}); >+ const table = new WebAssembly.Table({element: "funcref", initial: 19}); > const imports = { > imp: { > memory: memory, >diff --git a/JSTests/wasm/js-api/element.js b/JSTests/wasm/js-api/element.js >index fcbe2827f371663aa84fdf5c10100b8178177390..acf99f8c3e226826df5c60114cb37ba9cb244846 100644 >--- a/JSTests/wasm/js-api/element.js >+++ b/JSTests/wasm/js-api/element.js >@@ -27,7 +27,7 @@ import * as assert from '../assert.js'; > .Type().End() > .Function().End() > .Table() >- .Table({element: "anyfunc", initial: 20}) >+ .Table({element: "funcref", initial: 20}) > .End() > .Element() > .Element({tableIndex: 1, offset: 0, functionIndices: [0]}) >@@ -50,7 +50,7 @@ import * as assert from '../assert.js'; > .Type().End() > .Function().End() > .Table() >- .Table({element: "anyfunc", initial: 20, maximum: 20}) >+ .Table({element: "funcref", initial: 20, maximum: 20}) > .End() > .Element() > .Element({offset: 19, functionIndices: [0, 0]}) >@@ -74,7 +74,7 @@ import * as assert from '../assert.js'; > .Type().End() > .Function().End() > .Table() >- .Table({element: "anyfunc", initial: 20, maximum: 20}) >+ .Table({element: "funcref", initial: 20, maximum: 20}) > .End() > .Element() > .Element({offset: 20, functionIndices: [0]}) >@@ -98,7 +98,7 @@ import * as assert from '../assert.js'; > .Type().End() > .Function().End() > .Table() >- .Table({element: "anyfunc", initial: 20, maximum: 20}) >+ .Table({element: "funcref", initial: 20, maximum: 20}) > .End() > .Element() > .Element({offset: 0, functionIndices: [0, 0, 1]}) >@@ -121,7 +121,7 @@ import * as assert from '../assert.js'; > const builder = new Builder() > .Type().End() > .Import() >- .Table("imp", "table", {element: "anyfunc", initial: 19}) // unspecified maximum. >+ .Table("imp", "table", {element: "funcref", initial: 19}) // unspecified maximum. > .End() > .Function().End() > .Element() >@@ -142,7 +142,7 @@ import * as assert from '../assert.js'; > } > > for (let i = 19; i < 19 + 5; i++) { >- const table = new WebAssembly.Table({element: "anyfunc", initial: i}); >+ const table = new WebAssembly.Table({element: "funcref", initial: i}); > badInstantiation(table, WebAssembly.LinkError, "Element is trying to set an out of bounds table index (evaluating 'new WebAssembly.Instance(module, {imp: {table: actualTable}})')"); > } > } >@@ -152,7 +152,7 @@ import * as assert from '../assert.js'; > const builder = new Builder() > .Type().End() > .Import() >- .Table("imp", "table", {element: "anyfunc", initial: 19}) // unspecified maximum. >+ .Table("imp", "table", {element: "funcref", initial: 19}) // unspecified maximum. > .Global().I32("imp", "global", "immutable").End() > .End() > .Function().End() >@@ -173,7 +173,7 @@ import * as assert from '../assert.js'; > } > > function test(i) { >- const table = new WebAssembly.Table({element: "anyfunc", initial: 19}); >+ const table = new WebAssembly.Table({element: "funcref", initial: 19}); > const global = i; > const module = makeModule(); > const instance = new WebAssembly.Instance(module, {imp: {table, global}}); >@@ -195,7 +195,7 @@ import * as assert from '../assert.js'; > const builder = new Builder() > .Type().End() > .Import() >- .Table("imp", "table", {element: "anyfunc", initial: 19}) // unspecified maximum. >+ .Table("imp", "table", {element: "funcref", initial: 19}) // unspecified maximum. > .Global().F32("imp", "global", "immutable").End() > .End() > .Function().End() >diff --git a/JSTests/wasm/js-api/extension-MemoryMode.js b/JSTests/wasm/js-api/extension-MemoryMode.js >index 5608526bc2fa905203e274c42a6d6be2e161b443..2f13b2c1da3ce12bbda7ee12bbe3d71080744fd4 100644 >--- a/JSTests/wasm/js-api/extension-MemoryMode.js >+++ b/JSTests/wasm/js-api/extension-MemoryMode.js >@@ -18,7 +18,7 @@ assert.throws(() => WebAssemblyMemoryMode(1), TypeError, message); > assert.throws(() => WebAssemblyMemoryMode(""), TypeError, message); > assert.throws(() => WebAssemblyMemoryMode({}), TypeError, message); > assert.throws(() => WebAssemblyMemoryMode(new WebAssembly.Module(emptyModuleArray)), TypeError, message); >-assert.throws(() => WebAssemblyMemoryMode(new WebAssembly.Table({initial: 1, element: "anyfunc"})), TypeError, message); >+assert.throws(() => WebAssemblyMemoryMode(new WebAssembly.Table({initial: 1, element: "funcref"})), TypeError, message); > > const validateMode = what => { > const mode = WebAssemblyMemoryMode(what); >diff --git a/JSTests/wasm/js-api/table.js b/JSTests/wasm/js-api/table.js >index 1b844431ce65f91c4375325d5cae53dc8bc243c7..aa67d20f61c818e75b5a1fedc8764995f17a23fd 100644 >--- a/JSTests/wasm/js-api/table.js >+++ b/JSTests/wasm/js-api/table.js >@@ -5,11 +5,11 @@ import * as assert from '../assert.js'; > const builder = new Builder() > .Type().End() > .Import() >- .Table("imp", "table", {initial: 20, element: "anyfunc"}) >+ .Table("imp", "table", {initial: 20, element: "funcref"}) > .End() > .Function().End() > .Table() >- .Table({initial: 20, maximum: 30, element: "anyfunc"}) >+ .Table({initial: 20, maximum: 30, element: "funcref"}) > .End() > .Code() > .End(); >@@ -33,8 +33,8 @@ import * as assert from '../assert.js'; > .Type().End() > .Function().End() > .Table() >- .Table({initial: 20, maximum: 30, element: "anyfunc"}) >- .Table({initial: 20, maximum: 30, element: "anyfunc"}) >+ .Table({initial: 20, maximum: 30, element: "funcref"}) >+ .Table({initial: 20, maximum: 30, element: "funcref"}) > .End() > .Code() > .End(); >@@ -62,7 +62,7 @@ import * as assert from '../assert.js'; > .Type().End() > .Function().End() > .Table() >- .Table({initial:20, element:"anyfunc"}) >+ .Table({initial:20, element:"funcref"}) > .End() > .Export() > .Function("foo") >@@ -81,8 +81,8 @@ import * as assert from '../assert.js'; > .Type().End() > .Function().End() > .Table() >- .Table({initial:20, element:"anyfunc"}) >- .Table({initial:20, element:"anyfunc"}) >+ .Table({initial:20, element:"funcref"}) >+ .Table({initial:20, element:"funcref"}) > .End() > .Export() > .Function("foo") >@@ -116,7 +116,7 @@ import * as assert from '../assert.js'; > .Type().End() > .Function().End() > .Table() >- .Table({initial: 20, maximum: 30, element: "anyfunc"}) >+ .Table({initial: 20, maximum: 30, element: "funcref"}) > .End() > .Export() > .Table("foo", 1) >@@ -153,40 +153,40 @@ function assertBadTableImport(tableDescription, message) { > { > let badDescriptions = [ > [{initial: 10, element: "i32"}, >- "WebAssembly.Module doesn't parse at byte 18: Table type should be anyfunc or anyref, got -1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", >- "WebAssembly.Module doesn't parse at byte 26: Table type should be anyfunc or anyref, got -1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], >+ "WebAssembly.Module doesn't parse at byte 18: Table type should be funcref or anyref, got -1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", >+ "WebAssembly.Module doesn't parse at byte 26: Table type should be funcref or anyref, got -1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], > [{initial: 10, element: "f32"}, >- "WebAssembly.Module doesn't parse at byte 18: Table type should be anyfunc or anyref, got -3 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", >- "WebAssembly.Module doesn't parse at byte 26: Table type should be anyfunc or anyref, got -3 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], >+ "WebAssembly.Module doesn't parse at byte 18: Table type should be funcref or anyref, got -3 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", >+ "WebAssembly.Module doesn't parse at byte 26: Table type should be funcref or anyref, got -3 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], > [{initial: 10, element: "f64"}, >- "WebAssembly.Module doesn't parse at byte 18: Table type should be anyfunc or anyref, got -4 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", >- "WebAssembly.Module doesn't parse at byte 26: Table type should be anyfunc or anyref, got -4 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], >+ "WebAssembly.Module doesn't parse at byte 18: Table type should be funcref or anyref, got -4 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", >+ "WebAssembly.Module doesn't parse at byte 26: Table type should be funcref or anyref, got -4 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], > [{initial: 10, element: "i64"}, >- "WebAssembly.Module doesn't parse at byte 18: Table type should be anyfunc or anyref, got -2 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", >- "WebAssembly.Module doesn't parse at byte 26: Table type should be anyfunc or anyref, got -2 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], >+ "WebAssembly.Module doesn't parse at byte 18: Table type should be funcref or anyref, got -2 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", >+ "WebAssembly.Module doesn't parse at byte 26: Table type should be funcref or anyref, got -2 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], > [{initial: 10, maximum: 20, element: "i32"}, >- "WebAssembly.Module doesn't parse at byte 18: Table type should be anyfunc or anyref, got -1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", >- "WebAssembly.Module doesn't parse at byte 26: Table type should be anyfunc or anyref, got -1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], >+ "WebAssembly.Module doesn't parse at byte 18: Table type should be funcref or anyref, got -1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", >+ "WebAssembly.Module doesn't parse at byte 26: Table type should be funcref or anyref, got -1 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], > [{initial: 10, maximum: 20, element: "f32"}, >- "WebAssembly.Module doesn't parse at byte 18: Table type should be anyfunc or anyref, got -3 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", >- "WebAssembly.Module doesn't parse at byte 26: Table type should be anyfunc or anyref, got -3 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], >+ "WebAssembly.Module doesn't parse at byte 18: Table type should be funcref or anyref, got -3 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", >+ "WebAssembly.Module doesn't parse at byte 26: Table type should be funcref or anyref, got -3 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], > [{initial: 10, maximum: 20, element: "f64"}, >- "WebAssembly.Module doesn't parse at byte 18: Table type should be anyfunc or anyref, got -4 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", >- "WebAssembly.Module doesn't parse at byte 26: Table type should be anyfunc or anyref, got -4 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], >+ "WebAssembly.Module doesn't parse at byte 18: Table type should be funcref or anyref, got -4 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", >+ "WebAssembly.Module doesn't parse at byte 26: Table type should be funcref or anyref, got -4 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], > [{initial: 10, maximum: 20, element: "i64"}, >- "WebAssembly.Module doesn't parse at byte 18: Table type should be anyfunc or anyref, got -2 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", >- "WebAssembly.Module doesn't parse at byte 26: Table type should be anyfunc or anyref, got -2 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], >+ "WebAssembly.Module doesn't parse at byte 18: Table type should be funcref or anyref, got -2 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", >+ "WebAssembly.Module doesn't parse at byte 26: Table type should be funcref or anyref, got -2 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], > >- [{initial: 10, maximum: 9, element: "anyfunc"}, >+ [{initial: 10, maximum: 9, element: "funcref"}, > "WebAssembly.Module doesn't parse at byte 21: resizable limits has a initial page count of 10 which is greater than its maximum 9 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", > "WebAssembly.Module doesn't parse at byte 29: resizable limits has a initial page count of 10 which is greater than its maximum 9 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], >- [{initial: 1, maximum: 0, element: "anyfunc"}, >+ [{initial: 1, maximum: 0, element: "funcref"}, > "WebAssembly.Module doesn't parse at byte 21: resizable limits has a initial page count of 1 which is greater than its maximum 0 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", > "WebAssembly.Module doesn't parse at byte 29: resizable limits has a initial page count of 1 which is greater than its maximum 0 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], >- [{initial: 2**32 - 1, maximum: 2**32 - 2, element: "anyfunc"}, >+ [{initial: 2**32 - 1, maximum: 2**32 - 2, element: "funcref"}, > "WebAssembly.Module doesn't parse at byte 29: resizable limits has a initial page count of 4294967295 which is greater than its maximum 4294967294 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", > "WebAssembly.Module doesn't parse at byte 37: resizable limits has a initial page count of 4294967295 which is greater than its maximum 4294967294 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], >- [{initial: 2**31, element: "anyfunc"}, >+ [{initial: 2**31, element: "funcref"}, > "WebAssembly.Module doesn't parse at byte 24: Table's initial page count of 2147483648 is too big, maximum 10000000 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')", > "WebAssembly.Module doesn't parse at byte 32: Table's initial page count of 2147483648 is too big, maximum 10000000 (evaluating 'new WebAssembly.Module(builder.WebAssembly().get())')"], > ]; >@@ -201,8 +201,8 @@ function assertBadTableImport(tableDescription, message) { > const builder = new Builder() > .Type().End() > .Import() >- .Table("imp", "table", {initial: 20, element: "anyfunc"}) >- .Table("imp", "table", {initial: 20, element: "anyfunc"}) >+ .Table("imp", "table", {initial: 20, element: "funcref"}) >+ .Table("imp", "table", {initial: 20, element: "funcref"}) > .End() > .Function().End() > .Code() >@@ -226,10 +226,10 @@ function assertBadTableImport(tableDescription, message) { > } > > const badTables = [ >- [{initial: 100, maximum:100, element:"anyfunc"}, new WebAssembly.Table({initial:100, element: "anyfunc"}), "Table import imp:table does not have a 'maximum' but the module requires that it does (evaluating 'new WebAssembly.Instance(module, {imp: {table}})')"], >- [{initial: 100, maximum:100, element:"anyfunc"}, new WebAssembly.Table({initial:100, maximum:101, element: "anyfunc"}), "Imported Table imp:table 'maximum' is larger than the module's expected 'maximum' (evaluating 'new WebAssembly.Instance(module, {imp: {table}})')"], >- [{initial: 100, element:"anyfunc"}, new WebAssembly.Table({initial:10, element: "anyfunc"}), "Table import imp:table provided an 'initial' that is too small (evaluating 'new WebAssembly.Instance(module, {imp: {table}})')"], >- [{initial: 10, element:"anyfunc"}, new WebAssembly.Table({initial:9, element: "anyfunc"}), "Table import imp:table provided an 'initial' that is too small (evaluating 'new WebAssembly.Instance(module, {imp: {table}})')"], >+ [{initial: 100, maximum:100, element:"funcref"}, new WebAssembly.Table({initial:100, element: "funcref"}), "Table import imp:table does not have a 'maximum' but the module requires that it does (evaluating 'new WebAssembly.Instance(module, {imp: {table}})')"], >+ [{initial: 100, maximum:100, element:"funcref"}, new WebAssembly.Table({initial:100, maximum:101, element: "funcref"}), "Imported Table imp:table 'maximum' is larger than the module's expected 'maximum' (evaluating 'new WebAssembly.Instance(module, {imp: {table}})')"], >+ [{initial: 100, element:"funcref"}, new WebAssembly.Table({initial:10, element: "funcref"}), "Table import imp:table provided an 'initial' that is too small (evaluating 'new WebAssembly.Instance(module, {imp: {table}})')"], >+ [{initial: 10, element:"funcref"}, new WebAssembly.Table({initial:9, element: "funcref"}), "Table import imp:table provided an 'initial' that is too small (evaluating 'new WebAssembly.Instance(module, {imp: {table}})')"], > ]; > for (const [d, t, m] of badTables) { > assertBadTableInstance(d, t, m); >@@ -240,7 +240,7 @@ assert.throws(() => WebAssembly.Table.prototype.grow(undefined), TypeError, `exp > > { > { >- const table = new WebAssembly.Table({element: "anyfunc", initial: 20, maximum: 30}); >+ const table = new WebAssembly.Table({element: "funcref", initial: 20, maximum: 30}); > assert.eq(20, table.grow(0)); > assert.eq(20, table.length); > assert.eq(20, table.grow(1)); >@@ -248,14 +248,14 @@ assert.throws(() => WebAssembly.Table.prototype.grow(undefined), TypeError, `exp > } > > { >- const table = new WebAssembly.Table({element: "anyfunc", initial: 20, maximum: 30}); >+ const table = new WebAssembly.Table({element: "funcref", initial: 20, maximum: 30}); > assert.eq(20, table.grow(10)); > assert.eq(30, table.grow(0)); > assert.throws(() => table.grow(1), RangeError, "WebAssembly.Table.prototype.grow could not grow the table"); > } > > { >- const table = new WebAssembly.Table({element: "anyfunc", initial: 20}); >+ const table = new WebAssembly.Table({element: "funcref", initial: 20}); > let called = false; > table.grow({valueOf() { called = true; return 42; }}); > assert.truthy(called); >@@ -263,14 +263,14 @@ assert.throws(() => WebAssembly.Table.prototype.grow(undefined), TypeError, `exp > } > > { >- const table = new WebAssembly.Table({element: "anyfunc", initial: 20}); >+ const table = new WebAssembly.Table({element: "funcref", initial: 20}); > assert.throws(() => table.get(20), RangeError, "WebAssembly.Table.prototype.get expects an integer less than the length of the table"); > for (let i = 0; i < 20; i++) > assert.eq(table.get(i), null); > } > > { >- const table = new WebAssembly.Table({element: "anyfunc", initial: 20}); >+ const table = new WebAssembly.Table({element: "funcref", initial: 20}); > assert.throws(() => table.set(20, null), RangeError, "WebAssembly.Table.prototype.set expects an integer less than the length of the table"); > for (let i = 0; i < 20; i++) > table.set(i, null); >@@ -278,7 +278,7 @@ assert.throws(() => WebAssembly.Table.prototype.grow(undefined), TypeError, `exp > > { > // This should not throw >- new WebAssembly.Table({initial: 2**20, maximum: 2**32 - 1, element: "anyfunc"}); >+ new WebAssembly.Table({initial: 2**20, maximum: 2**32 - 1, element: "funcref"}); > } > } > >@@ -288,7 +288,7 @@ assert.throws(() => WebAssembly.Table.prototype.grow(undefined), TypeError, `exp > const builder = new Builder() > .Type().End() > .Import() >- .Table("imp", "table", {initial: 25, element: "anyfunc"}) >+ .Table("imp", "table", {initial: 25, element: "funcref"}) > .End() > .Function().End() > .Code() >@@ -306,7 +306,7 @@ assert.throws(() => WebAssembly.Table.prototype.grow(undefined), TypeError, `exp > const builder = new Builder() > .Type().End() > .Import() >- .Table("imp", "table", {initial: 25, element: "anyfunc"}) >+ .Table("imp", "table", {initial: 25, element: "funcref"}) > .End() > .Function().End() > .Export() >@@ -316,7 +316,7 @@ assert.throws(() => WebAssembly.Table.prototype.grow(undefined), TypeError, `exp > .Code().End(); > > const module = new WebAssembly.Module(builder.WebAssembly().get()); >- const table = new WebAssembly.Table({element: "anyfunc", initial: 25}); >+ const table = new WebAssembly.Table({element: "funcref", initial: 25}); > const instance = new WebAssembly.Instance(module, {imp: {table}}); > assert.truthy(table === instance.exports.table); > assert.truthy(table === instance.exports.table2); >@@ -327,7 +327,7 @@ assert.throws(() => WebAssembly.Table.prototype.grow(undefined), TypeError, `exp > .Type().End() > .Function().End() > .Table() >- .Table({initial: 20, maximum: 30, element: "anyfunc"}) >+ .Table({initial: 20, maximum: 30, element: "funcref"}) > .End() > .Export() > .Table("table", 0) >@@ -347,8 +347,8 @@ assert.throws(() => WebAssembly.Table.prototype.grow(undefined), TypeError, `exp > .Type().End() > .Function().End() > .Table() >- .Table({initial: 0, maximum: 1, element: "anyfunc"}) >- .Table({initial: 20, maximum: 30, element: "anyfunc"}) >+ .Table({initial: 0, maximum: 1, element: "funcref"}) >+ .Table({initial: 20, maximum: 30, element: "funcref"}) > .End() > .Export() > .Table("table0", 0) >diff --git a/JSTests/wasm/js-api/test_basic_api.js b/JSTests/wasm/js-api/test_basic_api.js >index 1a2d2221030451df0645b30ea31bb2748f5536d0..2158743edaec167ad46a0dee9694fdc0b5e7764c 100644 >--- a/JSTests/wasm/js-api/test_basic_api.js >+++ b/JSTests/wasm/js-api/test_basic_api.js >@@ -93,9 +93,9 @@ for (const c in constructorProperties) { > new WebAssembly.Memory({initial: 20}); > break; > case "Table": >- new WebAssembly.Table({initial: 20, element: "anyfunc"}); >- new WebAssembly.Table({initial: 20, maximum: 20, element: "anyfunc"}); >- new WebAssembly.Table({initial: 20, maximum: 25, element: "anyfunc"}); >+ new WebAssembly.Table({initial: 20, element: "funcref"}); >+ new WebAssembly.Table({initial: 20, maximum: 20, element: "funcref"}); >+ new WebAssembly.Table({initial: 20, maximum: 25, element: "funcref"}); > break; > case "CompileError": > case "LinkError": >diff --git a/JSTests/wasm/js-api/unique-signature.js b/JSTests/wasm/js-api/unique-signature.js >index 8f5a55fca368b35c976db5c5611b4fe094f88285..6e669e8c0842d8bf5faecd13a809872540c2e738 100644 >--- a/JSTests/wasm/js-api/unique-signature.js >+++ b/JSTests/wasm/js-api/unique-signature.js >@@ -16,7 +16,7 @@ import Builder from '../Builder.js'; > .End() > .Function().End() > .Table() >- .Table({initial: 4, maximum: 4, element: "anyfunc"}) >+ .Table({initial: 4, maximum: 4, element: "funcref"}) > .End() > .Export() > .Function("entry") >diff --git a/JSTests/wasm/js-api/wrapper-function.js b/JSTests/wasm/js-api/wrapper-function.js >index e3bc398653e9aa59ea1596421ea4c5d7b2ad4d0d..c6c03201353be1f1b37c7fc8fa9f6df2c0f3fa90 100644 >--- a/JSTests/wasm/js-api/wrapper-function.js >+++ b/JSTests/wasm/js-api/wrapper-function.js >@@ -56,7 +56,7 @@ function exportImport(type) { > } > > { >- const tableDescription = {element: "anyfunc", initial: 2}; >+ const tableDescription = {element: "funcref", initial: 2}; > function makeInstance(type, imp) { > const builder = new Builder() > .Type() >diff --git a/JSTests/wasm/modules/table.wat b/JSTests/wasm/modules/table.wat >index 6a6b699621487b9c3e5e7a7856f7287ef3261ade..17d6db541866512a3a8052f4083f0fae14e8eb19 100644 >--- a/JSTests/wasm/modules/table.wat >+++ b/JSTests/wasm/modules/table.wat >@@ -1,5 +1,5 @@ > (module >- (table $table (export "table") 3 anyfunc) >+ (table $table (export "table") 3 funcref) > (func $f0 (result i32) i32.const 42) > (func $f1 (result i32) i32.const 83) > (elem (i32.const 0) $f0 $f1)) >diff --git a/JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/imports.wat b/JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/imports.wat >index e5abeaafcf679d00c18db713326e9b800af0ad98..2d044e0b43c09b527f0862d12e451292e70771be 100644 >--- a/JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/imports.wat >+++ b/JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/imports.wat >@@ -1,7 +1,7 @@ > (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)) >+ (import "./re-export.js" "table" (table $table 4 funcref)) > (export "table" (table $table)) > (type $t0 (func (param i32) (result i32))) > (func $addOne (export "addOne") (type $t0) (param $p0 i32) (result i32) >diff --git a/JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/sum.wat b/JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/sum.wat >index ca4aaebfcfb3692c9131d3fac97b34511f95242a..7f23e5a54ed87d7aef4771d1c002aa736c379569 100644 >--- a/JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/sum.wat >+++ b/JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/sum.wat >@@ -5,5 +5,5 @@ > get_local $p0 > i32.add) > (global (export "answer") i32 i32.const 42) >- (table $table (export "table") 4 anyfunc) >+ (table $table (export "table") 4 funcref) > (elem (i32.const 0) $sum)) >diff --git a/JSTests/wasm/modules/wasm-imports-wasm-exports/imports.wat b/JSTests/wasm/modules/wasm-imports-wasm-exports/imports.wat >index 63c1d2c8d2f7bfd564ed4e6ebc07febc9e2ae2ff..ae8abf7081b1ba9b0042de370dd90f8d5f956d8d 100644 >--- a/JSTests/wasm/modules/wasm-imports-wasm-exports/imports.wat >+++ b/JSTests/wasm/modules/wasm-imports-wasm-exports/imports.wat >@@ -5,7 +5,7 @@ > (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)) >+ (import "./sum.wasm" "table" (table $table 4 funcref)) > (type $t0 (func (param i32) (result i32))) > (func $addOne (export "addOne") (type $t0) (param $p0 i32) (result i32) > i32.const 1 >diff --git a/JSTests/wasm/modules/wasm-imports-wasm-exports/sum.wat b/JSTests/wasm/modules/wasm-imports-wasm-exports/sum.wat >index fcb767b072ce412f6af1478f86c91d48813e56e5..6841261d201581ee8f07949afbb8f7422ed7cb51 100644 >--- a/JSTests/wasm/modules/wasm-imports-wasm-exports/sum.wat >+++ b/JSTests/wasm/modules/wasm-imports-wasm-exports/sum.wat >@@ -1,5 +1,5 @@ > (module >- (table $table (export "table") 4 anyfunc) >+ (table $table (export "table") 4 funcref) > (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 >diff --git a/JSTests/wasm/references/anyref_table.js b/JSTests/wasm/references/anyref_table.js >index bc95f67da16fe652c96c669265c6644886ee8674..f3dd01be1ec001fa3a5029c8bc5cf9286443cc60 100644 >--- a/JSTests/wasm/references/anyref_table.js >+++ b/JSTests/wasm/references/anyref_table.js >@@ -73,7 +73,7 @@ assert.throws(() => new WebAssembly.Instance(new WebAssembly.Module((new Builder > .Function("ret42", { params: [], ret: "i32" }) > .I32Const(42) > .End() >- .End().WebAssembly().get())), Error, "WebAssembly.Module doesn't parse at byte 30: Table 0 must have type 'anyfunc' to have an element section (evaluating 'new WebAssembly.Module')") >+ .End().WebAssembly().get())), Error, "WebAssembly.Module doesn't parse at byte 30: Table 0 must have type 'funcref' to have an element section (evaluating 'new WebAssembly.Module')") > > function doGCSet() { > fullGC() >diff --git a/JSTests/wasm/references/anyref_table_import.js b/JSTests/wasm/references/anyref_table_import.js >index 1742bb208c0a82424270ed5b90ff0a6b40875301..2fc601eaf4024c9bf85b00d723f1dd46345193b7 100644 >--- a/JSTests/wasm/references/anyref_table_import.js >+++ b/JSTests/wasm/references/anyref_table_import.js >@@ -210,7 +210,24 @@ import Builder from '../Builder.js'; > } > > { >- const tbl = new WebAssembly.Table({initial:2, element:"anyfunc"}); >+ const tbl = new WebAssembly.Table({initial:2, element:"funcref"}); >+ >+ const mod = new WebAssembly.Module((new Builder()) >+ .Type().End() >+ .Import() >+ .Table("imp", "tbl", {initial: 2, element: "anyref"}) >+ .End() >+ .Function().End() >+ .Export() >+ .End() >+ .Code() >+ .End().WebAssembly().get()) >+ >+ assert.throws(() => new WebAssembly.Instance(mod, { imp: { tbl }}), Error, "Table import imp:tbl provided a 'type' that is wrong (evaluating 'new WebAssembly.Instance(mod, { imp: { tbl }})')"); >+} >+ >+{ >+ const tbl = new WebAssembly.Table({initial:2, element:"funcref"}); > > const mod = new WebAssembly.Module((new Builder()) > .Type().End() >diff --git a/JSTests/wasm/references/func_ref.js b/JSTests/wasm/references/func_ref.js >index 36a79b6f34223267de4ee4d42b76715659a4968b..685adfd6cbba3cbe7840875077610504842d5214 100644 >--- a/JSTests/wasm/references/func_ref.js >+++ b/JSTests/wasm/references/func_ref.js >@@ -44,7 +44,7 @@ function makeExportedIdent() { > return instance.exports.h > } > >-function makeAnyfuncIdent() { >+function makeFuncrefIdent() { > const builder = (new Builder()) > .Type().End() > .Function().End() >@@ -52,7 +52,7 @@ function makeAnyfuncIdent() { > .Function("h") > .End() > .Code() >- .Function("h", { params: ["anyfunc"], ret: "anyfunc" }, []) >+ .Function("h", { params: ["funcref"], ret: "funcref" }, []) > .GetLocal(0) > .End() > .End(); >@@ -82,38 +82,38 @@ function makeAnyfuncIdent() { > .Function("local_read") > .End() > .Code() >- .Function("h", { params: ["anyfunc"], ret: "anyref" }, ["anyref"]) >+ .Function("h", { params: ["funcref"], ret: "anyref" }, ["anyref"]) > .GetLocal(0) > .SetLocal(1) > .GetLocal(1) > .End() > >- .Function("i", { params: ["anyfunc"], ret: "anyfunc" }, ["anyfunc"]) >+ .Function("i", { params: ["funcref"], ret: "funcref" }, ["funcref"]) > .GetLocal(0) > .SetLocal(1) > .GetLocal(1) > .End() > >- .Function("get_h", { params: [], ret: "anyfunc" }, ["anyfunc"]) >+ .Function("get_h", { params: [], ret: "funcref" }, ["funcref"]) > .I32Const(0) > .RefFunc(0) > .SetLocal(0) >- .If("anyfunc") >- .Block("anyfunc", (b) => >+ .If("funcref") >+ .Block("funcref", (b) => > b.GetLocal(0) > ) > .Else() >- .Block("anyfunc", (b) => >+ .Block("funcref", (b) => > b.GetLocal(0) > ) > .End() > .End() > >- .Function("fix", { params: [], ret: "anyfunc" }, []) >+ .Function("fix", { params: [], ret: "funcref" }, []) > .RefFunc(3) > .End() > >- .Function("get_not_exported", { params: [], ret: "anyfunc" }, []) >+ .Function("get_not_exported", { params: [], ret: "funcref" }, []) > .RefFunc(5) > .End() > >@@ -121,7 +121,7 @@ function makeAnyfuncIdent() { > .I32Const(42) > .End() > >- .Function("local_read", { params: [], ret: "i32" }, ["anyfunc"]) >+ .Function("local_read", { params: [], ret: "i32" }, ["funcref"]) > .GetLocal(0) > .RefIsNull() > .End() >@@ -135,20 +135,20 @@ function makeAnyfuncIdent() { > assert.eq(instance.exports.local_read(), 1) > assert.eq(instance.exports.h(null), null) > >- assert.throws(() => instance.exports.h(fun), Error, "Anyfunc must be an exported wasm function (evaluating 'func(...args)')") >+ assert.throws(() => instance.exports.h(fun), Error, "Funcref must be an exported wasm function (evaluating 'func(...args)')") > assert.eq(instance.exports.h(myfun), myfun) >- assert.throws(() => instance.exports.h(5), Error, "Anyfunc must be an exported wasm function (evaluating 'func(...args)')") >- assert.throws(() => instance.exports.h(undefined), Error, "Anyfunc must be an exported wasm function (evaluating 'func(...args)')") >+ assert.throws(() => instance.exports.h(5), Error, "Funcref must be an exported wasm function (evaluating 'func(...args)')") >+ assert.throws(() => instance.exports.h(undefined), Error, "Funcref must be an exported wasm function (evaluating 'func(...args)')") > > assert.eq(instance.exports.i(null), null) > assert.eq(instance.exports.i(myfun), myfun) >- assert.throws(() => instance.exports.i(fun), Error, "Anyfunc must be an exported wasm function (evaluating 'func(...args)')") >- assert.throws(() => instance.exports.i(5), Error, "Anyfunc must be an exported wasm function (evaluating 'func(...args)')") >+ assert.throws(() => instance.exports.i(fun), Error, "Funcref must be an exported wasm function (evaluating 'func(...args)')") >+ assert.throws(() => instance.exports.i(5), Error, "Funcref must be an exported wasm function (evaluating 'func(...args)')") > >- assert.throws(() => instance.exports.get_h()(fun), Error, "Anyfunc must be an exported wasm function (evaluating 'func(...args)')") >+ assert.throws(() => instance.exports.get_h()(fun), Error, "Funcref must be an exported wasm function (evaluating 'func(...args)')") > assert.eq(instance.exports.get_h()(null), null) > assert.eq(instance.exports.get_h()(myfun), myfun) >- assert.throws(() => instance.exports.get_h()(5), Error, "Anyfunc must be an exported wasm function (evaluating 'func(...args)')") >+ assert.throws(() => instance.exports.get_h()(5), Error, "Funcref must be an exported wasm function (evaluating 'func(...args)')") > > assert.eq(instance.exports.get_not_exported()(), 42) > >@@ -167,14 +167,14 @@ function makeAnyfuncIdent() { > const $1 = (() => new WebAssembly.Instance(new WebAssembly.Module((new Builder()) > .Type().End() > .Import() >- .Global().Anyfunc("imp", "ref", "immutable").End() >+ .Global().Funcref("imp", "ref", "immutable").End() > .End() > .Function().End() > .Global() >- .RefNull("anyfunc", "mutable") >- .RefNull("anyfunc", "immutable") >- .GetGlobal("anyfunc", 0, "mutable") >- .RefFunc("anyfunc", 2, "immutable") >+ .RefNull("funcref", "mutable") >+ .RefNull("funcref", "immutable") >+ .GetGlobal("funcref", 0, "mutable") >+ .RefFunc("funcref", 2, "immutable") > .End() > .Export() > .Function("set_glob") >@@ -187,12 +187,12 @@ function makeAnyfuncIdent() { > .Global("exp_glob_is_null", 4) > .End() > .Code() >- .Function("set_glob", { params: ["anyfunc"], ret: "void" }) >+ .Function("set_glob", { params: ["funcref"], ret: "void" }) > .GetLocal(0) > .SetGlobal(1) > .End() > >- .Function("get_glob", { params: [], ret: "anyfunc" }) >+ .Function("get_glob", { params: [], ret: "funcref" }) > .GetGlobal(1) > .End() > >@@ -206,7 +206,7 @@ function makeAnyfuncIdent() { > .Call(0) > .End() > >- .Function("get_import", { params: [], ret: "anyfunc" }) >+ .Function("get_import", { params: [], ret: "funcref" }) > .GetGlobal(0) > .End() > .End().WebAssembly().get()), { imp: { ref: makeExportedFunction(1337) } }))(); >@@ -223,7 +223,7 @@ function makeAnyfuncIdent() { > $1.exports.set_glob(null); assert.eq($1.exports.get_glob(), null) > $1.exports.set_glob(myfun); assert.eq($1.exports.get_glob()(), 42); > >- assert.throws(() => $1.exports.set_glob(fun), Error, "Anyfunc must be an exported wasm function (evaluating 'func(...args)')") >+ assert.throws(() => $1.exports.set_glob(fun), Error, "Funcref must be an exported wasm function (evaluating 'func(...args)')") > > assert.eq($1.exports.glob_is_null(), 0) > $1.exports.set_glob_null(); assert.eq($1.exports.get_glob(), null) >@@ -233,7 +233,7 @@ function makeAnyfuncIdent() { > assert.throws(() => new WebAssembly.Instance(new WebAssembly.Module((new Builder()) > .Type().End() > .Import() >- .Global().Anyfunc("imp", "ref", "immutable").End() >+ .Global().Funcref("imp", "ref", "immutable").End() > .End() > .Function().End() > .Code().End().WebAssembly().get()), { imp: { ref: function() { return "hi" } } }), Error, "imported global imp:ref must be a wasm exported function or null (evaluating 'new WebAssembly.Instance')"); >@@ -242,7 +242,7 @@ assert.throws(() => new WebAssembly.Module((new Builder()) > .Type().End() > .Function().End() > .Code() >- .Function("h", { params: ["anyfunc"], ret: "anyref" }) >+ .Function("h", { params: ["funcref"], ret: "anyref" }) > .GetLocal(0) > .End() > .End().WebAssembly().get()), Error, "WebAssembly.Module doesn't validate: control flow returns with unexpected type, in function at index 0 (evaluating 'new WebAssembly.Module')"); >@@ -251,7 +251,7 @@ assert.throws(() => new WebAssembly.Module((new Builder()) > .Type().End() > .Function().End() > .Table() >- .Table({initial: 1, element: "anyfunc"}) >+ .Table({initial: 1, element: "funcref"}) > .End() > .Code() > .Function("h", { params: ["i32"], ret: "void" }) >@@ -259,7 +259,7 @@ assert.throws(() => new WebAssembly.Module((new Builder()) > .I32Const(0) > .TableSet(0) > .End() >- .End().WebAssembly().get()), Error, "WebAssembly.Module doesn't validate: table.set value to type I32 expected Anyfunc, in function at index 0 (evaluating 'new WebAssembly.Module')"); >+ .End().WebAssembly().get()), Error, "WebAssembly.Module doesn't validate: table.set value to type I32 expected Funcref, in function at index 0 (evaluating 'new WebAssembly.Module')"); > > // Tables > { >@@ -268,10 +268,10 @@ assert.throws(() => new WebAssembly.Module((new Builder()) > .Function().End() > .Table() > .Table({initial: 0, element: "anyref"}) >- .Table({initial: 1, element: "anyfunc"}) >+ .Table({initial: 1, element: "funcref"}) > .End() > .Global() >- .RefNull("anyfunc", "mutable") >+ .RefNull("funcref", "mutable") > .End() > .Export() > .Function("set_glob") >@@ -280,12 +280,12 @@ assert.throws(() => new WebAssembly.Module((new Builder()) > .Function("ret_20") > .End() > .Code() >- .Function("set_glob", { params: ["anyfunc"], ret: "void" }) >+ .Function("set_glob", { params: ["funcref"], ret: "void" }) > .GetLocal(0) > .SetGlobal(0) > .End() > >- .Function("get_glob", { params: [], ret: "anyfunc" }) >+ .Function("get_glob", { params: [], ret: "funcref" }) > .GetGlobal(0) > .End() > >@@ -314,11 +314,11 @@ assert.throws(() => new WebAssembly.Module((new Builder()) > $1.exports.set_glob(null); assert.eq($1.exports.get_glob(), null); assert.throws(() => $1.exports.call_glob(42), Error, "call_indirect to a null table entry (evaluating 'func(...args)')") > $1.exports.set_glob(ident); assert.eq($1.exports.get_glob(), ident); assert.eq($1.exports.call_glob(42), 42) > >- assert.throws(() => $1.exports.set_glob(fun), Error, "Anyfunc must be an exported wasm function (evaluating 'func(...args)')") >+ assert.throws(() => $1.exports.set_glob(fun), Error, "Funcref must be an exported wasm function (evaluating 'func(...args)')") > $1.exports.set_glob(myfun); assert.eq($1.exports.get_glob(), myfun); assert.throws(() => $1.exports.call_glob(42), Error, "call_indirect to a signature that does not match (evaluating 'func(...args)')") > > for (let i=0; i<1000; ++i) { >- assert.throws(() => $1.exports.set_glob(function() {}), Error, "Anyfunc must be an exported wasm function (evaluating 'func(...args)')"); >+ assert.throws(() => $1.exports.set_glob(function() {}), Error, "Funcref must be an exported wasm function (evaluating 'func(...args)')"); > } > } > >@@ -330,20 +330,20 @@ assert.throws(() => new WebAssembly.Module((new Builder()) > .Function().End() > .Table() > .Table({initial: 0, element: "anyref"}) >- .Table({initial: 1, element: "anyfunc"}) >+ .Table({initial: 1, element: "funcref"}) > .End() > .Export() > .Function("set") > .Function("get") > .End() > .Code() >- .Function("set", { params: ["anyfunc"], ret: "void" }) >+ .Function("set", { params: ["funcref"], ret: "void" }) > .I32Const(0) > .GetLocal(0) > .TableSet(1) > .End() > >- .Function("get", { params: [], ret: "anyfunc" }) >+ .Function("get", { params: [], ret: "funcref" }) > .I32Const(0) > .TableGet(1) > .End() >@@ -376,15 +376,15 @@ assert.throws(() => new WebAssembly.Module((new Builder()) > > // Wasm->JS Calls > >-for (let importedFun of [function(i) { return i; }, makeAnyfuncIdent()]) { >+for (let importedFun of [function(i) { return i; }, makeFuncrefIdent()]) { > const $1 = new WebAssembly.Instance(new WebAssembly.Module((new Builder()) > .Type().End() > .Import() >- .Function("imp", "h", { params: ["anyfunc"], ret: "anyfunc" }) >+ .Function("imp", "h", { params: ["funcref"], ret: "funcref" }) > .End() > .Function().End() > .Table() >- .Table({initial: 1, element: "anyfunc"}) >+ .Table({initial: 1, element: "funcref"}) > .End() > .Export() > .Function("test1") >@@ -393,17 +393,17 @@ for (let importedFun of [function(i) { return i; }, makeAnyfuncIdent()]) { > .Function("test4") > .End() > .Code() >- .Function("test1", { params: ["anyfunc"], ret: "anyfunc" }) >+ .Function("test1", { params: ["funcref"], ret: "funcref" }) > .GetLocal(0) > .Call(0) > .End() > >- .Function("test2", { params: [], ret: "anyfunc" }) >+ .Function("test2", { params: [], ret: "funcref" }) > .RefFunc(1) > .Call(0) > .End() > >- .Function("test3", { params: ["anyfunc"], ret: "anyfunc" }) >+ .Function("test3", { params: ["funcref"], ret: "funcref" }) > .GetLocal(0) > .I32Const(0) > .RefFunc(0) >@@ -412,7 +412,7 @@ for (let importedFun of [function(i) { return i; }, makeAnyfuncIdent()]) { > .CallIndirect(0, 0) > .End() > >- .Function("test4", { params: [], ret: "anyfunc" }) >+ .Function("test4", { params: [], ret: "funcref" }) > .RefFunc(1) > .I32Const(0) > .RefFunc(0) >@@ -430,20 +430,20 @@ for (let importedFun of [function(i) { return i; }, makeAnyfuncIdent()]) { > for (let test of [$1.exports.test1, $1.exports.test3]) { > assert.eq(test(myfun), myfun) > assert.eq(test(myfun)(), 1337) >- assert.throws(() => test(fun), Error, "Anyfunc must be an exported wasm function (evaluating 'func(...args)')") >+ assert.throws(() => test(fun), Error, "Funcref must be an exported wasm function (evaluating 'func(...args)')") > > for (let i=0; i<1000; ++i) { >- assert.throws(() => test(fun), Error, "Anyfunc must be an exported wasm function (evaluating 'func(...args)')") >+ assert.throws(() => test(fun), Error, "Funcref must be an exported wasm function (evaluating 'func(...args)')") > } > } > > for (let test of [$1.exports.test2, $1.exports.test4]) { > assert.eq(test(), $1.exports.test1) > assert.eq(test()(myfun), myfun) >- assert.throws(() => test()(fun), Error, "Anyfunc must be an exported wasm function (evaluating 'func(...args)')") >+ assert.throws(() => test()(fun), Error, "Funcref must be an exported wasm function (evaluating 'func(...args)')") > > for (let i=0; i<1000; ++i) { >- assert.throws(() => test()(fun), Error, "Anyfunc must be an exported wasm function (evaluating 'func(...args)')") >+ assert.throws(() => test()(fun), Error, "Funcref must be an exported wasm function (evaluating 'func(...args)')") > } > } > } >diff --git a/JSTests/wasm/references/multitable.js b/JSTests/wasm/references/multitable.js >index 371c2f04d98d03fa362b24023856a8c924f12d98..9161589f19f4f99893bb02e00f3e7a9d70474447 100644 >--- a/JSTests/wasm/references/multitable.js >+++ b/JSTests/wasm/references/multitable.js >@@ -171,8 +171,8 @@ import Builder from '../Builder.js'; > .Type().End() > .Function().End() > .Table() >- .Table({initial: 3, maximum: 30, element: "anyfunc"}) >- .Table({initial: 2, maximum: 30, element: "anyfunc"}) >+ .Table({initial: 3, maximum: 30, element: "funcref"}) >+ .Table({initial: 2, maximum: 30, element: "funcref"}) > .End() > .Export() > .Function("call_tbl0") >@@ -220,8 +220,8 @@ import Builder from '../Builder.js'; > .Type().End() > .Function().End() > .Table() >- .Table({initial: 3, maximum: 30, element: "anyfunc"}) >- .Table({initial: 2, maximum: 30, element: "anyfunc"}) >+ .Table({initial: 3, maximum: 30, element: "funcref"}) >+ .Table({initial: 2, maximum: 30, element: "funcref"}) > .End() > .Export() > .Function("call_tbl0") >@@ -272,8 +272,8 @@ import Builder from '../Builder.js'; > .Type().End() > .Function().End() > .Table() >- .Table({initial: 3, maximum: 3, element: "anyfunc"}) >- .Table({initial: 2, maximum: 2, element: "anyfunc"}) >+ .Table({initial: 3, maximum: 3, element: "funcref"}) >+ .Table({initial: 2, maximum: 2, element: "funcref"}) > .End() > .Element() > .Element({tableIndex: 1, offset: 0, functionIndices: [0]}) >@@ -291,7 +291,7 @@ assert.throws(() => new WebAssembly.Instance(new WebAssembly.Module((new Builder > .Function().End() > .Table() > .Table({initial: 3, maximum: 3, element: "anyref"}) >- .Table({initial: 2, maximum: 3, element: "anyfunc"}) >+ .Table({initial: 2, maximum: 3, element: "funcref"}) > .End() > .Element() > .Element({tableIndex: 1, offset: 0, functionIndices: [0]}) >@@ -302,14 +302,14 @@ assert.throws(() => new WebAssembly.Instance(new WebAssembly.Module((new Builder > .Function("ret42", { params: [], ret: "i32" }) > .I32Const(42) > .End() >- .End().WebAssembly().get())), Error, "WebAssembly.Module doesn't parse at byte 40: Table 0 must have type 'anyfunc' to have an element section (evaluating 'new WebAssembly.Module')") >+ .End().WebAssembly().get())), Error, "WebAssembly.Module doesn't parse at byte 40: Table 0 must have type 'funcref' to have an element section (evaluating 'new WebAssembly.Module')") > > assert.throws(() => new WebAssembly.Instance(new WebAssembly.Module((new Builder()) > .Type().End() > .Function().End() > .Table() > .Table({initial: 3, maximum: 3, element: "anyref"}) >- .Table({initial: 2, maximum: 3, element: "anyfunc"}) >+ .Table({initial: 2, maximum: 3, element: "funcref"}) > .End() > .Code() > .Function("fun", { params: [], ret: "anyref" }) >@@ -323,7 +323,7 @@ assert.throws(() => new WebAssembly.Instance(new WebAssembly.Module((new Builder > .Function().End() > .Table() > .Table({initial: 3, maximum: 3, element: "anyref"}) >- .Table({initial: 2, maximum: 3, element: "anyfunc"}) >+ .Table({initial: 2, maximum: 3, element: "funcref"}) > .End() > .Code() > .Function("fun", { params: [], ret: "void" }) >@@ -338,7 +338,7 @@ assert.throws(() => new WebAssembly.Instance(new WebAssembly.Module((new Builder > .Function().End() > .Table() > .Table({initial: 3, maximum: 3, element: "anyref"}) >- .Table({initial: 2, maximum: 3, element: "anyfunc"}) >+ .Table({initial: 2, maximum: 3, element: "funcref"}) > .End() > .Code() > .Function("fun", { params: [], ret: "void" }) >@@ -351,27 +351,27 @@ assert.throws(() => new WebAssembly.Instance(new WebAssembly.Module((new Builder > .Function().End() > .Table() > .Table({initial: 3, maximum: 3, element: "anyref"}) >- .Table({initial: 2, maximum: 3, element: "anyfunc"}) >+ .Table({initial: 2, maximum: 3, element: "funcref"}) > .End() > .Code() > .Function("fun", { params: [], ret: "void" }) > .CallIndirect(0,0) > .End() >- .End().WebAssembly().get())), Error, "WebAssembly.Module doesn't parse at byte 4: call_indirect is only valid when a table has type anyfunc, in function at index 0 (evaluating 'new WebAssembly.Module')") >+ .End().WebAssembly().get())), Error, "WebAssembly.Module doesn't parse at byte 4: call_indirect is only valid when a table has type funcref, in function at index 0 (evaluating 'new WebAssembly.Module')") > > assert.throws(() => new WebAssembly.Instance(new WebAssembly.Module((new Builder()) > .Type().End() > .Function().End() > .Table() > .Table({initial: 3, maximum: 3, element: "anyref"}) >- .Table({initial: 2, maximum: 3, element: "anyfunc"}) >+ .Table({initial: 2, maximum: 3, element: "funcref"}) > .End() > .Code() > .Function("fun", { params: [], ret: "void" }) > .RefNull() > .TableGet(0) > .End() >- .End().WebAssembly().get())), Error, "WebAssembly.Module doesn't validate: table.get index to type Anyfunc expected I32, in function at index 0 (evaluating 'new WebAssembly.Module')") >+ .End().WebAssembly().get())), Error, "WebAssembly.Module doesn't validate: table.get index to type Funcref expected I32, in function at index 0 (evaluating 'new WebAssembly.Module')") > > > assert.throws(() => new WebAssembly.Instance(new WebAssembly.Module((new Builder()) >@@ -379,7 +379,7 @@ assert.throws(() => new WebAssembly.Instance(new WebAssembly.Module((new Builder > .Function().End() > .Table() > .Table({initial: 3, maximum: 3, element: "anyref"}) >- .Table({initial: 2, maximum: 3, element: "anyfunc"}) >+ .Table({initial: 2, maximum: 3, element: "funcref"}) > .End() > .Code() > .Function("fun", { params: [], ret: "void" }) >@@ -387,14 +387,14 @@ assert.throws(() => new WebAssembly.Instance(new WebAssembly.Module((new Builder > .RefNull() > .TableSet(0) > .End() >- .End().WebAssembly().get())), Error, "WebAssembly.Module doesn't validate: table.set index to type Anyfunc expected I32, in function at index 0 (evaluating 'new WebAssembly.Module')") >+ .End().WebAssembly().get())), Error, "WebAssembly.Module doesn't validate: table.set index to type Funcref expected I32, in function at index 0 (evaluating 'new WebAssembly.Module')") > > assert.throws(() => new WebAssembly.Instance(new WebAssembly.Module((new Builder()) > .Type().End() > .Function().End() > .Table() > .Table({initial: 3, maximum: 3, element: "anyref"}) >- .Table({initial: 2, maximum: 3, element: "anyfunc"}) >+ .Table({initial: 2, maximum: 3, element: "funcref"}) > .End() > .Code() > .Function("fun", { params: ["anyref"], ret: "void" }) >@@ -402,7 +402,7 @@ assert.throws(() => new WebAssembly.Instance(new WebAssembly.Module((new Builder > .GetLocal(0) > .TableSet(1) > .End() >- .End().WebAssembly().get())), Error, "WebAssembly.Module doesn't validate: table.set value to type Anyref expected Anyfunc, in function at index 0 (evaluating 'new WebAssembly.Module')") >+ .End().WebAssembly().get())), Error, "WebAssembly.Module doesn't validate: table.set value to type Anyref expected Funcref, in function at index 0 (evaluating 'new WebAssembly.Module')") > > function tableInsanity(num, b) { > b = b.Import() >@@ -428,7 +428,7 @@ assert.throws(() => new WebAssembly.Instance(new WebAssembly.Module(tableInsanit > { > const $1 = new WebAssembly.Instance(new WebAssembly.Module(tableInsanity(1000000-2, (new Builder()) > .Type().End()) >- .Table({initial: 3, maximum: 3, element: "anyfunc"}) >+ .Table({initial: 3, maximum: 3, element: "funcref"}) > .Table({initial: 3, maximum: 3, element: "anyref"}) > .End() > .Export() >diff --git a/JSTests/wasm/references/table_misc.js b/JSTests/wasm/references/table_misc.js >index d2095d52b60b4dd6899b4dd5f4ca63d41cd41096..c3b599f3ee5b0403a7f81adccfcbc7e211e22f6e 100644 >--- a/JSTests/wasm/references/table_misc.js >+++ b/JSTests/wasm/references/table_misc.js >@@ -194,8 +194,8 @@ assert.throws(() => new WebAssembly.Module((new Builder()) > .Type().End() > .Function().End() > .Table() >- .Table({initial: 0, maximum: 0, element: "anyfunc"}) >- .Table({initial: 20, maximum: 30, element: "anyfunc"}) >+ .Table({initial: 0, maximum: 0, element: "funcref"}) >+ .Table({initial: 20, maximum: 30, element: "funcref"}) > .End() > .Export() > .Function("tbl_size") >diff --git a/JSTests/wasm/references/validation.js b/JSTests/wasm/references/validation.js >index 7f7d18427b75d37052ad64845e3715c1caedee3d..b7ba61b3c64a3ccb9666a7ef49fc2c06037b4e42 100644 >--- a/JSTests/wasm/references/validation.js >+++ b/JSTests/wasm/references/validation.js >@@ -25,7 +25,7 @@ import Builder from '../Builder.js'; > const builder = (new Builder()) > .Type().End() > .Import() >- .Table("imp", "tbl", {initial: 2, element: "anyfunc"}) >+ .Table("imp", "tbl", {initial: 2, element: "funcref"}) > .End() > .Function().End() > .Export() >@@ -42,14 +42,14 @@ import Builder from '../Builder.js'; > const bin = builder.WebAssembly(); > bin.trim(); > >- assert.throws(() => new WebAssembly.Module(bin.get()), WebAssembly.CompileError, "WebAssembly.Module doesn't validate: table.set value to type I32 expected Anyfunc, in function at index 0 (evaluating 'new WebAssembly.Module(bin.get())')"); >+ assert.throws(() => new WebAssembly.Module(bin.get()), WebAssembly.CompileError, "WebAssembly.Module doesn't validate: table.set value to type I32 expected Funcref, in function at index 0 (evaluating 'new WebAssembly.Module(bin.get())')"); > } > > { > const builder = (new Builder()) > .Type().End() > .Import() >- .Table("imp", "tbl", {initial: 2, element: "anyfunc"}) >+ .Table("imp", "tbl", {initial: 2, element: "funcref"}) > .End() > .Function().End() > .Export() >@@ -66,14 +66,14 @@ import Builder from '../Builder.js'; > const bin = builder.WebAssembly(); > bin.trim(); > >- assert.throws(() => new WebAssembly.Module(bin.get()), WebAssembly.CompileError, "WebAssembly.Module doesn't validate: table.set value to type Anyref expected Anyfunc, in function at index 0 (evaluating 'new WebAssembly.Module(bin.get())')"); >+ assert.throws(() => new WebAssembly.Module(bin.get()), WebAssembly.CompileError, "WebAssembly.Module doesn't validate: table.set value to type Anyref expected Funcref, in function at index 0 (evaluating 'new WebAssembly.Module(bin.get())')"); > } > > { > const builder = (new Builder()) > .Type().End() > .Import() >- .Table("imp", "tbl", {initial: 2, element: "anyfunc"}) >+ .Table("imp", "tbl", {initial: 2, element: "funcref"}) > .End() > .Function().End() > .Export() >@@ -93,5 +93,5 @@ import Builder from '../Builder.js'; > } > > { >- assert.throws(() => new WebAssembly.Table({initial:2, element:"i32"}), TypeError, "WebAssembly.Table expects its 'element' field to be the string 'anyfunc' or 'anyref'"); >+ assert.throws(() => new WebAssembly.Table({initial:2, element:"i32"}), TypeError, "WebAssembly.Table expects its 'element' field to be the string 'funcref' or 'anyref'"); > } >diff --git a/JSTests/wasm/spec-harness/index.js b/JSTests/wasm/spec-harness/index.js >index eb00c6d878fc90d511f606b4b434845686735ae4..ccd24fbfe19060b164dd7045f1419d081841c33a 100644 >--- a/JSTests/wasm/spec-harness/index.js >+++ b/JSTests/wasm/spec-harness/index.js >@@ -82,7 +82,7 @@ function reinitializeRegistry() { > spectest: { > print: print, > global: 666, >- table: new WebAssembly.Table({initial: 10, maximum: 20, element: 'anyfunc'}), >+ table: new WebAssembly.Table({initial: 10, maximum: 20, element: 'funcref'}), > memory: new WebAssembly.Memory({initial: 1, maximum: 2}) > } > }; >diff --git a/JSTests/wasm/spec-harness/wasm-constants.js b/JSTests/wasm/spec-harness/wasm-constants.js >index 68c36ef1fd3df470c17839696a8ee78d12d93ac9..24ae6edee3db8839444268f46d623048925453ab 100644 >--- a/JSTests/wasm/spec-harness/wasm-constants.js >+++ b/JSTests/wasm/spec-harness/wasm-constants.js >@@ -71,7 +71,7 @@ let kFunctionNamesCode = 1; > let kLocalNamesCode = 2; > > let kWasmFunctionTypeForm = 0x60; >-let kWasmAnyFunctionTypeForm = 0x70; >+let kWasmFuncReftionTypeForm = 0x70; > > let kResizableMaximumFlag = 1; > >diff --git a/JSTests/wasm/spec-harness/wasm-module-builder.js b/JSTests/wasm/spec-harness/wasm-module-builder.js >index 68fab8985c76ed12f9455254d6536cc4ce669335..8e81af88fb977aee9095d15248e834f573717274 100644 >--- a/JSTests/wasm/spec-harness/wasm-module-builder.js >+++ b/JSTests/wasm/spec-harness/wasm-module-builder.js >@@ -321,7 +321,7 @@ class WasmModuleBuilder { > section.emit_u32v(imp.initial); // initial > if (has_max) section.emit_u32v(imp.maximum); // maximum > } else if (imp.kind == kExternalTable) { >- section.emit_u8(kWasmAnyFunctionTypeForm); >+ section.emit_u8(kWasmFuncReftionTypeForm); > var has_max = (typeof imp.maximum) != "undefined"; > section.emit_u8(has_max ? 1 : 0); // flags > section.emit_u32v(imp.initial); // initial >@@ -354,7 +354,7 @@ class WasmModuleBuilder { > if (debug) print("emitting table @ " + binary.length); > binary.emit_section(kTableSectionCode, section => { > section.emit_u8(1); // one table entry >- section.emit_u8(kWasmAnyFunctionTypeForm); >+ section.emit_u8(kWasmFuncReftionTypeForm); > section.emit_u8(1); > section.emit_u32v(wasm.function_table_length); > section.emit_u32v(wasm.function_table_length); >diff --git a/JSTests/wasm/spec-harness/wast.js b/JSTests/wasm/spec-harness/wast.js >index 5d329c102f3113aa525b0fc7cf5fa3dd89647c59..3ea71a3328e532bbb07138f1054c4d7f5f7679a2 100644 >--- a/JSTests/wasm/spec-harness/wast.js >+++ b/JSTests/wasm/spec-harness/wast.js >@@ -14831,7 +14831,7 @@ function elem_type(s) { > return error(s, s[/* pos */2][0] - 1 | 0, "invalid element type"); > } > else { >- return /* AnyFuncType */0; >+ return /* FuncRefType */0; > } > } > >@@ -20706,7 +20706,7 @@ function token(lexbuf) { > ]; > })]); > case 11 : >- return /* ANYFUNC */0; >+ return /* FUNCREF */0; > case 12 : > return /* MUT */1; > case 13 : >@@ -25993,7 +25993,7 @@ var yyact = /* array */[ > ]; > }, > function () { >- return /* AnyFuncType */0; >+ return /* FuncRefType */0; > }, > function (__caml_parser_env) { > var _1 = Parsing.peek_val(__caml_parser_env, 0); >@@ -27678,7 +27678,7 @@ var yytables = /* record */[ > /* table */'\x86\0\xa3\0\x8b\0\xf9\0\x8b\0\x02\x01\xf7\0\xd9\0\xfc\0\0\x01\x1e\x01\xcf\0\x87\0\x88\0\xfd\0\x8d\0\x13\x01\x0f\x01\x05\x01\x8f\0\x83\0\x04\x01\b\x01\t\x01\x8a\0\xcf\0\x8e\0\xe6\0\x05\x01\xe7\0\x1c\x01\x1c\x01\x05\0\x17\x01\x18\x01*\x01,\x01-\x01\x89\x01\x8a\x01\x8b\x01#\x01\x19\0!\0\x83\x01\x84\x01\x12\0$\x01\x8b\0%\x01\x19\0&\x01\x8b\0T\0n\0\x0f\0\x15\0\x16\x005\x01U\x003\x014\x01v\0\xd1\0"\0\xe4\0\xe4\0\xd8\0\xe4\0\xe2\0\xe3\0D\0\x15\0\x16\0C\x01\x10\x01\x11\x01\x12\x01:\x01\x9b\x01\x1f\x01\xc5\0\xc8\0\x91\0\x12\0K\x01\x05\x01\xd5\0\x91\0\x91\0\xe8\0\xe9\0\xea\0\xeb\0\xec\0|\0\xed\0\xee\0\xef\0\xf0\0\xf1\0}\0J\x01\xaf\x01L\x01\x19\0\xc6\0\xca\0#\0_\x01$\0\x19\0\xd7\0\x19\0\xe4\0\xe4\0\xe4\0\x14\x01\n\x01\x11\0\xcf\0.\0\xcf\0\'\0\x0b\x01\xcf\0P\0g\x01m\x01o\x01P\0|\0~\0P\0+\x011\0.\x01 \x01~\0*\0+\0,\0-\0U\x01\x81\x002\0P\x01\x12\0\x82\0V\x01F\0W\x01\x89\0X\x01(\x01\x13\0\x14\0\x15\0\x16\0\x17\0\x18\0\x19\0\x1a\0\x1b\0\x1c\0\x1d\0\x1e\0\x1f\0 \0&\0L\0(\0)\0|\0\x99\x017\0G\0|\0\x80\x01T\x018\x005\x006\0v\x01\x81\0O\0\x14\x01k\0\x82\0E\0\x95\x01|\0l\0\x98\x01\x8f\x01\x1c\x01\x96\x01\x94\x01\x91\0<\x01=\x01w\x01\x97\x01~\0\x91\0H\0\x1a\x01\x84\0\xe2\0\xe3\0\x9d\x01\x9a\x01\x9f\x01\x01\0\x02\0\x03\0\x9c\x01/\x000\x003\x004\0I\0\xa1\x01Z\x01[\x01\\\x01]\x01n\x01\xab\x01a\0b\0c\0d\0e\0f\0g\0h\0i\0j\0\xc2\0\xae\x01t\x01\xc3\0\xc2\0i\x01\xcf\0\x07\x01j\x01\x19\0\x1c\0J\0\x19\0\x1c\0K\0\x0f\0P\0\xb4\x01\x0f\0Q\0\xb7\x01\xcf\0\xe2\0\xe3\0x\x01y\x01z\x01{\x01\xa3\0\x93\0\x94\0\x95\0\x87\x01\x87\x01\x87\x01\x87\x01\xcf\0\xde\0<\x01=\x01~\0)\x01R\0\x92\x01m\0\x1c\0\x91\0\x91\0\x1c\0S\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\x008\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0o\0\xa3\x01\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0p\0W\0X\0Y\0\x19\0\x19\0q\0Z\0r\0[\0\\\0]\0^\0s\0_\0`\0\x87\x01t\0\x1c\0u\0w\0\x1c\0~\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0x\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0y\0z\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0{\0\x1c\0\x90\0\x91\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\xbf\0\x1c\0\x92\0\xbe\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\xc0\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x1c\0\x84\0\xda\0\xc7\0\x89\0\xd4\0 \0 \0 \0 \0 \0 \0 \0\xdb\0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0\x1c\0 \0 \0 \0 \0 \0 \0 \0 \0 \0\xdd\0\xf2\0\xfa\0\xfe\0\x17\0\x17\0\x17\0\x17\0\x17\0\x17\0\x17\0\x01\x01\x17\0\x17\0\x17\0\x17\0\x17\0\x17\0\x17\0\x17\0\x17\0\x17\0\x17\0\x17\0\x17\0\x17\0\x17\0\x17\0\x03\x01 \0\x17\0\x17\0\x17\0\x17\0\x17\0\x17\0\x17\0\x17\0\n\x01\xf8\0)\x01\x16\x01"\0"\0"\0"\0"\0"\0"\0\x19\x01"\0"\0"\0"\0"\0"\0"\0"\0"\0"\0"\0"\0"\0"\0"\0"\0\x1b\x01\x17\0"\0"\0"\0"\0"\0"\0"\0"\0!\x01/\x01\'\x010\x01\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\x006\x01\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\x009\x01"\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0;\x01>\x01?\x01@\x01\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0A\x01\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0B\x01\x03\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x04\x01D\x01E\x01F\x01\x03\0\x0b\x01\x03\0\x03\0\x03\0\x03\0\x03\0a\x01\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0G\x01\x1e\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0I\x01M\x01O\x01Q\x01\x19\0\x19\0\x19\0\x19\0\x19\0R\x01\x19\0S\x01Y\x01\x19\0\x19\0\x19\0\x19\0\x19\0\x19\0\x19\0\x19\0\x19\0\x19\0\x19\0\x19\0\x19\0\x19\0\x19\0^\x01\x03\0\x19\0\x19\0\x19\0\x19\0\x19\0\x19\0\x19\0\x19\0`\x01b\x01c\x01d\x01\x03\0e\x01\x03\0\x03\0\x03\0\x03\0\x03\0r\x01f\x01\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0h\x01\x19\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0k\x01l\x01p\x01q\x01\x03\0\x03\0\x03\0\x03\0\x03\0s\x01\x03\0|\x01}\x01\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0~\x01\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x03\0\x7f\x01\x81\x01\x85\x01\x86\x01\x1e\0\x8d\x01\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x8c\x01\x8e\x01\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x91\x01\x03\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x1e\0\x93\x01\x9e\x01\xa0\x01\xa4\x01\x97\0\xb0\x01\x98\0\x99\0\x9a\0\xa5\x01\x9b\0\xa6\x01\xa7\x01\x9c\0\x9d\0\x9e\0\x9f\0\xa0\0\xa1\0\xa2\0\xa3\0\xa4\0\xa5\0\xa6\0\xa7\0\xa8\0\xa9\0\xaa\0\xa8\x01\x1e\0\xab\0\xac\0\xad\0\xae\0\xaf\0\xb0\0\xb1\0\xb2\0\xa9\x01\xaa\x01\xac\x01\xad\x01\xf6\0\xb2\x01\x98\0\x99\0\x9a\0\xb1\x01\x9b\0\xb3\x01\xa3\0\x9c\0\x9d\0\x9e\0\x9f\0\xa0\0\xa1\0\xa2\0\xa3\0\xa4\0\xa5\0\xa6\0\xa7\0\xa8\0\xa9\0\xaa\0\xb5\x01\xb3\0\xab\0\xac\0\xad\0\xae\0\xaf\0\xb0\0\xb1\0\xb2\0\xb6\x01\xb8\x01\x84\0\xa3\0\xf8\0~\0\x98\0\x99\0\x9a\0\x91\0\x9b\0\xaa\0P\0\x9c\0\x9d\0\x9e\0\x9f\0\xa0\0\xa1\0\xa2\0\xa3\0\xa4\0\xa5\0\xa6\0\xa7\0\xa8\0\xa9\0\xaa\0\x17\0\xb3\0\xab\0\xac\0\xad\0\xae\0\xaf\0\xb0\0\xb1\0\xb2\0\t\0R\0\x7f\0\x03\0\xfb\0\x03\0\x98\0\x99\0\x9a\0\x19\0\x9b\0P\0K\0\x9c\0\x9d\0\x9e\0\x9f\0\xa0\0\xa1\0\xa2\0\xa3\0\xa4\0\xa5\0\xa6\0\xa7\0\xa8\0\xa9\0\xaa\0M\0\xb3\0\xab\0\xac\0\xad\0\xae\0\xaf\0\xb0\0\xb1\0\xb2\0H\x01\xc1\0\xf5\0\xf4\0\x82\x018\x01\x98\0\x99\0\x9a\0N\x01\x9b\0\x0e\0\xd6\0\x9c\0\x9d\0\x9e\0\x9f\0\xa0\0\xa1\0\xa2\0\xa3\0\xa4\0\xa5\0\xa6\0\xa7\0\xa8\0\xa9\0\xaa\0\0\0\xb3\0\xab\0\xac\0\xad\0\xae\0\xaf\0\xb0\0\xb1\0\xb2\0\0\0\0\0\0\0\0\0\0\0\0\0\x98\0\x99\0\xcb\0\0\0\xcc\0\0\0\0\0\x9c\0\xcd\0\x9e\0\x9f\0\xa0\0\xa1\0\xa2\0\xa3\0\xa4\0\xa5\0\xa6\0\xa7\0\xa8\0\xa9\0\xaa\0\0\0\xb3\0\xab\0\xac\0\xad\0\xae\0\xaf\0\xb0\0\xb1\0\xb2\0\0\0\0\0\xde\0\xdf\0\xe0\0\xe1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xe2\0\xe3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x98\0\x99\0\xcb\0\0\0\xcc\0\0\0\xb3\0\x9c\0\xcd\0\x9e\0\x9f\0\xa0\0\xa1\0\xa2\0\xa3\0\xa4\0\xa5\0\xa6\0\xa7\0\xa8\0\xa9\0\xaa\0\0\0\0\0\xab\0\xac\0\xad\0\xae\0\xaf\0\xb0\0\xb1\0\xb2\0\0\0\0\0\xde\0\xdf\0\xe0\0\xe1\0\x98\0\x99\0\xcb\0\0\0\xcc\0\0\0\0\0\x9c\0\xcd\0\x9e\0\x9f\0\xa0\0\xa1\0\xa2\0\xa3\0\xa4\0\xa5\0\xa6\0\xa7\0\xa8\0\xa9\0\xaa\0\0\0\xb3\0\xab\0\xac\0\xad\0\xae\0\xaf\0\xb0\0\xb1\0\xb2\0\0\0\0\0\0\0\xdf\0\xe0\0\xe1\0\x98\0\x99\0\xcb\0\0\0\xcc\0\0\0\0\0\x9c\0\xcd\0\x9e\0\x9f\0\xa0\0\xa1\0\xa2\0\xa3\0\xa4\0\xa5\0\xa6\0\xa7\0\xa8\0\xa9\0\xaa\0\0\0\xb3\0\xab\0\xac\0\xad\0\xae\0\xaf\0\xb0\0\xb1\0\xb2\0\0\0\0\0\0\0\0\0\0\0\0\0\x98\0\x99\0\xcb\0\0\0\xcc\0\x90\x01\xce\0\x9c\0\xcd\0\x9e\0\x9f\0\xa0\0\xa1\0\xa2\0\xa3\0\xa4\0\xa5\0\xa6\0\xa7\0\xa8\0\xa9\0\xaa\0\0\0\xb3\0\xab\0\xac\0\xad\0\xae\0\xaf\0\xb0\0\xb1\0\xb2\0\0\0\0\0\0\0\0\0\0\0\0\0\x98\0\x99\0\xcb\0\0\0\xcc\0\0\0\0\0\x9c\0\xcd\0\x9e\0\x9f\0\xa0\0\xa1\0\xa2\0\xa3\0\xa4\0\xa5\0\xa6\0\xa7\0\xa8\0\xa9\0\xaa\0\0\0\xb3\0\xab\0\xac\0\xad\0\xae\0\xaf\0\xb0\0\xb1\0\xb2\0\0\0\0\0\0\0\0\0\0\0\xe1\0\x98\0\x99\0\xcb\0\0\0\xcc\0\xa2\x01\0\0\x9c\0\xcd\0\x9e\0\x9f\0\xa0\0\xa1\0\xa2\0\xa3\0\xa4\0\xa5\0\xa6\0\xa7\0\xa8\0\xa9\0\xaa\0\0\0\xb3\0\xab\0\xac\0\xad\0\xae\0\xaf\0\xb0\0\xb1\0\xb2\0\0\0\0\0\0\0\0\0\0\0\0\0\x98\0\x99\0\xcb\0\0\0\xcc\0\0\0\0\0\x9c\0\xcd\0\x9e\0\x9f\0\xa0\0\xa1\0\xa2\0\xa3\0\xa4\0\xa5\0\xa6\0\xa7\0\xa8\0\xa9\0\xaa\0\0\0\xb3\0\xab\0\xac\0\xad\0\xae\0\xaf\0\xb0\0\xb1\0\xb2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xb3\0', > /* check */"Y\0\0\0\\\0\xb5\0^\0\xbf\0\xb4\0\x8f\0\xbc\0\xbd\0\xd7\0\x89\0Z\0[\0\xbc\0]\0\xce\0\xca\0\xc4\0^\0X\0\b\x01\xc5\0\xc6\0\\\0\x97\0^\0\x9b\0\xce\0\x9d\0\xd6\0\xd7\0\t\x01\xd1\0\xd2\0\xdf\0\xe0\0\xe1\0i\x01j\x01k\x01+\x01\x01\x01\n\0b\x01c\x012\x011\x01\x8a\x003\x01\t\x015\x01\x8e\0\x04\x01F\0\t\x01<\x01=\x01\xea\0\n\x01\xe6\0\xe7\0N\0\x8a\0\0\0\x9a\0\x9b\0\x8e\0\x9d\x008\x019\x01&\0<\x01=\x01\b\x01\xcb\0\xcc\0\xcd\0\xfc\0\x85\x01\xd8\0\x87\0\x88\0\x04\x012\x01\x11\x01\b\x01\x8d\0\t\x01\n\x01\x9e\0\x9f\0\xa0\0\xa1\0\xa2\0\x04\x01\xa4\0\xa5\0\xa6\0\xa7\0\xa8\0\n\x01\x10\x01\xaa\x01\x12\x01\x01\x01\x87\0\x88\0\0\0)\x01\x05\x01\x07\x01\x8d\0\t\x01\xcb\0\xcc\0\xcd\0\xcf\0\x01\x01\x03\0\xf6\0\t\x01\xf8\0\x04\x01\x07\x01\xfb\0\n\x011\x01<\x01=\x01\x0e\x01\x04\x01\x01\x01\x11\x01\xdf\0\t\x01\xe1\0\n\x01\x07\x01\x17\0\x18\0\x19\0\x1a\0+\x01\x01\x01\x1d\0\x1a\x012\x01\x05\x011\x01\x04\x013\x01\t\x015\x01\xde\0:\x01;\x01<\x01=\x01>\x01?\x01@\x01A\x01B\x01C\x01D\x01E\x01F\x01G\x01\x13\0\t\x01\x15\0\x16\0\x04\x01{\x01\x04\x01\x04\x01\x04\x01`\x01\n\x01\t\x01\x1f\0 \0\n\x01\x01\x01\n\x01\x14\x01\n\x01\x05\x01'\0x\x01\x04\x01\n\x01z\x01r\x01{\x01x\x01\n\x01\x04\x01.\x01/\x01Q\x01y\x01\x05\x01\n\x01\x04\x016\x01\t\x018\x019\x01\x8c\x01\x81\x01\x8e\x01\x01\0\x02\0\x03\0\x8a\x01\x1b\0\x1c\0\x1d\0\x1e\0\x04\x01\x90\x01#\x01$\x01%\x01&\x01<\x01\x9e\x019\0:\0;\0<\0=\0>\0?\0@\0A\0B\0\x06\x01\xa2\x01K\x01\t\x01\x06\x01\x0e\x01s\x01\t\x01\x11\x01\x06\x01\x06\x01\x04\x01\t\x01\t\x01\x04\x01\x07\x01\x04\x01\xb2\x01\n\x01\x04\x01\xb5\x01\x82\x018\x019\x01U\x01V\x01W\x01X\x01\n\x01\x01\x01\x02\x01\x03\x01h\x01i\x01j\x01k\x01\x91\x01-\x01.\x01/\x01\x05\x01\x06\x01\x04\x01t\x01\n\x01\x06\x01\t\x01\n\x01\t\x01\x04\x01\x0b\x01\f\x01\r\x01\x0e\x01\x0f\x01\t\x01\x11\x01\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\n\x01\x92\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\n\x01+\x01,\x01-\x01\t\x01\n\x01\n\x011\x01\n\x013\x014\x015\x016\x01\n\x018\x019\x01\xaa\x01#\x01\x06\x01\n\x01\n\x01\t\x01\x05\x01\x0b\x01\f\x01\r\x01\x0e\x01\x0f\x01\n\x01H\x01\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\n\x01\n\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\n\x01\x06\x01\x04\x01\x04\x01\t\x01\n\x01\x0b\x01\f\x01\r\x01+\x01\x0f\x01\n\x01\n\x01\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\n\x01H\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\t\x01\x04\x01\t\x01\t\x01\t\x01\t\x01\n\x01\x0b\x01\f\x01\r\x01\x0e\x01\x0f\x01\t\x01\x11\x01\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01H\x01\"\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\n\x01!\x01\n\x01\t\x01\t\x01\n\x01\x0b\x01\f\x01\r\x01\x0e\x01\x0f\x01\t\x01\x11\x01\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\n\x01H\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\x01\x01\t\x01\x06\x01\n\x01\t\x01\n\x01\x0b\x01\f\x01\r\x01\x0e\x01\x0f\x01\n\x01\x11\x01\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\t\x01H\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\t\x01\x04\x01\n\x01\x04\x01\t\x01\n\x01\x0b\x01\f\x01\r\x01\x0e\x01\x0f\x01\"\x01\x11\x01\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\n\x01H\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\n\x01\n\x01\n\x01\n\x01\t\x01\n\x01\x0b\x01\f\x01\r\x01\x0e\x01\x0f\x01\x06\x01\x11\x01\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\n\x01H\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\b\x01\n\x01\x01\x01\t\x01\t\x01\x07\x01\x0b\x01\f\x01\r\x01\x0e\x01\x0f\x01\x06\x01\x11\x01\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\n\x01H\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\n\x01\n\x01\n\x016\x01\t\x01\n\x01\x0b\x01\f\x01\r\x01\n\x01\x0f\x01\n\x01\n\x01\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\n\x01H\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\n\x01\n\x01\n\x01\x06\x01\t\x01\x04\x01\x0b\x01\f\x01\r\x01\x0e\x01\x0f\x014\x01\n\x01\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\x0e\x01H\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\x0e\x01\n\x01\n\x01\n\x01\t\x01\n\x01\x0b\x01\f\x01\r\x01\t\x01\x0f\x01\n\x01\n\x01\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\n\x01H\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\n\x01\n\x01\n\x01\n\x01\t\x01\x06\x01\x0b\x01\f\x01\r\x01\x0e\x01\x0f\x01\n\x01\n\x01\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\t\x01H\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\n\x01\n\x01\n\x01\n\x01\t\x01\t\x01\x0b\x01\f\x01\r\x01\n\x01\x0f\x01\n\x01\n\x01\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\n\x01H\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\n\x01\x0e\x01\n\x01\n\x01\t\x01\x11\x01\x0b\x01\f\x01\r\x01\n\x01\x0f\x01\t\x01\0\0\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\x11\x01H\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\n\x01\n\x01\n\x01\n\x01\t\x01\x01\x01\x0b\x01\f\x01\r\x01\n\x01\x0f\x01\n\x01\n\x01\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\n\x01H\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\n\x01\n\x01\x01\x01\n\x01\t\x01\t\x01\x0b\x01\f\x01\r\x01\x01\x01\x0f\x01\x0e\x01\n\x01\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\n\x01H\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\x0e\x01\x86\0\xab\0\xaa\0\t\x01\xf4\0\x0b\x01\f\x01\r\x01\x14\x01\x0f\x01\x02\0\x8d\0\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\xff\xffH\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0b\x01\f\x01\r\x01\xff\xff\x0f\x01\xff\xff\xff\xff\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\xff\xffH\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\xff\xff\xff\xff-\x01.\x01/\x010\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff8\x019\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0b\x01\f\x01\r\x01\xff\xff\x0f\x01\xff\xffH\x01\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\xff\xff\xff\xff#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\xff\xff\xff\xff-\x01.\x01/\x010\x01\x0b\x01\f\x01\r\x01\xff\xff\x0f\x01\xff\xff\xff\xff\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\xff\xffH\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\xff\xff\xff\xff\xff\xff.\x01/\x010\x01\x0b\x01\f\x01\r\x01\xff\xff\x0f\x01\xff\xff\xff\xff\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\xff\xffH\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0b\x01\f\x01\r\x01\xff\xff\x0f\x01\x10\x017\x01\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\xff\xffH\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0b\x01\f\x01\r\x01\xff\xff\x0f\x01\xff\xff\xff\xff\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\xff\xffH\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff0\x01\x0b\x01\f\x01\r\x01\xff\xff\x0f\x01\x10\x01\xff\xff\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\xff\xffH\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0b\x01\f\x01\r\x01\xff\xff\x0f\x01\xff\xff\xff\xff\x12\x01\x13\x01\x14\x01\x15\x01\x16\x01\x17\x01\x18\x01\x19\x01\x1a\x01\x1b\x01\x1c\x01\x1d\x01\x1e\x01\x1f\x01 \x01\xff\xffH\x01#\x01$\x01%\x01&\x01'\x01(\x01)\x01*\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffH\x01", > /* error_function */parse_error, >- /* names_const */"ANYFUNC\0MUT\0LPAR\0RPAR\0NOP\0DROP\0BLOCK\0END\0IF\0THEN\0ELSE\0SELECT\0LOOP\0BR\0BR_IF\0BR_TABLE\0CALL\0CALL_INDIRECT\0RETURN\0GET_LOCAL\0SET_LOCAL\0TEE_LOCAL\0GET_GLOBAL\0SET_GLOBAL\0UNREACHABLE\0CURRENT_MEMORY\0GROW_MEMORY\0FUNC\0START\0TYPE\0PARAM\0RESULT\0LOCAL\0GLOBAL\0MODULE\0TABLE\0ELEM\0MEMORY\0DATA\0OFFSET\0IMPORT\0EXPORT\0SCRIPT\0REGISTER\0INVOKE\0GET\0ASSERT_MALFORMED\0ASSERT_INVALID\0ASSERT_SOFT_INVALID\0ASSERT_UNLINKABLE\0ASSERT_RETURN\0ASSERT_RETURN_NAN\0ASSERT_TRAP\0ASSERT_EXHAUSTION\0INPUT\0OUTPUT\0EOF\0", >+ /* names_const */"FUNCREF\0MUT\0LPAR\0RPAR\0NOP\0DROP\0BLOCK\0END\0IF\0THEN\0ELSE\0SELECT\0LOOP\0BR\0BR_IF\0BR_TABLE\0CALL\0CALL_INDIRECT\0RETURN\0GET_LOCAL\0SET_LOCAL\0TEE_LOCAL\0GET_GLOBAL\0SET_GLOBAL\0UNREACHABLE\0CURRENT_MEMORY\0GROW_MEMORY\0FUNC\0START\0TYPE\0PARAM\0RESULT\0LOCAL\0GLOBAL\0MODULE\0TABLE\0ELEM\0MEMORY\0DATA\0OFFSET\0IMPORT\0EXPORT\0SCRIPT\0REGISTER\0INVOKE\0GET\0ASSERT_MALFORMED\0ASSERT_INVALID\0ASSERT_SOFT_INVALID\0ASSERT_UNLINKABLE\0ASSERT_RETURN\0ASSERT_RETURN_NAN\0ASSERT_TRAP\0ASSERT_EXHAUSTION\0INPUT\0OUTPUT\0EOF\0", > /* names_block */"NAT\0INT\0FLOAT\0TEXT\0VAR\0VALUE_TYPE\0LOAD\0STORE\0OFFSET_EQ_NAT\0ALIGN_EQ_NAT\0CONST\0UNARY\0BINARY\0COMPARE\0CONVERT\0TEST\0" > ]; > >@@ -29467,7 +29467,7 @@ function string_of_value_types(ts) { > } > > function string_of_elem_type() { >- return "anyfunc"; >+ return "funcref"; > } > > function string_of_limits(param) { >@@ -29482,7 +29482,7 @@ function string_of_memory_type(param) { > } > > function string_of_table_type(param) { >- return string_of_limits(param[0]) + " anyfunc"; >+ return string_of_limits(param[0]) + " funcref"; > } > > function string_of_global_type(param) { >diff --git a/JSTests/wasm/spec-tests/jsapi.js b/JSTests/wasm/spec-tests/jsapi.js >index 179e4fe975cdaae90852bd221ca7f7dcbd034fe6..8e5d2283cdcc7ff479ce1b7e0373e13b091eb225 100644 >--- a/JSTests/wasm/spec-tests/jsapi.js >+++ b/JSTests/wasm/spec-tests/jsapi.js >@@ -514,16 +514,16 @@ test(() => { > assertThrows(() => new Table(1), TypeError); > assertThrows(() => new Table({initial:1, element:1}), TypeError); > assertThrows(() => new Table({initial:1, element:"any"}), TypeError); >- assertThrows(() => new Table({initial:1, element:{valueOf() { return "anyfunc" }}}), TypeError); >- assertThrows(() => new Table({initial:{valueOf() { throw new Error("here")}}, element:"anyfunc"}), Error); >- assertThrows(() => new Table({initial:-1, element:"anyfunc"}), RangeError); >- assertThrows(() => new Table({initial:Math.pow(2,32), element:"anyfunc"}), RangeError); >- assertThrows(() => new Table({initial:2, maximum:1, element:"anyfunc"}), RangeError); >- assertThrows(() => new Table({initial:2, maximum:Math.pow(2,32), element:"anyfunc"}), RangeError); >- assert_equals(new Table({initial:1, element:"anyfunc"}) instanceof Table, true); >- assert_equals(new Table({initial:1.5, element:"anyfunc"}) instanceof Table, true); >- assert_equals(new Table({initial:1, maximum:1.5, element:"anyfunc"}) instanceof Table, true); >- assert_equals(new Table({initial:1, maximum:Math.pow(2,32)-1, element:"anyfunc"}) instanceof Table, true); >+ assertThrows(() => new Table({initial:1, element:{valueOf() { return "funcref" }}}), TypeError); >+ assertThrows(() => new Table({initial:{valueOf() { throw new Error("here")}}, element:"funcref"}), Error); >+ assertThrows(() => new Table({initial:-1, element:"funcref"}), RangeError); >+ assertThrows(() => new Table({initial:Math.pow(2,32), element:"funcref"}), RangeError); >+ assertThrows(() => new Table({initial:2, maximum:1, element:"funcref"}), RangeError); >+ assertThrows(() => new Table({initial:2, maximum:Math.pow(2,32), element:"funcref"}), RangeError); >+ assert_equals(new Table({initial:1, element:"funcref"}) instanceof Table, true); >+ assert_equals(new Table({initial:1.5, element:"funcref"}) instanceof Table, true); >+ assert_equals(new Table({initial:1, maximum:1.5, element:"funcref"}) instanceof Table, true); >+ assert_equals(new Table({initial:1, maximum:Math.pow(2,32)-1, element:"funcref"}) instanceof Table, true); > }, "'WebAssembly.Table' constructor function"); > > test(() => { >@@ -543,7 +543,7 @@ test(() => { > }, "'WebAssembly.Table.prototype' object"); > > test(() => { >- tbl1 = new Table({initial:2, element:"anyfunc"}); >+ tbl1 = new Table({initial:2, element:"funcref"}); > assert_equals(typeof tbl1, "object"); > assert_equals(String(tbl1), "[object WebAssembly.Table]"); > assert_equals(Object.getPrototypeOf(tbl1), tableProto); >@@ -631,7 +631,7 @@ test(() => { > assertThrows(() => tblGrow.call({}), TypeError); > assertThrows(() => tblGrow.call(tbl1, -1), RangeError); > assertThrows(() => tblGrow.call(tbl1, Math.pow(2,32)), RangeError); >- var tbl = new Table({element:"anyfunc", initial:1, maximum:2}); >+ var tbl = new Table({element:"funcref", initial:1, maximum:2}); > assert_equals(tbl.length, 1); > assert_equals(tbl.grow(0), 1); > assert_equals(tbl.length, 1); >@@ -732,7 +732,7 @@ test(() => { > }, 'unexpected success in assertInstantiateError'); > } > var scratch_memory = new WebAssembly.Memory({initial:1}); >- var scratch_table = new WebAssembly.Table({element:"anyfunc", initial:1, maximum:1}); >+ var scratch_table = new WebAssembly.Table({element:"funcref", initial:1, maximum:1}); > assertInstantiateError([], TypeError); > assertInstantiateError([undefined], TypeError); > assertInstantiateError([1], TypeError); >diff --git a/JSTests/wasm/stress/wasm-table-grow-initialize.js b/JSTests/wasm/stress/wasm-table-grow-initialize.js >index 255635c9fa42bb79c5f92206730c99f504ddd439..9ba8e73305f0bc7adf8733104b13111e779b5681 100644 >--- a/JSTests/wasm/stress/wasm-table-grow-initialize.js >+++ b/JSTests/wasm/stress/wasm-table-grow-initialize.js >@@ -4,7 +4,7 @@ function shouldBe(actual, expected) { > } > > var table = new WebAssembly.Table({ >- element: "anyfunc", >+ element: "funcref", > initial: 20 > }); > >diff --git a/JSTests/wasm/wasm.json b/JSTests/wasm/wasm.json >index 4a46904f971bcec42c306a25fc9307d30b92c90f..d4c3dcca22ca84c74f34d3fb61f53c86b5561e53 100644 >--- a/JSTests/wasm/wasm.json >+++ b/JSTests/wasm/wasm.json >@@ -11,14 +11,14 @@ > "i64": { "type": "varint7", "value": -2, "b3type": "B3::Int64" }, > "f32": { "type": "varint7", "value": -3, "b3type": "B3::Float" }, > "f64": { "type": "varint7", "value": -4, "b3type": "B3::Double" }, >- "anyfunc": { "type": "varint7", "value": -16, "b3type": "B3::Int64" }, >+ "funcref": { "type": "varint7", "value": -16, "b3type": "B3::Int64" }, > "anyref": { "type": "varint7", "value": -17, "b3type": "B3::Int64" }, > "func": { "type": "varint7", "value": -32, "b3type": "B3::Void" }, > "void": { "type": "varint7", "value": -64, "b3type": "B3::Void" } > }, >- "value_type": ["i32", "i64", "f32", "f64", "anyref", "anyfunc"], >- "block_type": ["i32", "i64", "f32", "f64", "void", "anyref", "anyfunc"], >- "elem_type": ["anyfunc","anyref"], >+ "value_type": ["i32", "i64", "f32", "f64", "anyref", "funcref"], >+ "block_type": ["i32", "i64", "f32", "f64", "void", "anyref", "funcref"], >+ "elem_type": ["funcref","anyref"], > "external_kind": { > "Function": { "type": "uint8", "value": 0 }, > "Table": { "type": "uint8", "value": 1 }, >@@ -59,9 +59,9 @@ > "i64.const": { "category": "special", "value": 66, "return": ["i64"], "parameter": [], "immediate": [{"name": "value", "type": "varint64"}], "description": "a constant value interpreted as i64" }, > "f64.const": { "category": "special", "value": 68, "return": ["f64"], "parameter": [], "immediate": [{"name": "value", "type": "double"}], "description": "a constant value interpreted as f64" }, > "f32.const": { "category": "special", "value": 67, "return": ["f32"], "parameter": [], "immediate": [{"name": "value", "type": "float"}], "description": "a constant value interpreted as f32" }, >- "ref.null": { "category": "special", "value": 208, "return": ["anyfunc"], "parameter": [], "immediate": [], "description": "a constant null reference" }, >+ "ref.null": { "category": "special", "value": 208, "return": ["funcref"], "parameter": [], "immediate": [], "description": "a constant null reference" }, > "ref.is_null": { "category": "special", "value": 209, "return": ["i32"], "parameter": ["anyref"], "immediate": [], "description": "determine if a reference is null" }, >- "ref.func": { "category": "special", "value": 210, "return": ["anyfunc"], "parameter": [], "immediate": [{"name": "function_index", "type": "varuint32"}], "description": "return a reference to the function at the given index" }, >+ "ref.func": { "category": "special", "value": 210, "return": ["funcref"], "parameter": [], "immediate": [{"name": "function_index", "type": "varuint32"}], "description": "return a reference to the function at the given index" }, > "get_local": { "category": "special", "value": 32, "return": ["any"], "parameter": [], "immediate": [{"name": "local_index", "type": "varuint32"}], "description": "read a local variable or parameter" }, > "set_local": { "category": "special", "value": 33, "return": [], "parameter": ["any"], "immediate": [{"name": "local_index", "type": "varuint32"}], "description": "write a local variable or parameter" }, > "tee_local": { "category": "special", "value": 34, "return": ["any"], "parameter": ["any"], "immediate": [{"name": "local_index", "type": "varuint32"}], "description": "write a local variable or parameter and return the same value" },
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198983
: 372416 |
372434