Added a simpler mechanism for registering one-off finalizers
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Oct 2011 22:44:36 +0000 (22:44 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Oct 2011 22:44:36 +0000 (22:44 +0000)
commit92fc1bf968cd0d9092a27b83642d880c7d3832ab
treecad4862369900aec1e2d0f4f2c2bede314bae4a0
parentaf522b89e8295184283efd58327272cee3bf4f13
Added a simpler mechanism for registering one-off finalizers
https://bugs.webkit.org/show_bug.cgi?id=69466

Reviewed by Oliver Hunt.

* heap/Heap.cpp:
(JSC::Heap::addFinalizer):
(JSC::Heap::FinalizerOwner::finalize):
* heap/Heap.h: New function for adding an arbitrary finalizer for an
arbitrary cell without declaring any special classes or Handles yourself.

* JavaScriptCore.exp: Fix build.

* runtime/Executable.cpp:
(JSC::ExecutableBase::clearCode):
(JSC::ExecutableBase::clearCodeVirtual):
(JSC::EvalExecutable::clearCodeVirtual):
(JSC::ProgramExecutable::clearCodeVirtual):
(JSC::FunctionExecutable::discardCode):
(JSC::FunctionExecutable::clearCodeVirtual):
* runtime/Executable.h:
(JSC::ExecutableBase::finishCreation): Use the new mechanism for eager
finalization of executables.

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::clearRareData):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::createRareDataIfNeeded):
(JSC::JSGlobalObject::registerWeakMap): Use the new mechanism for eager
finalization of weak maps.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@96760 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.exp
Source/JavaScriptCore/heap/Heap.cpp
Source/JavaScriptCore/heap/Heap.h
Source/JavaScriptCore/runtime/Executable.cpp
Source/JavaScriptCore/runtime/Executable.h
Source/JavaScriptCore/runtime/JSGlobalObject.cpp
Source/JavaScriptCore/runtime/JSGlobalObject.h