OLD | NEW |
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_id_ring.h" |
19 #include "vm/object_store.h" | 20 #include "vm/object_store.h" |
20 #include "vm/parser.h" | 21 #include "vm/parser.h" |
21 #include "vm/port.h" | 22 #include "vm/port.h" |
| 23 #include "vm/service.h" |
22 #include "vm/simulator.h" | 24 #include "vm/simulator.h" |
23 #include "vm/stack_frame.h" | 25 #include "vm/stack_frame.h" |
24 #include "vm/stub_code.h" | 26 #include "vm/stub_code.h" |
25 #include "vm/symbols.h" | 27 #include "vm/symbols.h" |
26 #include "vm/thread.h" | 28 #include "vm/thread.h" |
27 #include "vm/timer.h" | 29 #include "vm/timer.h" |
28 #include "vm/visitor.h" | 30 #include "vm/visitor.h" |
29 #include "vm/object_id_ring.h" | 31 |
30 | 32 |
31 namespace dart { | 33 namespace dart { |
32 | 34 |
33 DEFINE_FLAG(bool, report_usage_count, false, | 35 DEFINE_FLAG(bool, report_usage_count, false, |
34 "Track function usage and report."); | 36 "Track function usage and report."); |
35 DEFINE_FLAG(bool, trace_isolates, false, | 37 DEFINE_FLAG(bool, trace_isolates, false, |
36 "Trace isolate creation and shut down."); | 38 "Trace isolate creation and shut down."); |
37 DECLARE_FLAG(bool, trace_deoptimization_verbose); | 39 DECLARE_FLAG(bool, trace_deoptimization_verbose); |
38 | 40 |
39 | 41 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // In the case that the message originated locally, which is | 131 // In the case that the message originated locally, which is |
130 // always true for now, then this should never occur. | 132 // always true for now, then this should never occur. |
131 UNREACHABLE(); | 133 UNREACHABLE(); |
132 } | 134 } |
133 | 135 |
134 Instance& msg = Instance::Handle(); | 136 Instance& msg = Instance::Handle(); |
135 msg ^= msg_obj.raw(); // Can't use Instance::Cast because may be null. | 137 msg ^= msg_obj.raw(); // Can't use Instance::Cast because may be null. |
136 | 138 |
137 bool success = true; | 139 bool success = true; |
138 if (message->IsOOB()) { | 140 if (message->IsOOB()) { |
139 // For now the only OOB messages are Mirrors messages. | 141 Service::HandleServiceMessage(isolate_, message->reply_port(), msg); |
140 HandleMirrorsMessage(isolate_, message->reply_port(), msg); | |
141 } else { | 142 } else { |
142 const Object& result = Object::Handle( | 143 const Object& result = Object::Handle( |
143 DartLibraryCalls::HandleMessage( | 144 DartLibraryCalls::HandleMessage( |
144 receive_port, message->reply_port(), msg)); | 145 receive_port, message->reply_port(), msg)); |
145 if (result.IsError()) { | 146 if (result.IsError()) { |
146 success = ProcessUnhandledException(msg, Error::Cast(result)); | 147 success = ProcessUnhandledException(msg, Error::Cast(result)); |
147 } else { | 148 } else { |
148 ASSERT(result.IsNull()); | 149 ASSERT(result.IsNull()); |
149 } | 150 } |
150 } | 151 } |
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1197 return func.raw(); | 1198 return func.raw(); |
1198 } | 1199 } |
1199 | 1200 |
1200 | 1201 |
1201 void IsolateSpawnState::Cleanup() { | 1202 void IsolateSpawnState::Cleanup() { |
1202 SwitchIsolateScope switch_scope(isolate()); | 1203 SwitchIsolateScope switch_scope(isolate()); |
1203 Dart::ShutdownIsolate(); | 1204 Dart::ShutdownIsolate(); |
1204 } | 1205 } |
1205 | 1206 |
1206 } // namespace dart | 1207 } // namespace dart |
OLD | NEW |