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/JavaScriptCore.gypi

    r64106 r64585  
    215215            'runtime/FunctionPrototype.cpp',
    216216            'runtime/FunctionPrototype.h',
     217            'runtime/GCActivityCallback.cpp',
     218            'runtime/GCActivityCallback.h',
    217219            'runtime/GetterSetter.cpp',
    218220            'runtime/GetterSetter.h',
Note: See TracChangeset for help on using the changeset viewer.