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

Changeset 276154 in webkit


Ignore:
Timestamp:
Apr 16, 2021, 12:22:56 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Reduce maximum HashTable entry size to 128 bytes
https://bugs.webkit.org/show_bug.cgi?id=224381

Patch by Alex Christensen <achristensen@webkit.org> on 2021-04-16
Reviewed by Yusuke Suzuki.

Source/WebCore:

  • inspector/agents/InspectorAnimationAgent.cpp:

(WebCore::InspectorAnimationAgent::willApplyKeyframeEffect):
(WebCore::InspectorAnimationAgent::stopTrackingDeclarativeAnimation):

  • inspector/agents/InspectorAnimationAgent.h:

Source/WTF:

  • wtf/HashTable.h:

(WTF::KeyTraits>::inlineLookup):

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r276152 r276154  
     12021-04-16  Alex Christensen  <achristensen@webkit.org>
     2
     3        Reduce maximum HashTable entry size to 128 bytes
     4        https://bugs.webkit.org/show_bug.cgi?id=224381
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        * wtf/HashTable.h:
     9        (WTF::KeyTraits>::inlineLookup):
     10
    1112021-04-16  Tyler Wilcock  <twilco.o@protonmail.com>
    212
  • trunk/Source/WTF/wtf/HashTable.h

    r275954 r276154  
    666666    ALWAYS_INLINE auto HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::inlineLookup(const T& key) -> ValueType*
    667667    {
    668         static_assert(sizeof(Value) <= 250, "Your HashTable types are too big to efficiently move when rehashing.  Consider using UniqueRef instead");
     668        static_assert(sizeof(Value) <= 128, "Your HashTable types are too big to efficiently move when rehashing.  Consider using UniqueRef instead");
    669669        checkKey<HashTranslator>(key);
    670670
  • trunk/Source/WebCore/ChangeLog

    r276152 r276154  
     12021-04-16  Alex Christensen  <achristensen@webkit.org>
     2
     3        Reduce maximum HashTable entry size to 128 bytes
     4        https://bugs.webkit.org/show_bug.cgi?id=224381
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        * inspector/agents/InspectorAnimationAgent.cpp:
     9        (WebCore::InspectorAnimationAgent::willApplyKeyframeEffect):
     10        (WebCore::InspectorAnimationAgent::stopTrackingDeclarativeAnimation):
     11        * inspector/agents/InspectorAnimationAgent.h:
     12
    1132021-04-16  Tyler Wilcock  <twilco.o@protonmail.com>
    214
  • trunk/Source/WebCore/inspector/agents/InspectorAnimationAgent.cpp

    r268700 r276154  
    379379        return;
    380380
    381     auto ensureResult = m_trackedDeclarativeAnimationData.ensure(downcast<DeclarativeAnimation>(animation), [&] () -> TrackedDeclarativeAnimationData {
    382         return { makeString("animation:"_s, IdentifiersFactory::createIdentifier()), computedTiming };
     381    auto ensureResult = m_trackedDeclarativeAnimationData.ensure(downcast<DeclarativeAnimation>(animation), [&] () -> UniqueRef<TrackedDeclarativeAnimationData> {
     382        return makeUniqueRef<TrackedDeclarativeAnimationData>(TrackedDeclarativeAnimationData { makeString("animation:"_s, IdentifiersFactory::createIdentifier()), computedTiming });
    383383    });
    384     auto& trackingData = ensureResult.iterator->value;
     384    auto& trackingData = ensureResult.iterator->value.get();
    385385
    386386    Optional<Protocol::Animation::AnimationState> animationAnimationState;
     
    601601void InspectorAnimationAgent::stopTrackingDeclarativeAnimation(DeclarativeAnimation& animation)
    602602{
    603     auto it = m_trackedDeclarativeAnimationData.find(&animation);
    604     if (it == m_trackedDeclarativeAnimationData.end())
    605         return;
    606 
    607     if (it->value.lastComputedTiming.phase != AnimationEffectPhase::After && it->value.lastComputedTiming.phase != AnimationEffectPhase::Idle) {
     603    auto data = m_trackedDeclarativeAnimationData.take(&animation);
     604    if (!data)
     605        return;
     606
     607    if (data->lastComputedTiming.phase != AnimationEffectPhase::After && data->lastComputedTiming.phase != AnimationEffectPhase::Idle) {
    608608        auto event = Protocol::Animation::TrackingUpdate::create()
    609             .setTrackingAnimationId(it->value.trackingAnimationId)
     609            .setTrackingAnimationId(data->trackingAnimationId)
    610610            .setAnimationState(Protocol::Animation::AnimationState::Canceled)
    611611            .release();
    612612        m_frontendDispatcher->trackingUpdate(m_environment.executionStopwatch().elapsedTime().seconds(), WTFMove(event));
    613613    }
    614 
    615     m_trackedDeclarativeAnimationData.remove(it);
    616614}
    617615
  • trunk/Source/WebCore/inspector/agents/InspectorAnimationAgent.h

    r266885 r276154  
    9595
    9696    struct TrackedDeclarativeAnimationData {
     97        WTF_MAKE_STRUCT_FAST_ALLOCATED;
    9798        String trackingAnimationId;
    9899        ComputedEffectTiming lastComputedTiming;
    99100    };
    100     HashMap<DeclarativeAnimation*, TrackedDeclarativeAnimationData> m_trackedDeclarativeAnimationData;
     101    HashMap<DeclarativeAnimation*, UniqueRef<TrackedDeclarativeAnimationData>> m_trackedDeclarativeAnimationData;
    101102};
    102103
Note: See TracChangeset for help on using the changeset viewer.