<?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>106074</bug_id>
          
          <creation_ts>2013-01-03 18:52:35 -0800</creation_ts>
          <short_desc>DFG should not elide CheckStructure if it&apos;s needed to perform a cell check</short_desc>
          <delta_ts>2013-01-04 15:42:19 -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>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>799894</commentid>
    <comment_count>0</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2013-01-03 18:52:35 -0800</bug_when>
    <thetext>CheckStructure checks two things: if the value is a cell, and if so, that it has a particular structure (or one of a set of particular structures).  We shouldn&apos;t elide the CheckStructure just because we know that if the value was a cell then it would have a particular structure; we need to also prove that it is a cell.  (Example: we might have proved that a value is either a boolean or a cell with the primordial int32 array structure.)

Of course, it would be even better in those cases to replace CheckStructure with CheckCell.  But for now it&apos;s best to just fix the bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>799895</commentid>
    <comment_count>1</comment_count>
      <attachid>181262</attachid>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2013-01-03 18:53:18 -0800</bug_when>
    <thetext>Created attachment 181262
the patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>799896</commentid>
    <comment_count>2</comment_count>
      <attachid>181262</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2013-01-03 19:03:45 -0800</bug_when>
    <thetext>Comment on attachment 181262
the patch

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

r=me. Despite the fact I’m not an expert of JSC, I think Filip explained me enough details to know what’s happening here.

&gt; Source/JavaScriptCore/ChangeLog:3
&gt; +        

Please add the bug title here.

&gt; Source/JavaScriptCore/ChangeLog:9
&gt; +        * dfg/DFGConstantFoldingPhase.cpp:
&gt; +        (JSC::DFG::ConstantFoldingPhase::foldConstants):

It’ll be great if you could explain what you’ve described me in person (probably in some brief sentence).

&gt; Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp:107
&gt; +                if (!isCellSpeculation(value.m_type))
&gt; +                    break;
&gt;                  if (value.m_currentKnownStructure.isSubsetOf(set)) {

I wonder if you can add isSubsetOf that takes value and ASSERT that isCellSpeculation or whatever condition needed is true.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>799897</commentid>
    <comment_count>3</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2013-01-03 19:04:52 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; (From update of attachment 181262 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=181262&amp;action=review
&gt; 
&gt; r=me. Despite the fact I’m not an expert of JSC, I think Filip explained me enough details to know what’s happening here.
&gt; 
&gt; &gt; Source/JavaScriptCore/ChangeLog:3
&gt; &gt; +        
&gt; 
&gt; Please add the bug title here.
&gt; 
&gt; &gt; Source/JavaScriptCore/ChangeLog:9
&gt; &gt; +        * dfg/DFGConstantFoldingPhase.cpp:
&gt; &gt; +        (JSC::DFG::ConstantFoldingPhase::foldConstants):
&gt; 
&gt; It’ll be great if you could explain what you’ve described me in person (probably in some brief sentence).
&gt; 
&gt; &gt; Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp:107
&gt; &gt; +                if (!isCellSpeculation(value.m_type))
&gt; &gt; +                    break;
&gt; &gt;                  if (value.m_currentKnownStructure.isSubsetOf(set)) {
&gt; 
&gt; I wonder if you can add isSubsetOf that takes value and ASSERT that isCellSpeculation or whatever condition needed is true.

Or even better, just returns false is isCellSpeculation(m_type) is false.  So we don&apos;t have to repeat the idiom of checking both things in the future.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>799898</commentid>
    <comment_count>4</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2013-01-03 19:06:34 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; (From update of attachment 181262 [details] [details])
&gt; &gt; View in context: https://bugs.webkit.org/attachment.cgi?id=181262&amp;action=review
&gt; &gt; 
&gt; &gt; r=me. Despite the fact I’m not an expert of JSC, I think Filip explained me enough details to know what’s happening here.
&gt; &gt; 
&gt; &gt; &gt; Source/JavaScriptCore/ChangeLog:3
&gt; &gt; &gt; +        
&gt; &gt; 
&gt; &gt; Please add the bug title here.
&gt; &gt; 
&gt; &gt; &gt; Source/JavaScriptCore/ChangeLog:9
&gt; &gt; &gt; +        * dfg/DFGConstantFoldingPhase.cpp:
&gt; &gt; &gt; +        (JSC::DFG::ConstantFoldingPhase::foldConstants):
&gt; &gt; 
&gt; &gt; It’ll be great if you could explain what you’ve described me in person (probably in some brief sentence).
&gt; &gt; 
&gt; &gt; &gt; Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp:107
&gt; &gt; &gt; +                if (!isCellSpeculation(value.m_type))
&gt; &gt; &gt; +                    break;
&gt; &gt; &gt;                  if (value.m_currentKnownStructure.isSubsetOf(set)) {
&gt; &gt; 
&gt; &gt; I wonder if you can add isSubsetOf that takes value and ASSERT that isCellSpeculation or whatever condition needed is true.
&gt; 
&gt; Or even better, just returns false is isCellSpeculation(m_type) is false.  So we don&apos;t have to repeat the idiom of checking both things in the future.

I think I&apos;ll do that refactoring separately.  I&apos;m now starting to think about how to more broadly rationalize the AbstractValue API, so I&apos;ll hold off until I get a better idea in my head.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>800698</commentid>
    <comment_count>5</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2013-01-04 15:42:19 -0800</bug_when>
    <thetext>Landed in http://trac.webkit.org/changeset/138862</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>181262</attachid>
            <date>2013-01-03 18:53:18 -0800</date>
            <delta_ts>2013-01-03 19:03:45 -0800</delta_ts>
            <desc>the patch</desc>
            <filename>fixcell.patch</filename>
            <type>text/plain</type>
            <size>1842</size>
            <attacher name="Filip Pizlo">fpizlo</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTM4NzcxKQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDEzIEBA
CisyMDEzLTAxLTAzICBGaWxpcCBQaXpsbyAgPGZwaXpsb0BhcHBsZS5jb20+CisKKyAgICAgICAg
CisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0xMDYwNzQK
KworICAgICA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ycmVudEtub3duU3Ry
dWN0dXJlLmlzU3Vic2V0T2Yoc2V0KSkgewogICAgICAgICAgICAgICAgICAgICBBU1NFUlQobm9k
ZS5yZWZDb3VudCgpID09IDEpOwogICAgICAgICAgICAgICAgICAgICBub2RlLnNldE9wQW5kRGVm
YXVsdEZsYWdzKFBoYW50b20pOwpAQCAtMTEwLDggKzExMiw3IEBAIHByaXZhdGU6CiAgICAgICAg
ICAgICAgICAgfQogICAgICAgICAgICAgICAgIFN0cnVjdHVyZUFic3RyYWN0VmFsdWUmIHN0cnVj
dHVyZVZhbHVlID0gdmFsdWUubV9mdXR1cmVQb3NzaWJsZVN0cnVjdHVyZTsKICAgICAgICAgICAg
ICAgICBpZiAoc3RydWN0dXJlVmFsdWUuaXNTdWJzZXRPZihzZXQpCi0gICAgICAgICAgICAgICAg
ICAgICYmIHN0cnVjdHVyZVZhbHVlLmhhc1NpbmdsZXRvbigpCi0gICAgICAgICAgICAgICAgICAg
ICYmIGlzQ2VsbFNwZWN1bGF0aW9uKHZhbHVlLm1fdHlwZSkpIHsKKyAgICAgICAgICAgICAgICAg
ICAgJiYgc3RydWN0dXJlVmFsdWUuaGFzU2luZ2xldG9uKCkpIHsKICAgICAgICAgICAgICAgICAg
ICAgbm9kZS5jb252ZXJ0VG9TdHJ1Y3R1cmVUcmFuc2l0aW9uV2F0Y2hwb2ludChzdHJ1Y3R1cmVW
YWx1ZS5zaW5nbGV0b24oKSk7CiAgICAgICAgICAgICAgICAgICAgIGNoYW5nZWQgPSB0cnVlOwog
ICAgICAgICAgICAgICAgIH0K
</data>
<flag name="review"
          id="198813"
          type_id="1"
          status="+"
          setter="rniwa"
    />
          </attachment>
      

    </bug>

</bugzilla>