From: vegorov@chromium.org Date: Tue, 7 Feb 2012 08:51:47 +0000 (+0000) Subject: Enable non-incremental code compaction. X-Git-Tag: upstream/4.7.83~17441 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=029aa9ef92cfd4ac846a18c6d40ce6d20aa0cdd9;p=platform%2Fupstream%2Fv8.git Enable non-incremental code compaction. It is intended to bring memory usage down on idle notifications. R=erik.corry@gmail.com BUG=v8:1726 Review URL: https://chromiumcodereview.appspot.com/9323079 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10616 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/flag-definitions.h b/src/flag-definitions.h index 9cdea06..b8afb24 100644 --- a/src/flag-definitions.h +++ b/src/flag-definitions.h @@ -307,7 +307,6 @@ DEFINE_bool(cleanup_caches_in_maps_at_gc, true, "Flush code caches in maps during mark compact cycle.") DEFINE_bool(never_compact, false, "Never perform compaction on full GC - testing only") -DEFINE_bool(compact_code_space, false, "Compact code space") DEFINE_bool(cleanup_code_caches_at_gc, true, "Flush inline caches prior to mark compact collection and " "flush code caches in maps during mark compact cycle.") diff --git a/src/incremental-marking.cc b/src/incremental-marking.cc index 6248524..d034617 100644 --- a/src/incremental-marking.cc +++ b/src/incremental-marking.cc @@ -505,7 +505,8 @@ void IncrementalMarking::StartMarking(CompactionFlag flag) { } is_compacting_ = !FLAG_never_compact && (flag == ALLOW_COMPACTION) && - heap_->mark_compact_collector()->StartCompaction(); + heap_->mark_compact_collector()->StartCompaction( + MarkCompactCollector::INCREMENTAL_COMPACTION); state_ = MARKING; diff --git a/src/mark-compact.cc b/src/mark-compact.cc index ac2465e..4aa4c68 100644 --- a/src/mark-compact.cc +++ b/src/mark-compact.cc @@ -242,14 +242,14 @@ static void TraceFragmentation(PagedSpace* space) { } -bool MarkCompactCollector::StartCompaction() { +bool MarkCompactCollector::StartCompaction(CompactionMode mode) { if (!compacting_) { ASSERT(evacuation_candidates_.length() == 0); CollectEvacuationCandidates(heap()->old_pointer_space()); CollectEvacuationCandidates(heap()->old_data_space()); - if (FLAG_compact_code_space) { + if (mode == NON_INCREMENTAL_COMPACTION) { CollectEvacuationCandidates(heap()->code_space()); } else if (FLAG_trace_fragmentation) { TraceFragmentation(heap()->code_space()); @@ -697,7 +697,7 @@ void MarkCompactCollector::Prepare(GCTracer* tracer) { // Don't start compaction if we are in the middle of incremental // marking cycle. We did not collect any slots. if (!FLAG_never_compact && !was_marked_incrementally_) { - StartCompaction(); + StartCompaction(NON_INCREMENTAL_COMPACTION); } PagedSpaces spaces; diff --git a/src/mark-compact.h b/src/mark-compact.h index 135f220..dc4bcee 100644 --- a/src/mark-compact.h +++ b/src/mark-compact.h @@ -441,7 +441,12 @@ class MarkCompactCollector { // Performs a global garbage collection. void CollectGarbage(); - bool StartCompaction(); + enum CompactionMode { + INCREMENTAL_COMPACTION, + NON_INCREMENTAL_COMPACTION + }; + + bool StartCompaction(CompactionMode mode); void AbortCompaction();