| Summary: | [WASM-Function-References] Simplify representation of Wasm Type | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Dmitry <dbezhetskov> | ||||||||||||
| Component: | WebAssembly | Assignee: | Dmitry <dbezhetskov> | ||||||||||||
| Status: | NEW --- | ||||||||||||||
| Severity: | Normal | CC: | bashorov, ews-watchlist, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer, ysuzuki | ||||||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||||||
| Version: | WebKit Nightly Build | ||||||||||||||
| Hardware: | Unspecified | ||||||||||||||
| OS: | Unspecified | ||||||||||||||
| Bug Depends on: | |||||||||||||||
| Bug Blocks: | 247393 | ||||||||||||||
| Attachments: |
|
||||||||||||||
|
Description
Dmitry
2021-11-23 03:40:54 PST
Created attachment 445023 [details]
Patch
Created attachment 445066 [details]
Patch
Comment on attachment 445066 [details]
Patch
Acn you relove SignatureIndex completely? Currently, it is globally registered, but it should use per module type index onstead. And if we start using that in one place, then we should use it in all the place.
(In reply to Yusuke Suzuki from comment #3) > Comment on attachment 445066 [details] > Patch > > Acn you relove SignatureIndex completely? Currently, it is globally > registered, but it should use per module type index onstead. And if we start > using that in one place, then we should use it in all the place. Oops, typos. “Can you remove SignatureIndex completely?” Comment on attachment 445066 [details]
Patch
OK, I think it is fine for now.
Tools/Scripts/svn-apply failed to apply attachment 445066 [details] to trunk.
Please resolve the conflicts and upload a new patch.
Created attachment 451864 [details]
Patch
Comment on attachment 451864 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=451864&action=review > Source/JavaScriptCore/ChangeLog:10 > + Replace Signature index with index into Wasm Type section. > + Add corresponding mapping to be able to get itroduced type index > + via given function index. Can you describe the motivation of this change in the ChangeLog? Why do we need to use this instead of current SignatureIndex? > Source/JavaScriptCore/wasm/WasmFormat.h:260 > + uint32_t typeIndex; We should use more explicit name since it is not well-typed. Let's name it like, typeIndexInModule etc. > Source/JavaScriptCore/wasm/generateWasmOpsHeader.py:224 > + unsigned index; Ditto. Change this to typeIndexInModule. Created attachment 452175 [details]
Patch
Hi, I've updated the changelog to describe more motivation of this change and fixed naming issues Comment on attachment 452175 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=452175&action=review > Source/JavaScriptCore/wasm/WasmGlobal.cpp:107 > + Wasm::SignatureIndex paramIndex = m_type.typeIndexInModule; This looks incorrect since typeIndexInModule is not SignatureIndex. > Source/JavaScriptCore/wasm/js/JSWebAssemblyHelpers.h:194 > + Wasm::SignatureIndex paramIndex = type.typeIndexInModule; This looks incorrect since typeIndexInModule is not SignatureIndex. > Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp:282 > + slowPath.append(jit.branchPtr(CCallHelpers::NotEqual, scratchGPR, CCallHelpers::TrustedImmPtr(type.typeIndexInModule))); This looks incorrect since typeIndexInModule is not SignatureIndex. > Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp:273 > + Wasm::SignatureIndex paramIndex = global.type.typeIndexInModule; This looks incorrect since typeIndexInModule is not SignatureIndex. > Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp:327 > + Wasm::SignatureIndex paramIndex = global.type.typeIndexInModule; This looks incorrect since typeIndexInModule is not SignatureIndex. Created attachment 452682 [details]
Patch
|