Index: src/heap.cc |
diff --git a/src/heap.cc b/src/heap.cc |
index c7f363821fcb25ea226bbaa8f6456078ed8551a5..42e56ca1eb9e2bb40498d9ea2d341c71a67f6b4e 100644 |
--- a/src/heap.cc |
+++ b/src/heap.cc |
@@ -773,6 +773,21 @@ void Heap::CollectAllAvailableGarbage(const char* gc_reason) { |
} |
+void Heap::EnsureFillerObjectAtTop() { |
+ // There may be an allocation memento behind every object in new space. |
+ // If we evacuate a not full new space or if we are on the last page of |
+ // the new space, then there may be uninitialized memory behind the top |
+ // pointer of the new space page. We store a filler object there to |
+ // identify the unused space. |
+ Address from_top = new_space_.top(); |
+ Address from_limit = new_space_.limit(); |
+ if (from_top < from_limit) { |
+ int remaining_in_page = static_cast<int>(from_limit - from_top); |
+ CreateFillerObjectAt(from_top, remaining_in_page); |
+ } |
+} |
+ |
+ |
bool Heap::CollectGarbage(GarbageCollector collector, |
const char* gc_reason, |
const char* collector_reason, |
@@ -789,17 +804,7 @@ bool Heap::CollectGarbage(GarbageCollector collector, |
allocation_timeout_ = Max(6, FLAG_gc_interval); |
#endif |
- // There may be an allocation memento behind every object in new space. |
- // If we evacuate a not full new space or if we are on the last page of |
- // the new space, then there may be uninitialized memory behind the top |
- // pointer of the new space page. We store a filler object there to |
- // identify the unused space. |
- Address from_top = new_space_.top(); |
- Address from_limit = new_space_.limit(); |
- if (from_top < from_limit) { |
- int remaining_in_page = static_cast<int>(from_limit - from_top); |
- CreateFillerObjectAt(from_top, remaining_in_page); |
- } |
+ EnsureFillerObjectAtTop(); |
if (collector == SCAVENGER && !incremental_marking()->IsStopped()) { |
if (FLAG_trace_incremental_marking) { |
@@ -873,16 +878,6 @@ int Heap::NotifyContextDisposed() { |
} |
-void Heap::PerformScavenge() { |
- GCTracer tracer(this, NULL, NULL); |
- if (incremental_marking()->IsStopped()) { |
- PerformGarbageCollection(SCAVENGER, &tracer); |
- } else { |
- PerformGarbageCollection(MARK_COMPACTOR, &tracer); |
- } |
-} |
- |
- |
void Heap::MoveElements(FixedArray* array, |
int dst_index, |
int src_index, |