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" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "vm/object_store.h" | 21 #include "vm/object_store.h" |
22 #include "vm/parser.h" | 22 #include "vm/parser.h" |
23 #include "vm/port.h" | 23 #include "vm/port.h" |
24 #include "vm/profiler.h" | 24 #include "vm/profiler.h" |
25 #include "vm/reusable_handles.h" | 25 #include "vm/reusable_handles.h" |
26 #include "vm/service.h" | 26 #include "vm/service.h" |
27 #include "vm/simulator.h" | 27 #include "vm/simulator.h" |
28 #include "vm/stack_frame.h" | 28 #include "vm/stack_frame.h" |
29 #include "vm/stub_code.h" | 29 #include "vm/stub_code.h" |
30 #include "vm/symbols.h" | 30 #include "vm/symbols.h" |
| 31 #include "vm/tags.h" |
31 #include "vm/thread.h" | 32 #include "vm/thread.h" |
32 #include "vm/thread_interrupter.h" | 33 #include "vm/thread_interrupter.h" |
33 #include "vm/timer.h" | 34 #include "vm/timer.h" |
34 #include "vm/visitor.h" | 35 #include "vm/visitor.h" |
35 | 36 |
36 | 37 |
37 namespace dart { | 38 namespace dart { |
38 | 39 |
39 DEFINE_FLAG(bool, report_usage_count, false, | 40 DEFINE_FLAG(bool, report_usage_count, false, |
40 "Track function usage and report."); | 41 "Track function usage and report."); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 } | 111 } |
111 | 112 |
112 | 113 |
113 bool IsolateMessageHandler::HandleMessage(Message* message) { | 114 bool IsolateMessageHandler::HandleMessage(Message* message) { |
114 StartIsolateScope start_scope(isolate_); | 115 StartIsolateScope start_scope(isolate_); |
115 StackZone zone(isolate_); | 116 StackZone zone(isolate_); |
116 HandleScope handle_scope(isolate_); | 117 HandleScope handle_scope(isolate_); |
117 // TODO(turnidge): Rework collection total dart execution. This can | 118 // TODO(turnidge): Rework collection total dart execution. This can |
118 // overcount when other things (gc, compilation) are active. | 119 // overcount when other things (gc, compilation) are active. |
119 TIMERSCOPE(isolate_, time_dart_execution); | 120 TIMERSCOPE(isolate_, time_dart_execution); |
| 121 VMTagScope tagScope(isolate_, VMTag::kScriptTagId); |
120 | 122 |
121 // If the message is in band we lookup the receive port to dispatch to. If | 123 // If the message is in band we lookup the receive port to dispatch to. If |
122 // the receive port is closed, we drop the message without deserializing it. | 124 // the receive port is closed, we drop the message without deserializing it. |
123 Object& receive_port = Object::Handle(); | 125 Object& receive_port = Object::Handle(); |
124 if (!message->IsOOB()) { | 126 if (!message->IsOOB()) { |
125 receive_port = DartLibraryCalls::LookupReceivePort(message->dest_port()); | 127 receive_port = DartLibraryCalls::LookupReceivePort(message->dest_port()); |
126 if (receive_port.IsError()) { | 128 if (receive_port.IsError()) { |
127 return ProcessUnhandledException(Object::null_instance(), | 129 return ProcessUnhandledException(Object::null_instance(), |
128 Error::Cast(receive_port)); | 130 Error::Cast(receive_port)); |
129 } | 131 } |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 stacktrace_(NULL), | 331 stacktrace_(NULL), |
330 stack_frame_index_(-1), | 332 stack_frame_index_(-1), |
331 cha_used_(false), | 333 cha_used_(false), |
332 object_id_ring_(NULL), | 334 object_id_ring_(NULL), |
333 profiler_data_(NULL), | 335 profiler_data_(NULL), |
334 thread_state_(NULL), | 336 thread_state_(NULL), |
335 next_(NULL), | 337 next_(NULL), |
336 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS) | 338 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS) |
337 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT) | 339 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT) |
338 reusable_handles_() { | 340 reusable_handles_() { |
| 341 set_vm_tag(VMTag::kVMTagId); |
339 } | 342 } |
340 #undef REUSABLE_HANDLE_SCOPE_INIT | 343 #undef REUSABLE_HANDLE_SCOPE_INIT |
341 #undef REUSABLE_HANDLE_INITIALIZERS | 344 #undef REUSABLE_HANDLE_INITIALIZERS |
342 | 345 |
343 | 346 |
344 Isolate::~Isolate() { | 347 Isolate::~Isolate() { |
345 delete [] name_; | 348 delete [] name_; |
346 delete heap_; | 349 delete heap_; |
347 delete object_store_; | 350 delete object_store_; |
348 delete api_state_; | 351 delete api_state_; |
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1085 return func.raw(); | 1088 return func.raw(); |
1086 } | 1089 } |
1087 | 1090 |
1088 | 1091 |
1089 void IsolateSpawnState::Cleanup() { | 1092 void IsolateSpawnState::Cleanup() { |
1090 SwitchIsolateScope switch_scope(isolate()); | 1093 SwitchIsolateScope switch_scope(isolate()); |
1091 Dart::ShutdownIsolate(); | 1094 Dart::ShutdownIsolate(); |
1092 } | 1095 } |
1093 | 1096 |
1094 } // namespace dart | 1097 } // namespace dart |
OLD | NEW |