Reviewers: Erik Corry,

Description:
Enable code flushing for full (non-incremental) collections.

This will ensure that we will flush code when we hit memory limits.

[email protected]
BUG=v8:1609


Please review this at http://codereview.chromium.org/8060053/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/flag-definitions.h
  M src/mark-compact.cc


Index: src/flag-definitions.h
diff --git a/src/flag-definitions.h b/src/flag-definitions.h
index 23b3a24f453c16b4cc22cf084cb02c8e5afa36b5..379803f04678c0a6de9dee6fdd736ef0a2399714 100644
--- a/src/flag-definitions.h
+++ b/src/flag-definitions.h
@@ -258,7 +258,7 @@ DEFINE_bool(trace_fragmentation, false,
             "report fragmentation for old pointer and data pages")
 DEFINE_bool(collect_maps, true,
             "garbage collect maps from which no objects can be reached")
-DEFINE_bool(flush_code, false,
+DEFINE_bool(flush_code, true,
             "flush code that we expect not to use again before full gc")
 DEFINE_bool(incremental_marking, true, "use incremental marking")
DEFINE_bool(incremental_marking_steps, true, "do incremental marking steps")
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index 4fc9fdba5e974a8c43fa9c4f1872cbc93f01ca1d..da92f94388ebd4978b9bd2ab4cb902365480c916 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -1422,7 +1422,8 @@ class SharedFunctionInfoMarkingVisitor : public ObjectVisitor {
 void MarkCompactCollector::PrepareForCodeFlushing() {
   ASSERT(heap() == Isolate::Current()->heap());

-  if (!FLAG_flush_code) {
+ // TODO(1609) Currently incremental marker does not support code flushing.
+  if (!FLAG_flush_code || was_marked_incrementally_) {
     EnableCodeFlushing(false);
     return;
   }
@@ -3687,9 +3688,6 @@ void MarkCompactCollector::SweepSpaces() {
 }


-// TODO(1466) ReportDeleteIfNeeded is not called currently.
-// Our profiling tools do not expect intersections between
-// code objects. We should either reenable it or change our tools.
 void MarkCompactCollector::EnableCodeFlushing(bool enable) {
   if (enable) {
     if (code_flusher_ != NULL) return;
@@ -3702,6 +3700,9 @@ void MarkCompactCollector::EnableCodeFlushing(bool enable) {
 }


+// TODO(1466) ReportDeleteIfNeeded is not called currently.
+// Our profiling tools do not expect intersections between
+// code objects. We should either reenable it or change our tools.
 void MarkCompactCollector::ReportDeleteIfNeeded(HeapObject* obj,
                                                 Isolate* isolate) {
 #ifdef ENABLE_GDB_JIT_INTERFACE


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to