<?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>83234</bug_id>
          
          <creation_ts>2012-04-04 16:31:50 -0700</creation_ts>
          <short_desc>DFG InstanceOf should not uselessly speculate cell</short_desc>
          <delta_ts>2012-04-04 17:59:24 -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="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>596083</commentid>
    <comment_count>0</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2012-04-04 16:31:50 -0700</bug_when>
    <thetext>A useless speculation is one that:

1) Is performed on a value that dies at the point of speculation.

2) Handling the case where the speculation would fail is trivial and takes fewer instructions than an OSR exit trampoline (i.e. &lt;12 bytes on x86).

InstanceOf has a SpeculateCell optimization, which is probably great most of the time, but there are times when you do something like:

if (o.f instanceof p)

The temporary result of o.f dies immediately. Handling the case where it&apos;s not a cell is super easy: just return false. So there&apos;s little use in speculating cell here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>596087</commentid>
    <comment_count>1</comment_count>
      <attachid>135717</attachid>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2012-04-04 16:34:55 -0700</bug_when>
    <thetext>Created attachment 135717
the patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>596153</commentid>
    <comment_count>2</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2012-04-04 17:59:24 -0700</bug_when>
    <thetext>Landed in http://trac.webkit.org/changeset/113269</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>135717</attachid>
            <date>2012-04-04 16:34:55 -0700</date>
            <delta_ts>2012-04-04 16:37:30 -0700</delta_ts>
            <desc>the patch</desc>
            <filename>dontspeccell_patch_1.diff</filename>
            <type>text/plain</type>
            <size>1848</size>
            <attacher name="Filip Pizlo">fpizlo</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTEzMjYxKQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE2IEBA
CisyMDEyLTA0LTA0ICBGaWxpcCBQaXpsbyAgPGZwaXpsb0BhcHBsZS5jb20+CisKKyAgICAgICAg
REZHIEluc3RhbmNlT2Ygc2hvdWxkIG5vdCB1c2VsZXNzbHkgc3BlY3VsYXRlIGNlbGwKKyAgICAg
ICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTgzMjM0CisKKyAgICAg
ICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisgICAgICAgIAorICAgICAgICBJZiBJbnN0
YW5jZU9mIGlzIHRoZSBvbm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R5cGUgJiB+UHJlZGljdENlbGwpKSB7
CisgICAgaWYgKCghIShhdChub2RlLmNoaWxkMSgpKS5wcmVkaWN0aW9uKCkgJiB+UHJlZGljdENl
bGwpCisgICAgICAgICAmJiAhIShtX3N0YXRlLmZvck5vZGUobm9kZS5jaGlsZDEoKSkubV90eXBl
ICYgflByZWRpY3RDZWxsKSkKKyAgICAgICAgfHwgYXQobm9kZS5jaGlsZDEoKSkuYWRqdXN0ZWRS
ZWZDb3VudCgpID09IDEpIHsKICAgICAgICAgLy8gSXQgbWlnaHQgbm90IGJlIGEgY2VsbC4gU3Bl
Y3VsYXRlIGxlc3MgYWdncmVzc2l2ZWx5LgorICAgICAgICAvLyBPcjogaXQgbWlnaHQgb25seSBi
ZSB1c2VkIG9uY2UgKGkuZS4gYnkgdXMpLCBzbyB3ZSBnZXQgemVybyBiZW5lZml0CisgICAgICAg
IC8vIGZyb20gc3BlY3VsYXRpbmcgYW55IG1vcmUgYWdncmVzc2l2ZWx5IHRoYW4gd2UgYWJzb2x1
dGVseSBuZWVkIHRvLgogICAgICAgICAKICAgICAgICAgSlNWYWx1ZU9wZXJhbmQgdmFsdWUodGhp
cywgbm9kZS5jaGlsZDEoKSk7CiAgICAgICAgIFNwZWN1bGF0ZUNlbGxPcGVyYW5kIHByb3RvdHlw
ZSh0aGlzLCBub2RlLmNoaWxkMygpKTsK
</data>
<flag name="review"
          id="140311"
          type_id="1"
          status="+"
          setter="oliver"
    />
          </attachment>
      

    </bug>

</bugzilla>