<?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>65233</bug_id>
          
          <creation_ts>2011-07-26 22:34:59 -0700</creation_ts>
          <short_desc>DFG JIT speculation failure code performs incorrect conversions in the case where two registers need to be swapped</short_desc>
          <delta_ts>2011-07-27 00:12:55 -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>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Filip Pizlo">fpizlo</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>442743</commentid>
    <comment_count>0</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2011-07-26 22:34:59 -0700</bug_when>
    <thetext>The DFG JIT speculation failure code is quite optimized, and quite complicated.  One special case that it detects, and handles in an efficient way, is where the speculative path would have placed node A in register R1 and node B in register R2, whilst the non-speculative path reversed them: node A in R2, B in R1.  Special care must be taken, however, if speculative represents node A (i.e. R1) as an unboxed integer while non-speculative represents node A (i.e. R2) as a boxed integer.  This is where the DFG will currently fail.  Instead of asking if R1 in speculative has a different register format than R2 in non-speculative, it compares the register formats of R1 in speculative with R1 in non-speculative, despite the fact that R1 is associated with different nodes in the two paths.  This may make the speculation failure code miss cases where register formats need to be converted, and in other cases may perform a conversion on the wrong register, thereby causing two register to be corrupt: the one on which an incorrect conversion was performed, and the one on which no conversion was performed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>442744</commentid>
    <comment_count>1</comment_count>
      <attachid>102095</attachid>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2011-07-26 22:40:09 -0700</bug_when>
    <thetext>Created attachment 102095
the patch

Tests still running.  Will change to ? once (if) they succeed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>442761</commentid>
    <comment_count>2</comment_count>
      <attachid>102095</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-07-27 00:12:51 -0700</bug_when>
    <thetext>Comment on attachment 102095
the patch

Clearing flags on attachment: 102095

Committed r91825: &lt;http://trac.webkit.org/changeset/91825&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>442762</commentid>
    <comment_count>3</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-07-27 00:12:55 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>102095</attachid>
            <date>2011-07-26 22:40:09 -0700</date>
            <delta_ts>2011-07-27 00:12:51 -0700</delta_ts>
            <desc>the patch</desc>
            <filename>fixswap_patch_1.diff</filename>
            <type>text/plain</type>
            <size>2010</size>
            <attacher name="Filip Pizlo">fpizlo</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gOTE4MjMpCisrKyBT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zoKICAgICAgICAgCiAgICAgICAgIGppdC5zd2FwKGdw
cigpLCBvdGhlci5ncHIoKSk7CiAgICAgICAgIAotICAgICAgICBpZiAoVU5MSUtFTFkobmVlZERh
dGFGb3JtYXRDb252ZXJzaW9uKG15RGF0YUZvcm1hdCwgbXlOZXdEYXRhRm9ybWF0KSkpIHsKLSAg
ICAgICAgICAgIGlmIChteURhdGFGb3JtYXQgPT0gRGF0YUZvcm1hdEludGVnZXIpCisgICAgICAg
IGlmIChVTkxJS0VMWShuZWVkRGF0YUZvcm1hdENvbnZlcnNpb24ob3RoZXJEYXRhRm9ybWF0LCBt
eU5ld0RhdGFGb3JtYXQpKSkgeworICAgICAgICAgICAgaWYgKG90aGVyRGF0YUZvcm1hdCA9PSBE
YXRhRm9ybWF0SW50ZWdlcikKICAgICAgICAgICAgICAgICBqaXQub3JQdHIoR1BSSW5mbzo6dGFn
VHlwZU51bWJlclJlZ2lzdGVyLCBncHIoKSk7CiAgICAgICAgICAgICBlbHNlIGlmIChteU5ld0Rh
dGFGb3JtYXQgPT0gRGF0YUZvcm1hdEludGVnZXIpCiAgICAgICAgICAgICAgICAgaml0Lnplcm9F
eHRlbmQzMlRvUHRyKGdwcigpLCBncHIoKSk7CiAgICAgICAgIH0KICAgICAgICAgCi0gICAgICAg
IGlmIChVTkxJS0VMWShuZWVkRGF0YUZvcm1hdENvbnZlcnNpb24ob3RoZXJEYXRhRm9ybWF0LCBt
eU5ld0RhdGFGb3JtYXQpKSkgewotICAgICAgICAgICAgaWYgKG90aGVyRGF0YUZvcm1hdCA9PSBE
YXRhRm9ybWF0SW50ZWdlcikKKyAgICAgICAgaWYgKFVOTElLRUxZKG5lZWREYXRhRm9ybWF0Q29u
dmVyc2lvbihteURhdGFGb3JtYXQsIG90aGVyTmV3RGF0YUZvcm1hdCkpKSB7CisgICAgICAgICAg
ICBpZiAobXlEYXRhRm9ybWF0ID09IERhdGFGb3JtYXRJbnRlZ2VyKQogICAgICAgICAgICAgICAg
IGppdC5vclB0cihHUFJJbmZvOjp0YWdUeXBlTnVtYmVyUmVnaXN0ZXIsIG90aGVyLmdwcigpKTsK
ICAgICAgICAgICAgIGVsc2UgaWYgKG90aGVyTmV3RGF0YUZvcm1hdCA9PSBEYXRhRm9ybWF0SW50
ZWdlcikKICAgICAgICAgICAgICAgICBqaXQuemVyb0V4dGVuZDMyVG9QdHIob3RoZXIuZ3ByKCks
IG90aGVyLmdwcigpKTsK
</data>

          </attachment>
      

    </bug>

</bugzilla>