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

Unified Diff: src/counters.h

Issue 1688783005: Reland of [counters] moving runtime counters to counter.h (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months 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 | « src/builtins.cc ('k') | src/counters.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/counters.h
diff --git a/src/counters.h b/src/counters.h
index 10a845dddce9a775c45feeb19b745b65ca721eed..057c24e3f383ae321f057bb3d6796effe7b9227e 100644
--- a/src/counters.h
+++ b/src/counters.h
@@ -9,8 +9,10 @@
#include "src/allocation.h"
#include "src/base/platform/elapsed-timer.h"
#include "src/base/platform/time.h"
+#include "src/builtins.h"
#include "src/globals.h"
#include "src/objects.h"
+#include "src/runtime/runtime.h"
namespace v8 {
namespace internal {
@@ -699,6 +701,30 @@
/* Total count of functions compiled using the baseline compiler. */ \
SC(total_baseline_compile_count, V8.TotalBaselineCompileCount)
+struct RuntimeCallStats {
+#define CALL_RUNTIME_COUNTER(name, nargs, ressize) \
+ uint32_t Count_Runtime_##name; \
+ base::TimeDelta Time_Runtime_##name;
+ FOR_EACH_INTRINSIC(CALL_RUNTIME_COUNTER)
+#undef CALL_RUNTIME_COUNTER
+#define CALL_BUILTIN_COUNTER(name, type) \
+ uint32_t Count_Builtin_##name; \
+ base::TimeDelta Time_Builtin_##name;
+ BUILTIN_LIST_C(CALL_BUILTIN_COUNTER)
+#undef CALL_BUILTIN_COUNTER
+
+ // Dummy counter for the unexpected stub miss.
+ uint32_t Count_UnexpectedStubMiss;
+ base::TimeDelta Time_UnexpectedStubMiss;
+
+ bool in_runtime_call = false;
+
+ void Reset();
+ void Print(std::ostream& os);
+
+ RuntimeCallStats() { Reset(); }
+};
+
// This file contains all the v8 counters that are in use.
class Counters {
public:
@@ -809,6 +835,7 @@
void ResetCounters();
void ResetHistograms();
+ RuntimeCallStats* runtime_call_stats() { return &runtime_call_stats_; }
private:
#define HR(name, caption, min, max, num_buckets) Histogram name##_;
@@ -870,6 +897,8 @@
CODE_AGE_LIST_COMPLETE(SC)
#undef SC
+ RuntimeCallStats runtime_call_stats_;
+
friend class Isolate;
explicit Counters(Isolate* isolate);
« no previous file with comments | « src/builtins.cc ('k') | src/counters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698