[webkit-changes] [WebKit/WebKit] 7e71e7: [Wasm-GC] Update element segments to account for t...
Asumu Takikawa
noreply at github.com
Tue Dec 12 14:16:44 PST 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 7e71e7282468d89fdab477163369d6df25e9101b
https://github.com/WebKit/WebKit/commit/7e71e7282468d89fdab477163369d6df25e9101b
Author: Asumu Takikawa <asumu at igalia.com>
Date: 2023-12-12 (Tue, 12 Dec 2023)
Changed paths:
A JSTests/wasm/function-references-spec-tests/br_table.wast.js
A JSTests/wasm/function-references-spec-tests/ref.wast.js
A JSTests/wasm/function-references-spec-tests/ref_is_null.wast.js
A JSTests/wasm/function-references-spec-tests/table-sub.wast.js
A JSTests/wasm/function-references-spec-tests/unreached-valid.wast.js
M JSTests/wasm/gc-spec-tests/array.wast.js
A JSTests/wasm/gc-spec-tests/binary-gc.wast.js
A JSTests/wasm/gc-spec-tests/ref_eq.wast.js
A JSTests/wasm/gc-spec-tests/ref_test.wast.js
M JSTests/wasm/gc/array_new_elem.js
M JSTests/wasm/gc/const-exprs.js
M JSTests/wasm/gc/wast-wrapper.js
M JSTests/wasm/references/element_active_mod.js
M JSTests/wasm/v8/regress/regress-1046472.js
M Source/JavaScriptCore/wasm/WasmConstExprGenerator.cpp
M Source/JavaScriptCore/wasm/WasmConstExprGenerator.h
M Source/JavaScriptCore/wasm/WasmEntryPlan.cpp
M Source/JavaScriptCore/wasm/WasmFormat.h
M Source/JavaScriptCore/wasm/WasmFunctionParser.h
M Source/JavaScriptCore/wasm/WasmInstance.cpp
M Source/JavaScriptCore/wasm/WasmInstance.h
M Source/JavaScriptCore/wasm/WasmSectionParser.cpp
M Source/JavaScriptCore/wasm/WasmSectionParser.h
M Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp
Log Message:
-----------
[Wasm-GC] Update element segments to account for typed funcrefs and GC types
https://bugs.webkit.org/show_bug.cgi?id=251874
Reviewed by Justin Michaud.
Fix element segment parsing to allow more kinds of ref types (this is actually
a requirement of the reference types proposal, predating both typed funcref and
GC).
Also add support for general const expr initialization for elements.
For now, initialization steps for element segments are done each time on table
init or array.new_elem. This could be done earlier in module init instead (to
avoid duplciated work for shared elements), but that requires a larger change
to create a runtime representation of elements that can strongly hold
references.
Add missing spec tests and re-enable tests that now succeed as well. A small
validation fix was needed for the br_table test.
* JSTests/wasm/function-references-spec-tests/br_table.wast.js: Added.
* JSTests/wasm/function-references-spec-tests/ref.wast.js: Added.
* JSTests/wasm/function-references-spec-tests/ref_is_null.wast.js: Added.
* JSTests/wasm/function-references-spec-tests/table-sub.wast.js: Added.
* JSTests/wasm/function-references-spec-tests/unreached-valid.wast.js: Added.
* JSTests/wasm/gc-spec-tests/array.wast.js:
* JSTests/wasm/gc-spec-tests/binary-gc.wast.js: Added.
* JSTests/wasm/gc-spec-tests/ref_eq.wast.js: Added.
* JSTests/wasm/gc-spec-tests/ref_test.wast.js: Added.
* JSTests/wasm/gc/array_new_elem.js:
(testTypeMismatch):
(testAllElementSegmentKinds):
(testNullFunctionIndex):
* JSTests/wasm/gc/const-exprs.js:
(async testElementConstExprs):
* JSTests/wasm/gc/wast-wrapper.js:
* JSTests/wasm/references/element_active_mod.js:
(refNullExternInElemsSection):
* JSTests/wasm/v8/regress/regress-1046472.js:
* Source/JavaScriptCore/wasm/WasmConstExprGenerator.cpp:
(JSC::Wasm::evaluateExtendedConstExpr):
* Source/JavaScriptCore/wasm/WasmConstExprGenerator.h:
* Source/JavaScriptCore/wasm/WasmEntryPlan.cpp:
(JSC::Wasm::EntryPlan::prepare):
* Source/JavaScriptCore/wasm/WasmFormat.h:
(JSC::Wasm::Element::Element):
(JSC::Wasm::Element::length const):
(JSC::Wasm::Element::isNullFuncIndex): Deleted.
* Source/JavaScriptCore/wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::addReferencedFunctions):
(JSC::Wasm::FunctionParser<Context>::parseExpression):
* Source/JavaScriptCore/wasm/WasmInstance.cpp:
(JSC::Wasm::Instance::initElementSegment):
(JSC::Wasm::Instance::copyElementSegment):
(JSC::Wasm::Instance::evaluateConstantExpression):
* Source/JavaScriptCore/wasm/WasmInstance.h:
* Source/JavaScriptCore/wasm/WasmSectionParser.cpp:
(JSC::Wasm::SectionParser::parseTableHelper):
(JSC::Wasm::SectionParser::parseElement):
(JSC::Wasm::SectionParser::validateElementTableIdx):
(JSC::Wasm::SectionParser::parseElementSegmentVectorOfExpressions):
(JSC::Wasm::SectionParser::parseElementSegmentVectorOfIndexes):
* Source/JavaScriptCore/wasm/WasmSectionParser.h:
* Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::evaluateConstantExpression):
(JSC::WebAssemblyModuleRecord::evaluate):
Canonical link: https://commits.webkit.org/271952@main
More information about the webkit-changes
mailing list