Title: [234581] trunk/Source/WebCore
- Revision
- 234581
- Author
- [email protected]
- Date
- 2018-08-04 15:57:13 -0700 (Sat, 04 Aug 2018)
Log Message
Make WebCore::Timer more space-efficient
https://bugs.webkit.org/show_bug.cgi?id=187455
Reviewed by Brent Fulgham.
Steal a bit from m_heapIndex for m_wasDeleted to eliminate padding in Timer.
This reduces the size of Document, which has 8 Timers, from 3360 to 3296 bytes (saving 64 bytes).
* platform/Timer.cpp:
(WebCore::TimerBase::TimerBase):
* platform/Timer.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (234580 => 234581)
--- trunk/Source/WebCore/ChangeLog 2018-08-04 20:07:13 UTC (rev 234580)
+++ trunk/Source/WebCore/ChangeLog 2018-08-04 22:57:13 UTC (rev 234581)
@@ -1,3 +1,17 @@
+2018-08-04 Simon Fraser <[email protected]>
+
+ Make WebCore::Timer more space-efficient
+ https://bugs.webkit.org/show_bug.cgi?id=187455
+
+ Reviewed by Brent Fulgham.
+
+ Steal a bit from m_heapIndex for m_wasDeleted to eliminate padding in Timer.
+ This reduces the size of Document, which has 8 Timers, from 3360 to 3296 bytes (saving 64 bytes).
+
+ * platform/Timer.cpp:
+ (WebCore::TimerBase::TimerBase):
+ * platform/Timer.h:
+
2018-08-04 Ryosuke Niwa <[email protected]>
Properties set on window.customElements can disappear due to GC
Modified: trunk/Source/WebCore/platform/Timer.cpp (234580 => 234581)
--- trunk/Source/WebCore/platform/Timer.cpp 2018-08-04 20:07:13 UTC (rev 234580)
+++ trunk/Source/WebCore/platform/Timer.cpp 2018-08-04 22:57:13 UTC (rev 234581)
@@ -185,6 +185,8 @@
// ----------------
TimerBase::TimerBase()
+ : m_heapIndex(-1)
+ , m_wasDeleted(false)
{
}
Modified: trunk/Source/WebCore/platform/Timer.h (234580 => 234581)
--- trunk/Source/WebCore/platform/Timer.h 2018-08-04 20:07:13 UTC (rev 234580)
+++ trunk/Source/WebCore/platform/Timer.h 2018-08-04 22:57:13 UTC (rev 234581)
@@ -98,9 +98,9 @@
MonotonicTime m_nextFireTime; // 0 if inactive
MonotonicTime m_unalignedNextFireTime; // m_nextFireTime not considering alignment interval
Seconds m_repeatInterval; // 0 if not repeating
- int m_heapIndex { -1 }; // -1 if not in heap
+ signed int m_heapIndex : 31; // -1 if not in heap
+ bool m_wasDeleted : 1;
unsigned m_heapInsertionOrder; // Used to keep order among equal-fire-time timers
- bool m_wasDeleted { false };
Vector<TimerBase*>* m_cachedThreadGlobalTimerHeap { nullptr };
Ref<Thread> m_thread { Thread::current() };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes