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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234581
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2018-08-04 Simon Fraser <simon.fraser@apple.com>
+
+ 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 <rniwa@webkit.org>
Properties set on window.customElements can disappear due to GC
// ----------------
TimerBase::TimerBase()
+ : m_heapIndex(-1)
+ , m_wasDeleted(false)
{
}
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() };