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

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
Index: runtime/vm/dart_api_impl.cc
===================================================================
--- runtime/vm/dart_api_impl.cc (revision 32362)
+++ 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();
}
@@ -953,7 +957,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);
}
@@ -977,7 +981,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);
}
@@ -1205,6 +1209,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();
@@ -3199,9 +3204,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()) {
@@ -4100,8 +4102,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()) {
@@ -4148,7 +4150,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);
}
@@ -4330,8 +4332,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()) {
@@ -4422,8 +4424,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()) {
@@ -4452,8 +4454,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()) {

Powered by Google App Engine
This is Rietveld 408576698