Bug 258317 - Reduce repetitive logging in B3 disassembly
Summary: Reduce repetitive logging in B3 disassembly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Degazio
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-06-20 12:49 PDT by David Degazio
Modified: 2023-06-20 15:38 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Degazio 2023-06-20 12:49:31 PDT
rdar://111057998

Currently, when logging the disassembly of a function compiled in B3, we log the B3 origin of every Air instruction before that Air instruction and its associated assembly. However, quite often, a single B3 value will correspond to multiple Air instructions, resulting in us logging the same B3 value multiple times for consecutive Air instructions with the same origin:

b3    Void b@1 = Patchpoint(b@0:SomeRegister, b@2:SomeRegister, generator = 0x105114160, resultConstraints = WarmAny, ExitsSideways|ControlDependent|WritesPinned|ReadsPinned|Fence|Writes:Top|Reads:Top)
Air        Nop 
asm                      <32> 0x12a9280c0:    nop      
b3    Void b@1 = Patchpoint(b@0:SomeRegister, b@2:SomeRegister, generator = 0x105114160, resultConstraints = WarmAny, ExitsSideways|ControlDependent|WritesPinned|ReadsPinned|Fence|Writes:Top|Reads:Top)
Air        Patch &Patchpoint0, %x19, %fp

We could substantially reduce the size and visual clutter of B3 disassembly logs by only logging the B3 value if it's different from the previous one - B3 values that lower to multiple consecutive Air instructions will only log once:

b3    Void b@1 = Patchpoint(b@0:SomeRegister, b@2:SomeRegister, generator = 0x1141a8160, resultConstraints = WarmAny, ExitsSideways|ControlDependent|WritesPinned|ReadsPinned|Fence|Writes:Top|Reads:Top)
Air        Nop 
asm                      <32> 0x1288300c0:    nop      
Air        Patch &Patchpoint0, %x19, %fp
Comment 1 David Degazio 2023-06-20 12:59:01 PDT
Pull request: https://github.com/WebKit/WebKit/pull/15114
Comment 2 EWS 2023-06-20 15:38:01 PDT
Committed 265338@main (0449dbc56f1d): <https://commits.webkit.org/265338@main>

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