<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>258317</bug_id>
          
          <creation_ts>2023-06-20 12:49:31 -0700</creation_ts>
          <short_desc>Reduce repetitive logging in B3 disassembly</short_desc>
          <delta_ts>2023-06-20 15:38:03 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Degazio">d_degazio</reporter>
          <assigned_to name="David Degazio">d_degazio</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1962628</commentid>
    <comment_count>0</comment_count>
    <who name="David Degazio">d_degazio</who>
    <bug_when>2023-06-20 12:49:31 -0700</bug_when>
    <thetext>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                      &lt;32&gt; 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 &amp;Patchpoint0, %x19, %fp

We could substantially reduce the size and visual clutter of B3 disassembly logs by only logging the B3 value if it&apos;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                      &lt;32&gt; 0x1288300c0:    nop      
Air        Patch &amp;Patchpoint0, %x19, %fp</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1962629</commentid>
    <comment_count>1</comment_count>
    <who name="David Degazio">d_degazio</who>
    <bug_when>2023-06-20 12:59:01 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/15114</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1962677</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-06-20 15:38:01 -0700</bug_when>
    <thetext>Committed 265338@main (0449dbc56f1d): &lt;https://commits.webkit.org/265338@main&gt;

Reviewed commits have been landed. Closing PR #15114 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>