summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/runtime/Collector.h
diff options
context:
space:
mode:
Diffstat (limited to 'JavaScriptCore/runtime/Collector.h')
-rw-r--r--JavaScriptCore/runtime/Collector.h26
1 files changed, 16 insertions, 10 deletions
diff --git a/JavaScriptCore/runtime/Collector.h b/JavaScriptCore/runtime/Collector.h
index 23f9f15..877f890 100644
--- a/JavaScriptCore/runtime/Collector.h
+++ b/JavaScriptCore/runtime/Collector.h
@@ -39,11 +39,12 @@
namespace JSC {
- class MarkedArgumentBuffer;
class CollectorBlock;
class JSCell;
class JSGlobalData;
class JSValue;
+ class MarkedArgumentBuffer;
+ class MarkStack;
enum OperationInProgress { NoOperation, Allocation, Collection };
enum HeapType { PrimaryHeap, NumberHeap };
@@ -63,7 +64,7 @@ namespace JSC {
OperationInProgress operationInProgress;
};
- class Heap : Noncopyable {
+ class Heap : public Noncopyable {
public:
class Thread;
typedef CollectorHeapIterator<PrimaryHeap> iterator;
@@ -111,7 +112,7 @@ namespace JSC {
static bool isCellMarked(const JSCell*);
static void markCell(JSCell*);
- void markConservatively(void* start, void* end);
+ void markConservatively(MarkStack&, void* start, void* end);
HashSet<MarkedArgumentBuffer*>& markListSet() { if (!m_markListSet) m_markListSet = new HashSet<MarkedArgumentBuffer*>; return *m_markListSet; }
@@ -133,11 +134,11 @@ namespace JSC {
~Heap();
void recordExtraCost(size_t);
- void markProtectedObjects();
- void markCurrentThreadConservatively();
- void markCurrentThreadConservativelyInternal();
- void markOtherThreadConservatively(Thread*);
- void markStackObjectsConservatively();
+ void markProtectedObjects(MarkStack&);
+ void markCurrentThreadConservatively(MarkStack&);
+ void markCurrentThreadConservativelyInternal(MarkStack&);
+ void markOtherThreadConservatively(MarkStack&, Thread*);
+ void markStackObjectsConservatively(MarkStack&);
typedef HashCountedSet<JSCell*> ProtectCountSet;
@@ -167,8 +168,13 @@ namespace JSC {
template<size_t bytesPerWord> struct CellSize;
// cell size needs to be a power of two for certain optimizations in collector.cpp
- template<> struct CellSize<sizeof(uint32_t)> { static const size_t m_value = 32; }; // 32-bit
- template<> struct CellSize<sizeof(uint64_t)> { static const size_t m_value = 64; }; // 64-bit
+#if USE(JSVALUE32)
+ template<> struct CellSize<sizeof(uint32_t)> { static const size_t m_value = 32; };
+#else
+ template<> struct CellSize<sizeof(uint32_t)> { static const size_t m_value = 64; };
+#endif
+ template<> struct CellSize<sizeof(uint64_t)> { static const size_t m_value = 64; };
+
const size_t BLOCK_SIZE = 16 * 4096; // 64k
// derived constants