<?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>99258</bug_id>
          
          <creation_ts>2012-10-13 20:14:38 -0700</creation_ts>
          <short_desc>Array length array profiling is broken in the baseline JIT</short_desc>
          <delta_ts>2012-10-14 19:31:16 -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>1</everconfirmed>
          <reporter name="Filip Pizlo">fpizlo</reporter>
          <assigned_to name="Filip Pizlo">fpizlo</assigned_to>
          <cc>barraclough</cc>
    
    <cc>ggaren</cc>
    
    <cc>mark.lam</cc>
    
    <cc>mhahnenberg</cc>
    
    <cc>oliver</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>741543</commentid>
    <comment_count>0</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2012-10-13 20:14:38 -0700</bug_when>
    <thetext>It seems that a well-intentioned no-DFG-JIT build fix borked it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>741544</commentid>
    <comment_count>1</comment_count>
      <attachid>168573</attachid>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2012-10-13 20:21:09 -0700</bug_when>
    <thetext>Created attachment 168573
the patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>741584</commentid>
    <comment_count>2</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2012-10-14 12:43:36 -0700</bug_when>
    <thetext>Landed in http://trac.webkit.org/changeset/131268</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>741670</commentid>
    <comment_count>3</comment_count>
      <attachid>168573</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2012-10-14 19:24:57 -0700</bug_when>
    <thetext>Comment on attachment 168573
the patch

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

&gt; Source/JavaScriptCore/ChangeLog:11
&gt; +        canBeOptimized() returns true. But m_canBeOptimized is only initialized during
&gt; +        full method compiles, so in a stub compile it may (or may not) be false, meaning

Please also fix the JIT constructor, so that it default-initializes m_canBeOptimized to false.

Why is this initialization code in privateCompile(), and not in the the constructor, to begin with?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>741677</commentid>
    <comment_count>4</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2012-10-14 19:31:16 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; (From update of attachment 168573 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=168573&amp;action=review
&gt; 
&gt; &gt; Source/JavaScriptCore/ChangeLog:11
&gt; &gt; +        canBeOptimized() returns true. But m_canBeOptimized is only initialized during
&gt; &gt; +        full method compiles, so in a stub compile it may (or may not) be false, meaning
&gt; 
&gt; Please also fix the JIT constructor, so that it default-initializes m_canBeOptimized to false.

https://bugs.webkit.org/show_bug.cgi?id=99283

&gt; 
&gt; Why is this initialization code in privateCompile(), and not in the the constructor, to begin with?

I think that it makes sense for the decision logic to be in privateCompile().  In particular, this statement:

    DFG::CapabilityLevel level = m_codeBlock-&gt;canCompileWithDFG();

does an O(n) walk over the code block&apos;s bytecode.  We don&apos;t want that to happen every time we construct a JIT, since we do that for every stub compile.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>168573</attachid>
            <date>2012-10-13 20:21:09 -0700</date>
            <delta_ts>2012-10-14 19:24:57 -0700</delta_ts>
            <desc>the patch</desc>
            <filename>arraylength_1.patch</filename>
            <type>text/plain</type>
            <size>1817</size>
            <attacher name="Filip Pizlo">fpizlo</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTMxMjY0KQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDIyIEBA
CisyMDEyLTEwLTEzICBGaWxpcCBQaXpsbyAgPGZwaXpsb0BhcHBsZS5jb20+CisKKyAgICAgICAg
QXJyYXkgbGVuZ3RoIGFycmF5IHByb2ZpbGluZyBpcyBicm9rZW4gaW4gdGhlIGJhc2VsaW5lIEpJ
VAorICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9OTkyNTgK
KworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBUaGUgY29k
ZSBnZW5lcmF0b3IgZm9yIGFycmF5IGxlbmd0aCBzdHVicyBjYWxscyBpbnRvCisgICAgICAgIGVt
aXRBcnJheVByb2ZpbGluZ1NpdGVGb3JCeXRlY29kZUluZGV4KCksIHdoaWNoIGVtaXRzIHByb2Zp
bGluZyBvbmx5IGlmCisgICAgICAgIGNhbkJlT3B0aW1pemVkKCkgcmV0dXJucyB0cnVlLiBCdXQg
bV9jYW5CZU9wdGltaXplZCBpcyBvbmx5IGluaXRpYWxpemVkIGR1cmluZworICAgICAgICBmd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yZXNzKQogICAgICAgICB7CiAgICAgICAgICAgICBK
SVQgaml0KGdsb2JhbERhdGEsIGNvZGVCbG9jayk7CisjaWYgRU5BQkxFKERGR19KSVQpCisgICAg
ICAgICAgICAvLyBGb3JjZSBwcm9maWxpbmcgdG8gYmUgZW5hYmxlZCBkdXJpbmcgc3R1YiBnZW5l
cmF0aW9uLgorICAgICAgICAgICAgaml0Lm1fY2FuQmVPcHRpbWl6ZWQgPSB0cnVlOworI2VuZGlm
IC8vIEVOQUJMRShERkdfSklUKQogICAgICAgICAgICAgcmV0dXJuIGppdC5wcml2YXRlQ29tcGls
ZVBhdGNoR2V0QXJyYXlMZW5ndGgocmV0dXJuQWRkcmVzcyk7CiAgICAgICAgIH0KIAo=
</data>
<flag name="review"
          id="181595"
          type_id="1"
          status="+"
          setter="oliver"
    />
          </attachment>
      

    </bug>

</bugzilla>