Index: src/runtime/runtime.h |
diff --git a/src/runtime/runtime.h b/src/runtime/runtime.h |
index b5bcedb83aa118cdc53c0a5e1615741978d48341..668021d876b086a60c7021d5b87bb38bcaa91e15 100644 |
--- a/src/runtime/runtime.h |
+++ b/src/runtime/runtime.h |
@@ -1188,6 +1188,26 @@ |
}; |
+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 |
+ |
+ // 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(); } |
+}; |
+ |
+ |
class RuntimeState { |
public: |
unibrow::Mapping<unibrow::ToUppercase, 128>* to_upper_mapping() { |
@@ -1206,11 +1226,14 @@ |
redirected_intrinsic_functions_.Reset(redirected_intrinsic_functions); |
} |
+ RuntimeCallStats* runtime_call_stats() { return &runtime_call_stats_; } |
+ |
private: |
RuntimeState() {} |
unibrow::Mapping<unibrow::ToUppercase, 128> to_upper_mapping_; |
unibrow::Mapping<unibrow::ToLowercase, 128> to_lower_mapping_; |
+ RuntimeCallStats runtime_call_stats_; |
base::SmartArrayPointer<Runtime::Function> redirected_intrinsic_functions_; |