Reviewers: Erik Corry,
Description:
Enable non-incremental code compaction.
It is intended to bring memory usage down on idle notifications.
[email protected]
BUG=v8:1726
Please review this at https://chromiumcodereview.appspot.com/9323079/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/flag-definitions.h
M src/incremental-marking.cc
M src/mark-compact.h
M src/mark-compact.cc
Index: src/flag-definitions.h
diff --git a/src/flag-definitions.h b/src/flag-definitions.h
index
9cdea067254f2edab1bdb6ce9cc34b8dc8d2e5a9..b8afb24319908d41ed076b08ff1c57a6b96f3799
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.")
Index: src/incremental-marking.cc
diff --git a/src/incremental-marking.cc b/src/incremental-marking.cc
index
6248524668186dc0fe2162abd347d38b0ab13257..2a3905fcdffdcbdbf5483105a38a6de59f97db22
100644
--- a/src/incremental-marking.cc
+++ b/src/incremental-marking.cc
@@ -505,7 +505,7 @@ void IncrementalMarking::StartMarking(CompactionFlag
flag) {
}
is_compacting_ = !FLAG_never_compact && (flag == ALLOW_COMPACTION) &&
- heap_->mark_compact_collector()->StartCompaction();
+ heap_->mark_compact_collector()->StartCompaction(true);
state_ = MARKING;
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index
ac2465e35c3a98d8a26c0d4f0b4269c9cdec5d91..fc5b469e9656d94d3250766d3290fc44aa84721d
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(bool incremental) {
if (!compacting_) {
ASSERT(evacuation_candidates_.length() == 0);
CollectEvacuationCandidates(heap()->old_pointer_space());
CollectEvacuationCandidates(heap()->old_data_space());
- if (FLAG_compact_code_space) {
+ if (!incremental) {
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(false);
}
PagedSpaces spaces;
Index: src/mark-compact.h
diff --git a/src/mark-compact.h b/src/mark-compact.h
index
135f22043549e3ae34aed2cc437f895c6bcef0c8..9b7b8c2b82ba028e553763d8c405695865d52419
100644
--- a/src/mark-compact.h
+++ b/src/mark-compact.h
@@ -441,7 +441,7 @@ class MarkCompactCollector {
// Performs a global garbage collection.
void CollectGarbage();
- bool StartCompaction();
+ bool StartCompaction(bool incremental);
void AbortCompaction();
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev