Title: [276154] trunk/Source
Revision
276154
Author
[email protected]
Date
2021-04-16 12:22:56 -0700 (Fri, 16 Apr 2021)

Log Message

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

Patch by Alex Christensen <[email protected]> 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):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (276153 => 276154)


--- trunk/Source/WTF/ChangeLog	2021-04-16 19:20:07 UTC (rev 276153)
+++ trunk/Source/WTF/ChangeLog	2021-04-16 19:22:56 UTC (rev 276154)
@@ -1,3 +1,13 @@
+2021-04-16  Alex Christensen  <[email protected]>
+
+        Reduce maximum HashTable entry size to 128 bytes
+        https://bugs.webkit.org/show_bug.cgi?id=224381
+
+        Reviewed by Yusuke Suzuki.
+
+        * wtf/HashTable.h:
+        (WTF::KeyTraits>::inlineLookup):
+
 2021-04-16  Tyler Wilcock  <[email protected]>
 
         [css-counter-styles] Parse and add feature flag for @counter-style

Modified: trunk/Source/WTF/wtf/HashTable.h (276153 => 276154)


--- trunk/Source/WTF/wtf/HashTable.h	2021-04-16 19:20:07 UTC (rev 276153)
+++ trunk/Source/WTF/wtf/HashTable.h	2021-04-16 19:22:56 UTC (rev 276154)
@@ -665,7 +665,7 @@
     template<typename HashTranslator, typename T>
     ALWAYS_INLINE auto HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::inlineLookup(const T& key) -> ValueType*
     {
-        static_assert(sizeof(Value) <= 250, "Your HashTable types are too big to efficiently move when rehashing.  Consider using UniqueRef instead");
+        static_assert(sizeof(Value) <= 128, "Your HashTable types are too big to efficiently move when rehashing.  Consider using UniqueRef instead");
         checkKey<HashTranslator>(key);
 
         unsigned k = 0;

Modified: trunk/Source/WebCore/ChangeLog (276153 => 276154)


--- trunk/Source/WebCore/ChangeLog	2021-04-16 19:20:07 UTC (rev 276153)
+++ trunk/Source/WebCore/ChangeLog	2021-04-16 19:22:56 UTC (rev 276154)
@@ -1,3 +1,15 @@
+2021-04-16  Alex Christensen  <[email protected]>
+
+        Reduce maximum HashTable entry size to 128 bytes
+        https://bugs.webkit.org/show_bug.cgi?id=224381
+
+        Reviewed by Yusuke Suzuki.
+
+        * inspector/agents/InspectorAnimationAgent.cpp:
+        (WebCore::InspectorAnimationAgent::willApplyKeyframeEffect):
+        (WebCore::InspectorAnimationAgent::stopTrackingDeclarativeAnimation):
+        * inspector/agents/InspectorAnimationAgent.h:
+
 2021-04-16  Tyler Wilcock  <[email protected]>
 
         [css-counter-styles] Parse and add feature flag for @counter-style

Modified: trunk/Source/WebCore/inspector/agents/InspectorAnimationAgent.cpp (276153 => 276154)


--- trunk/Source/WebCore/inspector/agents/InspectorAnimationAgent.cpp	2021-04-16 19:20:07 UTC (rev 276153)
+++ trunk/Source/WebCore/inspector/agents/InspectorAnimationAgent.cpp	2021-04-16 19:22:56 UTC (rev 276154)
@@ -378,10 +378,10 @@
     if (!is<DeclarativeAnimation>(animation))
         return;
 
-    auto ensureResult = m_trackedDeclarativeAnimationData.ensure(downcast<DeclarativeAnimation>(animation), [&] () -> TrackedDeclarativeAnimationData {
-        return { makeString("animation:"_s, IdentifiersFactory::createIdentifier()), computedTiming };
+    auto ensureResult = m_trackedDeclarativeAnimationData.ensure(downcast<DeclarativeAnimation>(animation), [&] () -> UniqueRef<TrackedDeclarativeAnimationData> {
+        return makeUniqueRef<TrackedDeclarativeAnimationData>(TrackedDeclarativeAnimationData { makeString("animation:"_s, IdentifiersFactory::createIdentifier()), computedTiming });
     });
-    auto& trackingData = ensureResult.iterator->value;
+    auto& trackingData = ensureResult.iterator->value.get();
 
     Optional<Protocol::Animation::AnimationState> animationAnimationState;
 
@@ -600,19 +600,17 @@
 
 void InspectorAnimationAgent::stopTrackingDeclarativeAnimation(DeclarativeAnimation& animation)
 {
-    auto it = m_trackedDeclarativeAnimationData.find(&animation);
-    if (it == m_trackedDeclarativeAnimationData.end())
+    auto data = ""
+    if (!data)
         return;
 
-    if (it->value.lastComputedTiming.phase != AnimationEffectPhase::After && it->value.lastComputedTiming.phase != AnimationEffectPhase::Idle) {
+    if (data->lastComputedTiming.phase != AnimationEffectPhase::After && data->lastComputedTiming.phase != AnimationEffectPhase::Idle) {
         auto event = Protocol::Animation::TrackingUpdate::create()
-            .setTrackingAnimationId(it->value.trackingAnimationId)
+            .setTrackingAnimationId(data->trackingAnimationId)
             .setAnimationState(Protocol::Animation::AnimationState::Canceled)
             .release();
         m_frontendDispatcher->trackingUpdate(m_environment.executionStopwatch().elapsedTime().seconds(), WTFMove(event));
     }
-
-    m_trackedDeclarativeAnimationData.remove(it);
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/inspector/agents/InspectorAnimationAgent.h (276153 => 276154)


--- trunk/Source/WebCore/inspector/agents/InspectorAnimationAgent.h	2021-04-16 19:20:07 UTC (rev 276153)
+++ trunk/Source/WebCore/inspector/agents/InspectorAnimationAgent.h	2021-04-16 19:22:56 UTC (rev 276154)
@@ -94,10 +94,11 @@
     Timer m_animationDestroyedTimer;
 
     struct TrackedDeclarativeAnimationData {
+        WTF_MAKE_STRUCT_FAST_ALLOCATED;
         String trackingAnimationId;
         ComputedEffectTiming lastComputedTiming;
     };
-    HashMap<DeclarativeAnimation*, TrackedDeclarativeAnimationData> m_trackedDeclarativeAnimationData;
+    HashMap<DeclarativeAnimation*, UniqueRef<TrackedDeclarativeAnimationData>> m_trackedDeclarativeAnimationData;
 };
 
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to