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

Unified Diff: runtime/vm/native_arguments.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/native_arguments.h
===================================================================
--- runtime/vm/native_arguments.h (revision 32362)
+++ runtime/vm/native_arguments.h (working copy)
@@ -221,6 +221,40 @@
RawObject** retval_; // Pointer to the return value area.
};
+class DartToNativeTimerScope : public ValueObject {
turnidge 2014/02/11 21:24:33 Two notes: 1) Did you consider putting all of the
siva 2014/02/19 22:38:30 Created a new file timer_scope.h and moved all the
+ public:
+ explicit DartToNativeTimerScope(Isolate* isolate) {
+ dart_timer_ = &(isolate->timer_list().time_dart_execution());
+ native_timer_ = &(isolate->timer_list().time_native_execution());
+ dart_timer_->Stop();
+ native_timer_->Start();
+ }
+ ~DartToNativeTimerScope() {
+ native_timer_->Stop();
+ dart_timer_->Start();
+ }
+
+ private:
+ Timer* native_timer_;
+ Timer* dart_timer_;
+ DISALLOW_COPY_AND_ASSIGN(DartToNativeTimerScope);
+};
+
+class DartToVmTimerScope : public ValueObject {
+ public:
+ explicit DartToVmTimerScope(Isolate* isolate) {
+ dart_timer_ = &(isolate->timer_list().time_dart_execution());
+ dart_timer_->Stop();
+ }
+ ~DartToVmTimerScope() {
+ dart_timer_->Start();
+ }
+
+ private:
+ Timer* dart_timer_;
+ DISALLOW_COPY_AND_ASSIGN(DartToVmTimerScope);
+};
+
} // namespace dart
#endif // VM_NATIVE_ARGUMENTS_H_

Powered by Google App Engine
This is Rietveld 408576698