<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[246589] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/246589">246589</a></dd>
<dt>Author</dt> <dd>justin_michaud@apple.com</dd>
<dt>Date</dt> <dd>2019-06-19 08:36:46 -0700 (Wed, 19 Jun 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WASM-References] Rename anyfunc to funcref
https://bugs.webkit.org/show_bug.cgi?id=198983

Reviewed by Yusuke Suzuki.

JSTests:

* 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:

Source/JavaScriptCore:

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:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkJSTestsChangeLog">trunk/JSTests/ChangeLog</a></li>
<li><a href="#trunkJSTestswasmfunctiontestsbasicelementjs">trunk/JSTests/wasm/function-tests/basic-element.js</a></li>
<li><a href="#trunkJSTestswasmfunctiontestscontextswitchjs">trunk/JSTests/wasm/function-tests/context-switch.js</a></li>
<li><a href="#trunkJSTestswasmfunctiontestsexceptionsjs">trunk/JSTests/wasm/function-tests/exceptions.js</a></li>
<li><a href="#trunkJSTestswasmfunctiontestsgrowmemory2js">trunk/JSTests/wasm/function-tests/grow-memory-2.js</a></li>
<li><a href="#trunkJSTestswasmfunctiontestsnameSectionjs">trunk/JSTests/wasm/function-tests/nameSection.js</a></li>
<li><a href="#trunkJSTestswasmfunctiontestsstackoverflowjs">trunk/JSTests/wasm/function-tests/stack-overflow.js</a></li>
<li><a href="#trunkJSTestswasmfunctionteststablebasic2js">trunk/JSTests/wasm/function-tests/table-basic-2.js</a></li>
<li><a href="#trunkJSTestswasmfunctionteststablebasicjs">trunk/JSTests/wasm/function-tests/table-basic.js</a></li>
<li><a href="#trunkJSTestswasmfunctionteststrapfromstartasyncjs">trunk/JSTests/wasm/function-tests/trap-from-start-async.js</a></li>
<li><a href="#trunkJSTestswasmfunctionteststrapfromstartjs">trunk/JSTests/wasm/function-tests/trap-from-start.js</a></li>
<li><a href="#trunkJSTestswasmjsapiModuleexportsjs">trunk/JSTests/wasm/js-api/Module.exports.js</a></li>
<li><a href="#trunkJSTestswasmjsapiModuleimportsjs">trunk/JSTests/wasm/js-api/Module.imports.js</a></li>
<li><a href="#trunkJSTestswasmjsapicallindirectjs">trunk/JSTests/wasm/js-api/call-indirect.js</a></li>
<li><a href="#trunkJSTestswasmjsapielementdatajs">trunk/JSTests/wasm/js-api/element-data.js</a></li>
<li><a href="#trunkJSTestswasmjsapielementjs">trunk/JSTests/wasm/js-api/element.js</a></li>
<li><a href="#trunkJSTestswasmjsapiextensionMemoryModejs">trunk/JSTests/wasm/js-api/extension-MemoryMode.js</a></li>
<li><a href="#trunkJSTestswasmjsapitablejs">trunk/JSTests/wasm/js-api/table.js</a></li>
<li><a href="#trunkJSTestswasmjsapitest_basic_apijs">trunk/JSTests/wasm/js-api/test_basic_api.js</a></li>
<li><a href="#trunkJSTestswasmjsapiuniquesignaturejs">trunk/JSTests/wasm/js-api/unique-signature.js</a></li>
<li><a href="#trunkJSTestswasmjsapiwrapperfunctionjs">trunk/JSTests/wasm/js-api/wrapper-function.js</a></li>
<li><a href="#trunkJSTestswasmmodulestablewat">trunk/JSTests/wasm/modules/table.wat</a></li>
<li><a href="#trunkJSTestswasmmoduleswasmimportsjsreexportswasmexportsimportswat">trunk/JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/imports.wat</a></li>
<li><a href="#trunkJSTestswasmmoduleswasmimportsjsreexportswasmexportssumwat">trunk/JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/sum.wat</a></li>
<li><a href="#trunkJSTestswasmmoduleswasmimportswasmexportsimportswat">trunk/JSTests/wasm/modules/wasm-imports-wasm-exports/imports.wat</a></li>
<li><a href="#trunkJSTestswasmmoduleswasmimportswasmexportssumwat">trunk/JSTests/wasm/modules/wasm-imports-wasm-exports/sum.wat</a></li>
<li><a href="#trunkJSTestswasmreferencesanyref_tablejs">trunk/JSTests/wasm/references/anyref_table.js</a></li>
<li><a href="#trunkJSTestswasmreferencesanyref_table_importjs">trunk/JSTests/wasm/references/anyref_table_import.js</a></li>
<li><a href="#trunkJSTestswasmreferencesfunc_refjs">trunk/JSTests/wasm/references/func_ref.js</a></li>
<li><a href="#trunkJSTestswasmreferencesmultitablejs">trunk/JSTests/wasm/references/multitable.js</a></li>
<li><a href="#trunkJSTestswasmreferencestable_miscjs">trunk/JSTests/wasm/references/table_misc.js</a></li>
<li><a href="#trunkJSTestswasmreferencesvalidationjs">trunk/JSTests/wasm/references/validation.js</a></li>
<li><a href="#trunkJSTestswasmspecharnessindexjs">trunk/JSTests/wasm/spec-harness/index.js</a></li>
<li><a href="#trunkJSTestswasmspecharnesswasmconstantsjs">trunk/JSTests/wasm/spec-harness/wasm-constants.js</a></li>
<li><a href="#trunkJSTestswasmspecharnesswasmmodulebuilderjs">trunk/JSTests/wasm/spec-harness/wasm-module-builder.js</a></li>
<li><a href="#trunkJSTestswasmspecharnesswastjs">trunk/JSTests/wasm/spec-harness/wast.js</a></li>
<li><a href="#trunkJSTestswasmspectestsjsapijs">trunk/JSTests/wasm/spec-tests/jsapi.js</a></li>
<li><a href="#trunkJSTestswasmstresswasmtablegrowinitializejs">trunk/JSTests/wasm/stress/wasm-table-grow-initialize.js</a></li>
<li><a href="#trunkJSTestswasmwasmjson">trunk/JSTests/wasm/wasm.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmAirIRGeneratorcpp">trunk/Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmCallingConventionh">trunk/Source/JavaScriptCore/wasm/WasmCallingConvention.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmExceptionTypeh">trunk/Source/JavaScriptCore/wasm/WasmExceptionType.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmFormath">trunk/Source/JavaScriptCore/wasm/WasmFormat.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmFunctionParserh">trunk/Source/JavaScriptCore/wasm/WasmFunctionParser.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmSectionParsercpp">trunk/Source/JavaScriptCore/wasm/WasmSectionParser.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmValidatecpp">trunk/Source/JavaScriptCore/wasm/WasmValidate.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSToWasmcpp">trunk/Source/JavaScriptCore/wasm/js/JSToWasm.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWasmToJScpp">trunk/Source/JavaScriptCore/wasm/js/WasmToJS.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyFunctioncpp">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyModuleRecordcpp">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyTableConstructorcpp">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmwasmjson">trunk/Source/JavaScriptCore/wasm/wasm.json</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkJSTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/ChangeLog (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/ChangeLog  2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/ChangeLog     2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -1,3 +1,99 @@
</span><ins>+2019-06-19  Justin Michaud  <justin_michaud@apple.com>
+
+        [WASM-References] Rename anyfunc to funcref
+        https://bugs.webkit.org/show_bug.cgi?id=198983
+
+        Reviewed by Yusuke Suzuki.
+
+        * 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:
+
</ins><span class="cx"> 2019-06-18  Justin Michaud  <justin_michaud@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [WASM-References] Add support for Table.size, grow and fill instructions
</span></span></pre></div>
<a id="trunkJSTestswasmfunctiontestsbasicelementjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/function-tests/basic-element.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/function-tests/basic-element.js       2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/function-tests/basic-element.js  2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> import * as assert from '../assert.js';
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-const tableDescription = {initial: 1, element: "anyfunc"};
</del><ins>+const tableDescription = {initial: 1, element: "funcref"};
</ins><span class="cx"> const builder = new Builder()
</span><span class="cx">     .Type().End()
</span><span class="cx">     .Import()
</span></span></pre></div>
<a id="trunkJSTestswasmfunctiontestscontextswitchjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/function-tests/context-switch.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/function-tests/context-switch.js      2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/function-tests/context-switch.js 2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> 
</span><span class="cx"> {
</span><span class="cx">     function makeInstance() {
</span><del>-        const tableDescription = {initial: 1, element: "anyfunc"};
</del><ins>+        const tableDescription = {initial: 1, element: "funcref"};
</ins><span class="cx">         const builder = new Builder()
</span><span class="cx">             .Type()
</span><span class="cx">                 .Func([], "void")
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx"> 
</span><span class="cx"> {
</span><span class="cx">     function makeInstance() {
</span><del>-        const tableDescription = {initial: 1, element: "anyfunc"};
</del><ins>+        const tableDescription = {initial: 1, element: "funcref"};
</ins><span class="cx">         const builder = new Builder()
</span><span class="cx">             .Type()
</span><span class="cx">                 .Func(["i32"], "void")
</span><span class="lines">@@ -171,7 +171,7 @@
</span><span class="cx"> 
</span><span class="cx"> {
</span><span class="cx">     function makeInstance() {
</span><del>-        const tableDescription = {initial: 1, element: "anyfunc"};
</del><ins>+        const tableDescription = {initial: 1, element: "funcref"};
</ins><span class="cx">         const builder = new Builder()
</span><span class="cx">             .Type()
</span><span class="cx">                 .Func(["i32"], "void")
</span></span></pre></div>
<a id="trunkJSTestswasmfunctiontestsexceptionsjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/function-tests/exceptions.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/function-tests/exceptions.js  2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/function-tests/exceptions.js     2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> import * as assert from '../assert.js'
</span><span class="cx"> 
</span><span class="cx"> function makeInstance() {
</span><del>-    const tableDescription = {initial: 1, element: "anyfunc"};
</del><ins>+    const tableDescription = {initial: 1, element: "funcref"};
</ins><span class="cx">     const builder = new Builder()
</span><span class="cx">         .Type()
</span><span class="cx">             .Func(["i32", "i32"], "i32")
</span></span></pre></div>
<a id="trunkJSTestswasmfunctiontestsgrowmemory2js"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/function-tests/grow-memory-2.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/function-tests/grow-memory-2.js       2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/function-tests/grow-memory-2.js  2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> 
</span><span class="cx"> {
</span><span class="cx">     const memoryDescription = {initial: 0, maximum: 2};
</span><del>-    const tableDescription = {initial: 1, maximum: 1, element: "anyfunc"};
</del><ins>+    const tableDescription = {initial: 1, maximum: 1, element: "funcref"};
</ins><span class="cx">     const builder = (new Builder())
</span><span class="cx">         .Type()
</span><span class="cx">             .Func([], "void")
</span></span></pre></div>
<a id="trunkJSTestswasmfunctiontestsnameSectionjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/function-tests/nameSection.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/function-tests/nameSection.js 2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/function-tests/nameSection.js    2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -38,7 +38,7 @@
</span><span class="cx">         if (typeof importObject[imp.module][imp.name] === "undefined") {
</span><span class="cx">             switch (imp.kind) {
</span><span class="cx">             case "function": importObject[imp.module][imp.name] = () => {}; break;
</span><del>-            case "table": importObject[imp.module][imp.name] = new WebAssembly.Table({ initial: 6, maximum: 6, element: "anyfunc" }); break;
</del><ins>+            case "table": importObject[imp.module][imp.name] = new WebAssembly.Table({ initial: 6, maximum: 6, element: "funcref" }); break;
</ins><span class="cx">             case "memory": importObject[imp.module][imp.name] = new WebAssembly.Memory({ initial: 16777216 / (64 * 1024), maximum: 16777216 / (64 * 1024) }); break;
</span><span class="cx">             case "global": importObject[imp.module][imp.name] = 0; break;
</span><span class="cx">             }
</span></span></pre></div>
<a id="trunkJSTestswasmfunctiontestsstackoverflowjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/function-tests/stack-overflow.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/function-tests/stack-overflow.js      2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/function-tests/stack-overflow.js 2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> 
</span><span class="cx"> {
</span><span class="cx">     function makeInstance() {
</span><del>-        const tableDescription = {initial: 1, element: "anyfunc"};
</del><ins>+        const tableDescription = {initial: 1, element: "funcref"};
</ins><span class="cx">         const builder = new Builder()
</span><span class="cx">             .Type()
</span><span class="cx">                 .Func(["i32"], "void")
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx"> 
</span><span class="cx"> {
</span><span class="cx">     function makeInstance() {
</span><del>-        const tableDescription = {initial: 1, element: "anyfunc"};
</del><ins>+        const tableDescription = {initial: 1, element: "funcref"};
</ins><span class="cx">         const builder = new Builder()
</span><span class="cx">             .Type()
</span><span class="cx">                 .Func([], "void")
</span></span></pre></div>
<a id="trunkJSTestswasmfunctionteststablebasic2js"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/function-tests/table-basic-2.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/function-tests/table-basic-2.js       2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/function-tests/table-basic-2.js  2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx">             .Func(["i32"], "i32")
</span><span class="cx">         .End()
</span><span class="cx">         .Import()
</span><del>-            .Table("imp", "table", {initial: 20, element: "anyfunc"})
</del><ins>+            .Table("imp", "table", {initial: 20, element: "funcref"})
</ins><span class="cx">             .Function("imp", "func", { params: ["i32"], ret: "i32" })
</span><span class="cx">         .End()
</span><span class="cx">         .Function().End()
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> 
</span><span class="cx">     const bin = builder.WebAssembly().get();
</span><span class="cx">     const module = new WebAssembly.Module(bin);
</span><del>-    const table = new WebAssembly.Table({initial: 20, element: "anyfunc"});
</del><ins>+    const table = new WebAssembly.Table({initial: 20, element: "funcref"});
</ins><span class="cx">     return {instance: new WebAssembly.Instance(module, {imp: {table, func}}), table};
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkJSTestswasmfunctionteststablebasicjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/function-tests/table-basic.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/function-tests/table-basic.js 2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/function-tests/table-basic.js    2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx">             .Func(["i32"], "i32")
</span><span class="cx">         .End()
</span><span class="cx">         .Import()
</span><del>-            .Table("imp", "table", {initial: 20, element: "anyfunc"})
</del><ins>+            .Table("imp", "table", {initial: 20, element: "funcref"})
</ins><span class="cx">         .End()
</span><span class="cx">         .Function().End()
</span><span class="cx">         .Export()
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> 
</span><span class="cx">     const bin = builder.WebAssembly().get();
</span><span class="cx">     const module = new WebAssembly.Module(bin);
</span><del>-    const table = new WebAssembly.Table({initial: 20, element: "anyfunc"});
</del><ins>+    const table = new WebAssembly.Table({initial: 20, element: "funcref"});
</ins><span class="cx">     return {instance: new WebAssembly.Instance(module, {imp: {table}}), table};
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkJSTestswasmfunctionteststrapfromstartasyncjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/function-tests/trap-from-start-async.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/function-tests/trap-from-start-async.js       2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/function-tests/trap-from-start-async.js  2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> import Builder from '../Builder.js';
</span><span class="cx"> 
</span><span class="cx"> const memoryInfo = { initial: 2 };
</span><del>-const tableInfo = { element: "anyfunc", initial: 8 };
</del><ins>+const tableInfo = { element: "funcref", initial: 8 };
</ins><span class="cx"> 
</span><span class="cx"> async function StartTrapsAsync() {
</span><span class="cx">     const builder = (new Builder())
</span></span></pre></div>
<a id="trunkJSTestswasmfunctionteststrapfromstartjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/function-tests/trap-from-start.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/function-tests/trap-from-start.js     2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/function-tests/trap-from-start.js        2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> import Builder from '../Builder.js';
</span><span class="cx"> 
</span><span class="cx"> const memoryInfo = { initial: 2 };
</span><del>-const tableInfo = { element: "anyfunc", initial: 8 };
</del><ins>+const tableInfo = { element: "funcref", initial: 8 };
</ins><span class="cx"> 
</span><span class="cx"> (function StartTraps() {
</span><span class="cx">     const builder = (new Builder())
</span></span></pre></div>
<a id="trunkJSTestswasmjsapiModuleexportsjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/js-api/Module.exports.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/js-api/Module.exports.js      2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/js-api/Module.exports.js 2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -17,7 +17,7 @@
</span><span class="cx">             .Type().End()
</span><span class="cx">             .Function().End()
</span><span class="cx">             .Table()
</span><del>-                .Table({initial: 20, maximum: 30, element: "anyfunc"})
</del><ins>+                .Table({initial: 20, maximum: 30, element: "funcref"})
</ins><span class="cx">             .End()
</span><span class="cx">             .Memory().InitialMaxPages(1, 1).End()
</span><span class="cx">             .Global().I32(42, "immutable").End()
</span></span></pre></div>
<a id="trunkJSTestswasmjsapiModuleimportsjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/js-api/Module.imports.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/js-api/Module.imports.js      2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/js-api/Module.imports.js 2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -17,7 +17,7 @@
</span><span class="cx">             .Type().End()
</span><span class="cx">             .Import()
</span><span class="cx">                 .Function("fooFunction", "barFunction", { params: [] })
</span><del>-                .Table("fooTable", "barTable", {initial: 20, element: "anyfunc"})
</del><ins>+                .Table("fooTable", "barTable", {initial: 20, element: "funcref"})
</ins><span class="cx">                 .Memory("fooMemory", "barMemory", {initial: 20})
</span><span class="cx">                 .Global().I32("fooGlobal", "barGlobal", "immutable").End()
</span><span class="cx">             .End()
</span></span></pre></div>
<a id="trunkJSTestswasmjsapicallindirectjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/js-api/call-indirect.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/js-api/call-indirect.js       2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/js-api/call-indirect.js  2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -6,7 +6,7 @@
</span><span class="cx">         .Type().End()
</span><span class="cx">         .Import()
</span><span class="cx">             .Function("imp", "func", { params: ["i32"] })
</span><del>-            .Table("imp", "table", { initial: 1, maximum: 1, element: "anyfunc"})
</del><ins>+            .Table("imp", "table", { initial: 1, maximum: 1, element: "funcref"})
</ins><span class="cx">         .End()
</span><span class="cx">         .Function().End()
</span><span class="cx">         .Export()
</span><span class="lines">@@ -36,8 +36,8 @@
</span><span class="cx">         .Type().End()
</span><span class="cx">         .Import()
</span><span class="cx">             .Function("imp", "func", { params: ["i32"] })
</span><del>-            .Table("imp", "table0", { initial: 0, maximum: 0, element: "anyfunc"})
-            .Table("imp", "table", { initial: 1, maximum: 1, element: "anyfunc"})
</del><ins>+            .Table("imp", "table0", { initial: 0, maximum: 0, element: "funcref"})
+            .Table("imp", "table", { initial: 1, maximum: 1, element: "funcref"})
</ins><span class="cx">         .End()
</span><span class="cx">         .Function().End()
</span><span class="cx">         .Export()
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx"> for (const wasmModuleWhichImportJS of [oneTable, multiTable]) {
</span><span class="cx"> 
</span><span class="cx"> const makeTable = () => {
</span><del>-    return new WebAssembly.Table({initial: 1, maximum: 1, element: "anyfunc"});
</del><ins>+    return new WebAssembly.Table({initial: 1, maximum: 1, element: "funcref"});
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> (function MonomorphicImport() {
</span><span class="lines">@@ -73,7 +73,7 @@
</span><span class="cx">     const counterSetter = v => counter = v;
</span><span class="cx">     const table = makeTable();
</span><span class="cx">     const module = wasmModuleWhichImportJS();
</span><del>-    const instance = new WebAssembly.Instance(module, { imp: { func: counterSetter, table, table0: new WebAssembly.Table({initial: 0, maximum: 0, element: "anyfunc"}) } });
</del><ins>+    const instance = new WebAssembly.Instance(module, { imp: { func: counterSetter, table, table0: new WebAssembly.Table({initial: 0, maximum: 0, element: "funcref"}) } });
</ins><span class="cx">     table.set(0, instance.exports.callFunc);
</span><span class="cx">     for (let i = 0; i < 4096; ++i) {
</span><span class="cx">         // Invoke this a bunch of times to make sure the IC in the wasm -> JS stub works correctly.
</span><span class="lines">@@ -90,11 +90,11 @@
</span><span class="cx">     const module = wasmModuleWhichImportJS();
</span><span class="cx"> 
</span><span class="cx">     const tableA = makeTable();
</span><del>-    const instanceA = new WebAssembly.Instance(module, { imp: { func: counterASetter, table: tableA, table0: new WebAssembly.Table({initial: 0, maximum: 0, element: "anyfunc"}) } });
</del><ins>+    const instanceA = new WebAssembly.Instance(module, { imp: { func: counterASetter, table: tableA, table0: new WebAssembly.Table({initial: 0, maximum: 0, element: "funcref"}) } });
</ins><span class="cx">     tableA.set(0, instanceA.exports.callFunc);
</span><span class="cx"> 
</span><span class="cx">     const tableB = makeTable();
</span><del>-    const instanceB = new WebAssembly.Instance(module, { imp: { func: counterBSetter, table: tableB, table0: new WebAssembly.Table({initial: 0, maximum: 0, element: "anyfunc"}) } });
</del><ins>+    const instanceB = new WebAssembly.Instance(module, { imp: { func: counterBSetter, table: tableB, table0: new WebAssembly.Table({initial: 0, maximum: 0, element: "funcref"}) } });
</ins><span class="cx">     tableB.set(0, instanceB.exports.callFunc);
</span><span class="cx">     for (let i = 0; i < 2048; ++i) {
</span><span class="cx">         instanceA.exports.changeCounter(i, 0);
</span><span class="lines">@@ -126,7 +126,7 @@
</span><span class="cx">     let instances = [];
</span><span class="cx">     for (let i = 0; i < num; ++i) {
</span><span class="cx">         let table = makeTable();
</span><del>-        instances[i] = new WebAssembly.Instance(module, { imp: { func: counterSetters[i], table, table0: new WebAssembly.Table({initial: 0, maximum: 0, element: "anyfunc"}) } });
</del><ins>+        instances[i] = new WebAssembly.Instance(module, { imp: { func: counterSetters[i], table, table0: new WebAssembly.Table({initial: 0, maximum: 0, element: "funcref"}) } });
</ins><span class="cx">         table.set(0, instances[i].exports.callFunc);
</span><span class="cx">     }
</span><span class="cx">     for (let i = 0; i < 2048; ++i) {
</span></span></pre></div>
<a id="trunkJSTestswasmjsapielementdatajs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/js-api/element-data.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/js-api/element-data.js        2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/js-api/element-data.js   2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -10,7 +10,7 @@
</span><span class="cx">         .Type().End()
</span><span class="cx">         .Import()
</span><span class="cx">             .Memory("imp", "memory", memoryDescription)
</span><del>-            .Table("imp", "table", {element: "anyfunc", initial: 19}) // unspecified maximum.
</del><ins>+            .Table("imp", "table", {element: "funcref", initial: 19}) // unspecified maximum.
</ins><span class="cx">         .End()
</span><span class="cx">         .Function().End()
</span><span class="cx">         .Element()
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx">     const bin = builder.WebAssembly().get();
</span><span class="cx">     const module = new WebAssembly.Module(bin);
</span><span class="cx">     const memory = new WebAssembly.Memory(memoryDescription);
</span><del>-    const table = new WebAssembly.Table({element: "anyfunc", initial: 19});
</del><ins>+    const table = new WebAssembly.Table({element: "funcref", initial: 19});
</ins><span class="cx">     const imports = {
</span><span class="cx">         imp: {
</span><span class="cx">             memory: memory,
</span></span></pre></div>
<a id="trunkJSTestswasmjsapielementjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/js-api/element.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/js-api/element.js     2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/js-api/element.js        2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx">         .Type().End()
</span><span class="cx">         .Function().End()
</span><span class="cx">         .Table()
</span><del>-            .Table({element: "anyfunc", initial: 20})
</del><ins>+            .Table({element: "funcref", initial: 20})
</ins><span class="cx">         .End()
</span><span class="cx">         .Element()
</span><span class="cx">             .Element({tableIndex: 1, offset: 0, functionIndices: [0]})
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx">         .Type().End()
</span><span class="cx">         .Function().End()
</span><span class="cx">         .Table()
</span><del>-            .Table({element: "anyfunc", initial: 20, maximum: 20})
</del><ins>+            .Table({element: "funcref", initial: 20, maximum: 20})
</ins><span class="cx">         .End()
</span><span class="cx">         .Element()
</span><span class="cx">             .Element({offset: 19, functionIndices: [0, 0]})
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx">         .Type().End()
</span><span class="cx">         .Function().End()
</span><span class="cx">         .Table()
</span><del>-            .Table({element: "anyfunc", initial: 20, maximum: 20})
</del><ins>+            .Table({element: "funcref", initial: 20, maximum: 20})
</ins><span class="cx">         .End()
</span><span class="cx">         .Element()
</span><span class="cx">             .Element({offset: 20, functionIndices: [0]})
</span><span class="lines">@@ -98,7 +98,7 @@
</span><span class="cx">         .Type().End()
</span><span class="cx">         .Function().End()
</span><span class="cx">         .Table()
</span><del>-            .Table({element: "anyfunc", initial: 20, maximum: 20})
</del><ins>+            .Table({element: "funcref", initial: 20, maximum: 20})
</ins><span class="cx">         .End()
</span><span class="cx">         .Element()
</span><span class="cx">             .Element({offset: 0, functionIndices: [0, 0, 1]})
</span><span class="lines">@@ -121,7 +121,7 @@
</span><span class="cx">         const builder = new Builder()
</span><span class="cx">             .Type().End()
</span><span class="cx">             .Import()
</span><del>-                .Table("imp", "table", {element: "anyfunc", initial: 19}) // unspecified maximum.
</del><ins>+                .Table("imp", "table", {element: "funcref", initial: 19}) // unspecified maximum.
</ins><span class="cx">             .End()
</span><span class="cx">             .Function().End()
</span><span class="cx">             .Element()
</span><span class="lines">@@ -142,7 +142,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     for (let i = 19; i < 19 + 5; i++) {
</span><del>-        const table = new WebAssembly.Table({element: "anyfunc", initial: i});
</del><ins>+        const table = new WebAssembly.Table({element: "funcref", initial: i});
</ins><span class="cx">         badInstantiation(table, WebAssembly.LinkError, "Element is trying to set an out of bounds table index (evaluating 'new WebAssembly.Instance(module, {imp: {table: actualTable}})')");
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -152,7 +152,7 @@
</span><span class="cx">         const builder = new Builder()
</span><span class="cx">             .Type().End()
</span><span class="cx">             .Import()
</span><del>-                .Table("imp", "table", {element: "anyfunc", initial: 19}) // unspecified maximum.
</del><ins>+                .Table("imp", "table", {element: "funcref", initial: 19}) // unspecified maximum.
</ins><span class="cx">                 .Global().I32("imp", "global", "immutable").End()
</span><span class="cx">             .End()
</span><span class="cx">             .Function().End()
</span><span class="lines">@@ -173,7 +173,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function test(i) {
</span><del>-        const table = new WebAssembly.Table({element: "anyfunc", initial: 19});
</del><ins>+        const table = new WebAssembly.Table({element: "funcref", initial: 19});
</ins><span class="cx">         const global = i;
</span><span class="cx">         const module = makeModule();
</span><span class="cx">         const instance = new WebAssembly.Instance(module, {imp: {table, global}});
</span><span class="lines">@@ -195,7 +195,7 @@
</span><span class="cx">         const builder = new Builder()
</span><span class="cx">             .Type().End()
</span><span class="cx">             .Import()
</span><del>-                .Table("imp", "table", {element: "anyfunc", initial: 19}) // unspecified maximum.
</del><ins>+                .Table("imp", "table", {element: "funcref", initial: 19}) // unspecified maximum.
</ins><span class="cx">                 .Global().F32("imp", "global", "immutable").End()
</span><span class="cx">             .End()
</span><span class="cx">             .Function().End()
</span></span></pre></div>
<a id="trunkJSTestswasmjsapiextensionMemoryModejs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/js-api/extension-MemoryMode.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/js-api/extension-MemoryMode.js        2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/js-api/extension-MemoryMode.js   2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -18,7 +18,7 @@
</span><span class="cx"> assert.throws(() => WebAssemblyMemoryMode(""), TypeError, message);
</span><span class="cx"> assert.throws(() => WebAssemblyMemoryMode({}), TypeError, message);
</span><span class="cx"> assert.throws(() => WebAssemblyMemoryMode(new WebAssembly.Module(emptyModuleArray)), TypeError, message);
</span><del>-assert.throws(() => WebAssemblyMemoryMode(new WebAssembly.Table({initial: 1, element: "anyfunc"})), TypeError, message);
</del><ins>+assert.throws(() => WebAssemblyMemoryMode(new WebAssembly.Table({initial: 1, element: "funcref"})), TypeError, message);
</ins><span class="cx"> 
</span><span class="cx"> const validateMode = what => {
</span><span class="cx">     const mode = WebAssemblyMemoryMode(what);
</span></span></pre></div>
<a id="trunkJSTestswasmjsapitablejs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/js-api/table.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/js-api/table.js       2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/js-api/table.js  2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -5,11 +5,11 @@
</span><span class="cx">     const builder = new Builder()
</span><span class="cx">         .Type().End()
</span><span class="cx">         .Import()
</span><del>-            .Table("imp", "table", {initial: 20, element: "anyfunc"})
</del><ins>+            .Table("imp", "table", {initial: 20, element: "funcref"})
</ins><span class="cx">         .End()
</span><span class="cx">         .Function().End()
</span><span class="cx">         .Table()
</span><del>-            .Table({initial: 20, maximum: 30, element: "anyfunc"})
</del><ins>+            .Table({initial: 20, maximum: 30, element: "funcref"})
</ins><span class="cx">         .End()
</span><span class="cx">         .Code()
</span><span class="cx">         .End();
</span><span class="lines">@@ -33,8 +33,8 @@
</span><span class="cx">         .Type().End()
</span><span class="cx">         .Function().End()
</span><span class="cx">         .Table()
</span><del>-            .Table({initial: 20, maximum: 30, element: "anyfunc"})
-            .Table({initial: 20, maximum: 30, element: "anyfunc"})
</del><ins>+            .Table({initial: 20, maximum: 30, element: "funcref"})
+            .Table({initial: 20, maximum: 30, element: "funcref"})
</ins><span class="cx">         .End()
</span><span class="cx">         .Code()
</span><span class="cx">         .End();
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx">         .Type().End()
</span><span class="cx">         .Function().End()
</span><span class="cx">         .Table()
</span><del>-            .Table({initial:20, element:"anyfunc"})
</del><ins>+            .Table({initial:20, element:"funcref"})
</ins><span class="cx">         .End()
</span><span class="cx">         .Export()
</span><span class="cx">             .Function("foo")
</span><span class="lines">@@ -81,8 +81,8 @@
</span><span class="cx">         .Type().End()
</span><span class="cx">         .Function().End()
</span><span class="cx">         .Table()
</span><del>-            .Table({initial:20, element:"anyfunc"})
-            .Table({initial:20, element:"anyfunc"})
</del><ins>+            .Table({initial:20, element:"funcref"})
+            .Table({initial:20, element:"funcref"})
</ins><span class="cx">         .End()
</span><span class="cx">         .Export()
</span><span class="cx">             .Function("foo")
</span><span class="lines">@@ -116,7 +116,7 @@
</span><span class="cx">         .Type().End()
</span><span class="cx">         .Function().End()
</span><span class="cx">         .Table()
</span><del>-            .Table({initial: 20, maximum: 30, element: "anyfunc"})
</del><ins>+            .Table({initial: 20, maximum: 30, element: "funcref"})
</ins><span class="cx">         .End()
</span><span class="cx">         .Export()
</span><span class="cx">             .Table("foo", 1)
</span><span class="lines">@@ -153,40 +153,40 @@
</span><span class="cx"> {
</span><span class="cx">     let badDescriptions = [
</span><span class="cx">         [{initial: 10, element: "i32"},
</span><del>-         "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())')"],
</del><ins>+         "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())')"],
</ins><span class="cx">         [{initial: 10, element: "f32"},
</span><del>-         "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())')"],
</del><ins>+         "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())')"],
</ins><span class="cx">         [{initial: 10, element: "f64"},
</span><del>-         "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())')"],
</del><ins>+         "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())')"],
</ins><span class="cx">         [{initial: 10, element: "i64"},
</span><del>-         "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())')"],
</del><ins>+         "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())')"],
</ins><span class="cx">         [{initial: 10, maximum: 20, element: "i32"},
</span><del>-         "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())')"],
</del><ins>+         "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())')"],
</ins><span class="cx">         [{initial: 10, maximum: 20, element: "f32"},
</span><del>-         "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())')"],
</del><ins>+         "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())')"],
</ins><span class="cx">         [{initial: 10, maximum: 20, element: "f64"},
</span><del>-         "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())')"],
</del><ins>+         "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())')"],
</ins><span class="cx">         [{initial: 10, maximum: 20, element: "i64"},
</span><del>-         "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())')"],
</del><ins>+         "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())')"],
</ins><span class="cx"> 
</span><del>-        [{initial: 10, maximum: 9, element: "anyfunc"},
</del><ins>+        [{initial: 10, maximum: 9, element: "funcref"},
</ins><span class="cx">          "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())')",
</span><span class="cx">          "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())')"],
</span><del>-        [{initial: 1, maximum: 0, element: "anyfunc"},
</del><ins>+        [{initial: 1, maximum: 0, element: "funcref"},
</ins><span class="cx">          "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())')",
</span><span class="cx">          "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())')"],
</span><del>-        [{initial: 2**32 - 1, maximum: 2**32 - 2, element: "anyfunc"},
</del><ins>+        [{initial: 2**32 - 1, maximum: 2**32 - 2, element: "funcref"},
</ins><span class="cx">          "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())')",
</span><span class="cx">          "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())')"],
</span><del>-        [{initial: 2**31, element: "anyfunc"},
</del><ins>+        [{initial: 2**31, element: "funcref"},
</ins><span class="cx">          "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())')",
</span><span class="cx">          "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())')"],
</span><span class="cx">     ];
</span><span class="lines">@@ -201,8 +201,8 @@
</span><span class="cx">     const builder = new Builder()
</span><span class="cx">         .Type().End()
</span><span class="cx">         .Import()
</span><del>-            .Table("imp", "table", {initial: 20, element: "anyfunc"})
-            .Table("imp", "table", {initial: 20, element: "anyfunc"})
</del><ins>+            .Table("imp", "table", {initial: 20, element: "funcref"})
+            .Table("imp", "table", {initial: 20, element: "funcref"})
</ins><span class="cx">         .End()
</span><span class="cx">         .Function().End()
</span><span class="cx">         .Code()
</span><span class="lines">@@ -226,10 +226,10 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     const badTables = [
</span><del>-        [{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}})')"],
</del><ins>+        [{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}})')"],
</ins><span class="cx">     ];
</span><span class="cx">     for (const [d, t, m] of badTables) {
</span><span class="cx">         assertBadTableInstance(d, t, m);
</span><span class="lines">@@ -240,7 +240,7 @@
</span><span class="cx"> 
</span><span class="cx"> {
</span><span class="cx">     {
</span><del>-        const table = new WebAssembly.Table({element: "anyfunc", initial: 20, maximum: 30});
</del><ins>+        const table = new WebAssembly.Table({element: "funcref", initial: 20, maximum: 30});
</ins><span class="cx">         assert.eq(20, table.grow(0));
</span><span class="cx">         assert.eq(20, table.length);
</span><span class="cx">         assert.eq(20, table.grow(1));
</span><span class="lines">@@ -248,7 +248,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     {
</span><del>-        const table = new WebAssembly.Table({element: "anyfunc", initial: 20, maximum: 30});
</del><ins>+        const table = new WebAssembly.Table({element: "funcref", initial: 20, maximum: 30});
</ins><span class="cx">         assert.eq(20, table.grow(10));
</span><span class="cx">         assert.eq(30, table.grow(0));
</span><span class="cx">         assert.throws(() => table.grow(1), RangeError, "WebAssembly.Table.prototype.grow could not grow the table");
</span><span class="lines">@@ -255,7 +255,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     {
</span><del>-        const table = new WebAssembly.Table({element: "anyfunc", initial: 20});
</del><ins>+        const table = new WebAssembly.Table({element: "funcref", initial: 20});
</ins><span class="cx">         let called = false;
</span><span class="cx">         table.grow({valueOf() { called = true; return 42; }});
</span><span class="cx">         assert.truthy(called);
</span><span class="lines">@@ -263,7 +263,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     {
</span><del>-        const table = new WebAssembly.Table({element: "anyfunc", initial: 20});
</del><ins>+        const table = new WebAssembly.Table({element: "funcref", initial: 20});
</ins><span class="cx">         assert.throws(() => table.get(20), RangeError, "WebAssembly.Table.prototype.get expects an integer less than the length of the table");
</span><span class="cx">         for (let i = 0; i < 20; i++)
</span><span class="cx">             assert.eq(table.get(i), null);
</span><span class="lines">@@ -270,7 +270,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     {
</span><del>-        const table = new WebAssembly.Table({element: "anyfunc", initial: 20});
</del><ins>+        const table = new WebAssembly.Table({element: "funcref", initial: 20});
</ins><span class="cx">         assert.throws(() => table.set(20, null), RangeError, "WebAssembly.Table.prototype.set expects an integer less than the length of the table");
</span><span class="cx">         for (let i = 0; i < 20; i++)
</span><span class="cx">             table.set(i, null);
</span><span class="lines">@@ -278,7 +278,7 @@
</span><span class="cx"> 
</span><span class="cx">     {
</span><span class="cx">         // This should not throw
</span><del>-        new WebAssembly.Table({initial: 2**20, maximum: 2**32 - 1, element: "anyfunc"});
</del><ins>+        new WebAssembly.Table({initial: 2**20, maximum: 2**32 - 1, element: "funcref"});
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -288,7 +288,7 @@
</span><span class="cx">         const builder = new Builder()
</span><span class="cx">             .Type().End()
</span><span class="cx">             .Import()
</span><del>-                .Table("imp", "table", {initial: 25, element: "anyfunc"})
</del><ins>+                .Table("imp", "table", {initial: 25, element: "funcref"})
</ins><span class="cx">             .End()
</span><span class="cx">             .Function().End()
</span><span class="cx">             .Code()
</span><span class="lines">@@ -306,7 +306,7 @@
</span><span class="cx">     const builder = new Builder()
</span><span class="cx">         .Type().End()
</span><span class="cx">         .Import()
</span><del>-            .Table("imp", "table", {initial: 25, element: "anyfunc"})
</del><ins>+            .Table("imp", "table", {initial: 25, element: "funcref"})
</ins><span class="cx">         .End()
</span><span class="cx">         .Function().End()
</span><span class="cx">         .Export()
</span><span class="lines">@@ -316,7 +316,7 @@
</span><span class="cx">         .Code().End();
</span><span class="cx"> 
</span><span class="cx">     const module = new WebAssembly.Module(builder.WebAssembly().get());
</span><del>-    const table = new WebAssembly.Table({element: "anyfunc", initial: 25});
</del><ins>+    const table = new WebAssembly.Table({element: "funcref", initial: 25});
</ins><span class="cx">     const instance = new WebAssembly.Instance(module, {imp: {table}});
</span><span class="cx">     assert.truthy(table === instance.exports.table);
</span><span class="cx">     assert.truthy(table === instance.exports.table2);
</span><span class="lines">@@ -327,7 +327,7 @@
</span><span class="cx">         .Type().End()
</span><span class="cx">         .Function().End()
</span><span class="cx">         .Table()
</span><del>-            .Table({initial: 20, maximum: 30, element: "anyfunc"})
</del><ins>+            .Table({initial: 20, maximum: 30, element: "funcref"})
</ins><span class="cx">         .End()
</span><span class="cx">         .Export()
</span><span class="cx">             .Table("table", 0)
</span><span class="lines">@@ -347,8 +347,8 @@
</span><span class="cx">         .Type().End()
</span><span class="cx">         .Function().End()
</span><span class="cx">         .Table()
</span><del>-            .Table({initial: 0, maximum: 1, element: "anyfunc"})
-            .Table({initial: 20, maximum: 30, element: "anyfunc"})
</del><ins>+            .Table({initial: 0, maximum: 1, element: "funcref"})
+            .Table({initial: 20, maximum: 30, element: "funcref"})
</ins><span class="cx">         .End()
</span><span class="cx">         .Export()
</span><span class="cx">             .Table("table0", 0)
</span></span></pre></div>
<a id="trunkJSTestswasmjsapitest_basic_apijs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/js-api/test_basic_api.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/js-api/test_basic_api.js      2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/js-api/test_basic_api.js 2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -93,9 +93,9 @@
</span><span class="cx">         new WebAssembly.Memory({initial: 20});
</span><span class="cx">         break;
</span><span class="cx">     case "Table":
</span><del>-        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"});
</del><ins>+        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"});
</ins><span class="cx">         break;
</span><span class="cx">     case "CompileError":
</span><span class="cx">     case "LinkError":
</span></span></pre></div>
<a id="trunkJSTestswasmjsapiuniquesignaturejs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/js-api/unique-signature.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/js-api/unique-signature.js    2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/js-api/unique-signature.js       2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -16,7 +16,7 @@
</span><span class="cx">         .End()
</span><span class="cx">         .Function().End()
</span><span class="cx">         .Table()
</span><del>-            .Table({initial: 4, maximum: 4, element: "anyfunc"})
</del><ins>+            .Table({initial: 4, maximum: 4, element: "funcref"})
</ins><span class="cx">         .End()
</span><span class="cx">         .Export()
</span><span class="cx">             .Function("entry")
</span></span></pre></div>
<a id="trunkJSTestswasmjsapiwrapperfunctionjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/js-api/wrapper-function.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/js-api/wrapper-function.js    2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/js-api/wrapper-function.js       2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> {
</span><del>-    const tableDescription = {element: "anyfunc", initial: 2};
</del><ins>+    const tableDescription = {element: "funcref", initial: 2};
</ins><span class="cx">     function makeInstance(type, imp) {
</span><span class="cx">         const builder = new Builder()
</span><span class="cx">             .Type()
</span></span></pre></div>
<a id="trunkJSTestswasmmodulestablewat"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/modules/table.wat (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/modules/table.wat     2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/modules/table.wat        2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> (module
</span><del>-    (table $table (export "table") 3 anyfunc)
</del><ins>+    (table $table (export "table") 3 funcref)
</ins><span class="cx">     (func $f0 (result i32) i32.const 42)
</span><span class="cx">     (func $f1 (result i32) i32.const 83)
</span><span class="cx">     (elem (i32.const 0) $f0 $f1))
</span></span></pre></div>
<a id="trunkJSTestswasmmoduleswasmimportsjsreexportswasmexportsimportswat"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/imports.wat (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/imports.wat   2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/imports.wat      2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> (module
</span><span class="cx">     (import "./re-export.js" "sum" (func $sum (param i32 i32) (result i32)))
</span><span class="cx">     (import "./re-export.js" "answer" (global i32))
</span><del>-    (import "./re-export.js" "table" (table $table 4 anyfunc))
</del><ins>+    (import "./re-export.js" "table" (table $table 4 funcref))
</ins><span class="cx">     (export "table" (table $table))
</span><span class="cx">     (type $t0 (func (param i32) (result i32)))
</span><span class="cx">     (func $addOne (export "addOne") (type $t0) (param $p0 i32) (result i32)
</span></span></pre></div>
<a id="trunkJSTestswasmmoduleswasmimportsjsreexportswasmexportssumwat"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/sum.wat (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/sum.wat       2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/sum.wat  2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -5,5 +5,5 @@
</span><span class="cx">         get_local $p0
</span><span class="cx">         i32.add)
</span><span class="cx">     (global (export "answer") i32 i32.const 42)
</span><del>-    (table $table (export "table") 4 anyfunc)
</del><ins>+    (table $table (export "table") 4 funcref)
</ins><span class="cx">     (elem (i32.const 0) $sum))
</span></span></pre></div>
<a id="trunkJSTestswasmmoduleswasmimportswasmexportsimportswat"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/modules/wasm-imports-wasm-exports/imports.wat (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/modules/wasm-imports-wasm-exports/imports.wat 2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/modules/wasm-imports-wasm-exports/imports.wat    2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx">     (import "./sum.wasm" "answer2" (global f64))
</span><span class="cx">     (import "./sum.wasm" "answer3" (global f32))
</span><span class="cx">     (import "./sum.wasm" "answer4" (global f64))
</span><del>-    (import "./sum.wasm" "table" (table $table 4 anyfunc))
</del><ins>+    (import "./sum.wasm" "table" (table $table 4 funcref))
</ins><span class="cx">     (type $t0 (func (param i32) (result i32)))
</span><span class="cx">     (func $addOne (export "addOne") (type $t0) (param $p0 i32) (result i32)
</span><span class="cx">         i32.const 1
</span></span></pre></div>
<a id="trunkJSTestswasmmoduleswasmimportswasmexportssumwat"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/modules/wasm-imports-wasm-exports/sum.wat (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/modules/wasm-imports-wasm-exports/sum.wat     2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/modules/wasm-imports-wasm-exports/sum.wat        2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> (module
</span><del>-    (table $table (export "table") 4 anyfunc)
</del><ins>+    (table $table (export "table") 4 funcref)
</ins><span class="cx">     (type $t0 (func (param i32 i32) (result i32)))
</span><span class="cx">     (func $sum (export "sum") (type $t0) (param $p0 i32) (param $p1 i32) (result i32)
</span><span class="cx">         get_local $p1
</span></span></pre></div>
<a id="trunkJSTestswasmreferencesanyref_tablejs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/references/anyref_table.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/references/anyref_table.js    2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/references/anyref_table.js       2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -73,7 +73,7 @@
</span><span class="cx">     .Function("ret42", { params: [], ret: "i32" })
</span><span class="cx">       .I32Const(42)
</span><span class="cx">     .End()
</span><del>-    .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')")
</del><ins>+    .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')")
</ins><span class="cx"> 
</span><span class="cx"> function doGCSet() {
</span><span class="cx">     fullGC()
</span></span></pre></div>
<a id="trunkJSTestswasmreferencesanyref_table_importjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/references/anyref_table_import.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/references/anyref_table_import.js     2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/references/anyref_table_import.js        2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -210,7 +210,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> {
</span><del>-    const tbl = new WebAssembly.Table({initial:2, element:"anyfunc"});
</del><ins>+    const tbl = new WebAssembly.Table({initial:2, element:"funcref"});
</ins><span class="cx"> 
</span><span class="cx">     const mod = new WebAssembly.Module((new Builder())
</span><span class="cx">       .Type().End()
</span><span class="lines">@@ -225,3 +225,20 @@
</span><span class="cx"> 
</span><span class="cx">     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 }})')");
</span><span class="cx"> }
</span><ins>+
+{
+    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 }})')");
+}
</ins></span></pre></div>
<a id="trunkJSTestswasmreferencesfunc_refjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/references/func_ref.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/references/func_ref.js        2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/references/func_ref.js   2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx">     return instance.exports.h
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-function makeAnyfuncIdent() {
</del><ins>+function makeFuncrefIdent() {
</ins><span class="cx">     const builder = (new Builder())
</span><span class="cx">           .Type().End()
</span><span class="cx">           .Function().End()
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx">               .Function("h")
</span><span class="cx">           .End()
</span><span class="cx">           .Code()
</span><del>-            .Function("h", { params: ["anyfunc"], ret: "anyfunc" }, [])
</del><ins>+            .Function("h", { params: ["funcref"], ret: "funcref" }, [])
</ins><span class="cx">               .GetLocal(0)
</span><span class="cx">             .End()
</span><span class="cx">           .End();
</span><span class="lines">@@ -82,38 +82,38 @@
</span><span class="cx">               .Function("local_read")
</span><span class="cx">           .End()
</span><span class="cx">           .Code()
</span><del>-            .Function("h", { params: ["anyfunc"], ret: "anyref" }, ["anyref"])
</del><ins>+            .Function("h", { params: ["funcref"], ret: "anyref" }, ["anyref"])
</ins><span class="cx">               .GetLocal(0)
</span><span class="cx">               .SetLocal(1)
</span><span class="cx">               .GetLocal(1)
</span><span class="cx">             .End()
</span><span class="cx"> 
</span><del>-            .Function("i", { params: ["anyfunc"], ret: "anyfunc" }, ["anyfunc"])
</del><ins>+            .Function("i", { params: ["funcref"], ret: "funcref" }, ["funcref"])
</ins><span class="cx">               .GetLocal(0)
</span><span class="cx">               .SetLocal(1)
</span><span class="cx">               .GetLocal(1)
</span><span class="cx">             .End()
</span><span class="cx"> 
</span><del>-            .Function("get_h", { params: [], ret: "anyfunc" }, ["anyfunc"])
</del><ins>+            .Function("get_h", { params: [], ret: "funcref" }, ["funcref"])
</ins><span class="cx">               .I32Const(0)
</span><span class="cx">               .RefFunc(0)
</span><span class="cx">               .SetLocal(0)
</span><del>-              .If("anyfunc")
-              .Block("anyfunc", (b) =>
</del><ins>+              .If("funcref")
+              .Block("funcref", (b) =>
</ins><span class="cx">                 b.GetLocal(0)
</span><span class="cx">               )
</span><span class="cx">               .Else()
</span><del>-              .Block("anyfunc", (b) =>
</del><ins>+              .Block("funcref", (b) =>
</ins><span class="cx">                 b.GetLocal(0)
</span><span class="cx">               )
</span><span class="cx">               .End()
</span><span class="cx">             .End()
</span><span class="cx"> 
</span><del>-            .Function("fix", { params: [], ret: "anyfunc" }, [])
</del><ins>+            .Function("fix", { params: [], ret: "funcref" }, [])
</ins><span class="cx">               .RefFunc(3)
</span><span class="cx">             .End()
</span><span class="cx"> 
</span><del>-            .Function("get_not_exported", { params: [], ret: "anyfunc" }, [])
</del><ins>+            .Function("get_not_exported", { params: [], ret: "funcref" }, [])
</ins><span class="cx">               .RefFunc(5)
</span><span class="cx">             .End()
</span><span class="cx"> 
</span><span class="lines">@@ -121,7 +121,7 @@
</span><span class="cx">               .I32Const(42)
</span><span class="cx">             .End()
</span><span class="cx"> 
</span><del>-            .Function("local_read", { params: [], ret: "i32" }, ["anyfunc"])
</del><ins>+            .Function("local_read", { params: [], ret: "i32" }, ["funcref"])
</ins><span class="cx">               .GetLocal(0)
</span><span class="cx">               .RefIsNull()
</span><span class="cx">             .End()
</span><span class="lines">@@ -135,20 +135,20 @@
</span><span class="cx">     assert.eq(instance.exports.local_read(), 1)
</span><span class="cx">     assert.eq(instance.exports.h(null), null)
</span><span class="cx"> 
</span><del>-    assert.throws(() => instance.exports.h(fun), Error, "Anyfunc must be an exported wasm function (evaluating 'func(...args)')")
</del><ins>+    assert.throws(() => instance.exports.h(fun), Error, "Funcref must be an exported wasm function (evaluating 'func(...args)')")
</ins><span class="cx">     assert.eq(instance.exports.h(myfun), myfun)
</span><del>-    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)')")
</del><ins>+    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)')")
</ins><span class="cx"> 
</span><span class="cx">     assert.eq(instance.exports.i(null), null)
</span><span class="cx">     assert.eq(instance.exports.i(myfun), myfun)
</span><del>-    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)')")
</del><ins>+    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)')")
</ins><span class="cx"> 
</span><del>-    assert.throws(() => instance.exports.get_h()(fun), Error, "Anyfunc must be an exported wasm function (evaluating 'func(...args)')")
</del><ins>+    assert.throws(() => instance.exports.get_h()(fun), Error, "Funcref must be an exported wasm function (evaluating 'func(...args)')")
</ins><span class="cx">     assert.eq(instance.exports.get_h()(null), null)
</span><span class="cx">     assert.eq(instance.exports.get_h()(myfun), myfun)
</span><del>-    assert.throws(() => instance.exports.get_h()(5), Error, "Anyfunc must be an exported wasm function (evaluating 'func(...args)')")
</del><ins>+    assert.throws(() => instance.exports.get_h()(5), Error, "Funcref must be an exported wasm function (evaluating 'func(...args)')")
</ins><span class="cx"> 
</span><span class="cx">     assert.eq(instance.exports.get_not_exported()(), 42)
</span><span class="cx"> 
</span><span class="lines">@@ -167,14 +167,14 @@
</span><span class="cx">     const $1 = (() => new WebAssembly.Instance(new WebAssembly.Module((new Builder())
</span><span class="cx">       .Type().End()
</span><span class="cx">       .Import()
</span><del>-           .Global().Anyfunc("imp", "ref", "immutable").End()
</del><ins>+           .Global().Funcref("imp", "ref", "immutable").End()
</ins><span class="cx">       .End()
</span><span class="cx">       .Function().End()
</span><span class="cx">       .Global()
</span><del>-          .RefNull("anyfunc", "mutable")
-          .RefNull("anyfunc", "immutable")
-          .GetGlobal("anyfunc", 0, "mutable")
-          .RefFunc("anyfunc", 2, "immutable")
</del><ins>+          .RefNull("funcref", "mutable")
+          .RefNull("funcref", "immutable")
+          .GetGlobal("funcref", 0, "mutable")
+          .RefFunc("funcref", 2, "immutable")
</ins><span class="cx">       .End()
</span><span class="cx">       .Export()
</span><span class="cx">           .Function("set_glob")
</span><span class="lines">@@ -187,12 +187,12 @@
</span><span class="cx">           .Global("exp_glob_is_null", 4)
</span><span class="cx">       .End()
</span><span class="cx">       .Code()
</span><del>-        .Function("set_glob", { params: ["anyfunc"], ret: "void" })
</del><ins>+        .Function("set_glob", { params: ["funcref"], ret: "void" })
</ins><span class="cx">           .GetLocal(0)
</span><span class="cx">           .SetGlobal(1)
</span><span class="cx">         .End()
</span><span class="cx"> 
</span><del>-        .Function("get_glob", { params: [], ret: "anyfunc" })
</del><ins>+        .Function("get_glob", { params: [], ret: "funcref" })
</ins><span class="cx">             .GetGlobal(1)
</span><span class="cx">         .End()
</span><span class="cx"> 
</span><span class="lines">@@ -206,7 +206,7 @@
</span><span class="cx">             .Call(0)
</span><span class="cx">         .End()
</span><span class="cx"> 
</span><del>-        .Function("get_import", { params: [], ret: "anyfunc" })
</del><ins>+        .Function("get_import", { params: [], ret: "funcref" })
</ins><span class="cx">             .GetGlobal(0)
</span><span class="cx">         .End()
</span><span class="cx">       .End().WebAssembly().get()), { imp: { ref: makeExportedFunction(1337) } }))();
</span><span class="lines">@@ -223,7 +223,7 @@
</span><span class="cx">     $1.exports.set_glob(null); assert.eq($1.exports.get_glob(), null)
</span><span class="cx">     $1.exports.set_glob(myfun); assert.eq($1.exports.get_glob()(), 42);
</span><span class="cx"> 
</span><del>-    assert.throws(() => $1.exports.set_glob(fun), Error, "Anyfunc must be an exported wasm function (evaluating 'func(...args)')")
</del><ins>+    assert.throws(() => $1.exports.set_glob(fun), Error, "Funcref must be an exported wasm function (evaluating 'func(...args)')")
</ins><span class="cx"> 
</span><span class="cx">     assert.eq($1.exports.glob_is_null(), 0)
</span><span class="cx">     $1.exports.set_glob_null(); assert.eq($1.exports.get_glob(), null)
</span><span class="lines">@@ -233,7 +233,7 @@
</span><span class="cx"> assert.throws(() => new WebAssembly.Instance(new WebAssembly.Module((new Builder())
</span><span class="cx">   .Type().End()
</span><span class="cx">   .Import()
</span><del>-       .Global().Anyfunc("imp", "ref", "immutable").End()
</del><ins>+       .Global().Funcref("imp", "ref", "immutable").End()
</ins><span class="cx">   .End()
</span><span class="cx">   .Function().End()
</span><span class="cx">   .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')");
</span><span class="lines">@@ -242,7 +242,7 @@
</span><span class="cx">   .Type().End()
</span><span class="cx">   .Function().End()
</span><span class="cx">   .Code()
</span><del>-    .Function("h", { params: ["anyfunc"], ret: "anyref" })
</del><ins>+    .Function("h", { params: ["funcref"], ret: "anyref" })
</ins><span class="cx">       .GetLocal(0)
</span><span class="cx">     .End()
</span><span class="cx">   .End().WebAssembly().get()), Error, "WebAssembly.Module doesn't validate: control flow returns with unexpected type, in function at index 0 (evaluating 'new WebAssembly.Module')");
</span><span class="lines">@@ -251,7 +251,7 @@
</span><span class="cx">   .Type().End()
</span><span class="cx">   .Function().End()
</span><span class="cx">   .Table()
</span><del>-    .Table({initial: 1, element: "anyfunc"})
</del><ins>+    .Table({initial: 1, element: "funcref"})
</ins><span class="cx">   .End()
</span><span class="cx">   .Code()
</span><span class="cx">     .Function("h", { params: ["i32"], ret: "void" })
</span><span class="lines">@@ -259,7 +259,7 @@
</span><span class="cx">       .I32Const(0)
</span><span class="cx">       .TableSet(0)
</span><span class="cx">     .End()
</span><del>-  .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')");
</del><ins>+  .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')");
</ins><span class="cx"> 
</span><span class="cx"> // Tables
</span><span class="cx"> {
</span><span class="lines">@@ -268,10 +268,10 @@
</span><span class="cx">       .Function().End()
</span><span class="cx">       .Table()
</span><span class="cx">             .Table({initial: 0, element: "anyref"})
</span><del>-            .Table({initial: 1, element: "anyfunc"})
</del><ins>+            .Table({initial: 1, element: "funcref"})
</ins><span class="cx">       .End()
</span><span class="cx">       .Global()
</span><del>-          .RefNull("anyfunc", "mutable")
</del><ins>+          .RefNull("funcref", "mutable")
</ins><span class="cx">       .End()
</span><span class="cx">       .Export()
</span><span class="cx">           .Function("set_glob")
</span><span class="lines">@@ -280,12 +280,12 @@
</span><span class="cx">           .Function("ret_20")
</span><span class="cx">       .End()
</span><span class="cx">       .Code()
</span><del>-        .Function("set_glob", { params: ["anyfunc"], ret: "void" })
</del><ins>+        .Function("set_glob", { params: ["funcref"], ret: "void" })
</ins><span class="cx">           .GetLocal(0)
</span><span class="cx">           .SetGlobal(0)
</span><span class="cx">         .End()
</span><span class="cx"> 
</span><del>-        .Function("get_glob", { params: [], ret: "anyfunc" })
</del><ins>+        .Function("get_glob", { params: [], ret: "funcref" })
</ins><span class="cx">             .GetGlobal(0)
</span><span class="cx">         .End()
</span><span class="cx"> 
</span><span class="lines">@@ -314,11 +314,11 @@
</span><span class="cx">     $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)')")
</span><span class="cx">     $1.exports.set_glob(ident); assert.eq($1.exports.get_glob(), ident); assert.eq($1.exports.call_glob(42), 42)
</span><span class="cx"> 
</span><del>-    assert.throws(() => $1.exports.set_glob(fun), Error, "Anyfunc must be an exported wasm function (evaluating 'func(...args)')")
</del><ins>+    assert.throws(() => $1.exports.set_glob(fun), Error, "Funcref must be an exported wasm function (evaluating 'func(...args)')")
</ins><span class="cx">     $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)')")
</span><span class="cx"> 
</span><span class="cx">     for (let i=0; i<1000; ++i) {
</span><del>-        assert.throws(() => $1.exports.set_glob(function() {}), Error, "Anyfunc must be an exported wasm function (evaluating 'func(...args)')");
</del><ins>+        assert.throws(() => $1.exports.set_glob(function() {}), Error, "Funcref must be an exported wasm function (evaluating 'func(...args)')");
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -330,7 +330,7 @@
</span><span class="cx">       .Function().End()
</span><span class="cx">       .Table()
</span><span class="cx">             .Table({initial: 0, element: "anyref"})
</span><del>-            .Table({initial: 1, element: "anyfunc"})
</del><ins>+            .Table({initial: 1, element: "funcref"})
</ins><span class="cx">       .End()
</span><span class="cx">       .Export()
</span><span class="cx">           .Function("set")
</span><span class="lines">@@ -337,13 +337,13 @@
</span><span class="cx">           .Function("get")
</span><span class="cx">       .End()
</span><span class="cx">       .Code()
</span><del>-        .Function("set", { params: ["anyfunc"], ret: "void" })
</del><ins>+        .Function("set", { params: ["funcref"], ret: "void" })
</ins><span class="cx">           .I32Const(0)
</span><span class="cx">           .GetLocal(0)
</span><span class="cx">           .TableSet(1)
</span><span class="cx">         .End()
</span><span class="cx"> 
</span><del>-        .Function("get", { params: [], ret: "anyfunc" })
</del><ins>+        .Function("get", { params: [], ret: "funcref" })
</ins><span class="cx">             .I32Const(0)
</span><span class="cx">             .TableGet(1)
</span><span class="cx">         .End()
</span><span class="lines">@@ -376,15 +376,15 @@
</span><span class="cx"> 
</span><span class="cx"> // Wasm->JS Calls
</span><span class="cx"> 
</span><del>-for (let importedFun of [function(i) { return i; }, makeAnyfuncIdent()]) {
</del><ins>+for (let importedFun of [function(i) { return i; }, makeFuncrefIdent()]) {
</ins><span class="cx">     const $1 = new WebAssembly.Instance(new WebAssembly.Module((new Builder())
</span><span class="cx">       .Type().End()
</span><span class="cx">       .Import()
</span><del>-           .Function("imp", "h", { params: ["anyfunc"], ret: "anyfunc" })
</del><ins>+           .Function("imp", "h", { params: ["funcref"], ret: "funcref" })
</ins><span class="cx">       .End()
</span><span class="cx">       .Function().End()
</span><span class="cx">       .Table()
</span><del>-            .Table({initial: 1, element: "anyfunc"})
</del><ins>+            .Table({initial: 1, element: "funcref"})
</ins><span class="cx">       .End()
</span><span class="cx">       .Export()
</span><span class="cx">           .Function("test1")
</span><span class="lines">@@ -393,17 +393,17 @@
</span><span class="cx">           .Function("test4")
</span><span class="cx">       .End()
</span><span class="cx">       .Code()
</span><del>-        .Function("test1", { params: ["anyfunc"], ret: "anyfunc" })
</del><ins>+        .Function("test1", { params: ["funcref"], ret: "funcref" })
</ins><span class="cx">           .GetLocal(0)
</span><span class="cx">           .Call(0)
</span><span class="cx">         .End()
</span><span class="cx"> 
</span><del>-        .Function("test2", { params: [], ret: "anyfunc" })
</del><ins>+        .Function("test2", { params: [], ret: "funcref" })
</ins><span class="cx">           .RefFunc(1)
</span><span class="cx">           .Call(0)
</span><span class="cx">         .End()
</span><span class="cx"> 
</span><del>-        .Function("test3", { params: ["anyfunc"], ret: "anyfunc" })
</del><ins>+        .Function("test3", { params: ["funcref"], ret: "funcref" })
</ins><span class="cx">           .GetLocal(0)
</span><span class="cx">           .I32Const(0)
</span><span class="cx">           .RefFunc(0)
</span><span class="lines">@@ -412,7 +412,7 @@
</span><span class="cx">           .CallIndirect(0, 0)
</span><span class="cx">         .End()
</span><span class="cx"> 
</span><del>-        .Function("test4", { params: [], ret: "anyfunc" })
</del><ins>+        .Function("test4", { params: [], ret: "funcref" })
</ins><span class="cx">           .RefFunc(1)
</span><span class="cx">           .I32Const(0)
</span><span class="cx">           .RefFunc(0)
</span><span class="lines">@@ -430,10 +430,10 @@
</span><span class="cx">     for (let test of [$1.exports.test1, $1.exports.test3]) {
</span><span class="cx">         assert.eq(test(myfun), myfun)
</span><span class="cx">         assert.eq(test(myfun)(), 1337)
</span><del>-        assert.throws(() => test(fun), Error, "Anyfunc must be an exported wasm function (evaluating 'func(...args)')")
</del><ins>+        assert.throws(() => test(fun), Error, "Funcref must be an exported wasm function (evaluating 'func(...args)')")
</ins><span class="cx"> 
</span><span class="cx">         for (let i=0; i<1000; ++i) {
</span><del>-            assert.throws(() => test(fun), Error, "Anyfunc must be an exported wasm function (evaluating 'func(...args)')")
</del><ins>+            assert.throws(() => test(fun), Error, "Funcref must be an exported wasm function (evaluating 'func(...args)')")
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -440,10 +440,10 @@
</span><span class="cx">     for (let test of [$1.exports.test2, $1.exports.test4]) {
</span><span class="cx">         assert.eq(test(), $1.exports.test1)
</span><span class="cx">         assert.eq(test()(myfun), myfun)
</span><del>-        assert.throws(() => test()(fun), Error, "Anyfunc must be an exported wasm function (evaluating 'func(...args)')")
</del><ins>+        assert.throws(() => test()(fun), Error, "Funcref must be an exported wasm function (evaluating 'func(...args)')")
</ins><span class="cx"> 
</span><span class="cx">         for (let i=0; i<1000; ++i) {
</span><del>-            assert.throws(() => test()(fun), Error, "Anyfunc must be an exported wasm function (evaluating 'func(...args)')")
</del><ins>+            assert.throws(() => test()(fun), Error, "Funcref must be an exported wasm function (evaluating 'func(...args)')")
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkJSTestswasmreferencesmultitablejs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/references/multitable.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/references/multitable.js      2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/references/multitable.js 2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -171,8 +171,8 @@
</span><span class="cx">           .Type().End()
</span><span class="cx">           .Function().End()
</span><span class="cx">           .Table()
</span><del>-                .Table({initial: 3, maximum: 30, element: "anyfunc"})
-                .Table({initial: 2, maximum: 30, element: "anyfunc"})
</del><ins>+                .Table({initial: 3, maximum: 30, element: "funcref"})
+                .Table({initial: 2, maximum: 30, element: "funcref"})
</ins><span class="cx">           .End()
</span><span class="cx">           .Export()
</span><span class="cx">               .Function("call_tbl0")
</span><span class="lines">@@ -220,8 +220,8 @@
</span><span class="cx">           .Type().End()
</span><span class="cx">           .Function().End()
</span><span class="cx">           .Table()
</span><del>-                .Table({initial: 3, maximum: 30, element: "anyfunc"})
-                .Table({initial: 2, maximum: 30, element: "anyfunc"})
</del><ins>+                .Table({initial: 3, maximum: 30, element: "funcref"})
+                .Table({initial: 2, maximum: 30, element: "funcref"})
</ins><span class="cx">           .End()
</span><span class="cx">           .Export()
</span><span class="cx">               .Function("call_tbl0")
</span><span class="lines">@@ -272,8 +272,8 @@
</span><span class="cx">           .Type().End()
</span><span class="cx">           .Function().End()
</span><span class="cx">           .Table()
</span><del>-                .Table({initial: 3, maximum: 3, element: "anyfunc"})
-                .Table({initial: 2, maximum: 2, element: "anyfunc"})
</del><ins>+                .Table({initial: 3, maximum: 3, element: "funcref"})
+                .Table({initial: 2, maximum: 2, element: "funcref"})
</ins><span class="cx">           .End()
</span><span class="cx">           .Element()
</span><span class="cx">                 .Element({tableIndex: 1, offset: 0, functionIndices: [0]})
</span><span class="lines">@@ -291,7 +291,7 @@
</span><span class="cx">           .Function().End()
</span><span class="cx">           .Table()
</span><span class="cx">                 .Table({initial: 3, maximum: 3, element: "anyref"})
</span><del>-                .Table({initial: 2, maximum: 3, element: "anyfunc"})
</del><ins>+                .Table({initial: 2, maximum: 3, element: "funcref"})
</ins><span class="cx">           .End()
</span><span class="cx">           .Element()
</span><span class="cx">                 .Element({tableIndex: 1, offset: 0, functionIndices: [0]})
</span><span class="lines">@@ -302,7 +302,7 @@
</span><span class="cx">             .Function("ret42", { params: [], ret: "i32" })
</span><span class="cx">               .I32Const(42)
</span><span class="cx">             .End()
</span><del>-          .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')")
</del><ins>+          .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')")
</ins><span class="cx"> 
</span><span class="cx"> assert.throws(() => new WebAssembly.Instance(new WebAssembly.Module((new Builder())
</span><span class="cx">           .Type().End()
</span><span class="lines">@@ -309,7 +309,7 @@
</span><span class="cx">           .Function().End()
</span><span class="cx">           .Table()
</span><span class="cx">                 .Table({initial: 3, maximum: 3, element: "anyref"})
</span><del>-                .Table({initial: 2, maximum: 3, element: "anyfunc"})
</del><ins>+                .Table({initial: 2, maximum: 3, element: "funcref"})
</ins><span class="cx">           .End()
</span><span class="cx">           .Code()
</span><span class="cx">             .Function("fun", { params: [], ret: "anyref" })
</span><span class="lines">@@ -323,7 +323,7 @@
</span><span class="cx">           .Function().End()
</span><span class="cx">           .Table()
</span><span class="cx">                 .Table({initial: 3, maximum: 3, element: "anyref"})
</span><del>-                .Table({initial: 2, maximum: 3, element: "anyfunc"})
</del><ins>+                .Table({initial: 2, maximum: 3, element: "funcref"})
</ins><span class="cx">           .End()
</span><span class="cx">           .Code()
</span><span class="cx">             .Function("fun", { params: [], ret: "void" })
</span><span class="lines">@@ -338,7 +338,7 @@
</span><span class="cx">           .Function().End()
</span><span class="cx">           .Table()
</span><span class="cx">                 .Table({initial: 3, maximum: 3, element: "anyref"})
</span><del>-                .Table({initial: 2, maximum: 3, element: "anyfunc"})
</del><ins>+                .Table({initial: 2, maximum: 3, element: "funcref"})
</ins><span class="cx">           .End()
</span><span class="cx">           .Code()
</span><span class="cx">             .Function("fun", { params: [], ret: "void" })
</span><span class="lines">@@ -351,13 +351,13 @@
</span><span class="cx">           .Function().End()
</span><span class="cx">           .Table()
</span><span class="cx">                 .Table({initial: 3, maximum: 3, element: "anyref"})
</span><del>-                .Table({initial: 2, maximum: 3, element: "anyfunc"})
</del><ins>+                .Table({initial: 2, maximum: 3, element: "funcref"})
</ins><span class="cx">           .End()
</span><span class="cx">           .Code()
</span><span class="cx">             .Function("fun", { params: [], ret: "void" })
</span><span class="cx">               .CallIndirect(0,0)
</span><span class="cx">             .End()
</span><del>-          .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')")
</del><ins>+          .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')")
</ins><span class="cx"> 
</span><span class="cx"> assert.throws(() => new WebAssembly.Instance(new WebAssembly.Module((new Builder())
</span><span class="cx">           .Type().End()
</span><span class="lines">@@ -364,7 +364,7 @@
</span><span class="cx">           .Function().End()
</span><span class="cx">           .Table()
</span><span class="cx">                 .Table({initial: 3, maximum: 3, element: "anyref"})
</span><del>-                .Table({initial: 2, maximum: 3, element: "anyfunc"})
</del><ins>+                .Table({initial: 2, maximum: 3, element: "funcref"})
</ins><span class="cx">           .End()
</span><span class="cx">           .Code()
</span><span class="cx">             .Function("fun", { params: [], ret: "void" })
</span><span class="lines">@@ -371,7 +371,7 @@
</span><span class="cx">               .RefNull()
</span><span class="cx">               .TableGet(0)
</span><span class="cx">             .End()
</span><del>-          .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')")
</del><ins>+          .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')")
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> assert.throws(() => new WebAssembly.Instance(new WebAssembly.Module((new Builder())
</span><span class="lines">@@ -379,7 +379,7 @@
</span><span class="cx">           .Function().End()
</span><span class="cx">           .Table()
</span><span class="cx">                 .Table({initial: 3, maximum: 3, element: "anyref"})
</span><del>-                .Table({initial: 2, maximum: 3, element: "anyfunc"})
</del><ins>+                .Table({initial: 2, maximum: 3, element: "funcref"})
</ins><span class="cx">           .End()
</span><span class="cx">           .Code()
</span><span class="cx">             .Function("fun", { params: [], ret: "void" })
</span><span class="lines">@@ -387,7 +387,7 @@
</span><span class="cx">               .RefNull()
</span><span class="cx">               .TableSet(0)
</span><span class="cx">             .End()
</span><del>-          .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')")
</del><ins>+          .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')")
</ins><span class="cx"> 
</span><span class="cx"> assert.throws(() => new WebAssembly.Instance(new WebAssembly.Module((new Builder())
</span><span class="cx">           .Type().End()
</span><span class="lines">@@ -394,7 +394,7 @@
</span><span class="cx">           .Function().End()
</span><span class="cx">           .Table()
</span><span class="cx">                 .Table({initial: 3, maximum: 3, element: "anyref"})
</span><del>-                .Table({initial: 2, maximum: 3, element: "anyfunc"})
</del><ins>+                .Table({initial: 2, maximum: 3, element: "funcref"})
</ins><span class="cx">           .End()
</span><span class="cx">           .Code()
</span><span class="cx">             .Function("fun", { params: ["anyref"], ret: "void" })
</span><span class="lines">@@ -402,7 +402,7 @@
</span><span class="cx">               .GetLocal(0)
</span><span class="cx">               .TableSet(1)
</span><span class="cx">             .End()
</span><del>-          .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')")
</del><ins>+          .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')")
</ins><span class="cx"> 
</span><span class="cx"> function tableInsanity(num, b) {
</span><span class="cx">     b = b.Import()
</span><span class="lines">@@ -428,7 +428,7 @@
</span><span class="cx"> {
</span><span class="cx">     const $1 = new WebAssembly.Instance(new WebAssembly.Module(tableInsanity(1000000-2, (new Builder())
</span><span class="cx">           .Type().End())
</span><del>-                .Table({initial: 3, maximum: 3, element: "anyfunc"})
</del><ins>+                .Table({initial: 3, maximum: 3, element: "funcref"})
</ins><span class="cx">                 .Table({initial: 3, maximum: 3, element: "anyref"})
</span><span class="cx">           .End()
</span><span class="cx">           .Export()
</span></span></pre></div>
<a id="trunkJSTestswasmreferencestable_miscjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/references/table_misc.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/references/table_misc.js      2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/references/table_misc.js 2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -194,8 +194,8 @@
</span><span class="cx">           .Type().End()
</span><span class="cx">           .Function().End()
</span><span class="cx">           .Table()
</span><del>-                .Table({initial: 0, maximum: 0, element: "anyfunc"})
-                .Table({initial: 20, maximum: 30, element: "anyfunc"})
</del><ins>+                .Table({initial: 0, maximum: 0, element: "funcref"})
+                .Table({initial: 20, maximum: 30, element: "funcref"})
</ins><span class="cx">           .End()
</span><span class="cx">           .Export()
</span><span class="cx">               .Function("tbl_size")
</span></span></pre></div>
<a id="trunkJSTestswasmreferencesvalidationjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/references/validation.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/references/validation.js      2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/references/validation.js 2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx">     const builder = (new Builder())
</span><span class="cx">       .Type().End()
</span><span class="cx">       .Import()
</span><del>-            .Table("imp", "tbl", {initial: 2, element: "anyfunc"})
</del><ins>+            .Table("imp", "tbl", {initial: 2, element: "funcref"})
</ins><span class="cx">       .End()
</span><span class="cx">       .Function().End()
</span><span class="cx">       .Export()
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx">     const bin = builder.WebAssembly();
</span><span class="cx">     bin.trim();
</span><span class="cx"> 
</span><del>-    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())')");
</del><ins>+    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())')");
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> {
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx">     const builder = (new Builder())
</span><span class="cx">       .Type().End()
</span><span class="cx">       .Import()
</span><del>-            .Table("imp", "tbl", {initial: 2, element: "anyfunc"})
</del><ins>+            .Table("imp", "tbl", {initial: 2, element: "funcref"})
</ins><span class="cx">       .End()
</span><span class="cx">       .Function().End()
</span><span class="cx">       .Export()
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx">     const bin = builder.WebAssembly();
</span><span class="cx">     bin.trim();
</span><span class="cx"> 
</span><del>-    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())')");
</del><ins>+    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())')");
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> {
</span><span class="lines">@@ -73,7 +73,7 @@
</span><span class="cx">     const builder = (new Builder())
</span><span class="cx">       .Type().End()
</span><span class="cx">       .Import()
</span><del>-            .Table("imp", "tbl", {initial: 2, element: "anyfunc"})
</del><ins>+            .Table("imp", "tbl", {initial: 2, element: "funcref"})
</ins><span class="cx">       .End()
</span><span class="cx">       .Function().End()
</span><span class="cx">       .Export()
</span><span class="lines">@@ -93,5 +93,5 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> {
</span><del>-    assert.throws(() => new WebAssembly.Table({initial:2, element:"i32"}), TypeError, "WebAssembly.Table expects its 'element' field to be the string 'anyfunc' or 'anyref'");
</del><ins>+    assert.throws(() => new WebAssembly.Table({initial:2, element:"i32"}), TypeError, "WebAssembly.Table expects its 'element' field to be the string 'funcref' or 'anyref'");
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkJSTestswasmspecharnessindexjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/spec-harness/index.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/spec-harness/index.js 2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/spec-harness/index.js    2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx">         spectest: {
</span><span class="cx">             print: print,
</span><span class="cx">             global: 666,
</span><del>-            table: new WebAssembly.Table({initial: 10, maximum: 20, element: 'anyfunc'}),
</del><ins>+            table: new WebAssembly.Table({initial: 10, maximum: 20, element: 'funcref'}),
</ins><span class="cx">             memory: new WebAssembly.Memory({initial: 1, maximum: 2})
</span><span class="cx">         }
</span><span class="cx">     };
</span></span></pre></div>
<a id="trunkJSTestswasmspecharnesswasmconstantsjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/spec-harness/wasm-constants.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/spec-harness/wasm-constants.js        2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/spec-harness/wasm-constants.js   2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx"> let kLocalNamesCode = 2;
</span><span class="cx"> 
</span><span class="cx"> let kWasmFunctionTypeForm = 0x60;
</span><del>-let kWasmAnyFunctionTypeForm = 0x70;
</del><ins>+let kWasmFuncReftionTypeForm = 0x70;
</ins><span class="cx"> 
</span><span class="cx"> let kResizableMaximumFlag = 1;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkJSTestswasmspecharnesswasmmodulebuilderjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/spec-harness/wasm-module-builder.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/spec-harness/wasm-module-builder.js   2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/spec-harness/wasm-module-builder.js      2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -321,7 +321,7 @@
</span><span class="cx">             section.emit_u32v(imp.initial); // initial
</span><span class="cx">             if (has_max) section.emit_u32v(imp.maximum); // maximum
</span><span class="cx">           } else if (imp.kind == kExternalTable) {
</span><del>-            section.emit_u8(kWasmAnyFunctionTypeForm);
</del><ins>+            section.emit_u8(kWasmFuncReftionTypeForm);
</ins><span class="cx">             var has_max = (typeof imp.maximum) != "undefined";
</span><span class="cx">             section.emit_u8(has_max ? 1 : 0); // flags
</span><span class="cx">             section.emit_u32v(imp.initial); // initial
</span><span class="lines">@@ -354,7 +354,7 @@
</span><span class="cx">       if (debug) print("emitting table @ " + binary.length);
</span><span class="cx">       binary.emit_section(kTableSectionCode, section => {
</span><span class="cx">         section.emit_u8(1);  // one table entry
</span><del>-        section.emit_u8(kWasmAnyFunctionTypeForm);
</del><ins>+        section.emit_u8(kWasmFuncReftionTypeForm);
</ins><span class="cx">         section.emit_u8(1);
</span><span class="cx">         section.emit_u32v(wasm.function_table_length);
</span><span class="cx">         section.emit_u32v(wasm.function_table_length);
</span></span></pre></div>
<a id="trunkJSTestswasmspecharnesswastjs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/spec-harness/wast.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/spec-harness/wast.js  2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/spec-harness/wast.js     2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -14831,7 +14831,7 @@
</span><span class="cx">     return error(s, s[/* pos */2][0] - 1 | 0, "invalid element type");
</span><span class="cx">   }
</span><span class="cx">   else {
</span><del>-    return /* AnyFuncType */0;
</del><ins>+    return /* FuncRefType */0;
</ins><span class="cx">   }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -20706,7 +20706,7 @@
</span><span class="cx">                                   ];
</span><span class="cx">                           })]);
</span><span class="cx">         case 11 : 
</span><del>-            return /* ANYFUNC */0;
</del><ins>+            return /* FUNCREF */0;
</ins><span class="cx">         case 12 : 
</span><span class="cx">             return /* MUT */1;
</span><span class="cx">         case 13 : 
</span><span class="lines">@@ -25993,7 +25993,7 @@
</span><span class="cx">           ];
</span><span class="cx">   },
</span><span class="cx">   function () {
</span><del>-    return /* AnyFuncType */0;
</del><ins>+    return /* FuncRefType */0;
</ins><span class="cx">   },
</span><span class="cx">   function (__caml_parser_env) {
</span><span class="cx">     var _1 = Parsing.peek_val(__caml_parser_env, 0);
</span><span class="lines">@@ -27678,7 +27678,7 @@
</span><span class="cx">   /* 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\x1
 e\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&
 quot;\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\x
 a5\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\x
 e1\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\xa
 1\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',
</span><span class="cx">   /* 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>\x0
 1?\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&\x0
 1'\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(\x0
 1)\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\xf
 f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffH\x01",
</span><span class="cx">   /* error_function */parse_error,
</span><del>-  /* 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",
</del><ins>+  /* 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",
</ins><span class="cx">   /* names_block */"NAT\0INT\0FLOAT\0TEXT\0VAR\0VALUE_TYPE\0LOAD\0STORE\0OFFSET_EQ_NAT\0ALIGN_EQ_NAT\0CONST\0UNARY\0BINARY\0COMPARE\0CONVERT\0TEST\0"
</span><span class="cx"> ];
</span><span class="cx"> 
</span><span class="lines">@@ -29467,7 +29467,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function string_of_elem_type() {
</span><del>-  return "anyfunc";
</del><ins>+  return "funcref";
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function string_of_limits(param) {
</span><span class="lines">@@ -29482,7 +29482,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function string_of_table_type(param) {
</span><del>-  return string_of_limits(param[0]) + " anyfunc";
</del><ins>+  return string_of_limits(param[0]) + " funcref";
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function string_of_global_type(param) {
</span></span></pre></div>
<a id="trunkJSTestswasmspectestsjsapijs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/spec-tests/jsapi.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/spec-tests/jsapi.js   2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/spec-tests/jsapi.js      2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -514,16 +514,16 @@
</span><span class="cx">     assertThrows(() => new Table(1), TypeError);
</span><span class="cx">     assertThrows(() => new Table({initial:1, element:1}), TypeError);
</span><span class="cx">     assertThrows(() => new Table({initial:1, element:"any"}), TypeError);
</span><del>-    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);
</del><ins>+    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);
</ins><span class="cx"> }, "'WebAssembly.Table' constructor function");
</span><span class="cx"> 
</span><span class="cx"> test(() => {
</span><span class="lines">@@ -543,7 +543,7 @@
</span><span class="cx"> }, "'WebAssembly.Table.prototype' object");
</span><span class="cx"> 
</span><span class="cx"> test(() => {
</span><del>-    tbl1 = new Table({initial:2, element:"anyfunc"});
</del><ins>+    tbl1 = new Table({initial:2, element:"funcref"});
</ins><span class="cx">     assert_equals(typeof tbl1, "object");
</span><span class="cx">     assert_equals(String(tbl1), "[object WebAssembly.Table]");
</span><span class="cx">     assert_equals(Object.getPrototypeOf(tbl1), tableProto);
</span><span class="lines">@@ -631,7 +631,7 @@
</span><span class="cx">     assertThrows(() => tblGrow.call({}), TypeError);
</span><span class="cx">     assertThrows(() => tblGrow.call(tbl1, -1), RangeError);
</span><span class="cx">     assertThrows(() => tblGrow.call(tbl1, Math.pow(2,32)), RangeError);
</span><del>-    var tbl = new Table({element:"anyfunc", initial:1, maximum:2});
</del><ins>+    var tbl = new Table({element:"funcref", initial:1, maximum:2});
</ins><span class="cx">     assert_equals(tbl.length, 1);
</span><span class="cx">     assert_equals(tbl.grow(0), 1);
</span><span class="cx">     assert_equals(tbl.length, 1);
</span><span class="lines">@@ -732,7 +732,7 @@
</span><span class="cx">         }, 'unexpected success in assertInstantiateError');
</span><span class="cx">     }
</span><span class="cx">     var scratch_memory = new WebAssembly.Memory({initial:1});
</span><del>-    var scratch_table = new WebAssembly.Table({element:"anyfunc", initial:1, maximum:1});
</del><ins>+    var scratch_table = new WebAssembly.Table({element:"funcref", initial:1, maximum:1});
</ins><span class="cx">     assertInstantiateError([], TypeError);
</span><span class="cx">     assertInstantiateError([undefined], TypeError);
</span><span class="cx">     assertInstantiateError([1], TypeError);
</span></span></pre></div>
<a id="trunkJSTestswasmstresswasmtablegrowinitializejs"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/stress/wasm-table-grow-initialize.js (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/stress/wasm-table-grow-initialize.js  2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/stress/wasm-table-grow-initialize.js     2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -4,7 +4,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> var table = new WebAssembly.Table({
</span><del>-    element: "anyfunc",
</del><ins>+    element: "funcref",
</ins><span class="cx">     initial: 20
</span><span class="cx"> });
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkJSTestswasmwasmjson"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/wasm/wasm.json (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/wasm/wasm.json     2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/JSTests/wasm/wasm.json        2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -11,14 +11,14 @@
</span><span class="cx">         "i64":     { "type": "varint7", "value":  -2, "b3type": "B3::Int64" },
</span><span class="cx">         "f32":     { "type": "varint7", "value":  -3, "b3type": "B3::Float" },
</span><span class="cx">         "f64":     { "type": "varint7", "value":  -4, "b3type": "B3::Double" },
</span><del>-        "anyfunc": { "type": "varint7", "value": -16, "b3type": "B3::Int64" },
</del><ins>+        "funcref": { "type": "varint7", "value": -16, "b3type": "B3::Int64" },
</ins><span class="cx">         "anyref":  { "type": "varint7", "value": -17, "b3type": "B3::Int64" },
</span><span class="cx">         "func":    { "type": "varint7", "value": -32, "b3type": "B3::Void" },
</span><span class="cx">         "void":    { "type": "varint7", "value": -64, "b3type": "B3::Void" }
</span><span class="cx">     },
</span><del>-    "value_type": ["i32", "i64", "f32", "f64", "anyref", "anyfunc"],
-    "block_type": ["i32", "i64", "f32", "f64", "void", "anyref", "anyfunc"],
-    "elem_type": ["anyfunc","anyref"],
</del><ins>+    "value_type": ["i32", "i64", "f32", "f64", "anyref", "funcref"],
+    "block_type": ["i32", "i64", "f32", "f64", "void", "anyref", "funcref"],
+    "elem_type": ["funcref","anyref"],
</ins><span class="cx">     "external_kind": {
</span><span class="cx">         "Function": { "type": "uint8", "value": 0 },
</span><span class="cx">         "Table":    { "type": "uint8", "value": 1 },
</span><span class="lines">@@ -59,9 +59,9 @@
</span><span class="cx">         "i64.const":           { "category": "special",    "value":  66, "return": ["i64"],      "parameter": [],                       "immediate": [{"name": "value",          "type": "varint64"}],                                             "description": "a constant value interpreted as i64" },
</span><span class="cx">         "f64.const":           { "category": "special",    "value":  68, "return": ["f64"],      "parameter": [],                       "immediate": [{"name": "value",          "type": "double"}],                                               "description": "a constant value interpreted as f64" },
</span><span class="cx">         "f32.const":           { "category": "special",    "value":  67, "return": ["f32"],      "parameter": [],                       "immediate": [{"name": "value",          "type": "float"}],                                                "description": "a constant value interpreted as f32" },
</span><del>-        "ref.null":            { "category": "special",    "value": 208, "return": ["anyfunc"],  "parameter": [],                       "immediate": [],                                                                                           "description": "a constant null reference" },
</del><ins>+        "ref.null":            { "category": "special",    "value": 208, "return": ["funcref"],  "parameter": [],                       "immediate": [],                                                                                           "description": "a constant null reference" },
</ins><span class="cx">         "ref.is_null":         { "category": "special",    "value": 209, "return": ["i32"],      "parameter": ["anyref"],               "immediate": [],                                                                                           "description": "determine if a reference is null" },
</span><del>-        "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" },
</del><ins>+        "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" },
</ins><span class="cx">         "get_local":           { "category": "special",    "value":  32, "return": ["any"],      "parameter": [],                       "immediate": [{"name": "local_index",    "type": "varuint32"}],                                            "description": "read a local variable or parameter" },
</span><span class="cx">         "set_local":           { "category": "special",    "value":  33, "return": [],           "parameter": ["any"],                  "immediate": [{"name": "local_index",    "type": "varuint32"}],                                            "description": "write a local variable or parameter" },
</span><span class="cx">         "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" },
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog    2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/Source/JavaScriptCore/ChangeLog       2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -1,3 +1,53 @@
</span><ins>+2019-06-19  Justin Michaud  <justin_michaud@apple.com>
+
+        [WASM-References] Rename anyfunc to funcref
+        https://bugs.webkit.org/show_bug.cgi?id=198983
+
+        Reviewed by Yusuke Suzuki.
+
+        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:
+
</ins><span class="cx"> 2019-06-19  Fujii Hironori  <Hironori.Fujii@sony.com>
</span><span class="cx"> 
</span><span class="cx">         [CMake][Win] CombinedDomains.json is generated twice in JavaScriptCore_CopyPrivateHeaders and JavaScriptCore projects
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmAirIRGeneratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp  2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp     2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -365,7 +365,7 @@
</span><span class="cx">     TypedTmp g32() { return { newTmp(B3::GP), Type::I32 }; }
</span><span class="cx">     TypedTmp g64() { return { newTmp(B3::GP), Type::I64 }; }
</span><span class="cx">     TypedTmp gAnyref() { return { newTmp(B3::GP), Type::Anyref }; }
</span><del>-    TypedTmp gAnyfunc() { return { newTmp(B3::GP), Type::Anyfunc }; }
</del><ins>+    TypedTmp gFuncref() { return { newTmp(B3::GP), Type::Funcref }; }
</ins><span class="cx">     TypedTmp f32() { return { newTmp(B3::FP), Type::F32 }; }
</span><span class="cx">     TypedTmp f64() { return { newTmp(B3::FP), Type::F64 }; }
</span><span class="cx"> 
</span><span class="lines">@@ -376,8 +376,8 @@
</span><span class="cx">             return g32();
</span><span class="cx">         case Type::I64:
</span><span class="cx">             return g64();
</span><del>-        case Type::Anyfunc:
-            return gAnyfunc();
</del><ins>+        case Type::Funcref:
+            return gFuncref();
</ins><span class="cx">         case Type::Anyref:
</span><span class="cx">             return gAnyref();
</span><span class="cx">         case Type::F32:
</span><span class="lines">@@ -516,7 +516,7 @@
</span><span class="cx">                 break;
</span><span class="cx">             case Type::I64:
</span><span class="cx">             case Type::Anyref:
</span><del>-            case Type::Anyfunc:
</del><ins>+            case Type::Funcref:
</ins><span class="cx">                 resultType = B3::Int64;
</span><span class="cx">                 break;
</span><span class="cx">             case Type::F32:
</span><span class="lines">@@ -565,7 +565,7 @@
</span><span class="cx">             return Move32;
</span><span class="cx">         case Type::I64:
</span><span class="cx">         case Type::Anyref:
</span><del>-        case Type::Anyfunc:
</del><ins>+        case Type::Funcref:
</ins><span class="cx">             return Move;
</span><span class="cx">         case Type::F32:
</span><span class="cx">             return MoveFloat;
</span><span class="lines">@@ -813,7 +813,7 @@
</span><span class="cx">             break;
</span><span class="cx">         case Type::I64:
</span><span class="cx">         case Type::Anyref:
</span><del>-        case Type::Anyfunc:
</del><ins>+        case Type::Funcref:
</ins><span class="cx">             append(Move, arg, m_locals[i]);
</span><span class="cx">             break;
</span><span class="cx">         case Type::F32:
</span><span class="lines">@@ -899,7 +899,7 @@
</span><span class="cx">         m_locals.uncheckedAppend(local);
</span><span class="cx">         switch (type) {
</span><span class="cx">         case Type::Anyref:
</span><del>-        case Type::Anyfunc:
</del><ins>+        case Type::Funcref:
</ins><span class="cx">             append(Move, Arg::imm(JSValue::encode(jsNull())), local);
</span><span class="cx">             break;
</span><span class="cx">         case Type::I32:
</span><span class="lines">@@ -934,7 +934,7 @@
</span><span class="cx">     case Type::I32:
</span><span class="cx">     case Type::I64:
</span><span class="cx">     case Type::Anyref:
</span><del>-    case Type::Anyfunc:
</del><ins>+    case Type::Funcref:
</ins><span class="cx">         append(block, Move, Arg::bigImm(value), result);
</span><span class="cx">         break;
</span><span class="cx">     case Type::F32:
</span><span class="lines">@@ -973,7 +973,7 @@
</span><span class="cx"> auto AirIRGenerator::addRefFunc(uint32_t index, ExpressionType& result) -> PartialResult
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Emit this inline <https://bugs.webkit.org/show_bug.cgi?id=198506>.
</span><del>-    result = tmpForType(Type::Anyfunc);
</del><ins>+    result = tmpForType(Type::Funcref);
</ins><span class="cx">     emitCCall(&doWasmRefFunc, result, instanceValue(), addConstant(Type::I32, index));
</span><span class="cx"> 
</span><span class="cx">     return { };
</span><span class="lines">@@ -1699,7 +1699,7 @@
</span><span class="cx">             break;
</span><span class="cx">         case Type::I64:
</span><span class="cx">         case Type::Anyref:
</span><del>-        case Type::Anyfunc:
</del><ins>+        case Type::Funcref:
</ins><span class="cx">             append(Move, returnValues[0], returnValueGPR);
</span><span class="cx">             append(Ret64, returnValueGPR);
</span><span class="cx">             break;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmCallingConventionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmCallingConvention.h (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmCallingConvention.h 2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/Source/JavaScriptCore/wasm/WasmCallingConvention.h    2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -236,7 +236,7 @@
</span><span class="cx">         case Type::I32:
</span><span class="cx">         case Type::I64:
</span><span class="cx">         case Type::Anyref:
</span><del>-        case Wasm::Anyfunc:
</del><ins>+        case Wasm::Funcref:
</ins><span class="cx">             marshallArgumentImpl(m_gprArgs, gpArgumentCount, stackOffset, regFunc, stackFunc);
</span><span class="cx">             break;
</span><span class="cx">         case Type::F32:
</span><span class="lines">@@ -302,7 +302,7 @@
</span><span class="cx">         case Type::I32:
</span><span class="cx">         case Type::I64:
</span><span class="cx">         case Type::Anyref:
</span><del>-        case Wasm::Anyfunc:
</del><ins>+        case Wasm::Funcref:
</ins><span class="cx">             patchpoint->resultConstraint = B3::ValueRep::reg(GPRInfo::returnValueGPR);
</span><span class="cx">             break;
</span><span class="cx">         default:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmExceptionTypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmExceptionType.h (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmExceptionType.h     2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/Source/JavaScriptCore/wasm/WasmExceptionType.h        2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx">     macro(StackOverflow, "Stack overflow") \
</span><span class="cx">     macro(I64ArgumentType, "WebAssembly function with an i64 argument can't be called from JavaScript") \
</span><span class="cx">     macro(I64ReturnType, "WebAssembly function that returns i64 can't be called from JavaScript") \
</span><del>-    macro(FuncrefNotWasm, "Anyfunc must be an exported wasm function")
</del><ins>+    macro(FuncrefNotWasm, "Funcref must be an exported wasm function")
</ins><span class="cx"> 
</span><span class="cx"> enum class ExceptionType : uint32_t {
</span><span class="cx"> #define MAKE_ENUM(enumName, error) enumName,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmFormath"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmFormat.h (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmFormat.h    2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/Source/JavaScriptCore/wasm/WasmFormat.h       2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx">     case F64:
</span><span class="cx">         return true;
</span><span class="cx">     case Anyref:
</span><del>-    case Anyfunc:
</del><ins>+    case Funcref:
</ins><span class="cx">         return Options::useWebAssemblyReferences();
</span><span class="cx">     default:
</span><span class="cx">         break;
</span><span class="lines">@@ -80,7 +80,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (sub == parent)
</span><span class="cx">         return true;
</span><del>-    return sub == Anyfunc && parent == Anyref;
</del><ins>+    return sub == Funcref && parent == Anyref;
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> enum class ExternalKind : uint8_t {
</span><span class="lines">@@ -245,7 +245,7 @@
</span><span class="cx">     uint32_t initial() const { return m_initial; }
</span><span class="cx">     Optional<uint32_t> maximum() const { return m_maximum; }
</span><span class="cx">     TableElementType type() const { return m_type; }
</span><del>-    Wasm::Type wasmType() const { return m_type == TableElementType::Funcref ? Type::Anyfunc : Type::Anyref; }
</del><ins>+    Wasm::Type wasmType() const { return m_type == TableElementType::Funcref ? Type::Funcref : Type::Anyref; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     uint32_t m_initial;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmFunctionParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmFunctionParser.h (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmFunctionParser.h    2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/Source/JavaScriptCore/wasm/WasmFunctionParser.h       2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -342,7 +342,7 @@
</span><span class="cx"> 
</span><span class="cx">     case RefNull: {
</span><span class="cx">         WASM_PARSER_FAIL_IF(!Options::useWebAssemblyReferences(), "references are not enabled");
</span><del>-        m_expressionStack.append(m_context.addConstant(Anyfunc, JSValue::encode(jsNull())));
</del><ins>+        m_expressionStack.append(m_context.addConstant(Funcref, JSValue::encode(jsNull())));
</ins><span class="cx">         return { };
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -443,7 +443,7 @@
</span><span class="cx">         WASM_PARSER_FAIL_IF(!parseVarUInt32(tableIndex), "can't get call_indirect's table index");
</span><span class="cx">         WASM_PARSER_FAIL_IF(tableIndex >= m_info.tableCount(), "call_indirect's table index ", tableIndex, " invalid, limit is ", m_info.tableCount());
</span><span class="cx">         WASM_PARSER_FAIL_IF(m_info.usedSignatures.size() <= signatureIndex, "call_indirect's signature index ", signatureIndex, " exceeds known signatures ", m_info.usedSignatures.size());
</span><del>-        WASM_PARSER_FAIL_IF(m_info.tables[tableIndex].type() != TableElementType::Funcref, "call_indirect is only valid when a table has type anyfunc");
</del><ins>+        WASM_PARSER_FAIL_IF(m_info.tables[tableIndex].type() != TableElementType::Funcref, "call_indirect is only valid when a table has type funcref");
</ins><span class="cx"> 
</span><span class="cx">         const Signature& calleeSignature = m_info.usedSignatures[signatureIndex].get();
</span><span class="cx">         size_t argumentCount = calleeSignature.argumentCount() + 1; // Add the callee's index.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmSectionParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmSectionParser.cpp (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmSectionParser.cpp   2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/Source/JavaScriptCore/wasm/WasmSectionParser.cpp      2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -198,7 +198,7 @@
</span><span class="cx"> 
</span><span class="cx">     int8_t type;
</span><span class="cx">     WASM_PARSER_FAIL_IF(!parseInt7(type), "can't parse Table type");
</span><del>-    WASM_PARSER_FAIL_IF(type != Wasm::Anyfunc && type != Wasm::Anyref, "Table type should be anyfunc or anyref, got ", type);
</del><ins>+    WASM_PARSER_FAIL_IF(type != Wasm::Funcref && type != Wasm::Anyref, "Table type should be funcref or anyref, got ", type);
</ins><span class="cx"> 
</span><span class="cx">     uint32_t initial;
</span><span class="cx">     Optional<uint32_t> maximum;
</span><span class="lines">@@ -209,7 +209,7 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT(!maximum || *maximum >= initial);
</span><span class="cx"> 
</span><del>-    TableElementType tableType = type == Wasm::Anyfunc ? TableElementType::Funcref : TableElementType::Anyref;
</del><ins>+    TableElementType tableType = type == Wasm::Funcref ? TableElementType::Funcref : TableElementType::Anyref;
</ins><span class="cx">     m_info->tables.append(TableInformation(initial, maximum, isImport, tableType));
</span><span class="cx"> 
</span><span class="cx">     return { };
</span><span class="lines">@@ -378,7 +378,7 @@
</span><span class="cx"> 
</span><span class="cx">         WASM_PARSER_FAIL_IF(!parseVarUInt32(tableIndex), "can't get ", elementNum, "th Element table index");
</span><span class="cx">         WASM_PARSER_FAIL_IF(tableIndex >= m_info->tableCount(), "Element section for Table ", tableIndex, " exceeds available Table ", m_info->tableCount());
</span><del>-        WASM_PARSER_FAIL_IF(m_info->tables[tableIndex].type() != TableElementType::Funcref, "Table ", tableIndex, " must have type 'anyfunc' to have an element section");
</del><ins>+        WASM_PARSER_FAIL_IF(m_info->tables[tableIndex].type() != TableElementType::Funcref, "Table ", tableIndex, " must have type 'funcref' to have an element section");
</ins><span class="cx">         Type initExprType;
</span><span class="cx">         WASM_FAIL_IF_HELPER_FAILS(parseInitExpr(initOpcode, initExprBits, initExprType));
</span><span class="cx">         WASM_PARSER_FAIL_IF(initExprType != I32, "Element init_expr must produce an i32");
</span><span class="lines">@@ -481,7 +481,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     case RefNull: {
</span><del>-        resultType = Anyfunc;
</del><ins>+        resultType = Funcref;
</ins><span class="cx">         bitsOrImportNumber = JSValue::encode(jsNull());
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="lines">@@ -491,7 +491,7 @@
</span><span class="cx">         WASM_PARSER_FAIL_IF(!parseVarUInt32(index), "can't get ref.func index");
</span><span class="cx">         WASM_PARSER_FAIL_IF(index >= m_info->functions.size(), "ref.func index", index, " exceeds the number of functions ", m_info->functions.size());
</span><span class="cx"> 
</span><del>-        resultType = Anyfunc;
</del><ins>+        resultType = Funcref;
</ins><span class="cx">         bitsOrImportNumber = index;
</span><span class="cx">         break;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmValidatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmValidate.cpp (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmValidate.cpp        2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/Source/JavaScriptCore/wasm/WasmValidate.cpp   2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -238,7 +238,7 @@
</span><span class="cx"> 
</span><span class="cx"> auto Validate::addRefFunc(uint32_t index, ExpressionType& result) -> Result
</span><span class="cx"> {
</span><del>-    result = Type::Anyfunc;
</del><ins>+    result = Type::Funcref;
</ins><span class="cx">     WASM_VALIDATOR_FAIL_IF(index >= m_module.functionIndexSpaceSize(), "ref.func index ", index, " is too large, max is ", m_module.functionIndexSpaceSize());
</span><span class="cx">     m_module.addReferencedFunction(index);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSToWasmcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/JSToWasm.cpp (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSToWasm.cpp 2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/Source/JavaScriptCore/wasm/js/JSToWasm.cpp    2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -84,7 +84,7 @@
</span><span class="cx">             FALLTHROUGH;
</span><span class="cx">         case Wasm::I32:
</span><span class="cx">         case Wasm::Anyref:
</span><del>-        case Wasm::Anyfunc:
</del><ins>+        case Wasm::Funcref:
</ins><span class="cx">             if (numGPRs >= wasmCallingConvention().m_gprArgs.size())
</span><span class="cx">                 totalFrameSize += sizeof(void*);
</span><span class="cx">             ++numGPRs;
</span><span class="lines">@@ -154,7 +154,7 @@
</span><span class="cx">             switch (signature.argument(i)) {
</span><span class="cx">             case Wasm::I32:
</span><span class="cx">             case Wasm::I64:
</span><del>-            case Wasm::Anyfunc:
</del><ins>+            case Wasm::Funcref:
</ins><span class="cx">             case Wasm::Anyref:
</span><span class="cx">                 if (numGPRs >= wasmCallingConvention().m_gprArgs.size()) {
</span><span class="cx">                     if (signature.argument(i) == Wasm::I32) {
</span><span class="lines">@@ -240,7 +240,7 @@
</span><span class="cx">         jit.moveTrustedValue(jsUndefined(), JSValueRegs { GPRInfo::returnValueGPR });
</span><span class="cx">         break;
</span><span class="cx">     case Wasm::Anyref:
</span><del>-    case Wasm::Anyfunc:
</del><ins>+    case Wasm::Funcref:
</ins><span class="cx">         break;
</span><span class="cx">     case Wasm::I32:
</span><span class="cx">         jit.zeroExtend32ToPtr(GPRInfo::returnValueGPR, GPRInfo::returnValueGPR);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWasmToJScpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WasmToJS.cpp (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WasmToJS.cpp 2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/Source/JavaScriptCore/wasm/js/WasmToJS.cpp    2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -165,7 +165,7 @@
</span><span class="cx">             case I64:
</span><span class="cx">                 RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx">             case Anyref:
</span><del>-            case Anyfunc:
</del><ins>+            case Funcref:
</ins><span class="cx">             case I32: {
</span><span class="cx">                 GPRReg gprReg;
</span><span class="cx">                 if (marshalledGPRs < wasmCC.m_gprArgs.size())
</span><span class="lines">@@ -242,7 +242,7 @@
</span><span class="cx">                     case I32:
</span><span class="cx">                         arg = jsNumber(static_cast<int32_t>(buffer[argNum]));
</span><span class="cx">                         break;
</span><del>-                    case Anyfunc: {
</del><ins>+                    case Funcref: {
</ins><span class="cx">                         arg = JSValue::decode(buffer[argNum]);
</span><span class="cx">                         ASSERT(isWebAssemblyHostFunction(*vm, arg) || arg.isNull());
</span><span class="cx">                         break;
</span><span class="lines">@@ -280,7 +280,7 @@
</span><span class="cx">                     realResult = static_cast<uint64_t>(static_cast<uint32_t>(result.toInt32(exec)));
</span><span class="cx">                     break;
</span><span class="cx">                 }
</span><del>-                case Anyfunc: {
</del><ins>+                case Funcref: {
</ins><span class="cx">                     realResult = JSValue::encode(result);
</span><span class="cx">                     ASSERT(result.isFunction(*vm) || result.isNull());
</span><span class="cx">                     break;
</span><span class="lines">@@ -381,7 +381,7 @@
</span><span class="cx">             case I64:
</span><span class="cx">                 RELEASE_ASSERT_NOT_REACHED(); // Handled above.
</span><span class="cx">             case Anyref:
</span><del>-            case Anyfunc:
</del><ins>+            case Funcref:
</ins><span class="cx">             case I32: {
</span><span class="cx">                 GPRReg gprReg;
</span><span class="cx">                 if (marshalledGPRs < wasmCC.m_gprArgs.size())
</span><span class="lines">@@ -450,7 +450,7 @@
</span><span class="cx">             case I64:
</span><span class="cx">                 RELEASE_ASSERT_NOT_REACHED(); // Handled above.
</span><span class="cx">             case Anyref:
</span><del>-            case Anyfunc:
</del><ins>+            case Funcref:
</ins><span class="cx">             case I32:
</span><span class="cx">                 // Skipped: handled above.
</span><span class="cx">                 if (marshalledGPRs >= wasmCC.m_gprArgs.size())
</span><span class="lines">@@ -558,7 +558,7 @@
</span><span class="cx">         done.link(&jit);
</span><span class="cx">         break;
</span><span class="cx">     }
</span><del>-    case Anyfunc:
</del><ins>+    case Funcref:
</ins><span class="cx">     case Anyref:
</span><span class="cx">         break;
</span><span class="cx">     case F32: {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyFunctioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp      2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp 2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -84,9 +84,9 @@
</span><span class="cx">         case Wasm::I32:
</span><span class="cx">             arg = JSValue::decode(arg.toInt32(exec));
</span><span class="cx">             break;
</span><del>-        case Wasm::Anyfunc: {
</del><ins>+        case Wasm::Funcref: {
</ins><span class="cx">             if (!isWebAssemblyHostFunction(vm, arg) && !arg.isNull())
</span><del>-                return JSValue::encode(throwException(exec, scope, createJSWebAssemblyRuntimeError(exec, vm, "Anyfunc must be an exported wasm function")));
</del><ins>+                return JSValue::encode(throwException(exec, scope, createJSWebAssemblyRuntimeError(exec, vm, "Funcref must be an exported wasm function")));
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case Wasm::Anyref:
</span><span class="lines">@@ -232,7 +232,7 @@
</span><span class="cx">             argumentsIncludeI64 = true;
</span><span class="cx">             break;
</span><span class="cx">         case Wasm::Anyref:
</span><del>-        case Wasm::Anyfunc:
</del><ins>+        case Wasm::Funcref:
</ins><span class="cx">         case Wasm::I32:
</span><span class="cx">             if (numGPRs >= Wasm::wasmCallingConvention().m_gprArgs.size())
</span><span class="cx">                 totalFrameSize += sizeof(CPURegister);
</span><span class="lines">@@ -308,7 +308,7 @@
</span><span class="cx">                     ++numGPRs;
</span><span class="cx">                 }
</span><span class="cx">                 break;
</span><del>-            case Wasm::Anyfunc: {
</del><ins>+            case Wasm::Funcref: {
</ins><span class="cx">                 // FIXME: Emit this inline <https://bugs.webkit.org/show_bug.cgi?id=198506>.
</span><span class="cx">                 bool (*shouldThrow)(Wasm::Instance*, JSValue) = [] (Wasm::Instance* wasmInstance, JSValue arg) -> bool {
</span><span class="cx">                     JSWebAssemblyInstance* instance = wasmInstance->owner<JSWebAssemblyInstance>();
</span><span class="lines">@@ -492,7 +492,7 @@
</span><span class="cx">         isNaN.link(&jit);
</span><span class="cx">         break;
</span><span class="cx">     }
</span><del>-    case Wasm::Anyfunc:
</del><ins>+    case Wasm::Funcref:
</ins><span class="cx">     case Wasm::Anyref:
</span><span class="cx">         break;
</span><span class="cx">     case Wasm::I64:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyModuleRecordcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp  2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp     2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -237,7 +237,7 @@
</span><span class="cx">                 return exception(createJSWebAssemblyLinkError(exec, vm, importFailMessage(import, "imported global", "must be a number")));
</span><span class="cx">             // iii. Append ToWebAssemblyValue(v) to imports.
</span><span class="cx">             switch (moduleInformation.globals[import.kindIndex].type) {
</span><del>-            case Wasm::Anyfunc:
</del><ins>+            case Wasm::Funcref:
</ins><span class="cx">                 if (!isWebAssemblyHostFunction(vm, value) && !value.isNull())
</span><span class="cx">                     return exception(createJSWebAssemblyLinkError(exec, vm, importFailMessage(import, "imported global", "must be a wasm exported function or null")));
</span><span class="cx">                 m_instance->instance().setGlobal(import.kindIndex, value);
</span><span class="lines">@@ -410,7 +410,7 @@
</span><span class="cx">             // Return ToJSValue(v).
</span><span class="cx">             switch (global.type) {
</span><span class="cx">             case Wasm::Anyref:
</span><del>-            case Wasm::Anyfunc:
</del><ins>+            case Wasm::Funcref:
</ins><span class="cx">                 exportedValue = JSValue::decode(m_instance->instance().loadI64Global(exp.kindIndex));
</span><span class="cx">                 break;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyTableConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp      2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp 2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -65,12 +65,12 @@
</span><span class="cx">         RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx">         String elementString = elementValue.toWTFString(exec);
</span><span class="cx">         RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><del>-        if (elementString == "anyfunc")
</del><ins>+        if (elementString == "funcref" || elementString == "anyfunc")
</ins><span class="cx">             type = Wasm::TableElementType::Funcref;
</span><span class="cx">         else if (elementString == "anyref")
</span><span class="cx">             type = Wasm::TableElementType::Anyref;
</span><span class="cx">         else
</span><del>-            return JSValue::encode(throwException(exec, throwScope, createTypeError(exec, "WebAssembly.Table expects its 'element' field to be the string 'anyfunc' or 'anyref'"_s)));
</del><ins>+            return JSValue::encode(throwException(exec, throwScope, createTypeError(exec, "WebAssembly.Table expects its 'element' field to be the string 'funcref' or 'anyref'"_s)));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Identifier initialIdent = Identifier::fromString(&vm, "initial");
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmwasmjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/wasm.json (246588 => 246589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/wasm.json       2019-06-19 15:11:30 UTC (rev 246588)
+++ trunk/Source/JavaScriptCore/wasm/wasm.json  2019-06-19 15:36:46 UTC (rev 246589)
</span><span class="lines">@@ -11,14 +11,14 @@
</span><span class="cx">         "i64":     { "type": "varint7", "value":  -2, "b3type": "B3::Int64" },
</span><span class="cx">         "f32":     { "type": "varint7", "value":  -3, "b3type": "B3::Float" },
</span><span class="cx">         "f64":     { "type": "varint7", "value":  -4, "b3type": "B3::Double" },
</span><del>-        "anyfunc": { "type": "varint7", "value": -16, "b3type": "B3::Int64" },
</del><ins>+        "funcref": { "type": "varint7", "value": -16, "b3type": "B3::Int64" },
</ins><span class="cx">         "anyref":  { "type": "varint7", "value": -17, "b3type": "B3::Int64" },
</span><span class="cx">         "func":    { "type": "varint7", "value": -32, "b3type": "B3::Void" },
</span><span class="cx">         "void":    { "type": "varint7", "value": -64, "b3type": "B3::Void" }
</span><span class="cx">     },
</span><del>-    "value_type": ["i32", "i64", "f32", "f64", "anyref", "anyfunc"],
-    "block_type": ["i32", "i64", "f32", "f64", "void", "anyref", "anyfunc"],
-    "elem_type": ["anyfunc","anyref"],
</del><ins>+    "value_type": ["i32", "i64", "f32", "f64", "anyref", "funcref"],
+    "block_type": ["i32", "i64", "f32", "f64", "void", "anyref", "funcref"],
+    "elem_type": ["funcref","anyref"],
</ins><span class="cx">     "external_kind": {
</span><span class="cx">         "Function": { "type": "uint8", "value": 0 },
</span><span class="cx">         "Table":    { "type": "uint8", "value": 1 },
</span><span class="lines">@@ -59,9 +59,9 @@
</span><span class="cx">         "i64.const":           { "category": "special",    "value":  66, "return": ["i64"],      "parameter": [],                       "immediate": [{"name": "value",          "type": "varint64"}],                                             "description": "a constant value interpreted as i64" },
</span><span class="cx">         "f64.const":           { "category": "special",    "value":  68, "return": ["f64"],      "parameter": [],                       "immediate": [{"name": "value",          "type": "double"}],                                               "description": "a constant value interpreted as f64" },
</span><span class="cx">         "f32.const":           { "category": "special",    "value":  67, "return": ["f32"],      "parameter": [],                       "immediate": [{"name": "value",          "type": "float"}],                                                "description": "a constant value interpreted as f32" },
</span><del>-        "ref.null":            { "category": "special",    "value": 208, "return": ["anyfunc"],  "parameter": [],                       "immediate": [],                                                                                           "description": "a constant null reference" },
</del><ins>+        "ref.null":            { "category": "special",    "value": 208, "return": ["funcref"],  "parameter": [],                       "immediate": [],                                                                                           "description": "a constant null reference" },
</ins><span class="cx">         "ref.is_null":         { "category": "special",    "value": 209, "return": ["i32"],      "parameter": ["anyref"],               "immediate": [],                                                                                           "description": "determine if a reference is null" },
</span><del>-        "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" },
</del><ins>+        "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" },
</ins><span class="cx">         "get_local":           { "category": "special",    "value":  32, "return": ["any"],      "parameter": [],                       "immediate": [{"name": "local_index",    "type": "varuint32"}],                                            "description": "read a local variable or parameter" },
</span><span class="cx">         "set_local":           { "category": "special",    "value":  33, "return": [],           "parameter": ["any"],                  "immediate": [{"name": "local_index",    "type": "varuint32"}],                                            "description": "write a local variable or parameter" },
</span><span class="cx">         "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" },
</span></span></pre>
</div>
</div>

</body>
</html>