Ignore:
Timestamp:
Oct 16, 2013, 4:36:25 PM (12 years ago)
Author:
[email protected]
Message:

Add SPI to disable the garbage collector timer
https://bugs.webkit.org/show_bug.cgi?id=122921

Reviewed by Geoffrey Garen.

Based on a patch by Mark Hahnenberg.

  • API/JSBase.cpp:

(JSDisableGCTimer): Added; SPI function.

  • API/JSBasePrivate.h:
  • heap/BlockAllocator.cpp:

(JSC::createBlockFreeingThread): Added.
(JSC::BlockAllocator::BlockAllocator): Modified to use JSC::createBlockFreeingThread()
to conditionally create the "block freeing" thread depending on the value of
GCActivityCallback::s_shouldCreateGCTimer.
(JSC::BlockAllocator::~BlockAllocator):

  • heap/BlockAllocator.h:

(JSC::BlockAllocator::deallocate):

  • heap/Heap.cpp:

(JSC::Heap::didAbandon):
(JSC::Heap::collect):
(JSC::Heap::didAllocate):

  • heap/HeapTimer.cpp:

(JSC::HeapTimer::timerDidFire):

  • runtime/GCActivityCallback.cpp:
  • runtime/GCActivityCallback.h:

(JSC::DefaultGCActivityCallback::create): Only instantiate a DefaultGCActivityCallback object
when GCActivityCallback::s_shouldCreateGCTimer is true so as to prevent allocating a HeapTimer
object (since DefaultGCActivityCallback ultimately extends HeapTimer).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/HeapTimer.cpp

    r156780 r157537  
    8686
    8787    HeapTimer* heapTimer = 0;
    88     if (vm->heap.activityCallback()->m_timer.get() == timer)
     88    if (vm->heap.activityCallback() && vm->heap.activityCallback()->m_timer.get() == timer)
    8989        heapTimer = vm->heap.activityCallback();
    9090    else if (vm->heap.sweeper()->m_timer.get() == timer)
Note: See TracChangeset for help on using the changeset viewer.