<?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>226817</bug_id>
          
          <creation_ts>2021-06-09 07:21:51 -0700</creation_ts>
          <short_desc>[JSC] Fix incorrect register reuse in 32bit after r278568</short_desc>
          <delta_ts>2021-06-09 09:32:39 -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="Xan Lopez">xan.lopez</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>angelos</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>keith_miller</cc>
    
    <cc>mark.lam</cc>
    
    <cc>msaboff</cc>
    
    <cc>saam</cc>
    
    <cc>ticaiolima</cc>
    
    <cc>tzagallo</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>xan.lopez</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1768164</commentid>
    <comment_count>0</comment_count>
    <who name="Xan Lopez">xan.lopez</who>
    <bug_when>2021-06-09 07:21:51 -0700</bug_when>
    <thetext>The JSVALUE32_64 branch potentially needs both the tag and payload registers for both left/right nodes, so we cannot reuse any of them for the result since the first thing the code does is set it zero. Just remove the Reuse construction. This was causing extremely long test runs on 32bit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1768165</commentid>
    <comment_count>1</comment_count>
      <attachid>430963</attachid>
    <who name="Xan Lopez">xan.lopez</who>
    <bug_when>2021-06-09 07:23:45 -0700</bug_when>
    <thetext>Created attachment 430963
Fix incorrect register reuse

v1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1768168</commentid>
    <comment_count>2</comment_count>
    <who name="Angelos Oikonomopoulos">angelos</who>
    <bug_when>2021-06-09 07:27:59 -0700</bug_when>
    <thetext>*** Bug 226815 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1768171</commentid>
    <comment_count>3</comment_count>
      <attachid>430963</attachid>
    <who name="Caio Lima">ticaiolima</who>
    <bug_when>2021-06-09 07:45:26 -0700</bug_when>
    <thetext>Comment on attachment 430963
Fix incorrect register reuse

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

&gt; Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:7388
&gt; +    GPRTemporary result(this);

Could we try to still reuse it, but then move 0 after `notEqual.link(&amp;m_jit);` on line 7404? I think this would allow us to reuse left and right payload/tag there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1768172</commentid>
    <comment_count>4</comment_count>
      <attachid>430963</attachid>
    <who name="Caio Lima">ticaiolima</who>
    <bug_when>2021-06-09 07:47:41 -0700</bug_when>
    <thetext>Comment on attachment 430963
Fix incorrect register reuse

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

r=me

&gt;&gt; Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:7388
&gt;&gt; +    GPRTemporary result(this);
&gt; 
&gt; Could we try to still reuse it, but then move 0 after `notEqual.link(&amp;m_jit);` on line 7404? I think this would allow us to reuse left and right payload/tag there.

Never mind, this would require another jump for Equals case. Not reusing the tag sounds a better compromise then generating multiple branchs</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1768175</commentid>
    <comment_count>5</comment_count>
      <attachid>430963</attachid>
    <who name="Caio Lima">ticaiolima</who>
    <bug_when>2021-06-09 07:51:48 -0700</bug_when>
    <thetext>Comment on attachment 430963
Fix incorrect register reuse

32-bits queue is quite long, committing this to make it process patches</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1768176</commentid>
    <comment_count>6</comment_count>
      <attachid>430963</attachid>
    <who name="Caio Lima">ticaiolima</who>
    <bug_when>2021-06-09 08:03:15 -0700</bug_when>
    <thetext>Comment on attachment 430963
Fix incorrect register reuse

I retract this change. I think it wont work because we need to set `false` to result when left.tagGPR(), right.tagGPR() are different.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1768183</commentid>
    <comment_count>7</comment_count>
    <who name="Caio Lima">ticaiolima</who>
    <bug_when>2021-06-09 08:12:55 -0700</bug_when>
    <thetext>(In reply to Caio Lima from comment #6)
&gt; Comment on attachment 430963 [details]
&gt; Fix incorrect register reuse
&gt; 
&gt; I retract this change. I think it wont work because we need to set `false`
&gt; to result when left.tagGPR(), right.tagGPR() are different.

The patch already does that, since it doesn’t change previous behavior. So, my previous comment is wrong. I’ll r+/cq+ again after local run shows it passes all tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1768184</commentid>
    <comment_count>8</comment_count>
      <attachid>430963</attachid>
    <who name="Caio Lima">ticaiolima</who>
    <bug_when>2021-06-09 08:13:16 -0700</bug_when>
    <thetext>Comment on attachment 430963
Fix incorrect register reuse

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1768203</commentid>
    <comment_count>9</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2021-06-09 09:31:32 -0700</bug_when>
    <thetext>Committed r278662 (238644@main): &lt;https://commits.webkit.org/238644@main&gt;

All reviewed patches have been landed. Closing bug and clearing flags on attachment 430963.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1768205</commentid>
    <comment_count>10</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-06-09 09:32:39 -0700</bug_when>
    <thetext>&lt;rdar://problem/79081335&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>430963</attachid>
            <date>2021-06-09 07:23:45 -0700</date>
            <delta_ts>2021-06-09 09:31:33 -0700</delta_ts>
            <desc>Fix incorrect register reuse</desc>
            <filename>0001-JSC-Fix-incorrect-register-reuse-in-32bit-after-r278.patch</filename>
            <type>text/plain</type>
            <size>2433</size>
            <attacher name="Xan Lopez">xan.lopez</attacher>
            
              <data encoding="base64">RnJvbSAzYTAxZjg2M2Q0Yzg5NzEwZTMyZWMxMTVkNDcyZjU4NGIxMjYwZjkwIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiA9P1VURi04P3E/WGFuPTIwTD1DMz1CM3Blej89IDx4YW5AaWdh
bGlhLmNvbT4KRGF0ZTogV2VkLCA5IEp1biAyMDIxIDE2OjIyOjUyICswMjAwClN1YmplY3Q6IFtQ
QVRDSF0gW0pTQ10gRml4IGluY29ycmVjdCByZWdpc3RlciByZXVzZSBpbiAzMmJpdCBhZnRlciBy
Mjc4NTY4CiBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MjI2ODE3CgpS
ZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KCiogZGZnL0RGR1NwZWN1bGF0aXZlSklULmNwcDoK
KEpTQzo6REZHOjpTcGVjdWxhdGl2ZUpJVDo6Y29tcGlsZU5vdERvdWJsZU5laXRoZXJEb3VibGVO
b3JIZWFwQmlnSW50Tm9yU3RyaW5nU3RyaWN0RXF1YWxpdHkpOgpUaGUgSlNWQUxVRTMyXzY0IGJy
YW5jaCBwb3RlbnRpYWxseSBuZWVkcyBib3RoIHRoZSB0YWcgYW5kIHBheWxvYWQKcmVnaXN0ZXJz
IGZvciBib3RoIGxlZnQvcml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