Changeset 292493 in webkit for trunk/Source/JavaScriptCore/dfg


Ignore:
Timestamp:
Apr 6, 2022, 12:35:37 PM (3 years ago)
Author:
[email protected]
Message:

Call Structure::get instead of Structure::getConcurrently on the mutator thread
https://bugs.webkit.org/show_bug.cgi?id=238823

Reviewed by Yusuke Suzuki.

We try to call Structure::get instead of Structure::getConcurrently when
we know for sure we're on the main thread. This is because getConcurrently
is slower than get.

  • bytecode/AccessCase.cpp:

(JSC::AccessCase::couldStillSucceed const):
(JSC::AccessCase::generateImpl):

  • bytecode/AdaptiveInferredPropertyValueWatchpointBase.cpp:

(JSC::AdaptiveInferredPropertyValueWatchpointBase::install):

  • bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.cpp:

(JSC::LLIntPrototypeLoadAdaptiveStructureWatchpoint::install):

  • bytecode/ObjectPropertyCondition.cpp:

(JSC::ObjectPropertyCondition::structureEnsuresValidityAssumingImpurePropertyWatchpoint const):
(JSC::ObjectPropertyCondition::isStillValidAssumingImpurePropertyWatchpoint const):
(JSC::ObjectPropertyCondition::isStillValid const):
(JSC::ObjectPropertyCondition::structureEnsuresValidity const):

  • bytecode/ObjectPropertyCondition.h:
  • bytecode/ObjectPropertyConditionSet.cpp:

(JSC::ObjectPropertyConditionSet::structuresEnsureValidity const):
(JSC::generateConditionsForPropertyMiss):
(JSC::generateConditionsForPropertySetterMiss):
(JSC::generateConditionsForPrototypePropertyHit):
(JSC::generateConditionsForPrototypePropertyHitCustom):
(JSC::generateConditionsForPrototypeEquivalenceConcurrently):
(JSC::generateConditionsForPropertyMissConcurrently):
(JSC::generateConditionsForPropertySetterMissConcurrently):
(JSC::generateConditionForSelfEquivalence):
(JSC::ObjectPropertyConditionSet::structuresEnsureValidityAssumingImpurePropertyWatchpoint const): Deleted.
(JSC::ObjectPropertyConditionSet::isValidAndWatchable const): Deleted.

  • bytecode/ObjectPropertyConditionSet.h:
  • bytecode/PropertyCondition.cpp:

(JSC::PropertyCondition::isStillValidAssumingImpurePropertyWatchpoint const):
(JSC::watchabilityToConcurrency):
(JSC::PropertyCondition::isStillValid const):
(JSC::PropertyCondition::isWatchableWhenValid const):
(JSC::PropertyCondition::isWatchableAssumingImpurePropertyWatchpoint const):
(JSC::PropertyCondition::isWatchable const):

  • bytecode/PropertyCondition.h:
  • dfg/DFGAdaptiveStructureWatchpoint.cpp:

(JSC::DFG::AdaptiveStructureWatchpoint::install):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::check):
(JSC::DFG::ByteCodeParser::planLoad):

  • dfg/DFGConstantFoldingPhase.cpp:

(JSC::DFG::ConstantFoldingPhase::tryFoldAsPutByOffset):

  • dfg/DFGDesiredWatchpoints.h:

(JSC::DFG::AdaptiveStructureWatchpointAdaptor::hasBeenInvalidated):

  • dfg/DFGGraph.cpp:

(JSC::DFG::Graph::watchCondition):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::setupGetByIdPrototypeCache):

  • runtime/CachedSpecialPropertyAdaptiveStructureWatchpoint.cpp:

(JSC::CachedSpecialPropertyAdaptiveStructureWatchpoint::install):

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::tryInstallSpeciesWatchpoint):

  • runtime/JSObject.h:

(JSC::JSObject::getDirect const):

  • runtime/Structure.h:

(JSC::Structure::get):

  • runtime/StructureRareData.cpp:

(JSC::StructureRareData::cacheSpecialPropertySlow):

Location:
trunk/Source/JavaScriptCore/dfg
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGAdaptiveStructureWatchpoint.cpp

    r276226 r292493  
    5959void AdaptiveStructureWatchpoint::install(VM& vm)
    6060{
    61     RELEASE_ASSERT(m_key.isWatchable());
     61    RELEASE_ASSERT(m_key.isWatchable(PropertyCondition::MakeNoChanges));
    6262   
    6363    m_key.object()->structure(vm)->addTransitionWatchpoint(this);
  • trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r291332 r292493  
    42524252   
    42534253    Structure* structure = condition.object()->structure(*m_vm);
    4254     if (!condition.structureEnsuresValidity(structure))
     4254    if (!condition.structureEnsuresValidity(Concurrency::ConcurrentThread, structure))
    42554255        return false;
    42564256   
     
    43814381    // Check if the structure that we've registered makes the condition hold. If not, just give
    43824382    // up. This is case (5) above.
    4383     if (!condition.structureEnsuresValidity(structure))
     4383    if (!condition.structureEnsuresValidity(Concurrency::ConcurrentThread, structure))
    43844384        return GetByOffsetMethod();
    43854385   
  • trunk/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp

    r285592 r292493  
    14361436
    14371437                    Structure* structure = condition.object()->structure(m_graph.m_vm);
    1438                     if (!condition.structureEnsuresValidity(structure))
     1438                    if (!condition.structureEnsuresValidity(Concurrency::ConcurrentThread, structure))
    14391439                        return;
    14401440
  • trunk/Source/JavaScriptCore/dfg/DFGDesiredWatchpoints.h

    r276227 r292493  
    165165    static bool hasBeenInvalidated(const ObjectPropertyCondition& key)
    166166    {
    167         return !key.isWatchable();
     167        return !key.isWatchable(PropertyCondition::MakeNoChanges);
    168168    }
    169169    static void dumpInContext(
  • trunk/Source/JavaScriptCore/dfg/DFGGraph.cpp

    r291332 r292493  
    10651065        return false;
    10661066
    1067     if (!key.isWatchable())
     1067    if (!key.isWatchable(PropertyCondition::MakeNoChanges))
    10681068        return false;
    10691069
Note: See TracChangeset for help on using the changeset viewer.