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 "vm/code_observers.h" | 10 #include "vm/code_observers.h" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 } | 265 } |
266 Dart_MessageNotifyCallback callback = I->message_notify_callback(); | 266 Dart_MessageNotifyCallback callback = I->message_notify_callback(); |
267 if (callback) { | 267 if (callback) { |
268 // Allow the embedder to handle message notification. | 268 // Allow the embedder to handle message notification. |
269 (*callback)(Api::CastIsolate(I)); | 269 (*callback)(Api::CastIsolate(I)); |
270 } | 270 } |
271 } | 271 } |
272 | 272 |
273 | 273 |
274 bool IsolateMessageHandler::HandleMessage(Message* message) { | 274 bool IsolateMessageHandler::HandleMessage(Message* message) { |
275 StartIsolateScope start_scope(I); | |
276 StackZone zone(I); | 275 StackZone zone(I); |
277 HandleScope handle_scope(I); | 276 HandleScope handle_scope(I); |
278 // TODO(turnidge): Rework collection total dart execution. This can | 277 // TODO(turnidge): Rework collection total dart execution. This can |
279 // overcount when other things (gc, compilation) are active. | 278 // overcount when other things (gc, compilation) are active. |
280 TIMERSCOPE(isolate_, time_dart_execution); | 279 TIMERSCOPE(isolate_, time_dart_execution); |
281 | 280 |
282 // If the message is in band we lookup the handler to dispatch to. If the | 281 // If the message is in band we lookup the handler to dispatch to. If the |
283 // receive port was closed, we drop the message without deserializing it. | 282 // receive port was closed, we drop the message without deserializing it. |
284 // Illegal port is a special case for artificially enqueued isolate library | 283 // Illegal port is a special case for artificially enqueued isolate library |
285 // messages which are handled in C++ code below. | 284 // messages which are handled in C++ code below. |
(...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1631 serialized_message_, serialized_message_len_); | 1630 serialized_message_, serialized_message_len_); |
1632 } | 1631 } |
1633 | 1632 |
1634 | 1633 |
1635 void IsolateSpawnState::Cleanup() { | 1634 void IsolateSpawnState::Cleanup() { |
1636 SwitchIsolateScope switch_scope(I); | 1635 SwitchIsolateScope switch_scope(I); |
1637 Dart::ShutdownIsolate(); | 1636 Dart::ShutdownIsolate(); |
1638 } | 1637 } |
1639 | 1638 |
1640 } // namespace dart | 1639 } // namespace dart |
OLD | NEW |