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

Side by Side Diff: runtime/vm/isolate.cc

Issue 1293383011: Add an IsolateRunnable event to the service protocol. Improve service docs. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 #include "vm/isolate.h" 5 #include "vm/isolate.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "platform/json.h" 9 #include "platform/json.h"
10 #include "vm/code_observers.h" 10 #include "vm/code_observers.h"
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 ASSERT(this == state->isolate()); 1008 ASSERT(this == state->isolate());
1009 Run(); 1009 Run();
1010 } 1010 }
1011 TimelineStream* stream = GetIsolateStream(); 1011 TimelineStream* stream = GetIsolateStream();
1012 ASSERT(stream != NULL); 1012 ASSERT(stream != NULL);
1013 TimelineEvent* event = stream->StartEvent(); 1013 TimelineEvent* event = stream->StartEvent();
1014 if (event != NULL) { 1014 if (event != NULL) {
1015 event->Instant("Runnable"); 1015 event->Instant("Runnable");
1016 event->Complete(); 1016 event->Complete();
1017 } 1017 }
1018 if (Service::isolate_stream.enabled()) {
1019 ServiceEvent runnableEvent(this, ServiceEvent::kIsolateRunnable);
1020 Service::HandleEvent(&runnableEvent);
1021 }
1018 return true; 1022 return true;
1019 } 1023 }
1020 1024
1021 1025
1022 bool Isolate::VerifyPauseCapability(const Object& capability) const { 1026 bool Isolate::VerifyPauseCapability(const Object& capability) const {
1023 return !capability.IsNull() && 1027 return !capability.IsNull() &&
1024 capability.IsCapability() && 1028 capability.IsCapability() &&
1025 (pause_capability() == Capability::Cast(capability).Id()); 1029 (pause_capability() == Capability::Cast(capability).Id());
1026 } 1030 }
1027 1031
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
1697 // TODO(turnidge): Don't compute a full stack trace. 1701 // TODO(turnidge): Don't compute a full stack trace.
1698 DebuggerStackTrace* stack = debugger()->StackTrace(); 1702 DebuggerStackTrace* stack = debugger()->StackTrace();
1699 if (stack->Length() > 0) { 1703 if (stack->Length() > 0) {
1700 pause_event.set_top_frame(stack->FrameAt(0)); 1704 pause_event.set_top_frame(stack->FrameAt(0));
1701 } 1705 }
1702 jsobj.AddProperty("pauseEvent", &pause_event); 1706 jsobj.AddProperty("pauseEvent", &pause_event);
1703 } 1707 }
1704 1708
1705 const Library& lib = 1709 const Library& lib =
1706 Library::Handle(object_store()->root_library()); 1710 Library::Handle(object_store()->root_library());
1707 jsobj.AddProperty("rootLib", lib); 1711 if (!lib.IsNull()) {
1712 jsobj.AddProperty("rootLib", lib);
1713 }
1708 1714
1709 timer_list().PrintTimersToJSONProperty(&jsobj); 1715 timer_list().PrintTimersToJSONProperty(&jsobj);
1710 { 1716 {
1711 JSONObject tagCounters(&jsobj, "_tagCounters"); 1717 JSONObject tagCounters(&jsobj, "_tagCounters");
1712 vm_tag_counters()->PrintToJSONObject(&tagCounters); 1718 vm_tag_counters()->PrintToJSONObject(&tagCounters);
1713 } 1719 }
1714 if (object_store()->sticky_error() != Object::null()) { 1720 if (object_store()->sticky_error() != Object::null()) {
1715 Error& error = Error::Handle(this, object_store()->sticky_error()); 1721 Error& error = Error::Handle(this, object_store()->sticky_error());
1716 ASSERT(!error.IsNull()); 1722 ASSERT(!error.IsNull());
1717 jsobj.AddProperty("error", error, false); 1723 jsobj.AddProperty("error", error, false);
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
2146 serialized_message_, serialized_message_len_); 2152 serialized_message_, serialized_message_len_);
2147 } 2153 }
2148 2154
2149 2155
2150 void IsolateSpawnState::Cleanup() { 2156 void IsolateSpawnState::Cleanup() {
2151 SwitchIsolateScope switch_scope(I); 2157 SwitchIsolateScope switch_scope(I);
2152 Dart::ShutdownIsolate(); 2158 Dart::ShutdownIsolate();
2153 } 2159 }
2154 2160
2155 } // namespace dart 2161 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/observatory/tests/service/isolate_lifecycle_test.dart ('k') | runtime/vm/service/service.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698