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

Unified Diff: src/code-stubs.cc

Issue 2503183002: [Tracing] Implement IC statistics in tracing. (Closed)
Patch Set: Remove unnecessary cast 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..3070dac9dd1f95bf7c9a85fb5f41d9a95b3f8d64 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,7 +2292,19 @@ 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;
+ 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();
+ return;
+ }
OFStream os(stdout);
os << "[";
PrintBaseName(os);
« 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