diff options
Diffstat (limited to 'Source/JavaScriptCore/heap/Heap.h')
-rw-r--r-- | Source/JavaScriptCore/heap/Heap.h | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/Source/JavaScriptCore/heap/Heap.h b/Source/JavaScriptCore/heap/Heap.h index 296447d7b..91c3aa58f 100644 --- a/Source/JavaScriptCore/heap/Heap.h +++ b/Source/JavaScriptCore/heap/Heap.h @@ -42,7 +42,7 @@ namespace JSC { class CopiedSpace; class CodeBlock; - class FunctionExecutable; + class ExecutableBase; class GCActivityCallback; class GlobalCodeBlock; class Heap; @@ -85,6 +85,7 @@ namespace JSC { static bool testAndSetMarked(const void*); static void setMarked(const void*); + static bool isWriteBarrierEnabled(); static void writeBarrier(const JSCell*, JSValue); static void writeBarrier(const JSCell*, JSCell*); static uint8_t* addressOfCardFor(JSCell*); @@ -115,10 +116,10 @@ namespace JSC { typedef void (*Finalizer)(JSCell*); JS_EXPORT_PRIVATE void addFinalizer(JSCell*, Finalizer); - void addFunctionExecutable(FunctionExecutable*); - void removeFunctionExecutable(FunctionExecutable*); + void addCompiledCode(ExecutableBase*); void notifyIsSafeToCollect() { m_isSafeToCollect = true; } + bool isSafeToCollect() const { return m_isSafeToCollect; } JS_EXPORT_PRIVATE void collectAllGarbage(); enum SweepToggle { DoNotSweep, DoSweep }; @@ -158,7 +159,7 @@ namespace JSC { double lastGCLength() { return m_lastGCLength; } void increaseLastGCLength(double amount) { m_lastGCLength += amount; } - JS_EXPORT_PRIVATE void discardAllCompiledCode(); + JS_EXPORT_PRIVATE void deleteAllCompiledCode(); void didAllocate(size_t); void didAbandon(size_t); @@ -193,6 +194,7 @@ namespace JSC { void markTempSortVectors(HeapRootVisitor&); void harvestWeakReferences(); void finalizeUnconditionalFinalizers(); + void deleteUnmarkedCompiledCode(); RegisterFile& registerFile(); BlockAllocator& blockAllocator(); @@ -219,9 +221,6 @@ namespace JSC { Vector<Vector<ValueStringPair>* > m_tempSortingVectors; OwnPtr<HashSet<MarkedArgumentBuffer*> > m_markListSet; - OwnPtr<GCActivityCallback> m_activityCallback; - OwnPtr<IncrementalSweeper> m_sweeper; - MachineThreads m_machineThreads; MarkStackThreadSharedData m_sharedData; @@ -238,7 +237,10 @@ namespace JSC { double m_lastGCLength; double m_lastCodeDiscardTime; - DoublyLinkedList<FunctionExecutable> m_functions; + OwnPtr<GCActivityCallback> m_activityCallback; + OwnPtr<IncrementalSweeper> m_sweeper; + + DoublyLinkedList<ExecutableBase> m_compiledCode; }; inline bool Heap::shouldCollect() @@ -282,6 +284,15 @@ namespace JSC { MarkedBlock::blockFor(cell)->setMarked(cell); } + inline bool Heap::isWriteBarrierEnabled() + { +#if ENABLE(GGC) || ENABLE(WRITE_BARRIER_PROFILING) + return true; +#else + return false; +#endif + } + #if ENABLE(GGC) inline uint8_t* Heap::addressOfCardFor(JSCell* cell) { |