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

Unified Diff: runtime/vm/dart_api_impl.cc

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
« no previous file with comments | « runtime/vm/dart_api_impl.h ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
===================================================================
--- runtime/vm/dart_api_impl.cc (revision 32801)
+++ runtime/vm/dart_api_impl.cc (working copy)
@@ -176,7 +176,7 @@
Dart_Handle Api::NewError(const char* format, ...) {
Isolate* isolate = Isolate::Current();
- DARTSCOPE(isolate);
+ HANDLESCOPE(isolate);
CHECK_CALLBACK_STATE(isolate);
va_list args;
@@ -876,20 +876,23 @@
Isolate* isolate = Dart::CreateIsolate(isolate_name);
free(isolate_name);
{
+ START_TIMER(isolate, time_total_runtime);
StackZone zone(isolate);
HANDLESCOPE(isolate);
const Error& error_obj =
Error::Handle(isolate,
Dart::InitializeIsolate(snapshot, callback_data));
if (error_obj.IsNull()) {
+ START_TIMER(isolate, time_native_execution);
if (FLAG_check_function_fingerprints) {
Library::CheckFunctionFingerprints();
}
- START_TIMER(time_total_runtime);
return reinterpret_cast<Dart_Isolate>(isolate);
}
*error = strdup(error_obj.ToErrorCString());
}
+ STOP_TIMER(isolate, time_native_execution);
+ STOP_TIMER(isolate, time_total_runtime);
Dart::ShutdownIsolate();
return reinterpret_cast<Dart_Isolate>(NULL);
}
@@ -903,7 +906,8 @@
HandleScope handle_scope(isolate);
Dart::RunShutdownCallback();
}
- STOP_TIMER(time_total_runtime);
+ STOP_TIMER(isolate, time_native_execution);
+ STOP_TIMER(isolate, time_total_runtime);
Dart::ShutdownIsolate();
}
@@ -965,7 +969,7 @@
intptr_t* size) {
Isolate* isolate = Isolate::Current();
DARTSCOPE(isolate);
- TIMERSCOPE(time_creating_snapshot);
+ TIMERSCOPE(isolate, time_creating_snapshot);
if (buffer == NULL) {
RETURN_NULL_ERROR(buffer);
}
@@ -989,7 +993,7 @@
intptr_t* size) {
Isolate* isolate = Isolate::Current();
DARTSCOPE(isolate);
- TIMERSCOPE(time_creating_snapshot);
+ TIMERSCOPE(isolate, time_creating_snapshot);
if (buffer == NULL) {
RETURN_NULL_ERROR(buffer);
}
@@ -1219,6 +1223,7 @@
DART_EXPORT void Dart_EnterScope() {
Isolate* isolate = Isolate::Current();
CHECK_ISOLATE(isolate);
+ NativeToVmTimerScope __temp_isolate_timer__(isolate);
ApiState* state = isolate->api_state();
ASSERT(state != NULL);
ApiLocalScope* new_scope = state->reusable_scope();
@@ -3214,9 +3219,6 @@
Isolate* isolate = Isolate::Current();
DARTSCOPE(isolate);
CHECK_CALLBACK_STATE(isolate);
- // TODO(turnidge): This is a bit simplistic. It overcounts when
- // other operations (gc, compilation) are active.
- TIMERSCOPE(time_dart_execution);
const String& function_name = Api::UnwrapStringHandle(isolate, name);
if (function_name.IsNull()) {
@@ -4115,8 +4117,8 @@
Dart_Handle source,
intptr_t line_offset,
intptr_t col_offset) {
- TIMERSCOPE(time_script_loading);
Isolate* isolate = Isolate::Current();
+ TIMERSCOPE(isolate, time_script_loading);
DARTSCOPE(isolate);
const String& url_str = Api::UnwrapStringHandle(isolate, url);
if (url_str.IsNull()) {
@@ -4163,7 +4165,7 @@
intptr_t buffer_len) {
Isolate* isolate = Isolate::Current();
DARTSCOPE(isolate);
- TIMERSCOPE(time_script_loading);
+ TIMERSCOPE(isolate, time_script_loading);
if (buffer == NULL) {
RETURN_NULL_ERROR(buffer);
}
@@ -4345,8 +4347,8 @@
DART_EXPORT Dart_Handle Dart_LoadLibrary(Dart_Handle url,
Dart_Handle source) {
- TIMERSCOPE(time_script_loading);
Isolate* isolate = Isolate::Current();
+ TIMERSCOPE(isolate, time_script_loading);
DARTSCOPE(isolate);
const String& url_str = Api::UnwrapStringHandle(isolate, url);
if (url_str.IsNull()) {
@@ -4437,8 +4439,8 @@
DART_EXPORT Dart_Handle Dart_LoadSource(Dart_Handle library,
Dart_Handle url,
Dart_Handle source) {
- TIMERSCOPE(time_script_loading);
Isolate* isolate = Isolate::Current();
+ TIMERSCOPE(isolate, time_script_loading);
DARTSCOPE(isolate);
const Library& lib = Api::UnwrapLibraryHandle(isolate, library);
if (lib.IsNull()) {
@@ -4467,8 +4469,8 @@
DART_EXPORT Dart_Handle Dart_LibraryLoadPatch(Dart_Handle library,
Dart_Handle url,
Dart_Handle patch_source) {
- TIMERSCOPE(time_script_loading);
Isolate* isolate = Isolate::Current();
+ TIMERSCOPE(isolate, time_script_loading);
DARTSCOPE(isolate);
const Library& lib = Api::UnwrapLibraryHandle(isolate, library);
if (lib.IsNull()) {
« no previous file with comments | « runtime/vm/dart_api_impl.h ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698