Skip to content
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-Function-References] Improve type printing for reference types #20611

Conversation

takikawa
Copy link
Contributor

@takikawa takikawa commented Nov 16, 2023

fd12481

[WASM-Function-References] Improve type printing for reference types
https://bugs.webkit.org/show_bug.cgi?id=247746

Reviewed by Justin Michaud.

Print reftypes when typed funcrefs are enabled in (ref null? kind)
format where `kind` is either a heap type (e.g., `i31`, `struct`)
or a concrete type index (e.g., `<struct:0>`, `<func:3>`).

This printing is only used for validation errors for now, as it
relies on being able to access the ModuleInformation.

* JSTests/wasm/function-references/local_init.js:
(async testLocalInit):
* JSTests/wasm/function-references/ref_types.js:
(async testNonNullExternrefIncompatible):
(async testNonNullFuncrefIncompatible):
* JSTests/wasm/gc/any.js:
(testValidation):
(testNullfuncref):
(testNullexternref):
* JSTests/wasm/gc/arrays.js:
(testArrayDeclaration):
* JSTests/wasm/gc/casts.js:
(testFunctionCasts):
(testEqCasts):
* JSTests/wasm/gc/const-exprs.js:
(async testInvalidConstExprs):
* JSTests/wasm/gc/i31.js:
(testI31Get):
* JSTests/wasm/gc/rec.js:
(testRecDeclaration):
* JSTests/wasm/gc/structs.js:
(testStructDeclaration):
* JSTests/wasm/gc/sub.js:
(testSubDeclaration):
* Source/JavaScriptCore/wasm/WasmFormat.h:
(JSC::Wasm::heapTypeKindAsString):
* Source/JavaScriptCore/wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser::validationFail const):
(JSC::Wasm::FunctionParser::validationFailHelper const):
(JSC::Wasm::FunctionParser::typeToStringModuleRelative const):

Canonical link: https://commits.webkit.org/270988@main

55cb9c0

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ§ͺ api-wpe
βœ… πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1 βœ… πŸ›  gtk
βœ… πŸ›  πŸ§ͺ jsc βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ§ͺ gtk-wk2
βœ… πŸ›  πŸ§ͺ jsc-arm64 βœ… πŸ›  tv βœ… πŸ§ͺ mac-AS-debug-wk2 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv-sim βœ… πŸ›  jsc-armv7
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch βœ… πŸ§ͺ jsc-armv7-tests
βœ… πŸ›  watch-sim

@takikawa takikawa requested a review from a team as a code owner November 16, 2023 16:07
@takikawa takikawa self-assigned this Nov 16, 2023
@takikawa takikawa added the WebAssembly For bugs in JavaScript WebAssembly label Nov 16, 2023
Copy link
Contributor

@justinmichaud justinmichaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me

@takikawa takikawa force-pushed the eng/WASM-Function-References-Improve-type-printing-for-reference-types branch from c566707 to 55cb9c0 Compare November 20, 2023 17:35
@takikawa takikawa added the safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks label Nov 20, 2023
@webkit-ews-buildbot webkit-ews-buildbot added merge-queue Applied to send a pull request to merge-queue and removed safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks labels Nov 20, 2023
@webkit-ews-buildbot
Copy link
Collaborator

Safe-Merge-Queue: Build #3920.

@webkit-commit-queue webkit-commit-queue force-pushed the eng/WASM-Function-References-Improve-type-printing-for-reference-types branch from 55cb9c0 to 6655c50 Compare November 20, 2023 22:32
https://bugs.webkit.org/show_bug.cgi?id=247746

Reviewed by Justin Michaud.

Print reftypes when typed funcrefs are enabled in (ref null? kind)
format where `kind` is either a heap type (e.g., `i31`, `struct`)
or a concrete type index (e.g., `<struct:0>`, `<func:3>`).

This printing is only used for validation errors for now, as it
relies on being able to access the ModuleInformation.

* JSTests/wasm/function-references/local_init.js:
(async testLocalInit):
* JSTests/wasm/function-references/ref_types.js:
(async testNonNullExternrefIncompatible):
(async testNonNullFuncrefIncompatible):
* JSTests/wasm/gc/any.js:
(testValidation):
(testNullfuncref):
(testNullexternref):
* JSTests/wasm/gc/arrays.js:
(testArrayDeclaration):
* JSTests/wasm/gc/casts.js:
(testFunctionCasts):
(testEqCasts):
* JSTests/wasm/gc/const-exprs.js:
(async testInvalidConstExprs):
* JSTests/wasm/gc/i31.js:
(testI31Get):
* JSTests/wasm/gc/rec.js:
(testRecDeclaration):
* JSTests/wasm/gc/structs.js:
(testStructDeclaration):
* JSTests/wasm/gc/sub.js:
(testSubDeclaration):
* Source/JavaScriptCore/wasm/WasmFormat.h:
(JSC::Wasm::heapTypeKindAsString):
* Source/JavaScriptCore/wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser::validationFail const):
(JSC::Wasm::FunctionParser::validationFailHelper const):
(JSC::Wasm::FunctionParser::typeToStringModuleRelative const):

Canonical link: https://commits.webkit.org/270988@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/WASM-Function-References-Improve-type-printing-for-reference-types branch from 6655c50 to fd12481 Compare November 20, 2023 22:34
@webkit-commit-queue
Copy link
Collaborator

Committed 270988@main (fd12481): https://commits.webkit.org/270988@main

Reviewed commits have been landed. Closing PR #20611 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Nov 20, 2023
@webkit-commit-queue webkit-commit-queue merged commit fd12481 into WebKit:main Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebAssembly For bugs in JavaScript WebAssembly
Projects
None yet
5 participants