Changeset 248906 in webkit


Ignore:
Timestamp:
Aug 20, 2019 10:37:07 AM (5 years ago)
Author:
ysuzuki@apple.com
Message:

[JSC] Array.prototype.toString should not get "join" function each time
https://bugs.webkit.org/show_bug.cgi?id=200905

Reviewed by Mark Lam.

JSTests:

  • stress/array-prototype-join-change.js: Added.

(shouldBe):
(array2.join):
(DerivedArray):
(DerivedArray.prototype.join):
(array3.proto.join):
(Array.prototype.join):

Source/JavaScriptCore:

We avoid looking up join every time Array#toString is called. This patch implements the most profitable and easy
case first as we are doing optimization for Array#slice: non-modified original Array. Configuring watchpoint for
Array.prototype.join change and use this information and structure information to determine whether join lookup
in Array.prototype.toString is unnecessary. This improves JetStream2/3d-raytrace-SP score by 1.6%

ToT: 363.56
Patched: 369.26

This patch also renames InlineWatchpointSet fields from Watchpoint to WatchpointSet since they are not Watchpoint.

  • dfg/DFGByteCodeParser.cpp:

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

  • dfg/DFGGraph.h:

(JSC::DFG::Graph::isWatchingArrayIteratorProtocolWatchpoint):
(JSC::DFG::Graph::isWatchingNumberToStringWatchpoint):

  • runtime/ArrayPrototype.cpp:

(JSC::speciesWatchpointIsValid):
(JSC::canUseDefaultArrayJoinForToString):
(JSC::arrayProtoFuncToString):

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::JSGlobalObject):
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::tryInstallArraySpeciesWatchpoint):

  • runtime/JSGlobalObject.h:

(JSC::JSGlobalObject::arrayIteratorProtocolWatchpointSet):
(JSC::JSGlobalObject::mapIteratorProtocolWatchpointSet):
(JSC::JSGlobalObject::setIteratorProtocolWatchpointSet):
(JSC::JSGlobalObject::stringIteratorProtocolWatchpointSet):
(JSC::JSGlobalObject::mapSetWatchpointSet):
(JSC::JSGlobalObject::setAddWatchpointSet):
(JSC::JSGlobalObject::arraySpeciesWatchpointSet):
(JSC::JSGlobalObject::arrayJoinWatchpointSet):
(JSC::JSGlobalObject::numberToStringWatchpointSet):
(JSC::JSGlobalObject::arrayIteratorProtocolWatchpoint): Deleted.
(JSC::JSGlobalObject::mapIteratorProtocolWatchpoint): Deleted.
(JSC::JSGlobalObject::setIteratorProtocolWatchpoint): Deleted.
(JSC::JSGlobalObject::stringIteratorProtocolWatchpoint): Deleted.
(JSC::JSGlobalObject::mapSetWatchpoint): Deleted.
(JSC::JSGlobalObject::setAddWatchpoint): Deleted.
(JSC::JSGlobalObject::arraySpeciesWatchpoint): Deleted.
(JSC::JSGlobalObject::numberToStringWatchpoint): Deleted.

  • runtime/JSGlobalObjectInlines.h:

(JSC::JSGlobalObject::isArrayPrototypeIteratorProtocolFastAndNonObservable):
(JSC::JSGlobalObject::isMapPrototypeIteratorProtocolFastAndNonObservable):
(JSC::JSGlobalObject::isSetPrototypeIteratorProtocolFastAndNonObservable):
(JSC::JSGlobalObject::isStringPrototypeIteratorProtocolFastAndNonObservable):
(JSC::JSGlobalObject::isMapPrototypeSetFastAndNonObservable):
(JSC::JSGlobalObject::isSetPrototypeAddFastAndNonObservable):

Location:
trunk
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r248905 r248906  
     12019-08-20  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] Array.prototype.toString should not get "join" function each time
     4        https://bugs.webkit.org/show_bug.cgi?id=200905
     5
     6        Reviewed by Mark Lam.
     7
     8        * stress/array-prototype-join-change.js: Added.
     9        (shouldBe):
     10        (array2.join):
     11        (DerivedArray):
     12        (DerivedArray.prototype.join):
     13        (array3.__proto__.join):
     14        (Array.prototype.join):
     15
    1162019-08-20  Justin Michaud  <justin_michaud@apple.com>
    217
  • trunk/Source/JavaScriptCore/ChangeLog

    r248898 r248906  
     12019-08-20  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] Array.prototype.toString should not get "join" function each time
     4        https://bugs.webkit.org/show_bug.cgi?id=200905
     5
     6        Reviewed by Mark Lam.
     7
     8        We avoid looking up `join` every time Array#toString is called. This patch implements the most profitable and easy
     9        case first as we are doing optimization for Array#slice: non-modified original Array. Configuring watchpoint for
     10        Array.prototype.join change and use this information and structure information to determine whether `join` lookup
     11        in Array.prototype.toString is unnecessary. This improves JetStream2/3d-raytrace-SP score by 1.6%
     12
     13            ToT:     363.56
     14            Patched: 369.26
     15
     16        This patch also renames InlineWatchpointSet fields from Watchpoint to WatchpointSet since they are not Watchpoint.
     17
     18        * dfg/DFGByteCodeParser.cpp:
     19        (JSC::DFG::ByteCodeParser::handleIntrinsicCall):
     20        * dfg/DFGGraph.h:
     21        (JSC::DFG::Graph::isWatchingArrayIteratorProtocolWatchpoint):
     22        (JSC::DFG::Graph::isWatchingNumberToStringWatchpoint):
     23        * runtime/ArrayPrototype.cpp:
     24        (JSC::speciesWatchpointIsValid):
     25        (JSC::canUseDefaultArrayJoinForToString):
     26        (JSC::arrayProtoFuncToString):
     27        * runtime/JSGlobalObject.cpp:
     28        (JSC::JSGlobalObject::JSGlobalObject):
     29        (JSC::JSGlobalObject::init):
     30        (JSC::JSGlobalObject::tryInstallArraySpeciesWatchpoint):
     31        * runtime/JSGlobalObject.h:
     32        (JSC::JSGlobalObject::arrayIteratorProtocolWatchpointSet):
     33        (JSC::JSGlobalObject::mapIteratorProtocolWatchpointSet):
     34        (JSC::JSGlobalObject::setIteratorProtocolWatchpointSet):
     35        (JSC::JSGlobalObject::stringIteratorProtocolWatchpointSet):
     36        (JSC::JSGlobalObject::mapSetWatchpointSet):
     37        (JSC::JSGlobalObject::setAddWatchpointSet):
     38        (JSC::JSGlobalObject::arraySpeciesWatchpointSet):
     39        (JSC::JSGlobalObject::arrayJoinWatchpointSet):
     40        (JSC::JSGlobalObject::numberToStringWatchpointSet):
     41        (JSC::JSGlobalObject::arrayIteratorProtocolWatchpoint): Deleted.
     42        (JSC::JSGlobalObject::mapIteratorProtocolWatchpoint): Deleted.
     43        (JSC::JSGlobalObject::setIteratorProtocolWatchpoint): Deleted.
     44        (JSC::JSGlobalObject::stringIteratorProtocolWatchpoint): Deleted.
     45        (JSC::JSGlobalObject::mapSetWatchpoint): Deleted.
     46        (JSC::JSGlobalObject::setAddWatchpoint): Deleted.
     47        (JSC::JSGlobalObject::arraySpeciesWatchpoint): Deleted.
     48        (JSC::JSGlobalObject::numberToStringWatchpoint): Deleted.
     49        * runtime/JSGlobalObjectInlines.h:
     50        (JSC::JSGlobalObject::isArrayPrototypeIteratorProtocolFastAndNonObservable):
     51        (JSC::JSGlobalObject::isMapPrototypeIteratorProtocolFastAndNonObservable):
     52        (JSC::JSGlobalObject::isSetPrototypeIteratorProtocolFastAndNonObservable):
     53        (JSC::JSGlobalObject::isStringPrototypeIteratorProtocolFastAndNonObservable):
     54        (JSC::JSGlobalObject::isMapPrototypeSetFastAndNonObservable):
     55        (JSC::JSGlobalObject::isSetPrototypeAddFastAndNonObservable):
     56
    1572019-08-20  Joseph Pecoraro  <pecoraro@apple.com>
    258
  • trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r248872 r248906  
    23522352                // FIXME: We could easily relax the Array/Object.prototype transition as long as we OSR exitted if we saw a hole.
    23532353                // https://bugs.webkit.org/show_bug.cgi?id=173171
    2354                 if (globalObject->arraySpeciesWatchpoint().state() == IsWatched
     2354                if (globalObject->arraySpeciesWatchpointSet().state() == IsWatched
    23552355                    && globalObject->havingABadTimeWatchpoint()->isStillValid()
    23562356                    && arrayPrototypeStructure->transitionWatchpointSetIsStillValid()
     
    23582358                    && globalObject->arrayPrototypeChainIsSane()) {
    23592359
    2360                     m_graph.watchpoints().addLazily(globalObject->arraySpeciesWatchpoint());
     2360                    m_graph.watchpoints().addLazily(globalObject->arraySpeciesWatchpointSet());
    23612361                    m_graph.watchpoints().addLazily(globalObject->havingABadTimeWatchpoint());
    23622362                    m_graph.registerAndWatchStructureTransition(arrayPrototypeStructure);
  • trunk/Source/JavaScriptCore/dfg/DFGGraph.h

    r248642 r248906  
    801801    {
    802802        JSGlobalObject* globalObject = globalObjectFor(node->origin.semantic);
    803         InlineWatchpointSet& set = globalObject->arrayIteratorProtocolWatchpoint();
     803        InlineWatchpointSet& set = globalObject->arrayIteratorProtocolWatchpointSet();
    804804        return isWatchingGlobalObjectWatchpoint(globalObject, set);
    805805    }
     
    808808    {
    809809        JSGlobalObject* globalObject = globalObjectFor(node->origin.semantic);
    810         InlineWatchpointSet& set = globalObject->numberToStringWatchpoint();
     810        InlineWatchpointSet& set = globalObject->numberToStringWatchpointSet();
    811811        return isWatchingGlobalObjectWatchpoint(globalObject, set);
    812812    }
  • trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp

    r247296 r248906  
    197197    ArrayPrototype* arrayPrototype = globalObject->arrayPrototype();
    198198
    199     if (globalObject->arraySpeciesWatchpoint().stateOnJSThread() == ClearWatchpoint) {
     199    if (globalObject->arraySpeciesWatchpointSet().stateOnJSThread() == ClearWatchpoint) {
    200200        dataLogLnIf(ArrayPrototypeInternal::verbose, "Initializing Array species watchpoints for Array.prototype: ", pointerDump(arrayPrototype), " with structure: ", pointerDump(arrayPrototype->structure(vm)), "\nand Array: ", pointerDump(globalObject->arrayConstructor()), " with structure: ", pointerDump(globalObject->arrayConstructor()->structure(vm)));
    201201        globalObject->tryInstallArraySpeciesWatchpoint(exec);
    202         ASSERT(globalObject->arraySpeciesWatchpoint().stateOnJSThread() != ClearWatchpoint);
     202        ASSERT(globalObject->arraySpeciesWatchpointSet().stateOnJSThread() != ClearWatchpoint);
    203203    }
    204204
    205205    return !thisObject->hasCustomProperties(vm)
    206206        && arrayPrototype == thisObject->getPrototypeDirect(vm)
    207         && globalObject->arraySpeciesWatchpoint().stateOnJSThread() == IsWatched;
     207        && globalObject->arraySpeciesWatchpointSet().stateOnJSThread() == IsWatched;
    208208}
    209209
     
    577577}
    578578
     579inline bool canUseDefaultArrayJoinForToString(VM& vm, JSObject* thisObject)
     580{
     581    JSGlobalObject* globalObject = thisObject->globalObject();
     582
     583    if (globalObject->arrayJoinWatchpointSet().stateOnJSThread() != IsWatched)
     584        return false;
     585
     586    Structure* structure = thisObject->structure(vm);
     587
     588    // This is the fast case. Many arrays will be an original array.
     589    // We are doing very simple check here. If we do more complicated checks like looking into getDirect "join" of thisObject,
     590    // it would be possible that just looking into "join" function will show the same performance.
     591    return globalObject->isOriginalArrayStructure(structure);
     592}
     593
    579594EncodedJSValue JSC_HOST_CALL arrayProtoFuncToString(ExecState* exec)
    580595{
     
    586601    JSObject* thisObject = thisValue.toObject(exec);
    587602    RETURN_IF_EXCEPTION(scope, encodedJSValue());
    588    
    589     // 2. Let func be the result of calling the [[Get]] internal method of array with argument "join".
    590     JSValue function = JSValue(thisObject).get(exec, vm.propertyNames->join);
    591     RETURN_IF_EXCEPTION(scope, encodedJSValue());
    592 
    593     // 3. If IsCallable(func) is false, then let func be the standard built-in method Object.prototype.toString (15.2.4.2).
    594     bool customJoinCase = false;
    595     if (!function.isCell())
    596         customJoinCase = true;
    597     CallData callData;
    598     CallType callType = getCallData(vm, function, callData);
    599     if (callType == CallType::None)
    600         customJoinCase = true;
    601 
    602     if (UNLIKELY(customJoinCase))
    603         RELEASE_AND_RETURN(scope, JSValue::encode(jsMakeNontrivialString(exec, "[object ", thisObject->methodTable(vm)->className(thisObject, vm), "]")));
    604 
    605     // 4. Return the result of calling the [[Call]] internal method of func providing array as the this value and an empty arguments list.
    606     if (!isJSArray(thisObject) || callType != CallType::Host || callData.native.function != arrayProtoFuncJoin)
    607         RELEASE_AND_RETURN(scope, JSValue::encode(call(exec, function, callType, callData, thisObject, *vm.emptyList)));
     603
     604    if (!canUseDefaultArrayJoinForToString(vm, thisObject)) {
     605        // 2. Let func be the result of calling the [[Get]] internal method of array with argument "join".
     606        JSValue function = JSValue(thisObject).get(exec, vm.propertyNames->join);
     607        RETURN_IF_EXCEPTION(scope, encodedJSValue());
     608
     609        // 3. If IsCallable(func) is false, then let func be the standard built-in method Object.prototype.toString (15.2.4.2).
     610        bool customJoinCase = false;
     611        if (!function.isCell())
     612            customJoinCase = true;
     613        CallData callData;
     614        CallType callType = getCallData(vm, function, callData);
     615        if (callType == CallType::None)
     616            customJoinCase = true;
     617
     618        if (UNLIKELY(customJoinCase))
     619            RELEASE_AND_RETURN(scope, JSValue::encode(jsMakeNontrivialString(exec, "[object ", thisObject->methodTable(vm)->className(thisObject, vm), "]")));
     620
     621        // 4. Return the result of calling the [[Call]] internal method of func providing array as the this value and an empty arguments list.
     622        if (!isJSArray(thisObject) || callType != CallType::Host || callData.native.function != arrayProtoFuncJoin)
     623            RELEASE_AND_RETURN(scope, JSValue::encode(call(exec, function, callType, callData, thisObject, *vm.emptyList)));
     624    }
    608625
    609626    ASSERT(isJSArray(thisValue));
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r248846 r248906  
    418418    , m_varInjectionWatchpoint(adoptRef(new WatchpointSet(IsWatched)))
    419419    , m_weakRandom(Options::forceWeakRandomSeed() ? Options::forcedWeakRandomSeed() : static_cast<unsigned>(randomNumber() * (std::numeric_limits<unsigned>::max() + 1.0)))
    420     , m_arrayIteratorProtocolWatchpoint(IsWatched)
    421     , m_mapIteratorProtocolWatchpoint(IsWatched)
    422     , m_setIteratorProtocolWatchpoint(IsWatched)
    423     , m_stringIteratorProtocolWatchpoint(IsWatched)
    424     , m_mapSetWatchpoint(IsWatched)
    425     , m_setAddWatchpoint(IsWatched)
    426     , m_arraySpeciesWatchpoint(ClearWatchpoint)
    427     , m_numberToStringWatchpoint(IsWatched)
     420    , m_arrayIteratorProtocolWatchpointSet(IsWatched)
     421    , m_mapIteratorProtocolWatchpointSet(IsWatched)
     422    , m_setIteratorProtocolWatchpointSet(IsWatched)
     423    , m_stringIteratorProtocolWatchpointSet(IsWatched)
     424    , m_mapSetWatchpointSet(IsWatched)
     425    , m_setAddWatchpointSet(IsWatched)
     426    , m_arraySpeciesWatchpointSet(ClearWatchpoint)
     427    , m_arrayJoinWatchpointSet(IsWatched)
     428    , m_numberToStringWatchpointSet(IsWatched)
    428429    , m_runtimeFlags()
    429430    , m_stackTraceLimit(Options::defaultErrorStackTraceLimit())
     
    11461147    {
    11471148        ObjectPropertyCondition condition = setupAdaptiveWatchpoint(arrayIteratorPrototype, m_vm.propertyNames->next);
    1148         m_arrayIteratorPrototypeNext = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, condition, m_arrayIteratorProtocolWatchpoint);
     1149        m_arrayIteratorPrototypeNext = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, condition, m_arrayIteratorProtocolWatchpointSet);
    11491150        m_arrayIteratorPrototypeNext->install(vm);
    11501151    }
    11511152    {
    11521153        ObjectPropertyCondition condition = setupAdaptiveWatchpoint(this->arrayPrototype(), m_vm.propertyNames->iteratorSymbol);
    1153         m_arrayPrototypeSymbolIteratorWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, condition, m_arrayIteratorProtocolWatchpoint);
     1154        m_arrayPrototypeSymbolIteratorWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, condition, m_arrayIteratorProtocolWatchpointSet);
    11541155        m_arrayPrototypeSymbolIteratorWatchpoint->install(vm);
     1156    }
     1157    {
     1158        ObjectPropertyCondition condition = setupAdaptiveWatchpoint(this->arrayPrototype(), m_vm.propertyNames->join);
     1159        m_arrayPrototypeJoinWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, condition, m_arrayJoinWatchpointSet);
     1160        m_arrayPrototypeJoinWatchpoint->install(vm);
    11551161    }
    11561162
    11571163    {
    11581164        ObjectPropertyCondition condition = setupAdaptiveWatchpoint(mapIteratorPrototype, m_vm.propertyNames->next);
    1159         m_mapIteratorPrototypeNextWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, condition, m_mapIteratorProtocolWatchpoint);
     1165        m_mapIteratorPrototypeNextWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, condition, m_mapIteratorProtocolWatchpointSet);
    11601166        m_mapIteratorPrototypeNextWatchpoint->install(vm);
    11611167    }
    11621168    {
    11631169        ObjectPropertyCondition condition = setupAdaptiveWatchpoint(m_mapPrototype.get(), m_vm.propertyNames->iteratorSymbol);
    1164         m_mapPrototypeSymbolIteratorWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, condition, m_mapIteratorProtocolWatchpoint);
     1170        m_mapPrototypeSymbolIteratorWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, condition, m_mapIteratorProtocolWatchpointSet);
    11651171        m_mapPrototypeSymbolIteratorWatchpoint->install(vm);
    11661172    }
     
    11681174    {
    11691175        ObjectPropertyCondition condition = setupAdaptiveWatchpoint(setIteratorPrototype, m_vm.propertyNames->next);
    1170         m_setIteratorPrototypeNextWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, condition, m_setIteratorProtocolWatchpoint);
     1176        m_setIteratorPrototypeNextWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, condition, m_setIteratorProtocolWatchpointSet);
    11711177        m_setIteratorPrototypeNextWatchpoint->install(vm);
    11721178    }
    11731179    {
    11741180        ObjectPropertyCondition condition = setupAdaptiveWatchpoint(m_setPrototype.get(), m_vm.propertyNames->iteratorSymbol);
    1175         m_setPrototypeSymbolIteratorWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, condition, m_setIteratorProtocolWatchpoint);
     1181        m_setPrototypeSymbolIteratorWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, condition, m_setIteratorProtocolWatchpointSet);
    11761182        m_setPrototypeSymbolIteratorWatchpoint->install(vm);
    11771183    }
     
    11791185    {
    11801186        ObjectPropertyCondition condition = setupAdaptiveWatchpoint(m_stringIteratorPrototype.get(), m_vm.propertyNames->next);
    1181         m_stringIteratorPrototypeNextWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, condition, m_stringIteratorProtocolWatchpoint);
     1187        m_stringIteratorPrototypeNextWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, condition, m_stringIteratorProtocolWatchpointSet);
    11821188        m_stringIteratorPrototypeNextWatchpoint->install(vm);
    11831189    }
    11841190    {
    11851191        ObjectPropertyCondition condition = setupAdaptiveWatchpoint(m_stringPrototype.get(), m_vm.propertyNames->iteratorSymbol);
    1186         m_stringPrototypeSymbolIteratorWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, condition, m_stringIteratorProtocolWatchpoint);
     1192        m_stringPrototypeSymbolIteratorWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, condition, m_stringIteratorProtocolWatchpointSet);
    11871193        m_stringPrototypeSymbolIteratorWatchpoint->install(vm);
    11881194    }
     
    11901196    {
    11911197        ObjectPropertyCondition condition = setupAdaptiveWatchpoint(m_mapPrototype.get(), m_vm.propertyNames->set);
    1192         m_mapPrototypeSetWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, condition, m_mapSetWatchpoint);
     1198        m_mapPrototypeSetWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, condition, m_mapSetWatchpointSet);
    11931199        m_mapPrototypeSetWatchpoint->install(vm);
    11941200    }
     
    11961202    {
    11971203        ObjectPropertyCondition condition = setupAdaptiveWatchpoint(m_setPrototype.get(), m_vm.propertyNames->add);
    1198         m_setPrototypeAddWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, condition, m_setAddWatchpoint);
     1204        m_setPrototypeAddWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, condition, m_setAddWatchpointSet);
    11991205        m_setPrototypeAddWatchpoint->install(vm);
    12001206    }
     
    12071213
    12081214        ObjectPropertyCondition condition = setupAdaptiveWatchpoint(numberPrototype, m_vm.propertyNames->toString);
    1209         m_numberPrototypeToStringWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, condition, m_numberToStringWatchpoint);
     1215        m_numberPrototypeToStringWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, condition, m_numberToStringWatchpointSet);
    12101216        m_numberPrototypeToStringWatchpoint->install(vm);
    12111217        m_numberProtoToStringFunction.set(vm, this, jsCast<JSFunction*>(numberPrototype->getDirect(vm, vm.propertyNames->toString)));
     
    18901896
    18911897    auto invalidateWatchpoint = [&] {
    1892         m_arraySpeciesWatchpoint.invalidate(vm, StringFireDetail("Was not able to set up array species watchpoint."));
     1898        m_arraySpeciesWatchpointSet.invalidate(vm, StringFireDetail("Was not able to set up array species watchpoint."));
    18931899    };
    18941900
     
    19301936
    19311937    // We only watch this from the DFG, and the DFG makes sure to only start watching if the watchpoint is in the IsWatched state.
    1932     RELEASE_ASSERT(!m_arraySpeciesWatchpoint.isBeingWatched());
    1933     m_arraySpeciesWatchpoint.touch(vm, "Set up array species watchpoint.");
    1934 
    1935     m_arrayPrototypeConstructorWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, constructorCondition, m_arraySpeciesWatchpoint);
     1938    RELEASE_ASSERT(!m_arraySpeciesWatchpointSet.isBeingWatched());
     1939    m_arraySpeciesWatchpointSet.touch(vm, "Set up array species watchpoint.");
     1940
     1941    m_arrayPrototypeConstructorWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, constructorCondition, m_arraySpeciesWatchpointSet);
    19361942    m_arrayPrototypeConstructorWatchpoint->install(vm);
    19371943
    1938     m_arrayConstructorSpeciesWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, speciesCondition, m_arraySpeciesWatchpoint);
     1944    m_arrayConstructorSpeciesWatchpoint = makeUnique<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>>(this, speciesCondition, m_arraySpeciesWatchpointSet);
    19391945    m_arrayConstructorSpeciesWatchpoint->install(vm);
    19401946}
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r248846 r248906  
    453453    JSCallee* stackOverflowFrameCallee() const { return m_stackOverflowFrameCallee.get(); }
    454454
    455     InlineWatchpointSet& arrayIteratorProtocolWatchpoint() { return m_arrayIteratorProtocolWatchpoint; }
    456     InlineWatchpointSet& mapIteratorProtocolWatchpoint() { return m_mapIteratorProtocolWatchpoint; }
    457     InlineWatchpointSet& setIteratorProtocolWatchpoint() { return m_setIteratorProtocolWatchpoint; }
    458     InlineWatchpointSet& stringIteratorProtocolWatchpoint() { return m_stringIteratorProtocolWatchpoint; }
    459     InlineWatchpointSet& mapSetWatchpoint() { return m_mapSetWatchpoint; }
    460     InlineWatchpointSet& setAddWatchpoint() { return m_setAddWatchpoint; }
    461     InlineWatchpointSet& arraySpeciesWatchpoint() { return m_arraySpeciesWatchpoint; }
    462     InlineWatchpointSet& numberToStringWatchpoint()
     455    InlineWatchpointSet& arrayIteratorProtocolWatchpointSet() { return m_arrayIteratorProtocolWatchpointSet; }
     456    InlineWatchpointSet& mapIteratorProtocolWatchpointSet() { return m_mapIteratorProtocolWatchpointSet; }
     457    InlineWatchpointSet& setIteratorProtocolWatchpointSet() { return m_setIteratorProtocolWatchpointSet; }
     458    InlineWatchpointSet& stringIteratorProtocolWatchpointSet() { return m_stringIteratorProtocolWatchpointSet; }
     459    InlineWatchpointSet& mapSetWatchpointSet() { return m_mapSetWatchpointSet; }
     460    InlineWatchpointSet& setAddWatchpointSet() { return m_setAddWatchpointSet; }
     461    InlineWatchpointSet& arraySpeciesWatchpointSet() { return m_arraySpeciesWatchpointSet; }
     462    InlineWatchpointSet& arrayJoinWatchpointSet() { return m_arrayJoinWatchpointSet; }
     463    InlineWatchpointSet& numberToStringWatchpointSet()
    463464    {
    464465        RELEASE_ASSERT(VM::canUseJIT());
    465         return m_numberToStringWatchpoint;
     466        return m_numberToStringWatchpointSet;
    466467    }
    467468    // If this hasn't been invalidated, it means the array iterator protocol
    468469    // is not observable to user code yet.
    469     InlineWatchpointSet m_arrayIteratorProtocolWatchpoint;
    470     InlineWatchpointSet m_mapIteratorProtocolWatchpoint;
    471     InlineWatchpointSet m_setIteratorProtocolWatchpoint;
    472     InlineWatchpointSet m_stringIteratorProtocolWatchpoint;
    473     InlineWatchpointSet m_mapSetWatchpoint;
    474     InlineWatchpointSet m_setAddWatchpoint;
    475     InlineWatchpointSet m_arraySpeciesWatchpoint;
    476     InlineWatchpointSet m_numberToStringWatchpoint;
     470    InlineWatchpointSet m_arrayIteratorProtocolWatchpointSet;
     471    InlineWatchpointSet m_mapIteratorProtocolWatchpointSet;
     472    InlineWatchpointSet m_setIteratorProtocolWatchpointSet;
     473    InlineWatchpointSet m_stringIteratorProtocolWatchpointSet;
     474    InlineWatchpointSet m_mapSetWatchpointSet;
     475    InlineWatchpointSet m_setAddWatchpointSet;
     476    InlineWatchpointSet m_arraySpeciesWatchpointSet;
     477    InlineWatchpointSet m_arrayJoinWatchpointSet;
     478    InlineWatchpointSet m_numberToStringWatchpointSet;
    477479    std::unique_ptr<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>> m_arrayConstructorSpeciesWatchpoint;
    478480    std::unique_ptr<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>> m_arrayPrototypeConstructorWatchpoint;
    479481    std::unique_ptr<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>> m_arrayPrototypeSymbolIteratorWatchpoint;
     482    std::unique_ptr<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>> m_arrayPrototypeJoinWatchpoint;
    480483    std::unique_ptr<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>> m_arrayIteratorPrototypeNext;
    481484    std::unique_ptr<ObjectPropertyChangeAdaptiveWatchpoint<InlineWatchpointSet>> m_mapPrototypeSymbolIteratorWatchpoint;
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObjectInlines.h

    r237447 r248906  
    6363    // executing concurrently.
    6464
    65     return arrayIteratorProtocolWatchpoint().isStillValid() && !isHavingABadTime() && arrayPrototypeChainIsSane();
     65    return arrayIteratorProtocolWatchpointSet().isStillValid() && !isHavingABadTime() && arrayPrototypeChainIsSane();
    6666}
    6767
     
    7474ALWAYS_INLINE bool JSGlobalObject::isMapPrototypeIteratorProtocolFastAndNonObservable()
    7575{
    76     return mapIteratorProtocolWatchpoint().isStillValid();
     76    return mapIteratorProtocolWatchpointSet().isStillValid();
    7777}
    7878
    7979ALWAYS_INLINE bool JSGlobalObject::isSetPrototypeIteratorProtocolFastAndNonObservable()
    8080{
    81     return setIteratorProtocolWatchpoint().isStillValid();
     81    return setIteratorProtocolWatchpointSet().isStillValid();
    8282}
    8383
    8484ALWAYS_INLINE bool JSGlobalObject::isStringPrototypeIteratorProtocolFastAndNonObservable()
    8585{
    86     return stringIteratorProtocolWatchpoint().isStillValid();
     86    return stringIteratorProtocolWatchpointSet().isStillValid();
    8787}
    8888
    8989ALWAYS_INLINE bool JSGlobalObject::isMapPrototypeSetFastAndNonObservable()
    9090{
    91     return mapSetWatchpoint().isStillValid();
     91    return mapSetWatchpointSet().isStillValid();
    9292}
    9393
    9494ALWAYS_INLINE bool JSGlobalObject::isSetPrototypeAddFastAndNonObservable()
    9595{
    96     return setAddWatchpoint().isStillValid();
     96    return setAddWatchpointSet().isStillValid();
    9797}
    9898
Note: See TracChangeset for help on using the changeset viewer.