| Index: src/heap.h
|
| diff --git a/src/heap.h b/src/heap.h
|
| index 484cd22bdf76d58f5fb75076d6d0ee5a4fb48655..2a7716efba2166466d56e606e3cb3fa3abbb763b 100644
|
| --- a/src/heap.h
|
| +++ b/src/heap.h
|
| @@ -686,13 +686,21 @@ class Heap : public AllStatic {
|
| static void GarbageCollectionPrologue();
|
| static void GarbageCollectionEpilogue();
|
|
|
| + enum CollectionPolicy { NORMAL, AGGRESSIVE };
|
| +
|
| // Performs garbage collection operation.
|
| // Returns whether required_space bytes are available after the collection.
|
| - static bool CollectGarbage(int required_space, AllocationSpace space);
|
| + static bool CollectGarbage(int required_space,
|
| + AllocationSpace space,
|
| + CollectionPolicy collectionPolicy = NORMAL);
|
|
|
| // Performs a full garbage collection. Force compaction if the
|
| // parameter is true.
|
| - static void CollectAllGarbage(bool force_compaction);
|
| + static void CollectAllGarbage(bool force_compaction,
|
| + CollectionPolicy collectionPolicy = NORMAL);
|
| +
|
| + // Last hope GC, should try to squeeze as much as possible.
|
| + static void CollectAllAvailableGarbage();
|
|
|
| // Notify the heap that a context has been disposed.
|
| static int NotifyContextDisposed() { return ++contexts_disposed_; }
|
| @@ -1213,9 +1221,14 @@ class Heap : public AllStatic {
|
| static GarbageCollector SelectGarbageCollector(AllocationSpace space);
|
|
|
| // Performs garbage collection
|
| - static void PerformGarbageCollection(AllocationSpace space,
|
| - GarbageCollector collector,
|
| - GCTracer* tracer);
|
| + static void PerformGarbageCollection(GarbageCollector collector,
|
| + GCTracer* tracer,
|
| + CollectionPolicy collectionPolicy);
|
| +
|
| + static const int kMinimumPromotionLimit = 2 * MB;
|
| + static const int kMinimumAllocationLimit = 8 * MB;
|
| +
|
| + inline static void UpdateOldSpaceLimits();
|
|
|
| // Allocate an uninitialized object in map space. The behavior is identical
|
| // to Heap::AllocateRaw(size_in_bytes, MAP_SPACE), except that (a) it doesn't
|
|
|