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

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

Issue 19622003: VM Service isolate listing (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
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 "lib/mirrors.h" 10 #include "lib/mirrors.h"
11 #include "vm/code_observers.h" 11 #include "vm/code_observers.h"
12 #include "vm/compiler_stats.h" 12 #include "vm/compiler_stats.h"
13 #include "vm/dart_api_state.h" 13 #include "vm/dart_api_state.h"
14 #include "vm/dart_entry.h" 14 #include "vm/dart_entry.h"
15 #include "vm/debugger.h" 15 #include "vm/debugger.h"
16 #include "vm/heap.h" 16 #include "vm/heap.h"
17 #include "vm/heap_histogram.h" 17 #include "vm/heap_histogram.h"
18 #include "vm/message_handler.h" 18 #include "vm/message_handler.h"
19 #include "vm/object_store.h" 19 #include "vm/object_store.h"
20 #include "vm/parser.h" 20 #include "vm/parser.h"
21 #include "vm/port.h" 21 #include "vm/port.h"
22 #include "vm/simulator.h" 22 #include "vm/simulator.h"
23 #include "vm/stack_frame.h" 23 #include "vm/stack_frame.h"
24 #include "vm/stub_code.h" 24 #include "vm/stub_code.h"
25 #include "vm/symbols.h" 25 #include "vm/symbols.h"
26 #include "vm/thread.h" 26 #include "vm/thread.h"
27 #include "vm/timer.h" 27 #include "vm/timer.h"
28 #include "vm/visitor.h" 28 #include "vm/visitor.h"
29 #include "vm/object_id_ring.h" 29 #include "vm/object_id_ring.h"
30 #include "vm/service.h"
30 31
31 namespace dart { 32 namespace dart {
32 33
33 DEFINE_FLAG(bool, report_usage_count, false, 34 DEFINE_FLAG(bool, report_usage_count, false,
34 "Track function usage and report."); 35 "Track function usage and report.");
35 DEFINE_FLAG(bool, trace_isolates, false, 36 DEFINE_FLAG(bool, trace_isolates, false,
36 "Trace isolate creation and shut down."); 37 "Trace isolate creation and shut down.");
37 DECLARE_FLAG(bool, trace_deoptimization_verbose); 38 DECLARE_FLAG(bool, trace_deoptimization_verbose);
38 39
39 40
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 // In the case that the message originated locally, which is 130 // In the case that the message originated locally, which is
130 // always true for now, then this should never occur. 131 // always true for now, then this should never occur.
131 UNREACHABLE(); 132 UNREACHABLE();
132 } 133 }
133 134
134 Instance& msg = Instance::Handle(); 135 Instance& msg = Instance::Handle();
135 msg ^= msg_obj.raw(); // Can't use Instance::Cast because may be null. 136 msg ^= msg_obj.raw(); // Can't use Instance::Cast because may be null.
136 137
137 bool success = true; 138 bool success = true;
138 if (message->IsOOB()) { 139 if (message->IsOOB()) {
139 // For now the only OOB messages are Mirrors messages. 140 if (message->IsService()) {
140 HandleMirrorsMessage(isolate_, message->reply_port(), msg); 141 HandleServiceMessage(isolate_, message->reply_port(), msg);
142 } else {
143 ASSERT(message->type() == Message::kNormalType);
144 HandleMirrorsMessage(isolate_, message->reply_port(), msg);
145 }
141 } else { 146 } else {
147 // If it is not an OOB message, it must be a normal message.
148 ASSERT(message->type() == Message::kNormalType);
142 const Object& result = Object::Handle( 149 const Object& result = Object::Handle(
143 DartLibraryCalls::HandleMessage( 150 DartLibraryCalls::HandleMessage(
144 receive_port, message->reply_port(), msg)); 151 receive_port, message->reply_port(), msg));
145 if (result.IsError()) { 152 if (result.IsError()) {
146 success = ProcessUnhandledException(msg, Error::Cast(result)); 153 success = ProcessUnhandledException(msg, Error::Cast(result));
147 } else { 154 } else {
148 ASSERT(result.IsNull()); 155 ASSERT(result.IsNull());
149 } 156 }
150 } 157 }
151 delete message; 158 delete message;
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
1197 return func.raw(); 1204 return func.raw();
1198 } 1205 }
1199 1206
1200 1207
1201 void IsolateSpawnState::Cleanup() { 1208 void IsolateSpawnState::Cleanup() {
1202 SwitchIsolateScope switch_scope(isolate()); 1209 SwitchIsolateScope switch_scope(isolate());
1203 Dart::ShutdownIsolate(); 1210 Dart::ShutdownIsolate();
1204 } 1211 }
1205 1212
1206 } // namespace dart 1213 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698