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) \