Index: src/heap.h |
=================================================================== |
--- src/heap.h (revision 7102) |
+++ src/heap.h (working copy) |
@@ -1,4 +1,4 @@ |
-// Copyright 2010 the V8 project authors. All rights reserved. |
+// Copyright 2011 the V8 project authors. All rights reserved. |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
// met: |
@@ -763,10 +763,19 @@ |
// collect more garbage. |
inline static bool CollectGarbage(AllocationSpace space); |
+ static const int kNoGCFlags = 0; |
+ static const int kForceCompactionMask = 1; |
+ static const int kSweepPreciselyMask = 2; |
Vyacheslav Egorov (Chromium)
2011/03/15 09:20:09
maybe better hide the concept of conservative and
Erik Corry
2011/03/17 13:39:17
Done.
|
+ |
// Performs a full garbage collection. Force compaction if the |
// parameter is true. |
- static void CollectAllGarbage(bool force_compaction); |
+ static void CollectAllGarbage(int flags); |
+ |
+ // Ensure that we have swept all spaces in such a way that we can iterate |
+ // over live objects. May cause a GC. |
+ static void EnsureHeapIsIterable(); |
+ |
// Last hope GC, should try to squeeze as much as possible. |
static void CollectAllAvailableGarbage(); |
@@ -1610,7 +1619,8 @@ |
// A HeapIterator provides iteration over the whole heap. It |
// aggregates the specific iterators for the different spaces as |
-// these can only iterate over one space only. |
+// these can only iterate over one space only. It can only be guaranteed |
+// to iterate over live objects. |
// |
// HeapIterator can skip free list nodes (that is, de-allocated heap |
// objects that still remain in the heap). As implementation of free |
@@ -1621,28 +1631,18 @@ |
class HeapIterator BASE_EMBEDDED { |
public: |
- enum HeapObjectsFiltering { |
- kNoFiltering, |
- kFilterFreeListNodes, |
- kFilterUnreachable |
- }; |
- |
HeapIterator(); |
- explicit HeapIterator(HeapObjectsFiltering filtering); |
~HeapIterator(); |
- HeapObject* next(); |
- void reset(); |
+ HeapObject* Next(); |
+ void Reset(); |
private: |
// Perform the initialization. |
void Init(); |
// Perform all necessary shutdown (destruction) work. |
void Shutdown(); |
- HeapObject* NextObject(); |
- HeapObjectsFiltering filtering_; |
- HeapObjectsFilter* filter_; |
// Space iterator for iterating all the spaces. |
SpaceIterator* space_iterator_; |
// Object iterator for the space currently being iterated. |