Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (87229 => 87230)
--- trunk/Source/_javascript_Core/ChangeLog 2011-05-24 23:46:14 UTC (rev 87229)
+++ trunk/Source/_javascript_Core/ChangeLog 2011-05-24 23:46:35 UTC (rev 87230)
@@ -1,3 +1,22 @@
+2011-05-24 Geoffrey Garen <[email protected]>
+
+ Reviewed by Oliver Hunt.
+
+ Split HeapRootVisitor into its own class
+ https://bugs.webkit.org/show_bug.cgi?id=61399
+
+ * GNUmakefile.list.am:
+ * _javascript_Core.gypi:
+ * _javascript_Core.vcproj/_javascript_Core/_javascript_Core.vcproj:
+ * _javascript_Core.xcodeproj/project.pbxproj:
+ * heap/HandleHeap.cpp:
+ * heap/HandleStack.cpp:
+ * heap/Heap.cpp:
+ * heap/HeapRootVisitor.h: Copied from Source/_javascript_Core/heap/MarkStack.h.
+ * heap/MarkStack.h:
+ * runtime/ArgList.cpp:
+ * runtime/SmallStrings.cpp:
+
2011-05-24 Jay Civelli <[email protected]>
Rubberstamped by David Kilzer.
Modified: trunk/Source/_javascript_Core/GNUmakefile.list.am (87229 => 87230)
--- trunk/Source/_javascript_Core/GNUmakefile.list.am 2011-05-24 23:46:14 UTC (rev 87229)
+++ trunk/Source/_javascript_Core/GNUmakefile.list.am 2011-05-24 23:46:35 UTC (rev 87230)
@@ -112,6 +112,7 @@
Source/_javascript_Core/heap/MachineStackMarker.h \
Source/_javascript_Core/heap/MarkStack.cpp \
Source/_javascript_Core/heap/MarkStack.h \
+ Source/_javascript_Core/heap/HeapRootVisitor.h \
Source/_javascript_Core/heap/MarkedBlock.cpp \
Source/_javascript_Core/heap/MarkedBlock.h \
Source/_javascript_Core/heap/MarkedSpace.cpp \
Modified: trunk/Source/_javascript_Core/_javascript_Core.gypi (87229 => 87230)
--- trunk/Source/_javascript_Core/_javascript_Core.gypi 2011-05-24 23:46:14 UTC (rev 87229)
+++ trunk/Source/_javascript_Core/_javascript_Core.gypi 2011-05-24 23:46:35 UTC (rev 87230)
@@ -319,6 +319,7 @@
'heap/MachineStackMarker.h',
'heap/MarkStack.cpp',
'heap/MarkStack.h',
+ 'heap/HeapRootVisitor.h',
'heap/MarkedBlock.cpp',
'heap/MarkedBlock.h',
'heap/MarkedSpace.cpp',
Modified: trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.vcproj (87229 => 87230)
--- trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.vcproj 2011-05-24 23:46:14 UTC (rev 87229)
+++ trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.vcproj 2011-05-24 23:46:35 UTC (rev 87230)
@@ -1914,6 +1914,10 @@
>
</File>
<File
+ RelativePath="..\..\heap\HeapRootVisitor.h"
+ >
+ </File>
+ <File
RelativePath="..\..\heap\Heap.cpp"
>
</File>
Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (87229 => 87230)
--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2011-05-24 23:46:14 UTC (rev 87229)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2011-05-24 23:46:35 UTC (rev 87230)
@@ -164,6 +164,7 @@
147F39D7107EC37600427A48 /* JSVariableObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC22A39A0E16E14800AF21C8 /* JSVariableObject.cpp */; };
1482B74E0A43032800517CFC /* JSStringRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1482B74C0A43032800517CFC /* JSStringRef.cpp */; };
1482B7E40A43076000517CFC /* JSObjectRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1482B7E20A43076000517CFC /* JSObjectRef.cpp */; };
+ 1486300A138C61F800B42E16 /* HeapRootVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 14863009138C61F800B42E16 /* HeapRootVisitor.h */; };
148CD1D8108CF902008163C6 /* JSContextRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 148CD1D7108CF902008163C6 /* JSContextRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
148F21AA107EC53A0042EC2C /* BytecodeGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 969A07200ED1CE3300F1F681 /* BytecodeGenerator.cpp */; };
148F21B0107EC5410042EC2C /* Lexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8650255597D01FF60F7 /* Lexer.cpp */; };
@@ -783,6 +784,7 @@
1482B7E10A43076000517CFC /* JSObjectRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSObjectRef.h; sourceTree = "<group>"; };
1482B7E20A43076000517CFC /* JSObjectRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSObjectRef.cpp; sourceTree = "<group>"; };
1483B589099BC1950016E4F0 /* JSImmediate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSImmediate.h; sourceTree = "<group>"; };
+ 14863009138C61F800B42E16 /* HeapRootVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HeapRootVisitor.h; path = ../../../webkit/Source/_javascript_Core/heap/HeapRootVisitor.h; sourceTree = SOURCE_ROOT; };
148A1626095D16BB00666D0D /* ListRefPtr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ListRefPtr.h; sourceTree = "<group>"; };
148A1ECD0D10C23B0069A47C /* RefPtrHashMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RefPtrHashMap.h; sourceTree = "<group>"; };
148CD1D7108CF902008163C6 /* JSContextRefPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSContextRefPrivate.h; sourceTree = "<group>"; };
@@ -1480,8 +1482,10 @@
142E312D134FF0A600AFADB5 /* HandleHeap.h */,
142E312E134FF0A600AFADB5 /* HandleStack.cpp */,
142E312F134FF0A600AFADB5 /* HandleStack.h */,
+ 146FA5A81378F6B0003627A3 /* HandleTypes.h */,
14FB986B135225410085A5DB /* Heap.cpp */,
14FB986C135225410085A5DB /* Heap.h */,
+ 14863009138C61F800B42E16 /* HeapRootVisitor.h */,
142E3130134FF0A600AFADB5 /* Local.h */,
142E3131134FF0A600AFADB5 /* LocalScope.h */,
14B7233F12D7D0DA003BD5ED /* MachineStackMarker.cpp */,
@@ -1494,7 +1498,6 @@
142D6F0F13539A4100B02E86 /* MarkStack.h */,
142E3132134FF0A600AFADB5 /* Strong.h */,
142E3133134FF0A600AFADB5 /* Weak.h */,
- 146FA5A81378F6B0003627A3 /* HandleTypes.h */,
);
path = heap;
sourceTree = "<group>";
@@ -2536,6 +2539,7 @@
7934BB7E1361979400CB99A1 /* ParallelJobsLibdispatch.h in Headers */,
7934BB7F1361979400CB99A1 /* ParallelJobsOpenMP.h in Headers */,
651DCA04136A6FEF00F74194 /* PassTraits.h in Headers */,
+ 1486300A138C61F800B42E16 /* HeapRootVisitor.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Modified: trunk/Source/_javascript_Core/heap/HandleHeap.cpp (87229 => 87230)
--- trunk/Source/_javascript_Core/heap/HandleHeap.cpp 2011-05-24 23:46:14 UTC (rev 87229)
+++ trunk/Source/_javascript_Core/heap/HandleHeap.cpp 2011-05-24 23:46:35 UTC (rev 87230)
@@ -26,6 +26,7 @@
#include "config.h"
#include "HandleHeap.h"
+#include "HeapRootVisitor.h"
#include "JSObject.h"
namespace JSC {
Modified: trunk/Source/_javascript_Core/heap/HandleStack.cpp (87229 => 87230)
--- trunk/Source/_javascript_Core/heap/HandleStack.cpp 2011-05-24 23:46:14 UTC (rev 87229)
+++ trunk/Source/_javascript_Core/heap/HandleStack.cpp 2011-05-24 23:46:35 UTC (rev 87230)
@@ -24,10 +24,9 @@
*/
#include "config.h"
-
#include "HandleStack.h"
-#include "MarkStack.h"
+#include "HeapRootVisitor.h"
namespace JSC {
Modified: trunk/Source/_javascript_Core/heap/Heap.cpp (87229 => 87230)
--- trunk/Source/_javascript_Core/heap/Heap.cpp 2011-05-24 23:46:14 UTC (rev 87229)
+++ trunk/Source/_javascript_Core/heap/Heap.cpp 2011-05-24 23:46:35 UTC (rev 87230)
@@ -24,6 +24,7 @@
#include "CodeBlock.h"
#include "ConservativeRoots.h"
#include "GCActivityCallback.h"
+#include "HeapRootVisitor.h"
#include "Interpreter.h"
#include "JSGlobalData.h"
#include "JSGlobalObject.h"
Copied: trunk/Source/_javascript_Core/heap/HeapRootVisitor.h (from rev 87198, trunk/Source/_javascript_Core/heap/MarkStack.h) (0 => 87230)
--- trunk/Source/_javascript_Core/heap/HeapRootVisitor.h (rev 0)
+++ trunk/Source/_javascript_Core/heap/HeapRootVisitor.h 2011-05-24 23:46:35 UTC (rev 87230)
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2009, 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 HeapRootVisitor_h
+#define HeapRootVisitor_h
+
+#include "MarkStack.h"
+
+namespace JSC {
+
+ // Privileged class for marking JSValues directly. It is only safe to use
+ // this class to mark direct heap roots that are marked during every GC pass.
+ // All other references should be wrapped in WriteBarriers and marked through
+ // the MarkStack.
+ class HeapRootVisitor {
+ private:
+ friend class Heap;
+ HeapRootVisitor(SlotVisitor&);
+
+ public:
+ void mark(JSValue*);
+ void mark(JSValue*, size_t);
+ void mark(JSString**);
+ void mark(JSCell**);
+
+ SlotVisitor& visitor();
+
+ private:
+ SlotVisitor& m_visitor;
+ };
+
+ inline HeapRootVisitor::HeapRootVisitor(SlotVisitor& visitor)
+ : m_visitor(visitor)
+ {
+ }
+
+ inline void HeapRootVisitor::mark(JSValue* slot)
+ {
+ m_visitor.append(slot);
+ }
+
+ inline void HeapRootVisitor::mark(JSValue* slot, size_t count)
+ {
+ m_visitor.append(slot, count);
+ }
+
+ inline void HeapRootVisitor::mark(JSString** slot)
+ {
+ m_visitor.append(reinterpret_cast<JSCell**>(slot));
+ }
+
+ inline void HeapRootVisitor::mark(JSCell** slot)
+ {
+ m_visitor.append(slot);
+ }
+
+ inline SlotVisitor& HeapRootVisitor::visitor()
+ {
+ return m_visitor;
+ }
+
+} // namespace JSC
+
+#endif // HeapRootVisitor_h
Modified: trunk/Source/_javascript_Core/heap/MarkStack.h (87229 => 87230)
--- trunk/Source/_javascript_Core/heap/MarkStack.h 2011-05-24 23:46:14 UTC (rev 87229)
+++ trunk/Source/_javascript_Core/heap/MarkStack.h 2011-05-24 23:46:35 UTC (rev 87230)
@@ -43,8 +43,6 @@
class Register;
template<typename T> class WriteBarrierBase;
- typedef MarkStack SlotVisitor;
-
enum MarkSetProperties { MayContainNullValues, NoNullValues };
struct MarkSet {
@@ -278,57 +276,8 @@
internalAppend(value.asCell());
}
- // Privileged class for marking JSValues directly. It is only safe to use
- // this class to mark direct heap roots that are marked during every GC pass.
- // All other references should be wrapped in WriteBarriers and marked through
- // the MarkStack.
- class HeapRootVisitor {
- private:
- friend class Heap;
- HeapRootVisitor(SlotVisitor&);
+ typedef MarkStack SlotVisitor;
- public:
- void mark(JSValue*);
- void mark(JSValue*, size_t);
- void mark(JSString**);
- void mark(JSCell**);
-
- SlotVisitor& visitor();
-
- private:
- SlotVisitor& m_visitor;
- };
-
- inline HeapRootVisitor::HeapRootVisitor(SlotVisitor& visitor)
- : m_visitor(visitor)
- {
- }
-
- inline void HeapRootVisitor::mark(JSValue* slot)
- {
- m_visitor.append(slot);
- }
-
- inline void HeapRootVisitor::mark(JSValue* slot, size_t count)
- {
- m_visitor.append(slot, count);
- }
-
- inline void HeapRootVisitor::mark(JSString** slot)
- {
- m_visitor.append(reinterpret_cast<JSCell**>(slot));
- }
-
- inline void HeapRootVisitor::mark(JSCell** slot)
- {
- m_visitor.append(slot);
- }
-
- inline SlotVisitor& HeapRootVisitor::visitor()
- {
- return m_visitor;
- }
-
} // namespace JSC
#endif
Modified: trunk/Source/_javascript_Core/runtime/ArgList.cpp (87229 => 87230)
--- trunk/Source/_javascript_Core/runtime/ArgList.cpp 2011-05-24 23:46:14 UTC (rev 87229)
+++ trunk/Source/_javascript_Core/runtime/ArgList.cpp 2011-05-24 23:46:35 UTC (rev 87230)
@@ -21,8 +21,8 @@
#include "config.h"
#include "ArgList.h"
+#include "HeapRootVisitor.h"
#include "JSValue.h"
-#include "JSCell.h"
#include "JSObject.h"
#include "ScopeChain.h"
Modified: trunk/Source/_javascript_Core/runtime/SmallStrings.cpp (87229 => 87230)
--- trunk/Source/_javascript_Core/runtime/SmallStrings.cpp 2011-05-24 23:46:14 UTC (rev 87229)
+++ trunk/Source/_javascript_Core/runtime/SmallStrings.cpp 2011-05-24 23:46:35 UTC (rev 87230)
@@ -26,6 +26,7 @@
#include "config.h"
#include "SmallStrings.h"
+#include "HeapRootVisitor.h"
#include "JSGlobalObject.h"
#include "JSString.h"
#include <wtf/Noncopyable.h>