Code block jettisoning should be part of the GC's transitive closure
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Nov 2011 03:58:48 +0000 (03:58 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Nov 2011 03:58:48 +0000 (03:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=72467

Reviewed by Geoff Garen.

Replaced JettisonedCodeBlocks with DFGCodeBlocks. The latter knows about all
DFG code blocks (i.e. those that may be jettisoned, and may have inlined weak
references) and helps track what state each of those code blocks is in during
GC. The state consists of two flags; mayBeExecuting, which tells if the code block
is live from call frames; and isJettisoned, which tells if the code block is
not owned by any executable and thus should be deleted as soon as it is not
mayBeExecuting.

- Not executing, Not jettisoned: The code block may or may not be reachable from
  any executables, but it is owned by an executable, and hence should be
  kept alive if its executable is live and if all of its weak references are
  live. Otherwise it should be deleted during the current GC cycle, and its
  outgoing references should not be scanned.

- Not executing but jettisoned: The code block should be deleted as soon as
  possible and none of its outgoing references should be scanned.

- Executing but not jettisoned: The code block should be kept alive during this
  GC cycle, and all of its outgoing references (including the weak ones)
  should be scanned and marked strongly. The mayBeExecuting bit will be cleared at
  the end of the GC cycle.

- Executing and jettisoned: The code block should be kept alive during this
  GC cycle, and all of its outgoing references (including the weak ones)
  should be scanned and marked strongly. However, on the next GC cycle, it
  will have its mayBeExecuting bit cleared and hence it will become a candidate
  for immediate deletion provided it is not executing again.

This is performance-neutral.

* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Target.pri:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::~CodeBlock):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::setJITCode):
(JSC::CodeBlock::DFGData::DFGData):
(JSC::DFGCodeBlocks::mark):
* heap/ConservativeRoots.cpp:
(JSC::ConservativeRoots::add):
* heap/ConservativeRoots.h:
* heap/DFGCodeBlocks.cpp: Added.
(JSC::DFGCodeBlocks::DFGCodeBlocks):
(JSC::DFGCodeBlocks::~DFGCodeBlocks):
(JSC::DFGCodeBlocks::jettison):
(JSC::DFGCodeBlocks::clearMarks):
(JSC::DFGCodeBlocks::deleteUnmarkedJettisonedCodeBlocks):
(JSC::DFGCodeBlocks::traceMarkedCodeBlocks):
* heap/DFGCodeBlocks.h: Added.
* heap/Heap.cpp:
(JSC::Heap::jettisonDFGCodeBlock):
(JSC::Heap::markRoots):
(JSC::Heap::collect):
* heap/Heap.h:
* heap/JettisonedCodeBlocks.cpp: Removed.
* heap/JettisonedCodeBlocks.h: Removed.
* interpreter/RegisterFile.cpp:
(JSC::RegisterFile::gatherConservativeRoots):
* interpreter/RegisterFile.h:
* runtime/Executable.cpp:
(JSC::jettisonCodeBlock):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@100556 268f45cc-cd09-0410-ab3c-d52691b4dbfc

19 files changed:
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/GNUmakefile.list.am
Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/Target.pri
Source/JavaScriptCore/bytecode/CodeBlock.cpp
Source/JavaScriptCore/bytecode/CodeBlock.h
Source/JavaScriptCore/heap/ConservativeRoots.cpp
Source/JavaScriptCore/heap/ConservativeRoots.h
Source/JavaScriptCore/heap/DFGCodeBlocks.cpp [new file with mode: 0644]
Source/JavaScriptCore/heap/DFGCodeBlocks.h [new file with mode: 0644]
Source/JavaScriptCore/heap/Heap.cpp
Source/JavaScriptCore/heap/Heap.h
Source/JavaScriptCore/heap/JettisonedCodeBlocks.cpp [deleted file]
Source/JavaScriptCore/heap/JettisonedCodeBlocks.h [deleted file]
Source/JavaScriptCore/interpreter/RegisterFile.cpp
Source/JavaScriptCore/interpreter/RegisterFile.h
Source/JavaScriptCore/runtime/Executable.cpp

index 2bd7acd..0106a64 100644 (file)
@@ -67,10 +67,10 @@ SET(JavaScriptCore_SOURCES
     dfg/DFGThunks.cpp
 
     heap/AllocationSpace.cpp
+    heap/DFGCodeBlocks.cpp
     heap/Heap.cpp
     heap/HandleHeap.cpp
     heap/HandleStack.cpp
-    heap/JettisonedCodeBlocks.cpp
     heap/MachineStackMarker.cpp
     heap/MarkedBlock.cpp
     heap/MarkedSpace.cpp
index 61a7f2f..1455471 100644 (file)
@@ -1,3 +1,75 @@
+2011-11-15  Filip Pizlo  <fpizlo@apple.com>
+
+        Code block jettisoning should be part of the GC's transitive closure
+        https://bugs.webkit.org/show_bug.cgi?id=72467
+
+        Reviewed by Geoff Garen.
+        
+        Replaced JettisonedCodeBlocks with DFGCodeBlocks. The latter knows about all
+        DFG code blocks (i.e. those that may be jettisoned, and may have inlined weak
+        references) and helps track what state each of those code blocks is in during
+        GC. The state consists of two flags; mayBeExecuting, which tells if the code block
+        is live from call frames; and isJettisoned, which tells if the code block is
+        not owned by any executable and thus should be deleted as soon as it is not
+        mayBeExecuting.
+        
+        - Not executing, Not jettisoned: The code block may or may not be reachable from
+          any executables, but it is owned by an executable, and hence should be
+          kept alive if its executable is live and if all of its weak references are
+          live. Otherwise it should be deleted during the current GC cycle, and its
+          outgoing references should not be scanned.
+          
+        - Not executing but jettisoned: The code block should be deleted as soon as
+          possible and none of its outgoing references should be scanned.
+          
+        - Executing but not jettisoned: The code block should be kept alive during this
+          GC cycle, and all of its outgoing references (including the weak ones)
+          should be scanned and marked strongly. The mayBeExecuting bit will be cleared at
+          the end of the GC cycle.
+          
+        - Executing and jettisoned: The code block should be kept alive during this
+          GC cycle, and all of its outgoing references (including the weak ones)
+          should be scanned and marked strongly. However, on the next GC cycle, it
+          will have its mayBeExecuting bit cleared and hence it will become a candidate
+          for immediate deletion provided it is not executing again.
+
+        This is performance-neutral.
+
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * Target.pri:
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::~CodeBlock):
+        * bytecode/CodeBlock.h:
+        (JSC::CodeBlock::setJITCode):
+        (JSC::CodeBlock::DFGData::DFGData):
+        (JSC::DFGCodeBlocks::mark):
+        * heap/ConservativeRoots.cpp:
+        (JSC::ConservativeRoots::add):
+        * heap/ConservativeRoots.h:
+        * heap/DFGCodeBlocks.cpp: Added.
+        (JSC::DFGCodeBlocks::DFGCodeBlocks):
+        (JSC::DFGCodeBlocks::~DFGCodeBlocks):
+        (JSC::DFGCodeBlocks::jettison):
+        (JSC::DFGCodeBlocks::clearMarks):
+        (JSC::DFGCodeBlocks::deleteUnmarkedJettisonedCodeBlocks):
+        (JSC::DFGCodeBlocks::traceMarkedCodeBlocks):
+        * heap/DFGCodeBlocks.h: Added.
+        * heap/Heap.cpp:
+        (JSC::Heap::jettisonDFGCodeBlock):
+        (JSC::Heap::markRoots):
+        (JSC::Heap::collect):
+        * heap/Heap.h:
+        * heap/JettisonedCodeBlocks.cpp: Removed.
+        * heap/JettisonedCodeBlocks.h: Removed.
+        * interpreter/RegisterFile.cpp:
+        (JSC::RegisterFile::gatherConservativeRoots):
+        * interpreter/RegisterFile.h:
+        * runtime/Executable.cpp:
+        (JSC::jettisonCodeBlock):
+
 2011-11-16  Filip Pizlo  <fpizlo@apple.com>
 
         Unreviewed, build fix for 32-bit.
index a936862..7d5fdd5 100644 (file)
@@ -163,11 +163,11 @@ javascriptcore_sources += \
        Source/JavaScriptCore/heap/CardSet.h \
        Source/JavaScriptCore/heap/ConservativeRoots.cpp \
        Source/JavaScriptCore/heap/ConservativeRoots.h \
+       Source/JavaScriptCore/heap/DFGCodeBlocks.cpp \
+       Source/JavaScriptCore/heap/DFGCodeBlocks.h \
        Source/JavaScriptCore/heap/Handle.h \
        Source/JavaScriptCore/heap/HandleHeap.cpp \
        Source/JavaScriptCore/heap/HandleHeap.h \
-       Source/JavaScriptCore/heap/JettisonedCodeBlocks.cpp \
-       Source/JavaScriptCore/heap/JettisonedCodeBlocks.h \
        Source/JavaScriptCore/heap/SlotVisitor.h \
        Source/JavaScriptCore/heap/HandleStack.cpp \
        Source/JavaScriptCore/heap/HandleStack.h \
index 124fbf3..a793dd7 100644 (file)
                                     >
                             </File>
                             <File
-                                    RelativePath="..\..\heap\JettisonedCodeBlocks.cpp"
+                                    RelativePath="..\..\heap\DFGCodeBlocks.cpp"
                                     >
                             </File>
                             <File
-                                    RelativePath="..\..\heap\JettisonedCodeBlocks.h"
+                                    RelativePath="..\..\heap\DFGCodeBlocks.h"
                                     >
                             </File>
                             <File
index 918f89f..b27e713 100644 (file)
@@ -50,6 +50,8 @@
                0BF28A2911A33DC300638F84 /* SizeLimits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0BF28A2811A33DC300638F84 /* SizeLimits.cpp */; };
                0F16D726142C39C000CF784A /* BitVector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F16D724142C39A200CF784A /* BitVector.cpp */; };
                0F242DA713F3B1E8007ADD4C /* WeakReferenceHarvester.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F242DA513F3B1BB007ADD4C /* WeakReferenceHarvester.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               0F2C556F14738F3100121E4F /* DFGCodeBlocks.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2C556E14738F2E00121E4F /* DFGCodeBlocks.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               0F2C557014738F3500121E4F /* DFGCodeBlocks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F2C556D14738F2E00121E4F /* DFGCodeBlocks.cpp */; };
                0F2E5BF7146357D5003EB2EB /* Spectrum.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2E5BF5146357D2003EB2EB /* Spectrum.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0F426A481460CBB300131F8F /* ValueRecovery.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F426A451460CBAB00131F8F /* ValueRecovery.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0F426A491460CBB700131F8F /* VirtualRegister.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F426A461460CBAB00131F8F /* VirtualRegister.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0FD82E86141F3FF100179C94 /* PredictedType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD82E84141F3FDA00179C94 /* PredictedType.cpp */; };
                0FD82E9014207A5F00179C94 /* ValueProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD82E8E14207A5100179C94 /* ValueProfile.cpp */; };
                0FD82EF51423075B00179C94 /* DFGIntrinsic.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD82EF31423073900179C94 /* DFGIntrinsic.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               0FD82F2B1426CA6D00179C94 /* JettisonedCodeBlocks.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD82F291426CA5A00179C94 /* JettisonedCodeBlocks.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               0FD82F2C1426CA7400179C94 /* JettisonedCodeBlocks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD82F281426CA5A00179C94 /* JettisonedCodeBlocks.cpp */; };
                0FD82F4B142806A100179C94 /* BitVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD82F491428069200179C94 /* BitVector.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0FE228ED1436AB2700196C48 /* Heuristics.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE228EB1436AB2300196C48 /* Heuristics.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0FE228EE1436AB2C00196C48 /* Heuristics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE228EA1436AB2300196C48 /* Heuristics.cpp */; };
                0BF28A2811A33DC300638F84 /* SizeLimits.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SizeLimits.cpp; sourceTree = "<group>"; };
                0F16D724142C39A200CF784A /* BitVector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BitVector.cpp; sourceTree = "<group>"; };
                0F242DA513F3B1BB007ADD4C /* WeakReferenceHarvester.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakReferenceHarvester.h; sourceTree = "<group>"; };
+               0F2C556D14738F2E00121E4F /* DFGCodeBlocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DFGCodeBlocks.cpp; sourceTree = "<group>"; };
+               0F2C556E14738F2E00121E4F /* DFGCodeBlocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DFGCodeBlocks.h; sourceTree = "<group>"; };
                0F2E5BF5146357D2003EB2EB /* Spectrum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Spectrum.h; sourceTree = "<group>"; };
                0F426A451460CBAB00131F8F /* ValueRecovery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ValueRecovery.h; sourceTree = "<group>"; };
                0F426A461460CBAB00131F8F /* VirtualRegister.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VirtualRegister.h; sourceTree = "<group>"; };
                0FD82E84141F3FDA00179C94 /* PredictedType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PredictedType.cpp; sourceTree = "<group>"; };
                0FD82E8E14207A5100179C94 /* ValueProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ValueProfile.cpp; sourceTree = "<group>"; };
                0FD82EF31423073900179C94 /* DFGIntrinsic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGIntrinsic.h; path = dfg/DFGIntrinsic.h; sourceTree = "<group>"; };
-               0FD82F281426CA5A00179C94 /* JettisonedCodeBlocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JettisonedCodeBlocks.cpp; sourceTree = "<group>"; };
-               0FD82F291426CA5A00179C94 /* JettisonedCodeBlocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JettisonedCodeBlocks.h; sourceTree = "<group>"; };
                0FD82F491428069200179C94 /* BitVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitVector.h; sourceTree = "<group>"; };
                0FE228EA1436AB2300196C48 /* Heuristics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Heuristics.cpp; sourceTree = "<group>"; };
                0FE228EB1436AB2300196C48 /* Heuristics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Heuristics.h; sourceTree = "<group>"; };
                142E312A134FF0A600AFADB5 /* heap */ = {
                        isa = PBXGroup;
                        children = (
+                               0F2C556D14738F2E00121E4F /* DFGCodeBlocks.cpp */,
+                               0F2C556E14738F2E00121E4F /* DFGCodeBlocks.h */,
                                0F5F08CE146C762F000472A9 /* UnconditionalFinalizer.h */,
                                0F431736146BAC65007E3890 /* ListableHandler.h */,
-                               0FD82F281426CA5A00179C94 /* JettisonedCodeBlocks.cpp */,
-                               0FD82F291426CA5A00179C94 /* JettisonedCodeBlocks.h */,
                                A70456AE1427FB030037DA68 /* AllocationSpace.cpp */,
                                A70456AF1427FB150037DA68 /* AllocationSpace.h */,
                                A7521E121429169A003C8D0C /* CardSet.h */,
                                86ADD1450FDDEA980006EEC2 /* ARMv7Assembler.h in Headers */,
                                145722861437E140005FDE26 /* StrongInlines.h in Headers */,
                                0FD82F4B142806A100179C94 /* BitVector.h in Headers */,
-                               0FD82F2B1426CA6D00179C94 /* JettisonedCodeBlocks.h in Headers */,
                                0FD82EF51423075B00179C94 /* DFGIntrinsic.h in Headers */,
                                0FD82E85141F3FE300179C94 /* BoundsCheckedPointer.h in Headers */,
                                0FD82E57141DAF1000179C94 /* DFGOSREntry.h in Headers */,
                                0F431738146BAC69007E3890 /* ListableHandler.h in Headers */,
                                0F5F08CF146C7633000472A9 /* UnconditionalFinalizer.h in Headers */,
                                978801411471AD920041B016 /* JSDateMath.h in Headers */,
+                               0F2C556F14738F3100121E4F /* DFGCodeBlocks.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                        buildActionMask = 2147483647;
                        files = (
                                0F16D726142C39C000CF784A /* BitVector.cpp in Sources */,
-                               0FD82F2C1426CA7400179C94 /* JettisonedCodeBlocks.cpp in Sources */,
                                0FD82E9014207A5F00179C94 /* ValueProfile.cpp in Sources */,
                                0FD82E86141F3FF100179C94 /* PredictedType.cpp in Sources */,
                                0FD82E56141DAF0800179C94 /* DFGOSREntry.cpp in Sources */,
                                0FC0979E146B272100CF2442 /* DFGCorrectableJumpPoint.cpp in Sources */,
                                0FC097A1146B28CA00CF2442 /* DFGThunks.cpp in Sources */,
                                978801401471AD920041B016 /* JSDateMath.cpp in Sources */,
+                               0F2C557014738F3500121E4F /* DFGCodeBlocks.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 400039e..5534946 100644 (file)
@@ -66,10 +66,10 @@ SOURCES += \
     bytecompiler/NodesCodegen.cpp \
     heap/AllocationSpace.cpp \
     heap/ConservativeRoots.cpp \
+    heap/DFGCodeBlocks.cpp \
     heap/HandleHeap.cpp \
     heap/HandleStack.cpp \
     heap/Heap.cpp \
-    heap/JettisonedCodeBlocks.cpp \
     heap/MachineStackMarker.cpp \
     heap/MarkStack.cpp \
     heap/MarkedBlock.cpp \
index 73ab389..49d0610 100644 (file)
@@ -1496,6 +1496,12 @@ CodeBlock::CodeBlock(ScriptExecutable* ownerExecutable, CodeType codeType, JSGlo
 
 CodeBlock::~CodeBlock()
 {
+#if ENABLE(DFG_JIT)
+    // Remove myself from the set of DFG code blocks. Note that I may not be in this set
+    // (because I'm not a DFG code block), in which case this is a no-op anyway.
+    m_globalData->heap.m_dfgCodeBlocks.m_set.remove(this);
+#endif
+    
 #if ENABLE(VERBOSE_VALUE_PROFILE)
     dumpValueProfiles();
 #endif
index 029c2b0..6c0fc64 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "CodeOrigin.h"
 #include "CompactJITCodeMap.h"
+#include "DFGCodeBlocks.h"
 #include "DFGOSREntry.h"
 #include "DFGOSRExit.h"
 #include "EvalCodeCache.h"
@@ -71,6 +72,7 @@ namespace JSC {
     };
 
     class ExecState;
+    class DFGCodeBlocks;
 
     enum CodeType { GlobalCode, EvalCode, FunctionCode };
 
@@ -523,6 +525,12 @@ namespace JSC {
         {
             m_jitCode = code;
             m_jitCodeWithArityCheck = codeWithArityCheck;
+#if ENABLE(DFG_JIT)
+            if (m_jitCode.jitType() == JITCode::DFGJIT) {
+                createDFGDataIfNecessary();
+                m_globalData->heap.m_dfgCodeBlocks.m_set.add(this);
+            }
+#endif
         }
         JITCode& getJITCode() { return m_jitCode; }
         MacroAssemblerCodePtr getJITCodeWithArityCheck() { return m_jitCodeWithArityCheck; }
@@ -1080,6 +1088,8 @@ namespace JSC {
         virtual void finalizeUnconditionally();
         
     private:
+        friend class DFGCodeBlocks;
+        
 #if !defined(NDEBUG) || ENABLE(OPCODE_SAMPLING)
         void dump(ExecState*, const Vector<Instruction>::const_iterator& begin, Vector<Instruction>::const_iterator&) const;
 
@@ -1154,11 +1164,19 @@ namespace JSC {
         };
         
         struct DFGData {
+            DFGData()
+                : mayBeExecuting(false)
+                , isJettisoned(false)
+            {
+            }
+            
             Vector<DFG::OSREntryData> osrEntry;
             SegmentedVector<DFG::OSRExit, 8> osrExit;
             Vector<DFG::SpeculationRecovery> speculationRecovery;
             Vector<WeakReferenceTransition> transitions;
             Vector<WriteBarrier<JSCell> > weakReferences;
+            bool mayBeExecuting;
+            bool isJettisoned;
         };
         
         OwnPtr<DFGData> m_dfgData;
@@ -1380,6 +1398,26 @@ namespace JSC {
         return isInlineCallFrameSlow();
     }
 #endif
+
+#if ENABLE(DFG_JIT)
+    inline void DFGCodeBlocks::mark(void* candidateCodeBlock)
+    {
+        // We have to check for 0 and -1 because those are used by the HashMap as markers.
+        uintptr_t value = reinterpret_cast<uintptr_t>(candidateCodeBlock);
+        
+        // This checks for both of those nasty cases in one go.
+        // 0 + 1 = 1
+        // -1 + 1 = 0
+        if (value + 1 <= 1)
+            return;
+        
+        HashSet<CodeBlock*>::iterator iter = m_set.find(static_cast<CodeBlock*>(candidateCodeBlock));
+        if (iter == m_set.end())
+            return;
+        
+        (*iter)->m_dfgData->mayBeExecuting = true;
+    }
+#endif
     
 } // namespace JSC
 
index 4d2bb2f..05c668c 100644 (file)
 #include "config.h"
 #include "ConservativeRoots.h"
 
+#include "CodeBlock.h"
+#include "DFGCodeBlocks.h"
 #include "JSCell.h"
 #include "JSObject.h"
-#include "JettisonedCodeBlocks.h"
 #include "Structure.h"
 
 namespace JSC {
@@ -113,9 +114,9 @@ void ConservativeRoots::add(void* begin, void* end)
     genericAddSpan(begin, end, dummyMarkHook);
 }
 
-void ConservativeRoots::add(void* begin, void* end, JettisonedCodeBlocks& jettisonedCodeBlocks)
+void ConservativeRoots::add(void* begin, void* end, DFGCodeBlocks& dfgCodeBlocks)
 {
-    genericAddSpan(begin, end, jettisonedCodeBlocks);
+    genericAddSpan(begin, end, dfgCodeBlocks);
 }
 
 } // namespace JSC
index 035db8f..86dfc58 100644 (file)
@@ -33,7 +33,7 @@
 namespace JSC {
 
 class JSCell;
-class JettisonedCodeBlocks;
+class DFGCodeBlocks;
 class Heap;
 
 class ConservativeRoots {
@@ -42,7 +42,7 @@ public:
     ~ConservativeRoots();
 
     void add(void* begin, void* end);
-    void add(void* begin, void* end, JettisonedCodeBlocks&);
+    void add(void* begin, void* end, DFGCodeBlocks&);
     
     size_t size();
     JSCell** roots();
diff --git a/Source/JavaScriptCore/heap/DFGCodeBlocks.cpp b/Source/JavaScriptCore/heap/DFGCodeBlocks.cpp
new file mode 100644 (file)
index 0000000..03c8df2
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "config.h"
+#include "DFGCodeBlocks.h"
+
+#include "CodeBlock.h"
+#include "SlotVisitor.h"
+#include <wtf/Vector.h>
+
+namespace JSC {
+
+#if ENABLE(DFG_JIT)
+
+DFGCodeBlocks::DFGCodeBlocks() { }
+
+DFGCodeBlocks::~DFGCodeBlocks()
+{
+    Vector<CodeBlock*, 16> toRemove;
+    
+    for (HashSet<CodeBlock*>::iterator iter = m_set.begin(); iter != m_set.end(); ++iter) {
+        if ((*iter)->m_dfgData->isJettisoned)
+            toRemove.append(*iter);
+    }
+    
+    WTF::deleteAllValues(toRemove);
+}
+
+void DFGCodeBlocks::jettison(PassOwnPtr<CodeBlock> codeBlockPtr)
+{
+    // We don't want to delete it now; we just want its pointer.
+    CodeBlock* codeBlock = codeBlockPtr.leakPtr();
+    
+    ASSERT(codeBlock);
+    ASSERT(codeBlock->getJITType() == JITCode::DFGJIT);
+    
+    // It should not have already been jettisoned.
+    ASSERT(!codeBlock->m_dfgData->isJettisoned);
+
+    // We should have this block already.
+    ASSERT(m_set.find(codeBlock) != m_set.end());
+    
+    codeBlock->m_dfgData->isJettisoned = true;
+}
+
+void DFGCodeBlocks::clearMarks()
+{
+    for (HashSet<CodeBlock*>::iterator iter = m_set.begin(); iter != m_set.end(); ++iter)
+        (*iter)->m_dfgData->mayBeExecuting = false;
+}
+
+void DFGCodeBlocks::deleteUnmarkedJettisonedCodeBlocks()
+{
+    Vector<CodeBlock*, 16> toRemove;
+    
+    for (HashSet<CodeBlock*>::iterator iter = m_set.begin(); iter != m_set.end(); ++iter) {
+        if ((*iter)->m_dfgData->isJettisoned && !(*iter)->m_dfgData->mayBeExecuting)
+            toRemove.append(*iter);
+    }
+    
+    WTF::deleteAllValues(toRemove);
+}
+
+void DFGCodeBlocks::traceMarkedCodeBlocks(SlotVisitor& visitor)
+{
+    for (HashSet<CodeBlock*>::iterator iter = m_set.begin(); iter != m_set.end(); ++iter) {
+        if ((*iter)->m_dfgData->mayBeExecuting)
+            (*iter)->visitAggregate(visitor);
+    }
+}
+
+#else // ENABLE(DFG_JIT)
+
+void DFGCodeBlocks::jettison(PassOwnPtr<CodeBlock>)
+{
+}
+
+#endif // ENABLE(DFG_JIT)
+
+} // namespace JSC
+
+
diff --git a/Source/JavaScriptCore/heap/DFGCodeBlocks.h b/Source/JavaScriptCore/heap/DFGCodeBlocks.h
new file mode 100644 (file)
index 0000000..06fd5ed
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef DFGCodeBlocks_h
+#define DFGCodeBlocks_h
+
+#include <wtf/FastAllocBase.h>
+#include <wtf/HashSet.h>
+#include <wtf/PassOwnPtr.h>
+
+namespace JSC {
+
+class CodeBlock;
+class SlotVisitor;
+
+// DFGCodeBlocks notifies the garbage collector about optimized code blocks that
+// have different marking behavior depending on whether or not they are on the
+// stack, and that may be jettisoned. Jettisoning is the process of discarding
+// a code block after all calls to it have been unlinked. This class takes special
+// care to ensure that if there are still call frames that are using the code
+// block, then it should not be immediately deleted, but rather, it should be
+// deleted once we know that there are no longer any references to it from any
+// call frames. This class takes its name from the DFG compiler; only code blocks
+// compiled by the DFG need special marking behavior if they are on the stack, and
+// only those code blocks may be jettisoned.
+
+#if ENABLE(DFG_JIT)
+class DFGCodeBlocks {
+    WTF_MAKE_FAST_ALLOCATED;
+
+public:
+    DFGCodeBlocks();
+    ~DFGCodeBlocks();
+    
+    // Inform the collector that a code block has been jettisoned form its
+    // executable and should only be kept alive if there are call frames that use
+    // it. This is typically called either from a recompilation trigger, or from
+    // an unconditional finalizer associated with a CodeBlock that had weak
+    // references, where some subset of those references were dead.
+    void jettison(PassOwnPtr<CodeBlock>);
+    
+    // Clear all mark bits associated with DFG code blocks.
+    void clearMarks();
+    
+    // Mark a pointer that may be a CodeBlock that belongs to the set of DFG code
+    // blocks. This is defined inline in CodeBlock.h
+    void mark(void* candidateCodeBlock);
+    
+    // Delete all jettisoned code blocks that have not been marked (i.e. are not referenced
+    // from call frames).
+    void deleteUnmarkedJettisonedCodeBlocks();
+    
+    // Trace all marked code blocks (i.e. are referenced from call frames). The CodeBlock
+    // is free to make use of m_dfgData->isMarked and m_dfgData->isJettisoned.
+    void traceMarkedCodeBlocks(SlotVisitor&);
+
+private:
+    friend class CodeBlock;
+    
+    HashSet<CodeBlock*> m_set;
+};
+#else
+class DFGCodeBlocks {
+    WTF_MAKE_FAST_ALLOCATED;
+
+public:
+    void jettison(PassOwnPtr<CodeBlock>);
+    void clearMarks() { }
+    void mark(void*) { }
+    void deleteUnmarkedJettisonedCodeBlocks() { }
+    void traceMarkedCodeBlocks(SlotVisitor&) { }
+};
+#endif
+
+} // namespace JSC
+
+#endif
index 9be3345..f8f052c 100644 (file)
@@ -486,6 +486,11 @@ bool Heap::unprotect(JSValue k)
     return m_protectedValues.remove(k.asCell());
 }
 
+void Heap::jettisonDFGCodeBlock(PassOwnPtr<CodeBlock> codeBlock)
+{
+    m_dfgCodeBlocks.jettison(codeBlock);
+}
+
 void Heap::markProtectedObjects(HeapRootVisitor& heapRootVisitor)
 {
     ProtectCountSet::iterator end = m_protectedValues.end();
@@ -493,11 +498,6 @@ void Heap::markProtectedObjects(HeapRootVisitor& heapRootVisitor)
         heapRootVisitor.visit(&it->first);
 }
 
-void Heap::addJettisonedCodeBlock(PassOwnPtr<CodeBlock> codeBlock)
-{
-    m_jettisonedCodeBlocks.addCodeBlock(codeBlock);
-}
-
 void Heap::pushTempSortVector(Vector<ValueStringPair>* tempVector)
 {
     m_tempSortingVectors.append(tempVector);
@@ -579,12 +579,11 @@ void Heap::markRoots(bool fullGC)
     }
 
     ConservativeRoots registerFileRoots(&m_objectSpace.blocks());
-    m_jettisonedCodeBlocks.clearMarks();
+    m_dfgCodeBlocks.clearMarks();
     {
         GCPHASE(GatherRegisterFileRoots);
-        registerFile().gatherConservativeRoots(registerFileRoots, m_jettisonedCodeBlocks);
+        registerFile().gatherConservativeRoots(registerFileRoots, m_dfgCodeBlocks);
     }
-    m_jettisonedCodeBlocks.deleteUnmarkedCodeBlocks();
 #if ENABLE(GGC)
     MarkedBlock::DirtyCellVector dirtyCells;
     if (!fullGC) {
@@ -668,7 +667,7 @@ void Heap::markRoots(bool fullGC)
     
         {
             GCPHASE(TraceCodeBlocks);
-            m_jettisonedCodeBlocks.traceCodeBlocks(visitor);
+            m_dfgCodeBlocks.traceMarkedCodeBlocks(visitor);
             visitor.donateAndDrain();
         }
     
@@ -805,6 +804,11 @@ void Heap::collect(SweepToggle sweepToggle)
         GCPHASE(ResetAllocator);
         resetAllocator();
     }
+    
+    {
+        GCPHASE(DeleteCodeBlocks);
+        m_dfgCodeBlocks.deleteUnmarkedJettisonedCodeBlocks();
+    }
 
     if (sweepToggle == DoSweep) {
         SamplingRegion samplingRegion("Garbage Collection: Sweeping");
index 8efc393..1b22825 100644 (file)
@@ -23,9 +23,9 @@
 #define Heap_h
 
 #include "AllocationSpace.h"
+#include "DFGCodeBlocks.h"
 #include "HandleHeap.h"
 #include "HandleStack.h"
-#include "JettisonedCodeBlocks.h"
 #include "MarkedBlock.h"
 #include "MarkedBlockSet.h"
 #include "MarkedSpace.h"
@@ -37,6 +37,7 @@
 
 namespace JSC {
 
+    class CodeBlock;
     class GCActivityCallback;
     class GlobalCodeBlock;
     class Heap;
@@ -103,7 +104,7 @@ namespace JSC {
         void protect(JSValue);
         bool unprotect(JSValue); // True when the protect count drops to 0.
         
-        void addJettisonedCodeBlock(PassOwnPtr<CodeBlock>);
+        void jettisonDFGCodeBlock(PassOwnPtr<CodeBlock>);
 
         size_t size();
         size_t capacity();
@@ -131,6 +132,7 @@ namespace JSC {
         friend class MarkedBlock;
         friend class AllocationSpace;
         friend class SlotVisitor;
+        friend class CodeBlock;
 
         static const size_t minExtraCost = 256;
         static const size_t maxExtraCost = 1024 * 1024;
@@ -204,7 +206,7 @@ namespace JSC {
 
         HandleHeap m_handleHeap;
         HandleStack m_handleStack;
-        JettisonedCodeBlocks m_jettisonedCodeBlocks;
+        DFGCodeBlocks m_dfgCodeBlocks;
         FinalizerOwner m_finalizerOwner;
         
         bool m_isSafeToCollect;
diff --git a/Source/JavaScriptCore/heap/JettisonedCodeBlocks.cpp b/Source/JavaScriptCore/heap/JettisonedCodeBlocks.cpp
deleted file mode 100644 (file)
index 4f22740..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include "config.h"
-#include "JettisonedCodeBlocks.h"
-
-#include "CodeBlock.h"
-#include "SlotVisitor.h"
-#include <wtf/Vector.h>
-
-namespace JSC {
-
-JettisonedCodeBlocks::JettisonedCodeBlocks() { }
-
-JettisonedCodeBlocks::~JettisonedCodeBlocks()
-{
-    WTF::deleteAllKeys(m_map);
-}
-
-void JettisonedCodeBlocks::addCodeBlock(PassOwnPtr<CodeBlock> codeBlock)
-{
-    ASSERT(m_map.find(codeBlock.get()) == m_map.end());
-    
-    m_map.add(codeBlock.leakPtr(), false);
-}
-
-void JettisonedCodeBlocks::clearMarks()
-{
-    HashMap<CodeBlock*, bool>::iterator begin = m_map.begin();
-    HashMap<CodeBlock*, bool>::iterator end = m_map.end();
-    for (HashMap<CodeBlock*, bool>::iterator iter = begin; iter != end; ++iter)
-        iter->second = false;
-}
-
-void JettisonedCodeBlocks::deleteUnmarkedCodeBlocks()
-{
-    Vector<CodeBlock*> toRemove;
-    
-    HashMap<CodeBlock*, bool>::iterator begin = m_map.begin();
-    HashMap<CodeBlock*, bool>::iterator end = m_map.end();
-    for (HashMap<CodeBlock*, bool>::iterator iter = begin; iter != end; ++iter) {
-        if (!iter->second)
-            toRemove.append(iter->first);
-    }
-    
-    for (unsigned i = 0; i < toRemove.size(); ++i) {
-        m_map.remove(toRemove[i]);
-        delete toRemove[i];
-    }
-}
-
-void JettisonedCodeBlocks::traceCodeBlocks(SlotVisitor& slotVisitor)
-{
-    HashMap<CodeBlock*, bool>::iterator begin = m_map.begin();
-    HashMap<CodeBlock*, bool>::iterator end = m_map.end();
-    for (HashMap<CodeBlock*, bool>::iterator iter = begin; iter != end; ++iter)
-        iter->first->visitAggregate(slotVisitor);
-}
-
-} // namespace JSC
-
diff --git a/Source/JavaScriptCore/heap/JettisonedCodeBlocks.h b/Source/JavaScriptCore/heap/JettisonedCodeBlocks.h
deleted file mode 100644 (file)
index 38dc99f..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#ifndef JettisonedCodeBlocks_h
-#define JettisonedCodeBlocks_h
-
-#include <wtf/FastAllocBase.h>
-#include <wtf/HashMap.h>
-#include <wtf/PassOwnPtr.h>
-
-namespace JSC {
-
-class CodeBlock;
-class SlotVisitor;
-
-class JettisonedCodeBlocks {
-    WTF_MAKE_FAST_ALLOCATED; // Only malloc'd in ConservativeRoots
-public:
-    JettisonedCodeBlocks();
-    
-    ~JettisonedCodeBlocks();
-    
-    void addCodeBlock(PassOwnPtr<CodeBlock>);
-    
-    void clearMarks();
-    
-    void mark(void* candidateCodeBlock)
-    {
-        // We have to check for 0 and -1 because those are used by the HashMap as markers.
-        uintptr_t value = reinterpret_cast<uintptr_t>(candidateCodeBlock);
-        
-        // This checks for both of those nasty cases in one go.
-        // 0 + 1 = 1
-        // -1 + 1 = 0
-        if (value + 1 <= 1)
-            return;
-        
-        HashMap<CodeBlock*, bool>::iterator iter = m_map.find(static_cast<CodeBlock*>(candidateCodeBlock));
-        if (iter == m_map.end())
-            return;
-        iter->second = true;
-    }
-    
-    void deleteUnmarkedCodeBlocks();
-    
-    void traceCodeBlocks(SlotVisitor&);
-
-private:
-    // It would be great to use an OwnPtr<CodeBlock> here but that would
-    // almost certainly not work.
-    HashMap<CodeBlock*, bool> m_map;
-};
-
-} // namespace JSC
-
-#endif // JettisonedCodeBlocks_h
-
index 44e09e0..b723527 100644 (file)
@@ -73,9 +73,9 @@ void RegisterFile::gatherConservativeRoots(ConservativeRoots& conservativeRoots)
     conservativeRoots.add(begin(), end());
 }
 
-void RegisterFile::gatherConservativeRoots(ConservativeRoots& conservativeRoots, JettisonedCodeBlocks& jettisonedCodeBlocks)
+void RegisterFile::gatherConservativeRoots(ConservativeRoots& conservativeRoots, DFGCodeBlocks& dfgCodeBlocks)
 {
-    conservativeRoots.add(begin(), end(), jettisonedCodeBlocks);
+    conservativeRoots.add(begin(), end(), dfgCodeBlocks);
 }
 
 void RegisterFile::releaseExcessCapacity()
index 61fe9b8..51bce6c 100644 (file)
@@ -38,7 +38,7 @@
 namespace JSC {
 
     class ConservativeRoots;
-    class JettisonedCodeBlocks;
+    class DFGCodeBlocks;
 
     class RegisterFile {
         WTF_MAKE_NONCOPYABLE(RegisterFile);
@@ -65,7 +65,7 @@ namespace JSC {
         ~RegisterFile();
         
         void gatherConservativeRoots(ConservativeRoots&);
-        void gatherConservativeRoots(ConservativeRoots&, JettisonedCodeBlocks&);
+        void gatherConservativeRoots(ConservativeRoots&, DFGCodeBlocks&);
 
         Register* begin() const { return static_cast<Register*>(m_reservation.base()); }
         Register* end() const { return m_end; }
index a212dca..62322dd 100644 (file)
@@ -80,7 +80,7 @@ static void jettisonCodeBlock(JSGlobalData& globalData, OwnPtr<T>& codeBlock)
     OwnPtr<T> codeBlockToJettison = codeBlock.release();
     codeBlock = static_pointer_cast<T>(codeBlockToJettison->releaseAlternative());
     codeBlockToJettison->unlinkIncomingCalls();
-    globalData.heap.addJettisonedCodeBlock(static_pointer_cast<CodeBlock>(codeBlockToJettison.release()));
+    globalData.heap.jettisonDFGCodeBlock(static_pointer_cast<CodeBlock>(codeBlockToJettison.release()));
 }
 #endif