Commit 68b8a508 authored by vegorov@chromium.org's avatar vegorov@chromium.org

Count Mark-Compact/Mark-Sweep collections only after compaction decision was made

Review URL: http://codereview.chromium.org/2665001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4811 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8ff90837
......@@ -659,18 +659,19 @@ void Heap::PerformGarbageCollection(AllocationSpace space,
void Heap::MarkCompact(GCTracer* tracer) {
gc_state_ = MARK_COMPACT;
if (MarkCompactCollector::IsCompacting()) {
mc_count_++;
} else {
ms_count_++;
}
tracer->set_full_gc_count(mc_count_);
LOG(ResourceEvent("markcompact", "begin"));
MarkCompactCollector::Prepare(tracer);
bool is_compacting = MarkCompactCollector::IsCompacting();
if (is_compacting) {
mc_count_++;
} else {
ms_count_++;
}
tracer->set_full_gc_count(mc_count_ + ms_count_);
MarkCompactPrologue(is_compacting);
MarkCompactCollector::CollectGarbage();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment