Revision: 14395
Author:   [email protected]
Date:     Tue Apr 23 08:21:11 2013
Log: Add a flag to deoptimize all functions every n garbage collections.

[email protected]

Review URL: https://chromiumcodereview.appspot.com/14091013
http://code.google.com/p/v8/source/detail?r=14395

Modified:
 /branches/bleeding_edge/src/flag-definitions.h
 /branches/bleeding_edge/src/heap.cc
 /branches/bleeding_edge/src/heap.h

=======================================
--- /branches/bleeding_edge/src/flag-definitions.h      Tue Apr 16 07:39:48 2013
+++ /branches/bleeding_edge/src/flag-definitions.h      Tue Apr 23 08:21:11 2013
@@ -230,6 +230,9 @@
 DEFINE_int(deopt_every_n_times,
            0,
            "deoptimize every n times a deopt point is passed")
+DEFINE_int(deopt_every_n_garbage_collections,
+           0,
+           "deoptimize every n garbage collections")
 DEFINE_bool(trap_on_deopt, false, "put a break point before deoptimizing")
 DEFINE_bool(deoptimize_uncommon_cases, true, "deoptimize uncommon cases")
 DEFINE_bool(polymorphic_inlining, true, "polymorphic inlining")
=======================================
--- /branches/bleeding_edge/src/heap.cc Fri Apr 19 06:26:47 2013
+++ /branches/bleeding_edge/src/heap.cc Tue Apr 23 08:21:11 2013
@@ -157,6 +157,7 @@
       ms_count_at_last_idle_notification_(0),
       gc_count_at_last_idle_gc_(0),
       scavenges_since_last_idle_round_(kIdleScavengeThreshold),
+      gcs_since_last_deopt_(0),
 #ifdef VERIFY_HEAP
       no_weak_embedded_maps_verification_scope_depth_(0),
 #endif
@@ -487,6 +488,12 @@
   if (FLAG_gc_verbose) Print();
   if (FLAG_code_stats) ReportCodeStatistics("After GC");
 #endif
+  if (FLAG_deopt_every_n_garbage_collections > 0) {
+ if (++gcs_since_last_deopt_ == FLAG_deopt_every_n_garbage_collections) {
+      Deoptimizer::DeoptimizeAll(isolate());
+      gcs_since_last_deopt_ = 0;
+    }
+  }

   isolate_->counters()->alive_after_last_gc()->Set(
       static_cast<int>(SizeOfObjects()));
=======================================
--- /branches/bleeding_edge/src/heap.h  Fri Apr 19 06:26:47 2013
+++ /branches/bleeding_edge/src/heap.h  Tue Apr 23 08:21:11 2013
@@ -2295,6 +2295,11 @@
   unsigned int gc_count_at_last_idle_gc_;
   int scavenges_since_last_idle_round_;

+ // If the --deopt_every_n_garbage_collections flag is set to a positive value,
+  // this variable holds the number of garbage collections since the last
+  // deoptimization triggered by garbage collection.
+  int gcs_since_last_deopt_;
+
 #ifdef VERIFY_HEAP
   int no_weak_embedded_maps_verification_scope_depth_;
 #endif

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to