Chromium Code Reviews| Index: src/code-stubs.cc |
| diff --git a/src/code-stubs.cc b/src/code-stubs.cc |
| index f0f38ebe9376962df326dab42cc1abff0f67958a..52ca32f6a6bd83fc2f29abdc60ce5d3753487224 100644 |
| --- a/src/code-stubs.cc |
| +++ b/src/code-stubs.cc |
| @@ -14,8 +14,10 @@ |
| #include "src/gdb-jit.h" |
| #include "src/ic/accessor-assembler.h" |
| #include "src/ic/handler-compiler.h" |
| +#include "src/ic/ic-stats.h" |
| #include "src/ic/ic.h" |
| #include "src/macro-assembler.h" |
| +#include "src/tracing/tracing-category-observer.h" |
| namespace v8 { |
| namespace internal { |
| @@ -2290,11 +2292,23 @@ void HydrogenCodeStub::TraceTransition(StateType from, StateType to) { |
| // Note: Although a no-op transition is semantically OK, it is hinting at a |
| // bug somewhere in our state transition machinery. |
| DCHECK(from != to); |
| - if (!FLAG_trace_ic) return; |
| - OFStream os(stdout); |
| - os << "["; |
| - PrintBaseName(os); |
| - os << ": " << from << "=>" << to << "]" << std::endl; |
| + if (V8_LIKELY(!FLAG_ic_stats)) return; |
| + if (FLAG_ic_stats & |
| + v8::tracing::TracingCategoryObserver::ENABLED_BY_TRACING) { |
| + auto ic_stats = ICStats::instance(); |
| + ic_stats->Begin(); |
| + ICInfo& ic_info = ic_stats->Current(); |
| + ic_info.type = MajorName(MajorKey()); |
| + ic_info.state = ToString(from); |
| + ic_info.state += "=>"; |
| + ic_info.state += ToString(to); |
| + ic_stats->End(); |
| + } else if (FLAG_ic_stats) { |
|
Camillo Bruni
2016/12/05 20:13:50
nit: drop this check as you the early return above
lpy
2016/12/05 22:38:11
Done.
|
| + OFStream os(stdout); |
| + os << "["; |
| + PrintBaseName(os); |
| + os << ": " << from << "=>" << to << "]" << std::endl; |
| + } |
| } |
| void CallICStub::PrintState(std::ostream& os) const { // NOLINT |