Reviewers: rossberg,

Message:
PTAL.

Description:
Add counters for requested/inserted/executed soft deopts

Please review this at https://codereview.chromium.org/17498003/

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

Affected files:
  M src/deoptimizer.cc
  M src/hydrogen.cc
  M src/v8-counters.h


Index: src/deoptimizer.cc
diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc
index be0ea98b52e5a554c40445bc85c4ae35fc743aa6..e4475538e18e4b052b5559d28fd225652aeb03cd 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();
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 9d4fe2e50529e779b45cde69b4c3140274d8a3a5..82c88c7c1d016464957a409fd3743adeff23fb91 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -4660,9 +4660,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);
 }
Index: src/v8-counters.h
diff --git a/src/v8-counters.h b/src/v8-counters.h
index 30f5b34d10d9930930e7d5a693381c9fb0b869da..dfe1e20c3297a3fd26f67b5ad3871340537cce8e 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)                \


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