Commit ff9ceebe authored by ulan@chromium.org's avatar ulan@chromium.org

Add a flag to deoptimize all functions every n garbage collections.

R=mstarzinger@chromium.org

Review URL: https://chromiumcodereview.appspot.com/14091013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14395 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent cd34acda
......@@ -230,6 +230,9 @@ DEFINE_bool(stress_environments, false, "environment for every instruction")
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")
......
......@@ -157,6 +157,7 @@ Heap::Heap()
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 @@ void Heap::GarbageCollectionEpilogue() {
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()));
......
......@@ -2295,6 +2295,11 @@ class Heap {
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment