<?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>109900</bug_id>
          
          <creation_ts>2013-02-14 23:28:34 -0800</creation_ts>
          <short_desc>DFG AbstractState should filter operands to NewArray more precisely</short_desc>
          <delta_ts>2013-02-15 11:58:51 -0800</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>1</everconfirmed>
          <reporter name="Filip Pizlo">fpizlo</reporter>
          <assigned_to name="Filip Pizlo">fpizlo</assigned_to>
          <cc>abarth</cc>
    
    <cc>barraclough</cc>
    
    <cc>ggaren</cc>
    
    <cc>mark.lam</cc>
    
    <cc>mhahnenberg</cc>
    
    <cc>msaboff</cc>
    
    <cc>oliver</cc>
    
    <cc>sam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>833735</commentid>
    <comment_count>0</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2013-02-14 23:28:34 -0800</bug_when>
    <thetext>Patch forthcoming</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>833736</commentid>
    <comment_count>1</comment_count>
      <attachid>188489</attachid>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2013-02-14 23:32:21 -0800</bug_when>
    <thetext>Created attachment 188489
the patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>833999</commentid>
    <comment_count>2</comment_count>
      <attachid>188489</attachid>
    <who name="Mark Hahnenberg">mhahnenberg</who>
    <bug_when>2013-02-15 07:20:12 -0800</bug_when>
    <thetext>Comment on attachment 188489
the patch

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

&gt; Source/JavaScriptCore/dfg/DFGAbstractState.cpp:1300
&gt; +                forNode(m_graph.m_varArgChildren[node-&gt;firstChild() + operandIndex]).filter(SpecRealNumber);

Why not SpecDouble? What would happen if somebody filled their arrays with NaNs?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>834218</commentid>
    <comment_count>3</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2013-02-15 11:37:40 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; (From update of attachment 188489 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=188489&amp;action=review
&gt; 
&gt; &gt; Source/JavaScriptCore/dfg/DFGAbstractState.cpp:1300
&gt; &gt; +                forNode(m_graph.m_varArgChildren[node-&gt;firstChild() + operandIndex]).filter(SpecRealNumber);
&gt; 
&gt; Why not SpecDouble? What would happen if somebody filled their arrays with NaNs?

NaNs can&apos;t be stored into double arrays.  If you do it, they turn into contiguous arrays (of generic JSValues).  The backend will speculate that you&apos;re not storing NaN into a double array and spec fail if you do (so that the baseline JIT can do the double-&gt;contiguous conversion).

Hence, filtering SpecRealNumber accurately represents the speculations that the backend will do.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>834220</commentid>
    <comment_count>4</comment_count>
      <attachid>188489</attachid>
    <who name="Mark Hahnenberg">mhahnenberg</who>
    <bug_when>2013-02-15 11:38:25 -0800</bug_when>
    <thetext>Comment on attachment 188489
the patch

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

r=me

&gt;&gt;&gt; Source/JavaScriptCore/dfg/DFGAbstractState.cpp:1300
&gt;&gt;&gt; +                forNode(m_graph.m_varArgChildren[node-&gt;firstChild() + operandIndex]).filter(SpecRealNumber);
&gt;&gt; 
&gt;&gt; Why not SpecDouble? What would happen if somebody filled their arrays with NaNs?
&gt; 
&gt; NaNs can&apos;t be stored into double arrays.  If you do it, they turn into contiguous arrays (of generic JSValues).  The backend will speculate that you&apos;re not storing NaN into a double array and spec fail if you do (so that the baseline JIT can do the double-&gt;contiguous conversion).
&gt; 
&gt; Hence, filtering SpecRealNumber accurately represents the speculations that the backend will do.

Sounds good.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>834224</commentid>
    <comment_count>5</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2013-02-15 11:49:39 -0800</bug_when>
    <thetext>Landed in http://trac.webkit.org/changeset/143024</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>834240</commentid>
    <comment_count>6</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2013-02-15 11:57:43 -0800</bug_when>
    <thetext>Reopening to attach new patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>834241</commentid>
    <comment_count>7</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2013-02-15 11:58:51 -0800</bug_when>
    <thetext>oops.  soryr</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>188489</attachid>
            <date>2013-02-14 23:32:21 -0800</date>
            <delta_ts>2013-02-15 11:57:41 -0800</delta_ts>
            <desc>the patch</desc>
            <filename>blah.patch</filename>
            <type>text/plain</type>
            <size>2362</size>
            <attacher name="Filip Pizlo">fpizlo</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5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ciAodW5zaWduZWQgb3BlcmFuZEluZGV4ID0gMDsgb3BlcmFuZEluZGV4IDwgbm9k
ZS0+bnVtQ2hpbGRyZW4oKTsgKytvcGVyYW5kSW5kZXgpCisgICAgICAgICAgICAgICAgZm9yTm9k
ZShtX2dyYXBoLm1fdmFyQXJnQ2hpbGRyZW5bbm9kZS0+Zmlyc3RDaGlsZCgpICsgb3BlcmFuZElu
ZGV4XSkuZmlsdGVyKFNwZWNSZWFsTnVtYmVyKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAg
ICBjYXNlIEFMTF9DT05USUdVT1VTX0lOREVYSU5HX1RZUEVTOgorICAgICAgICBjYXNlIEFMTF9B
UlJBWV9TVE9SQUdFX0lOREVYSU5HX1RZUEVTOgorICAgICAgICAgICAgYnJlYWs7CisgICAgICAg
IGRlZmF1bHQ6CisgICAgICAgICAgICBDUkFTSCgpOworICAgICAgICAgICAgYnJlYWs7CisgICAg
ICAgIH0KICAgICAgICAgZm9yTm9kZShub2RlKS5zZXQobV9ncmFwaC5nbG9iYWxPYmplY3RGb3Io
bm9kZS0+Y29kZU9yaWdpbiktPmFycmF5U3RydWN0dXJlRm9ySW5kZXhpbmdUeXBlRHVyaW5nQWxs
b2NhdGlvbihub2RlLT5pbmRleGluZ1R5cGUoKSkpOwogICAgICAgICBtX2hhdmVTdHJ1Y3R1cmVz
ID0gdHJ1ZTsKICAgICAgICAgYnJlYWs7Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>