<?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>65937</bug_id>
          
          <creation_ts>2011-08-09 13:24:40 -0700</creation_ts>
          <short_desc>DFG non-speculative JIT misuses the register allocator when generating ValueToInt32 conversions where the input is known to be a double.</short_desc>
          <delta_ts>2011-08-09 13:34:21 -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>DUPLICATE</resolution>
          <dup_id>65930</dup_id>
          
          <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>1</everconfirmed>
          <reporter name="Filip Pizlo">fpizlo</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>barraclough</cc>
    
    <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>oliver</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>448753</commentid>
    <comment_count>0</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2011-08-09 13:24:40 -0700</bug_when>
    <thetext>The DFG JIT has an on-the-fly register allocator, which works by having the code generator specify when a value is needed, when it is being used, and when it is not needed anymore.  But the DFG non-speculative JIT path for generating ValueToInt32 conversions where the source is a double will first kill a register and then allocate it.  Sometimes this works by accident (if there are other uses of the register), but when visiting http://www.skinnytaste.com/2011/06/ricotta-cheese-chocolate-chip-muffins.html, it generates an assertion failure.  The DFG non-speculative JIT should really first allocate the register and then kill it rather than the other way around.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>448756</commentid>
    <comment_count>1</comment_count>
      <attachid>103389</attachid>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2011-08-09 13:26:47 -0700</bug_when>
    <thetext>Created attachment 103389
the patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>448757</commentid>
    <comment_count>2</comment_count>
      <attachid>103389</attachid>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2011-08-09 13:27:42 -0700</bug_when>
    <thetext>Comment on attachment 103389
the patch

r- actually, you should make a testcase for this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>448759</commentid>
    <comment_count>3</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2011-08-09 13:33:19 -0700</bug_when>
    <thetext>Is this a dup of bug 65930?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>448761</commentid>
    <comment_count>4</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2011-08-09 13:34:04 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; Is this a dup of bug 65930?

Yeah it is - I didn&apos;t see the other bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>448763</commentid>
    <comment_count>5</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2011-08-09 13:34:21 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 65930 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>103389</attachid>
            <date>2011-08-09 13:26:47 -0700</date>
            <delta_ts>2011-08-09 13:27:42 -0700</delta_ts>
            <desc>the patch</desc>
            <filename>useafterfpr_patch_1.diff</filename>
            <type>text/plain</type>
            <size>1728</size>
            <attacher name="Filip Pizlo">fpizlo</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJj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v
bXBpbGVJbmRleCwgVXNlQ2hpbGRyZW5DYWxsZWRFeHBsaWNpdGx5KTsKICAgICAgICAgICAgIGJy
ZWFrOwogICAgICAgICB9CiAK
</data>
<flag name="review"
          id="98985"
          type_id="1"
          status="-"
          setter="oliver"
    />
          </attachment>
      

    </bug>

</bugzilla>