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

Unified Diff: runtime/vm/isolate.cc

Issue 206213004: Add a VM page to the observatory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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/isolate.h ('k') | runtime/vm/json_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index 44f53c74411c7a64ac657123df3d95bc71d0267b..4344992c88b6a3705395f8d1f62d95346c60a0af 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -860,14 +860,28 @@ void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor,
}
-void Isolate::PrintToJSONStream(JSONStream* stream) {
+void Isolate::PrintToJSONStream(JSONStream* stream, bool ref) {
JSONObject jsobj(stream);
- jsobj.AddProperty("type", "Isolate");
+ jsobj.AddProperty("type", (ref ? "@Isolate" : "Isolate"));
jsobj.AddPropertyF("id", "isolates/%" Pd "",
static_cast<intptr_t>(main_port()));
- jsobj.AddPropertyF("name", "%" Pd "",
+ jsobj.AddPropertyF("mainPort", "%" Pd "",
static_cast<intptr_t>(main_port()));
+
+ // Assign an isolate name based on the entry function.
IsolateSpawnState* state = spawn_state();
+ if (state == NULL) {
+ jsobj.AddPropertyF("name", "root");
+ } else if (state->class_name() != NULL) {
+ jsobj.AddPropertyF("name", "%s.%s",
+ state->class_name(),
+ state->function_name());
+ } else {
+ jsobj.AddPropertyF("name", "%s", state->function_name());
+ }
+ if (ref) {
+ return;
+ }
if (state != NULL) {
const Object& entry = Object::Handle(this, state->ResolveFunction());
if (!entry.IsNull() && entry.IsFunction()) {
@@ -899,11 +913,11 @@ void Isolate::PrintToJSONStream(JSONStream* stream) {
bool paused_on_exit = message_handler()->paused_on_exit();
bool pause_on_start = message_handler()->pause_on_start();
bool pause_on_exit = message_handler()->pause_on_exit();
- jsobj.AddProperty("live_ports", live_ports);
- jsobj.AddProperty("control_ports", control_ports);
- jsobj.AddProperty("paused_on_exit", paused_on_exit);
- jsobj.AddProperty("paused_on_start", pause_on_start);
- jsobj.AddProperty("pause_on_exit", pause_on_exit);
+ jsobj.AddProperty("livePorts", live_ports);
+ jsobj.AddProperty("controlPorts", control_ports);
+ jsobj.AddProperty("pausedOnStart", pause_on_start);
+ jsobj.AddProperty("pausedOnExit", paused_on_exit);
+ jsobj.AddProperty("pauseOnExit", pause_on_exit);
const Library& lib =
Library::Handle(object_store()->root_library());
jsobj.AddProperty("rootLib", lib);
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/json_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698