-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[Wasm-GC] Update element segments to account for typed funcrefs and GC types #21647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Wasm-GC] Update element segments to account for typed funcrefs and GC types #21647
Conversation
EWS run on previous version of this PR (hash cefa447) |
This will also close https://bugs.webkit.org/show_bug.cgi?id=260542 |
cefa447
to
8570de3
Compare
EWS run on previous version of this PR (hash 8570de3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be fixed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh whoops, thanks for catching this. Currently it's not expected that this should ever fail, so I'll put in a RELEASE_ASSERT
but once I fix https://bugs.webkit.org/show_bug.cgi?id=264454 it will change to throw an exception in rare cases (ditto for the other call of evaluateConstantExpression
).
BTW there is a test failure in armv7, which just looks to be the result of error message mismatch (test still fails correctly). I'll update the expected message when I push in a bit. |
8570de3
to
818914a
Compare
EWS run on previous version of this PR (hash 818914a) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me
No reviewer information in commit message, blocking PR #21647 |
818914a
to
a032f5e
Compare
EWS run on current version of this PR (hash a032f5e) |
EWS run on current version of this PR (hash a032f5e) |
…C 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
a032f5e
to
7e71e72
Compare
Committed 271952@main (7e71e72): https://commits.webkit.org/271952@main Reviewed commits have been landed. Closing PR #21647 and removing active labels. |
7e71e72
a032f5e
🛠 🧪 jsc🧪 gtk-wk2🛠 🧪 jsc-arm64