Changeset 248872 in webkit


Ignore:
Timestamp:
Aug 19, 2019 3:16:15 PM (5 years ago)
Author:
ysuzuki@apple.com
Message:

[JSC] DFG DataView get/set optimization should take care of the case little-endian flag is JSEmpty
https://bugs.webkit.org/show_bug.cgi?id=200899
<rdar://problem/54073341>

Reviewed by Mark Lam.

JSTests:

  • stress/data-view-get-dfg-should-handle-empty-constant.js: Added.

(i.new.Promise):

  • stress/data-view-set-dfg-should-handle-empty-constant.js: Added.

(i.new.Promise):

Source/JavaScriptCore:

DFGByteCodeParser attempt to get constant flag for isLittleEndian for DataView get/set.
When getting a constant in DFG, we first need to check whether it is JSEmpty. But we are missing
this check for DataView get/set optimization.

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::handleIntrinsicCall):

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r248857 r248872  
     12019-08-19  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] DFG DataView get/set optimization should take care of the case little-endian flag is JSEmpty
     4        https://bugs.webkit.org/show_bug.cgi?id=200899
     5        <rdar://problem/54073341>
     6
     7        Reviewed by Mark Lam.
     8
     9        * stress/data-view-get-dfg-should-handle-empty-constant.js: Added.
     10        (i.new.Promise):
     11        * stress/data-view-set-dfg-should-handle-empty-constant.js: Added.
     12        (i.new.Promise):
     13
    1142019-08-19  Michael Saboff  <msaboff@apple.com>
    215
  • trunk/Source/JavaScriptCore/ChangeLog

    r248866 r248872  
     12019-08-19  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] DFG DataView get/set optimization should take care of the case little-endian flag is JSEmpty
     4        https://bugs.webkit.org/show_bug.cgi?id=200899
     5        <rdar://problem/54073341>
     6
     7        Reviewed by Mark Lam.
     8
     9        DFGByteCodeParser attempt to get constant flag for isLittleEndian for DataView get/set.
     10        When getting a constant in DFG, we first need to check whether it is JSEmpty. But we are missing
     11        this check for DataView get/set optimization.
     12
     13        * dfg/DFGByteCodeParser.cpp:
     14        (JSC::DFG::ByteCodeParser::handleIntrinsicCall):
     15
    1162019-08-19  Tadeu Zagallo  <tzagallo@apple.com>
    217
  • trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r248546 r248872  
    32453245                    if (littleEndianChild->hasConstant()) {
    32463246                        JSValue constant = littleEndianChild->constant()->value();
    3247                         isLittleEndian = constant.pureToBoolean();
    3248                         if (isLittleEndian != MixedTriState)
    3249                             littleEndianChild = nullptr;
     3247                        if (constant) {
     3248                            isLittleEndian = constant.pureToBoolean();
     3249                            if (isLittleEndian != MixedTriState)
     3250                                littleEndianChild = nullptr;
     3251                        }
    32503252                    } else
    32513253                        isLittleEndian = MixedTriState;
     
    33283330                    if (littleEndianChild->hasConstant()) {
    33293331                        JSValue constant = littleEndianChild->constant()->value();
    3330                         isLittleEndian = constant.pureToBoolean();
    3331                         if (isLittleEndian != MixedTriState)
    3332                             littleEndianChild = nullptr;
     3332                        if (constant) {
     3333                            isLittleEndian = constant.pureToBoolean();
     3334                            if (isLittleEndian != MixedTriState)
     3335                                littleEndianChild = nullptr;
     3336                        }
    33333337                    } else
    33343338                        isLittleEndian = MixedTriState;
Note: See TracChangeset for help on using the changeset viewer.