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

Changeset 285592 in webkit


Ignore:
Timestamp:
Nov 10, 2021, 10:54:59 AM (5 years ago)
Author:
sbarati@apple.com
Message:

in_by_val should not constant fold to in_by_id when the property is a property index
https://bugs.webkit.org/show_bug.cgi?id=232753

Reviewed by Yusuke Suzuki.

JSTests:

  • stress/dont-in-by-id-when-index-2.js: Added.

(assert):
(main.v179):
(main.async v244):
(main):

  • stress/dont-in-by-id-when-index.js: Added.

(assert):
(test):

Source/JavaScriptCore:

  • dfg/DFGAbstractInterpreterInlines.h:

(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):

  • dfg/DFGConstantFoldingPhase.cpp:

(JSC::DFG::ConstantFoldingPhase::foldConstants):

  • dfg/DFGValidate.cpp:
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r285578 r285592  
     12021-11-10  Saam Barati  <sbarati@apple.com>
     2
     3        in_by_val should not constant fold to in_by_id when the property is a property index
     4        https://bugs.webkit.org/show_bug.cgi?id=232753
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        * stress/dont-in-by-id-when-index-2.js: Added.
     9        (assert):
     10        (main.v179):
     11        (main.async v244):
     12        (main):
     13        * stress/dont-in-by-id-when-index.js: Added.
     14        (assert):
     15        (test):
     16
    1172021-11-10  Xan Lopez  <xan@igalia.com>
    218
  • trunk/Source/JavaScriptCore/ChangeLog

    r285538 r285592  
     12021-11-10  Saam Barati  <sbarati@apple.com>
     2
     3        in_by_val should not constant fold to in_by_id when the property is a property index
     4        https://bugs.webkit.org/show_bug.cgi?id=232753
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        * dfg/DFGAbstractInterpreterInlines.h:
     9        (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
     10        * dfg/DFGConstantFoldingPhase.cpp:
     11        (JSC::DFG::ConstantFoldingPhase::foldConstants):
     12        * dfg/DFGValidate.cpp:
     13
    1142021-11-09  Commit Queue  <commit-queue@webkit.org>
    215
  • trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h

    r285525 r285592  
    42494249            if (constant.isString()) {
    42504250                JSString* string = asString(constant);
    4251                 if (CacheableIdentifier::isCacheableIdentifierCell(string))
     4251                if (CacheableIdentifier::isCacheableIdentifierCell(string) && !parseIndex(CacheableIdentifier::createFromCell(string).uid()))
    42524252                    m_state.setShouldTryConstantFolding(true);
    42534253            }
  • trunk/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp

    r284726 r285592  
    682682                    if (constant.isString()) {
    683683                        JSString* string = asString(constant);
    684                         if (CacheableIdentifier::isCacheableIdentifierCell(string)) {
     684                        if (CacheableIdentifier::isCacheableIdentifierCell(string) && !parseIndex(CacheableIdentifier::createFromCell(string).uid())) {
    685685                            const StringImpl* impl = string->tryGetValueImpl();
    686686                            RELEASE_ASSERT(impl);
  • trunk/Source/JavaScriptCore/dfg/DFGValidate.cpp

    r284646 r285592  
    3030
    3131#include "ButterflyInlines.h"
     32#include "CacheableIdentifierInlines.h"
    3233#include "DFGClobberize.h"
    3334#include "DFGClobbersExitState.h"
     
    234235                    if (!node->child1())
    235236                        VALIDATE((node), !node->child2());
     237                }
     238
     239                if (node->hasCacheableIdentifier()) {
     240                    auto* uid = node->cacheableIdentifier().uid();
     241                    VALIDATE((node), !parseIndex(*uid));
    236242                }
    237243                 
Note: See TracChangeset for help on using the changeset viewer.