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()) { |