<?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>128155</bug_id>
          
          <creation_ts>2014-02-03 19:47:25 -0800</creation_ts>
          <short_desc>ASSERT in speculateMachineInt on 32-bit platforms</short_desc>
          <delta_ts>2014-02-04 11:05:14 -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>Unspecified</rep_platform>
          <op_sys>Unspecified</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="Mark Hahnenberg">mhahnenberg</reporter>
          <assigned_to name="Mark Hahnenberg">mhahnenberg</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>fpizlo</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>976169</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Hahnenberg">mhahnenberg</who>
    <bug_when>2014-02-03 19:47:25 -0800</bug_when>
    <thetext>Patch on the way.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>976170</commentid>
    <comment_count>1</comment_count>
      <attachid>223064</attachid>
    <who name="Mark Hahnenberg">mhahnenberg</who>
    <bug_when>2014-02-03 19:49:16 -0800</bug_when>
    <thetext>Created attachment 223064
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>976171</commentid>
    <comment_count>2</comment_count>
      <attachid>223064</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2014-02-03 19:50:49 -0800</bug_when>
    <thetext>Comment on attachment 223064
Patch

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>976372</commentid>
    <comment_count>3</comment_count>
      <attachid>223064</attachid>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2014-02-04 08:48:12 -0800</bug_when>
    <thetext>Comment on attachment 223064
Patch

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

&gt; Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp:139
&gt;              if (type == SpecInt52AsDouble)
&gt; -                type = SpecInt52;
&gt; +                type = enableInt52() ? SpecInt52 : SpecDouble;

I&apos;m pretty sure this is wrong and will result in worse optimizations on 32-bit.  In particular, you&apos;re claiming that if something was representable as an in52 (i.e. it&apos;s non-fractional and not-NaN and not infinity), then it&apos;s SpecDouble, which means &quot;this value can be an integer, or a real, or infinity, or NaN, etc&quot;.  So, this is not the right fix.

You should have instead just made this say:

if (type == SpecInt52AsDouble &amp;&amp; enableInt52())
    type = SpecInt52;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>976373</commentid>
    <comment_count>4</comment_count>
    <who name="Mark Hahnenberg">mhahnenberg</who>
    <bug_when>2014-02-04 08:49:27 -0800</bug_when>
    <thetext>&gt; You should have instead just made this say:
&gt; 
&gt; if (type == SpecInt52AsDouble &amp;&amp; enableInt52())
&gt;     type = SpecInt52;

But what happens when !enableInt52()? Is it valid for the speculated type to be SpecInt52AsDouble on 32-bit platforms?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>976420</commentid>
    <comment_count>5</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2014-02-04 10:12:47 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; &gt; You should have instead just made this say:
&gt; &gt; 
&gt; &gt; if (type == SpecInt52AsDouble &amp;&amp; enableInt52())
&gt; &gt;     type = SpecInt52;
&gt; 
&gt; But what happens when !enableInt52()? Is it valid for the speculated type to be SpecInt52AsDouble on 32-bit platforms?

Yes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>976423</commentid>
    <comment_count>6</comment_count>
      <attachid>223135</attachid>
    <who name="Mark Hahnenberg">mhahnenberg</who>
    <bug_when>2014-02-04 10:15:28 -0800</bug_when>
    <thetext>Created attachment 223135
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>976442</commentid>
    <comment_count>7</comment_count>
    <who name="Mark Hahnenberg">mhahnenberg</who>
    <bug_when>2014-02-04 11:05:05 -0800</bug_when>
    <thetext>Committed r163391: &lt;http://trac.webkit.org/changeset/163391&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>223064</attachid>
            <date>2014-02-03 19:49:16 -0800</date>
            <delta_ts>2014-02-04 10:15:27 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-128155-20140203194915.patch</filename>
            <type>text/plain</type>
            <size>1367</size>
            <attacher name="Mark Hahnenberg">mhahnenberg</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTYzMzU5KQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDEzIEBA
CisyMDE0LTAyLTAzICBNYXJrIEhhaG5lbmJlcmcgIDxtaGFobmVuYmVyZ0BhcHBsZS5jb20+CisK
KyAgICAgICAgQVNTRVJUIGluIHNwZWN1bGF0ZU1hY2hpbmVJbnQgb24gMzItYml0IHBsYXRmb3Jt
cworICAgICAgICBodHRwczovL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ludDUyQXNEb3VibGUpCi0gICAg
ICAgICAgICAgICAgdHlwZSA9IFNwZWNJbnQ1MjsKKyAgICAgICAgICAgICAgICB0eXBlID0gZW5h
YmxlSW50NTIoKSA/IFNwZWNJbnQ1MiA6IFNwZWNEb3VibGU7CiAgICAgICAgICAgICBjaGFuZ2Vk
IHw9IHNldFByZWRpY3Rpb24odHlwZSk7CiAgICAgICAgICAgICBicmVhazsKICAgICAgICAgfQo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>223135</attachid>
            <date>2014-02-04 10:15:28 -0800</date>
            <delta_ts>2014-02-04 11:05:14 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-128155-20140204101524.patch</filename>
            <type>text/plain</type>
            <size>1339</size>
            <attacher name="Mark Hahnenberg">mhahnenberg</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gMTYzMzg3KQorKysgU291cmNl
L0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDEzIEBA
CisyMDE0LTAyLTA0ICBNYXJrIEhhaG5lbmJlcmcgIDxtaGFobmVuYmVyZ0BhcHBsZS5jb20+CisK
KyAgICAgICAgQVNTRVJUIGluIHNwZWN1bGF0ZU1hY2hpbmVJbnQgb24gMzItYml0IHBsYXRmb3Jt
cworICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MTI4MTU1
CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgKiBkZmcv
REZHUHJlZGljd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ICAgICAgICAgY2hhbmdlZCB8PSBzZXRQcmVkaWN0aW9u
KHR5cGUpOwogICAgICAgICAgICAgYnJlYWs7Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>