diff options
| author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2013-03-14 14:10:22 +0100 |
|---|---|---|
| committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-18 17:25:46 +0100 |
| commit | 597984021ca00fd98a0dfe2effd742c6e7bd4190 (patch) | |
| tree | b18e79f91719f072f339b7b5b068b9004aa7d3d7 /Source/JavaScriptCore/heap/IncrementalSweeper.cpp | |
| parent | 3774b52275c59d74571b0e1f87950dcfc257d408 (diff) | |
[Qt] Implement IncrementalSweeper and HeapTimer
https://bugs.webkit.org/show_bug.cgi?id=103996
Reviewed by Simon Hausmann.
Implements the incremental sweeping garbage collection for the Qt platform.
* heap/HeapTimer.cpp:
(JSC::HeapTimer::HeapTimer):
(JSC::HeapTimer::~HeapTimer):
(JSC::HeapTimer::timerEvent):
(JSC::HeapTimer::synchronize):
(JSC::HeapTimer::invalidate):
(JSC::HeapTimer::didStartVMShutdown):
* heap/HeapTimer.h:
(HeapTimer):
* heap/IncrementalSweeper.cpp:
(JSC::IncrementalSweeper::IncrementalSweeper):
(JSC::IncrementalSweeper::scheduleTimer):
* heap/IncrementalSweeper.h:
(IncrementalSweeper):
Change-Id: I47b874c050e08519cf5e3ed5a98a98ac8785971f
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141089 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'Source/JavaScriptCore/heap/IncrementalSweeper.cpp')
| -rw-r--r-- | Source/JavaScriptCore/heap/IncrementalSweeper.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/JavaScriptCore/heap/IncrementalSweeper.cpp b/Source/JavaScriptCore/heap/IncrementalSweeper.cpp index 4aec4dd51..41bc7f5e4 100644 --- a/Source/JavaScriptCore/heap/IncrementalSweeper.cpp +++ b/Source/JavaScriptCore/heap/IncrementalSweeper.cpp @@ -37,7 +37,7 @@ namespace JSC { -#if USE(CF) || PLATFORM(BLACKBERRY) +#if USE(CF) || PLATFORM(BLACKBERRY) || PLATFORM(QT) static const double sweepTimeSlice = .01; // seconds static const double sweepTimeTotal = .10; @@ -67,11 +67,12 @@ void IncrementalSweeper::cancelTimer() CFRunLoopTimerSetNextFireDate(m_timer.get(), CFAbsoluteTimeGetCurrent() + s_decade); } -#elif PLATFORM(BLACKBERRY) +#elif PLATFORM(BLACKBERRY) || PLATFORM(QT) IncrementalSweeper::IncrementalSweeper(Heap* heap) : HeapTimer(heap->globalData()) , m_currentBlockToSweepIndex(0) + , m_blocksToSweep(heap->m_blockSnapshot) { } @@ -82,7 +83,11 @@ IncrementalSweeper* IncrementalSweeper::create(Heap* heap) void IncrementalSweeper::scheduleTimer() { +#if PLATFORM(QT) + m_timer.start(sweepTimeSlice * sweepTimeMultiplier * 1000, this); +#else m_timer.start(sweepTimeSlice * sweepTimeMultiplier); +#endif } void IncrementalSweeper::cancelTimer() |
