Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Put incremental code flushing behind a flag. (issue 11367105)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
mstarzin...@chromium.org  
View profile  
 More options Nov 6 2012, 6:03 am
From: mstarzin...@chromium.org
Date: Tue, 06 Nov 2012 11:03:09 +0000
Local: Tues, Nov 6 2012 6:03 am
Subject: Put incremental code flushing behind a flag. (issue 11367105)
Reviewers: Toon Verwaest,

Description:
Put incremental code flushing behind a flag.

This is used to disable incremental code flushing by default for now
until we can stabilize it and make it ready for production.

R=verwa...@chromium.org
BUG=chromium:159140

Please review this at https://chromiumcodereview.appspot.com/11367105/

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

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

Index: src/flag-definitions.h
diff --git a/src/flag-definitions.h b/src/flag-definitions.h
index  
99906ef4b7ff655269e55edd57a3e68c31823a8b..0208ecb1b1180c1b6c9fdec495a56eb12 678d752  
100644
--- a/src/flag-definitions.h
+++ b/src/flag-definitions.h
@@ -393,7 +393,9 @@ DEFINE_bool(trace_external_memory, false,
  DEFINE_bool(collect_maps, true,
              "garbage collect maps from which no objects can be reached")
  DEFINE_bool(flush_code, true,
-            "flush code that we expect not to use again before full gc")
+            "flush code that we expect not to use again during full gc")
+DEFINE_bool(flush_code_incrementally, false,
+            "flush code that we expect not to use again incrementally")
  DEFINE_bool(incremental_marking, true, "use incremental marking")
  DEFINE_bool(incremental_marking_steps, true, "do incremental marking  
steps")
  DEFINE_bool(trace_incremental_marking, false,
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index  
76084cfd58ac23b7b3a350049830a80bb9f664ed..9113e7bd4058619526361c01b4482174b 463b413  
100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -420,13 +420,9 @@ void Heap::GarbageCollectionPrologue() {
    gc_count_++;
    unflattened_strings_length_ = 0;

-  bool should_enable_code_flushing = FLAG_flush_code;
-#ifdef ENABLE_DEBUGGER_SUPPORT
-  if (isolate_->debug()->IsLoaded() ||  
isolate_->debug()->has_break_points()) {
-    should_enable_code_flushing = false;
+  if (FLAG_flush_code && FLAG_flush_code_incrementally) {
+    mark_compact_collector()->EnableCodeFlushing(true);
    }
-#endif
-  
mark_compact_collector()->EnableCodeFlushing(should_enable_code_flushing);

  #ifdef VERIFY_HEAP
    if (FLAG_verify_heap) {
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index  
641293399e6297d6824c2d07ee1d0ecf6cddd91b..ebba22b44a875b01006d01f0fe7906367 75ed8bf  
100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -1471,6 +1471,11 @@ void  
MarkCompactCollector::PrepareThreadForCodeFlushing(Isolate* isolate,
  void MarkCompactCollector::PrepareForCodeFlushing() {
    ASSERT(heap() == Isolate::Current()->heap());

+  // Enable code flushing for non-incremental cycles.
+  if (FLAG_flush_code && !FLAG_flush_code_incrementally) {
+    EnableCodeFlushing(!was_marked_incrementally_);
+  }
+
    // If code flushing is disabled, there is no need to prepare for it.
    if (!is_code_flushing_enabled()) return;

@@ -2033,6 +2038,11 @@ void MarkCompactCollector::AfterMarking() {
    // Flush code from collected candidates.
    if (is_code_flushing_enabled()) {
      code_flusher_->ProcessCandidates();
+    // If incremental marker does not support code flushing, we need to
+    // disable it before incremental marking steps for next cycle.
+    if (FLAG_flush_code && !FLAG_flush_code_incrementally) {
+      EnableCodeFlushing(false);
+    }
    }

    if (!FLAG_watch_ic_patching) {
@@ -3607,6 +3617,13 @@ void MarkCompactCollector::SweepSpaces() {

  void MarkCompactCollector::EnableCodeFlushing(bool enable) {
+#ifdef ENABLE_DEBUGGER_SUPPORT
+  if (heap()->isolate()->debug()->IsLoaded() ||
+      heap()->isolate()->debug()->has_break_points()) {
+    enable = false;
+  }
+#endif
+
    if (enable) {
      if (code_flusher_ != NULL) return;
      code_flusher_ = new CodeFlusher(heap()->isolate());
Index: test/cctest/test-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index  
696dc864430d2c72250a8ac60be5411080c7c94f..811973b46ad3f87e636b79e39a00180f7 c5f8ef2  
100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -1003,7 +1003,7 @@ TEST(TestCodeFlushing) {

  TEST(TestCodeFlushingIncremental) {
    // If we do not flush code this test is invalid.
-  if (!FLAG_flush_code) return;
+  if (!FLAG_flush_code || !FLAG_flush_code_incrementally) return;
    i::FLAG_allow_natives_syntax = true;
    InitializeVM();
    v8::HandleScope scope;
@@ -1071,7 +1071,7 @@ TEST(TestCodeFlushingIncremental) {

  TEST(TestCodeFlushingIncrementalScavenge) {
    // If we do not flush code this test is invalid.
-  if (!FLAG_flush_code) return;
+  if (!FLAG_flush_code || !FLAG_flush_code_incrementally) return;
    i::FLAG_allow_natives_syntax = true;
    InitializeVM();
    v8::HandleScope scope;


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
verwa...@chromium.org  
View profile  
 More options Nov 6 2012, 6:49 am
From: verwa...@chromium.org
Date: Tue, 06 Nov 2012 11:49:16 +0000
Local: Tues, Nov 6 2012 6:49 am
Subject: Re: Put incremental code flushing behind a flag. (issue 11367105)
lgtm with nit

https://chromiumcodereview.appspot.com/11367105/diff/1/src/flag-defin...
File src/flag-definitions.h (right):

https://chromiumcodereview.appspot.com/11367105/diff/1/src/flag-defin...
src/flag-definitions.h:398: "flush code that we expect not to use again
incrementally")
... again (full gc).
... again (incrementally).

https://chromiumcodereview.appspot.com/11367105/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mstarzin...@chromium.org  
View profile  
 More options Nov 6 2012, 6:51 am
From: mstarzin...@chromium.org
Date: Tue, 06 Nov 2012 11:51:22 +0000
Local: Tues, Nov 6 2012 6:51 am
Subject: Re: Put incremental code flushing behind a flag. (issue 11367105)
Addressed comments. Landing.

https://chromiumcodereview.appspot.com/11367105/diff/1/src/flag-defin...
File src/flag-definitions.h (right):

https://chromiumcodereview.appspot.com/11367105/diff/1/src/flag-defin...
src/flag-definitions.h:398: "flush code that we expect not to use again
incrementally")
On 2012/11/06 11:49:16, Toon Verwaest wrote:

> ... again (full gc).
> ... again (incrementally).

Done.

https://chromiumcodereview.appspot.com/11367105/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »