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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_NATIVE_ARGUMENTS_H_ 5 #ifndef VM_NATIVE_ARGUMENTS_H_
6 #define VM_NATIVE_ARGUMENTS_H_ 6 #define VM_NATIVE_ARGUMENTS_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/handles_impl.h" 10 #include "vm/handles_impl.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 } 214 }
215 return 0; 215 return 0;
216 } 216 }
217 217
218 Isolate* isolate_; // Current isolate pointer. 218 Isolate* isolate_; // Current isolate pointer.
219 int argc_tag_; // Encodes argument count and invoked native call type. 219 int argc_tag_; // Encodes argument count and invoked native call type.
220 RawObject*(*argv_)[]; // Pointer to an array of arguments to runtime call. 220 RawObject*(*argv_)[]; // Pointer to an array of arguments to runtime call.
221 RawObject** retval_; // Pointer to the return value area. 221 RawObject** retval_; // Pointer to the return value area.
222 }; 222 };
223 223
224 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
225 public:
226 explicit DartToNativeTimerScope(Isolate* isolate) {
227 dart_timer_ = &(isolate->timer_list().time_dart_execution());
228 native_timer_ = &(isolate->timer_list().time_native_execution());
229 dart_timer_->Stop();
230 native_timer_->Start();
231 }
232 ~DartToNativeTimerScope() {
233 native_timer_->Stop();
234 dart_timer_->Start();
235 }
236
237 private:
238 Timer* native_timer_;
239 Timer* dart_timer_;
240 DISALLOW_COPY_AND_ASSIGN(DartToNativeTimerScope);
241 };
242
243 class DartToVmTimerScope : public ValueObject {
244 public:
245 explicit DartToVmTimerScope(Isolate* isolate) {
246 dart_timer_ = &(isolate->timer_list().time_dart_execution());
247 dart_timer_->Stop();
248 }
249 ~DartToVmTimerScope() {
250 dart_timer_->Start();
251 }
252
253 private:
254 Timer* dart_timer_;
255 DISALLOW_COPY_AND_ASSIGN(DartToVmTimerScope);
256 };
257
224 } // namespace dart 258 } // namespace dart
225 259
226 #endif // VM_NATIVE_ARGUMENTS_H_ 260 #endif // VM_NATIVE_ARGUMENTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698