Chromium Code Reviews| 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_ |