Changeset 194057 in webkit
- Timestamp:
- Dec 14, 2015 1:36:27 PM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r194050 r194057 1 2015-12-14 Andreas Kling <akling@apple.com> 2 3 ResourceUsageOverlay should show GC timers. 4 <https://webkit.org/b/152151> 5 6 Reviewed by Darin Adler. 7 8 Expose the next fire time (in WTF timestamp style) of a GCActivityCallback. 9 10 * heap/GCActivityCallback.cpp: 11 (JSC::GCActivityCallback::scheduleTimer): 12 (JSC::GCActivityCallback::cancelTimer): 13 * heap/GCActivityCallback.h: 14 1 15 2015-12-14 Filip Pizlo <fpizlo@apple.com> 2 16 -
trunk/Source/JavaScriptCore/heap/GCActivityCallback.cpp
r192773 r194057 96 96 double delta = m_delay - newDelay; 97 97 m_delay = newDelay; 98 m_nextFireTime = WTF::currentTime() + newDelay; 98 99 CFRunLoopTimerSetNextFireDate(m_timer.get(), CFRunLoopTimerGetNextFireDate(m_timer.get()) - delta); 99 100 } … … 102 103 { 103 104 m_delay = s_decade; 105 m_nextFireTime = 0; 104 106 CFRunLoopTimerSetNextFireDate(m_timer.get(), CFAbsoluteTimeGetCurrent() + s_decade); 105 107 } -
trunk/Source/JavaScriptCore/heap/GCActivityCallback.h
r192773 r194057 62 62 static bool s_shouldCreateGCTimer; 63 63 64 #if USE(CF) || PLATFORM(EFL) 65 double nextFireTime() const { return m_nextFireTime; } 66 #endif 67 64 68 protected: 65 69 virtual double lastGCLength() = 0; … … 110 114 private: 111 115 double m_delay; 116 double m_nextFireTime { 0 }; 112 117 #endif 113 118 }; -
trunk/Source/WebCore/ChangeLog
r194054 r194057 1 2015-12-14 Andreas Kling <akling@apple.com> 2 3 ResourceUsageOverlay should show GC timers. 4 <https://webkit.org/b/152151> 5 6 Reviewed by Darin Adler. 7 8 Add countdowns until next Eden and Full GC to the overlay. It also shows if there 9 is no garbage collection scheduled. This will be helpful in understanding why GC 10 sometimes takes a very long time to happen. 11 12 * page/ResourceUsageOverlay.h: 13 * page/cocoa/ResourceUsageOverlayCocoa.mm: 14 (WebCore::formatByteNumber): Drive-by silly math fix. :| 15 (WebCore::gcTimerString): 16 (WebCore::ResourceUsageOverlay::platformDraw): 17 (WebCore::nextFireTimeForGCTimer): 18 (WebCore::runSamplerThread): 19 1 20 2015-12-14 Chris Fleizach <cfleizach@apple.com> 2 21 -
trunk/Source/WebCore/page/ResourceUsageOverlay.h
r193873 r194057 60 60 61 61 static const int normalWidth = 570; 62 static const int normalHeight = 1 30;62 static const int normalHeight = 160; 63 63 64 64 private: -
trunk/Source/WebCore/page/cocoa/ResourceUsageOverlayCocoa.mm
r193873 r194057 33 33 #include "PlatformCALayer.h" 34 34 #include <CoreGraphics/CGContext.h> 35 #include <JavaScriptCore/GCActivityCallback.h> 35 36 #include <QuartzCore/CALayer.h> 36 37 #include <QuartzCore/CATransaction.h> … … 186 187 HashSet<CALayer *> overlayLayers; 187 188 JSC::VM* vm { nullptr }; 189 190 double timeOfNextEdenCollection { 0 }; 191 double timeOfNextFullCollection { 0 }; 188 192 }; 189 193 … … 422 426 { 423 427 if (number >= 1024 * 1048576) 424 return String::format("%.3f GB", static_cast<double>(number) / 1024 * 1048576);428 return String::format("%.3f GB", static_cast<double>(number) / (1024 * 1048576)); 425 429 if (number >= 1048576) 426 430 return String::format("%.2f MB", static_cast<double>(number) / 1048576); … … 428 432 return String::format("%.1f kB", static_cast<double>(number) / 1024); 429 433 return String::format("%lu", number); 434 } 435 436 static String gcTimerString(double timerFireDate, double now) 437 { 438 if (!timerFireDate) 439 return ASCIILiteral("[not scheduled]"); 440 return String::format("%g", timerFireDate - now); 430 441 } 431 442 … … 461 472 y += 10; 462 473 } 474 475 double now = WTF::currentTime(); 476 showText(context, 10, y + 10, colorForLabels, String::format(" Eden GC: %s", gcTimerString(data.timeOfNextEdenCollection, now).ascii().data())); 477 showText(context, 10, y + 20, colorForLabels, String::format(" Full GC: %s", gcTimerString(data.timeOfNextFullCollection, now).ascii().data())); 463 478 464 479 drawCpuHistory(context, viewBounds.size.width - 70, 0, viewBounds.size.height, data.cpuHistory); … … 610 625 // FIXME: Handle running with bmalloc disabled. 611 626 data.categories[MemoryCategory::bmalloc].history.last() -= currentGCHeapCapacity + currentGCOwned; 627 628 data.timeOfNextEdenCollection = data.vm->heap.edenActivityCallback()->nextFireTime(); 629 data.timeOfNextFullCollection = data.vm->heap.fullActivityCallback()->nextFireTime(); 612 630 } 613 631
Note: See TracChangeset
for help on using the changeset viewer.