⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 267636 in webkit


Ignore:
Timestamp:
Sep 26, 2020, 2:08:55 PM (6 years ago)
Author:
Alan Coon
Message:

Cherry-pick r267135. rdar://problem/69586651

JSImmutableButterfly::get needs to return jsDoubleNumber for double arrays
https://bugs.webkit.org/show_bug.cgi?id=216589
<rdar://problem/68061245>

Reviewed by Yusuke Suzuki.

JSTests:

  • stress/jsimmutablebutterfly-get-must-return-double-boxed-value.js: Added.

Source/JavaScriptCore:

We are using JSImmutableButterfly::get in AI to constant fold GetByVal,
but we were failing to always return a boxed double value for double loads.
We were calling jsNumber instead of jsDooubleNumber. This is in contrast to
the runtime, which always returns a double boxed value. This would lead AI
to disagree with the runtime, and miscompile code.

  • runtime/JSImmutableButterfly.h: (JSC::JSImmutableButterfly::get const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267135 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-610-branch
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-610-branch/JSTests/ChangeLog

    r267635 r267636  
     12020-09-25  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r267135. rdar://problem/69586651
     4
     5    JSImmutableButterfly::get needs to return jsDoubleNumber for double arrays
     6    https://bugs.webkit.org/show_bug.cgi?id=216589
     7    <rdar://problem/68061245>
     8   
     9    Reviewed by Yusuke Suzuki.
     10   
     11    JSTests:
     12   
     13    * stress/jsimmutablebutterfly-get-must-return-double-boxed-value.js: Added.
     14   
     15    Source/JavaScriptCore:
     16   
     17    We are using JSImmutableButterfly::get in AI to constant fold GetByVal,
     18    but we were failing to always return a boxed double value for double loads.
     19    We were calling jsNumber instead of jsDooubleNumber. This is in contrast to
     20    the runtime, which always returns a double boxed value. This would lead AI
     21    to disagree with the runtime, and miscompile code.
     22   
     23    * runtime/JSImmutableButterfly.h:
     24    (JSC::JSImmutableButterfly::get const):
     25   
     26   
     27    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267135 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     28
     29    2020-09-15  Saam Barati  <sbarati@apple.com>
     30
     31            JSImmutableButterfly::get needs to return jsDoubleNumber for double arrays
     32            https://bugs.webkit.org/show_bug.cgi?id=216589
     33            <rdar://problem/68061245>
     34
     35            Reviewed by Yusuke Suzuki.
     36
     37            * stress/jsimmutablebutterfly-get-must-return-double-boxed-value.js: Added.
     38
    1392020-09-25  Alan Coon  <alancoon@apple.com>
    240
  • branches/safari-610-branch/Source/JavaScriptCore/ChangeLog

    r267635 r267636  
     12020-09-25  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r267135. rdar://problem/69586651
     4
     5    JSImmutableButterfly::get needs to return jsDoubleNumber for double arrays
     6    https://bugs.webkit.org/show_bug.cgi?id=216589
     7    <rdar://problem/68061245>
     8   
     9    Reviewed by Yusuke Suzuki.
     10   
     11    JSTests:
     12   
     13    * stress/jsimmutablebutterfly-get-must-return-double-boxed-value.js: Added.
     14   
     15    Source/JavaScriptCore:
     16   
     17    We are using JSImmutableButterfly::get in AI to constant fold GetByVal,
     18    but we were failing to always return a boxed double value for double loads.
     19    We were calling jsNumber instead of jsDooubleNumber. This is in contrast to
     20    the runtime, which always returns a double boxed value. This would lead AI
     21    to disagree with the runtime, and miscompile code.
     22   
     23    * runtime/JSImmutableButterfly.h:
     24    (JSC::JSImmutableButterfly::get const):
     25   
     26   
     27    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267135 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     28
     29    2020-09-15  Saam Barati  <sbarati@apple.com>
     30
     31            JSImmutableButterfly::get needs to return jsDoubleNumber for double arrays
     32            https://bugs.webkit.org/show_bug.cgi?id=216589
     33            <rdar://problem/68061245>
     34
     35            Reviewed by Yusuke Suzuki.
     36
     37            We are using JSImmutableButterfly::get in AI to constant fold GetByVal,
     38            but we were failing to always return a boxed double value for double loads.
     39            We were calling jsNumber instead of jsDooubleNumber. This is in contrast to
     40            the runtime, which always returns a double boxed value. This would lead AI
     41            to disagree with the runtime, and miscompile code.
     42
     43            * runtime/JSImmutableButterfly.h:
     44            (JSC::JSImmutableButterfly::get const):
     45
    1462020-09-25  Alan Coon  <alancoon@apple.com>
    247
  • branches/safari-610-branch/Source/JavaScriptCore/runtime/JSImmutableButterfly.h

    r254735 r267636  
    143143        // Holes are not supported yet.
    144144        ASSERT(!std::isnan(value));
    145         return jsNumber(value);
     145        return jsDoubleNumber(value);
    146146    }
    147147
Note: See TracChangeset for help on using the changeset viewer.