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

Unified Diff: runtime/vm/timer.h

Issue 137483010: Add more timing information in the VM to track time spent is dart code Vs native code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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
Index: runtime/vm/timer.h
===================================================================
--- runtime/vm/timer.h (revision 32362)
+++ runtime/vm/timer.h (working copy)
@@ -83,6 +83,7 @@
V(time_compilation, "Function compilation") \
V(time_bootstrap, "Bootstrap of core classes") \
V(time_dart_execution, "Dart execution") \
+ V(time_native_execution, "Native code execution") \
V(time_total_runtime, "Total runtime for isolate") \
// Maintains a list of timers per isolate.
@@ -98,6 +99,7 @@
#undef TIMER_FIELD_ACCESSOR
void ReportTimers();
+ void ReportTimerState(const char* prefix);
void PrintTimersToJSONProperty(JSONObject* jsobj);
@@ -110,12 +112,15 @@
};
// Timer Usage.
-#define START_TIMER(name) \
- Isolate::Current()->timer_list().name().Start();
+#define START_TIMER(isolate, name) \
+ isolate->timer_list().name().Start();
-#define STOP_TIMER(name) \
- Isolate::Current()->timer_list().name().Stop();
+#define STOP_TIMER(isolate, name) \
+ isolate->timer_list().name().Stop();
+#define TIMER_STATE(isolate, prefix) \
+ isolate->timer_list().ReportTimerState(prefix);
+
// The class TimerScope is used to start and stop a timer within a scope.
// It is used as follows:
// {
@@ -127,7 +132,7 @@
// }
class TimerScope : public StackResource {
public:
- TimerScope(bool flag, Timer* timer, BaseIsolate* isolate = NULL)
+ TimerScope(bool flag, Timer* timer, BaseIsolate* isolate)
: StackResource(isolate), flag_(flag), nested_(false), timer_(timer) {
if (flag_) {
if (!timer_->running()) {
@@ -152,9 +157,8 @@
DISALLOW_COPY_AND_ASSIGN(TimerScope);
};
-#define TIMERSCOPE(name) \
- TimerScope vm_internal_timer_(true, \
- &(Isolate::Current()->timer_list().name()))
+#define TIMERSCOPE(isolate, name) \
+ TimerScope vm_internal_timer_(true, &(isolate->timer_list().name()), isolate)
} // namespace dart

Powered by Google App Engine
This is Rietveld 408576698