Ignore:
Timestamp:
Aug 3, 2010, 1:34:17 PM (15 years ago)
Author:
[email protected]
Message:

https://bugs.webkit.org/show_bug.cgi?id=41318
GC should reclaim garbage even when new objects are not being allocated rapidly

Patch by Nathan Lawrence <[email protected]> on 2010-08-03
Reviewed by Oliver Hunt.

Added a callback in JavaScriptCore that gets triggered after an
allocation causes the heap to reset. This is useful for adding a
timer that will trigger garbage collection after the "last" allocation.

Also needed was to add lock and unlock methods to JSLock that needed
only a JSGlobalData object versus an ExecState object.

(JSC::JIT::emit_op_put_by_val):

  • runtime/Collector.cpp:

(JSC::Heap::Heap):
(JSC::Heap::reset):
(JSC::Heap::setActivityCallback):

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

(JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
(JSC::DefaultGCActivityCallback::~DefaultGCActivityCallback):
(JSC::DefaultGCActivityCallback::operator()):

  • runtime/GCActivityCallback.h: Added.

(JSC::GCActivityCallback::~GCActivityCallback):
(JSC::GCActivityCallback::operator()):
(JSC::GCActivityCallback::GCActivityCallback):
(JSC::DefaultGCActivityCallback::create):

  • runtime/GCActivityCallbackCF.cpp: Added.

(JSC::DefaultGCActivityCallbackPlatformData::trigger):
(JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
(JSC::DefaultGCActivityCallback::~DefaultGCActivityCallback):
(JSC::DefaultGCActivityCallback::operator()):

  • runtime/JSLock.cpp:

(JSC::JSLock::JSLock):

  • runtime/JSLock.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSLock.cpp

    r58133 r64585  
    6262JSLock::JSLock(ExecState* exec)
    6363    : m_lockBehavior(exec->globalData().isSharedInstance() ? LockForReal : SilenceAssertionsOnly)
     64{
     65    lock(m_lockBehavior);
     66}
     67
     68JSLock::JSLock(JSGlobalData* globalData)
     69    : m_lockBehavior(globalData->isSharedInstance() ? LockForReal : SilenceAssertionsOnly)
    6470{
    6571    lock(m_lockBehavior);
Note: See TracChangeset for help on using the changeset viewer.