Bug 237347

Summary: Refactor OpcodeTraits to support the possibility of having 2-byte WASM opcode ids in bytecode streams
Product: WebKit Reporter: Justin Michaud <justin_michaud>
Component: New BugsAssignee: Justin Michaud <justin_michaud>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch
none
Patch
none
Patch
none
Patch none

Description Justin Michaud 2022-03-01 16:09:39 PST
Refactor OpcodeTraits to support the possibility of having 2-byte WASM opcode ids in bytecode streams
Comment 1 Justin Michaud 2022-03-01 16:23:36 PST
Created attachment 453547 [details]
Patch
Comment 2 Justin Michaud 2022-03-01 16:26:44 PST
Comment on attachment 453547 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=453547&action=review

> Source/JavaScriptCore/jit/JITExceptions.cpp:66
> +        std::visit([&](auto* pc) {

I am calling this out as an area that needs special review
Comment 3 Justin Michaud 2022-03-01 16:45:25 PST
Created attachment 453549 [details]
Patch
Comment 4 Justin Michaud 2022-03-01 16:51:44 PST
Created attachment 453550 [details]
Patch
Comment 5 Justin Michaud 2022-03-01 17:03:15 PST
Created attachment 453554 [details]
Patch
Comment 6 Keith Miller 2022-03-01 17:20:03 PST
Oooh, I think this will be really nice for cleaning up my bytecode metadata pointer patch!
Comment 7 Justin Michaud 2022-03-01 21:57:37 PST
Created attachment 453570 [details]
Patch
Comment 8 Justin Michaud 2022-03-02 09:17:42 PST
Created attachment 453625 [details]
Patch
Comment 9 Keith Miller 2022-03-02 09:51:27 PST
Comment on attachment 453625 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=453625&action=review

r=me with comments.

> Source/JavaScriptCore/bytecode/BytecodeDumper.h:-135
> -class BytecodeDumper final : public JSC::BytecodeDumper<FunctionCodeBlockGenerator> {

How come we don't need this one anymore?

> Source/JavaScriptCore/bytecode/BytecodeDumper.h:151
> +    int outOfLineJumpOffset(JSInstructionStream::Offset) const override;

Why is this JSInstructionStream? I'm assuming it's just a copy paste error and the two `Offset` types are the same in practice?

> Source/JavaScriptCore/bytecode/BytecodeGeneratorification.cpp:45
> +    typename JSInstructionStream::Offset point { 0 };

Do you need `typename` here? I thought that wasn't necessary as of C++20. Ditto a bunch of other places.
Comment 10 Justin Michaud 2022-03-02 10:10:38 PST
Comment on attachment 453625 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=453625&action=review

>> Source/JavaScriptCore/bytecode/BytecodeDumper.h:-135
>> -class BytecodeDumper final : public JSC::BytecodeDumper<FunctionCodeBlockGenerator> {
> 
> How come we don't need this one anymore?

I'm not sure what you mean?

>> Source/JavaScriptCore/bytecode/BytecodeDumper.h:151
>> +    int outOfLineJumpOffset(JSInstructionStream::Offset) const override;
> 
> Why is this JSInstructionStream? I'm assuming it's just a copy paste error and the two `Offset` types are the same in practice?

Good catch!

>> Source/JavaScriptCore/bytecode/BytecodeGeneratorification.cpp:45
>> +    typename JSInstructionStream::Offset point { 0 };
> 
> Do you need `typename` here? I thought that wasn't necessary as of C++20. Ditto a bunch of other places.

Yeah probably. I'll review the spec.
Comment 11 Justin Michaud 2022-03-02 10:23:12 PST
Created attachment 453633 [details]
Patch
Comment 12 Keith Miller 2022-03-02 11:06:54 PST
Comment on attachment 453625 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=453625&action=review

>>> Source/JavaScriptCore/bytecode/BytecodeDumper.h:-135
>>> -class BytecodeDumper final : public JSC::BytecodeDumper<FunctionCodeBlockGenerator> {
>> 
>> How come we don't need this one anymore?
> 
> I'm not sure what you mean?

I meant this subclass override but I now realize that question doesn't make any sense since it's just a different superclass now.
Comment 13 Keith Miller 2022-03-02 11:06:55 PST
Comment on attachment 453625 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=453625&action=review

>>> Source/JavaScriptCore/bytecode/BytecodeDumper.h:-135
>>> -class BytecodeDumper final : public JSC::BytecodeDumper<FunctionCodeBlockGenerator> {
>> 
>> How come we don't need this one anymore?
> 
> I'm not sure what you mean?

I meant this subclass override but I now realize that question doesn't make any sense since it's just a different superclass now.
Comment 14 EWS 2022-03-02 22:50:56 PST
Committed r290768 (248012@main): <https://commits.webkit.org/248012@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 453633 [details].
Comment 15 Radar WebKit Bug Importer 2022-03-02 22:51:18 PST
<rdar://problem/89734679>