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

Changeset 284716 in webkit


Ignore:
Timestamp:
Oct 22, 2021, 2:56:00 PM (5 years ago)
Author:
ysuzuki@apple.com
Message:

[JSC] GetTypedArrayLengthAsInt52 must be inserted only when we ensure that input is TypedArray via array-mode-based filtering
https://bugs.webkit.org/show_bug.cgi?id=232168
rdar://84366658

Reviewed by Robin Morisset.

JSTests:

  • stress/gettypedarraylengthasint52-must-be-emitted-for-typedarray.js: Added.

(foo):

Source/JavaScriptCore:

GetTypedArrayLengthAsInt52 works only when input is TypedArray, which should be validated via array-mode (and already inserted checks in fixup).
Accidentally we were inserting it without checking typed-array condition in SSA lowering phase. This patch adds a condition which ensures it
is TypedArray.

  • dfg/DFGSSALoweringPhase.cpp:

(JSC::DFG::SSALoweringPhase::handleNode):
(JSC::DFG::SSALoweringPhase::lowerBoundsCheck):

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r284702 r284716  
     12021-10-22  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] GetTypedArrayLengthAsInt52 must be inserted only when we ensure that input is TypedArray via array-mode-based filtering
     4        https://bugs.webkit.org/show_bug.cgi?id=232168
     5        rdar://84366658
     6
     7        Reviewed by Robin Morisset.
     8
     9        * stress/gettypedarraylengthasint52-must-be-emitted-for-typedarray.js: Added.
     10        (foo):
     11
    1122021-10-22  Asumu Takikawa  <asumu@igalia.com>
    213
  • trunk/Source/JavaScriptCore/ChangeLog

    r284715 r284716  
     12021-10-22  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] GetTypedArrayLengthAsInt52 must be inserted only when we ensure that input is TypedArray via array-mode-based filtering
     4        https://bugs.webkit.org/show_bug.cgi?id=232168
     5        rdar://84366658
     6
     7        Reviewed by Robin Morisset.
     8
     9        GetTypedArrayLengthAsInt52 works only when input is TypedArray, which should be validated via array-mode (and already inserted checks in fixup).
     10        Accidentally we were inserting it without checking typed-array condition in SSA lowering phase. This patch adds a condition which ensures it
     11        is TypedArray.
     12
     13        * dfg/DFGSSALoweringPhase.cpp:
     14        (JSC::DFG::SSALoweringPhase::handleNode):
     15        (JSC::DFG::SSALoweringPhase::lowerBoundsCheck):
     16
    1172021-10-22  Mark Lam  <mark.lam@apple.com>
    218
  • trunk/Source/JavaScriptCore/dfg/DFGSSALoweringPhase.cpp

    r284646 r284716  
    100100                break;
    101101           
    102             if (m_node->arrayMode().typedArrayType() != NotTypedArray && m_node->arrayMode().isOutOfBounds()) {
     102            if (m_node->arrayMode().isSomeTypedArrayView() && m_node->arrayMode().isOutOfBounds()) {
    103103#if USE(LARGE_TYPED_ARRAYS)
    104104                if (m_node->arrayMode().mayBeLargeTypedArray() || m_graph.hasExitSite(m_node->origin.semantic, Overflow)) {
     
    150150        Node* checkInBounds;
    151151#if USE(LARGE_TYPED_ARRAYS)
    152         if ((op == GetArrayLength) && (m_node->arrayMode().mayBeLargeTypedArray() || m_graph.hasExitSite(m_node->origin.semantic, Overflow))) {
     152        if ((op == GetArrayLength) && m_node->arrayMode().isSomeTypedArrayView() && (m_node->arrayMode().mayBeLargeTypedArray() || m_graph.hasExitSite(m_node->origin.semantic, Overflow))) {
    153153            Node* length = m_insertionSet.insertNode(
    154154                m_nodeIndex, SpecInt52Any, GetTypedArrayLengthAsInt52, m_node->origin,
Note: See TracChangeset for help on using the changeset viewer.