From 0e54a418dbbfbeead510e9de90c1db6bf9bc9088 Mon Sep 17 00:00:00 2001 From: "jkummerow@chromium.org" Date: Thu, 20 Jun 2013 16:53:22 +0000 Subject: [PATCH] Add counters for requested/inserted/executed soft deopts R=rossberg@chromium.org Review URL: https://codereview.chromium.org/17498003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15253 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/deoptimizer.cc | 1 + src/hydrogen.cc | 2 ++ src/v8-counters.h | 3 +++ 3 files changed, 6 insertions(+) diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc index 8316576286..eec86978ce 100644 --- a/src/deoptimizer.cc +++ b/src/deoptimizer.cc @@ -547,6 +547,7 @@ Deoptimizer::Deoptimizer(Isolate* isolate, if (function != NULL && function->IsOptimized()) { function->shared()->increment_deopt_count(); if (bailout_type_ == Deoptimizer::SOFT) { + isolate->counters()->soft_deopts_executed()->Increment(); // Soft deopts shouldn't count against the overall re-optimization count // that can eventually lead to disabling optimization for a function. int opt_count = function->shared()->opt_count(); diff --git a/src/hydrogen.cc b/src/hydrogen.cc index a0133e41c4..1e261ef44e 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -4664,9 +4664,11 @@ void HOptimizedGraphBuilder::PushAndAdd(HInstruction* instr) { void HOptimizedGraphBuilder::AddSoftDeoptimize() { + isolate()->counters()->soft_deopts_requested()->Increment(); if (FLAG_always_opt) return; if (current_block()->IsDeoptimizing()) return; AddInstruction(new(zone()) HSoftDeoptimize()); + isolate()->counters()->soft_deopts_inserted()->Increment(); current_block()->MarkAsDeoptimizing(); graph()->set_has_soft_deoptimize(true); } diff --git a/src/v8-counters.h b/src/v8-counters.h index 30f5b34d10..dfe1e20c32 100644 --- a/src/v8-counters.h +++ b/src/v8-counters.h @@ -238,6 +238,9 @@ namespace internal { SC(transcendental_cache_miss, V8.TranscendentalCacheMiss) \ SC(stack_interrupts, V8.StackInterrupts) \ SC(runtime_profiler_ticks, V8.RuntimeProfilerTicks) \ + SC(soft_deopts_requested, V8.SoftDeoptsRequested) \ + SC(soft_deopts_inserted, V8.SoftDeoptsInserted) \ + SC(soft_deopts_executed, V8.SoftDeoptsExecuted) \ SC(new_space_bytes_available, V8.MemoryNewSpaceBytesAvailable) \ SC(new_space_bytes_committed, V8.MemoryNewSpaceBytesCommitted) \ SC(new_space_bytes_used, V8.MemoryNewSpaceBytesUsed) \