Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Unified Diff: src/code-stubs.cc

Issue 2503183002: [Tracing] Implement IC statistics in tracing. (Closed)
Patch Set: Address cbruni's comments Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « BUILD.gn ('k') | src/flag-definitions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « BUILD.gn ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698