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 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1410 // Remove this isolate from the list *before* we start tearing it down, to | 1410 // Remove this isolate from the list *before* we start tearing it down, to |
1411 // avoid exposing it in a state of decay. | 1411 // avoid exposing it in a state of decay. |
1412 RemoveIsolateFromList(this); | 1412 RemoveIsolateFromList(this); |
1413 | 1413 |
1414 // Create an area where we do have a zone and a handle scope so that we can | 1414 // Create an area where we do have a zone and a handle scope so that we can |
1415 // call VM functions while tearing this isolate down. | 1415 // call VM functions while tearing this isolate down. |
1416 { | 1416 { |
1417 StackZone stack_zone(this); | 1417 StackZone stack_zone(this); |
1418 HandleScope handle_scope(this); | 1418 HandleScope handle_scope(this); |
1419 | 1419 |
| 1420 if (compiler_stats_ != NULL) { |
| 1421 compiler_stats()->Print(); |
| 1422 } |
| 1423 |
1420 // Notify exit listeners that this isolate is shutting down. | 1424 // Notify exit listeners that this isolate is shutting down. |
1421 if (object_store() != NULL) { | 1425 if (object_store() != NULL) { |
1422 NotifyExitListeners(); | 1426 NotifyExitListeners(); |
1423 } | 1427 } |
1424 | 1428 |
1425 // Clean up debugger resources. | 1429 // Clean up debugger resources. |
1426 debugger()->Shutdown(); | 1430 debugger()->Shutdown(); |
1427 | 1431 |
1428 // Close all the ports owned by this isolate. | 1432 // Close all the ports owned by this isolate. |
1429 PortMap::ClosePorts(message_handler()); | 1433 PortMap::ClosePorts(message_handler()); |
1430 | 1434 |
1431 // Fail fast if anybody tries to post any more messsages to this isolate. | 1435 // Fail fast if anybody tries to post any more messsages to this isolate. |
1432 delete message_handler(); | 1436 delete message_handler(); |
1433 set_message_handler(NULL); | 1437 set_message_handler(NULL); |
1434 | 1438 |
1435 // Dump all accumulated timer data for the isolate. | 1439 // Dump all accumulated timer data for the isolate. |
1436 timer_list_.ReportTimers(); | 1440 timer_list_.ReportTimers(); |
1437 | 1441 |
1438 // Write out the coverage data if collection has been enabled. | 1442 // Write out the coverage data if collection has been enabled. |
1439 CodeCoverage::Write(this); | 1443 CodeCoverage::Write(this); |
1440 | 1444 |
1441 // Finalize any weak persistent handles with a non-null referent. | 1445 // Finalize any weak persistent handles with a non-null referent. |
1442 FinalizeWeakPersistentHandlesVisitor visitor; | 1446 FinalizeWeakPersistentHandlesVisitor visitor; |
1443 api_state()->weak_persistent_handles().VisitHandles(&visitor); | 1447 api_state()->weak_persistent_handles().VisitHandles(&visitor); |
1444 api_state()->prologue_weak_persistent_handles().VisitHandles(&visitor); | 1448 api_state()->prologue_weak_persistent_handles().VisitHandles(&visitor); |
1445 | 1449 |
1446 if (compiler_stats_ != NULL) { | |
1447 compiler_stats()->Print(); | |
1448 } | |
1449 if (FLAG_trace_isolates) { | 1450 if (FLAG_trace_isolates) { |
1450 heap()->PrintSizes(); | 1451 heap()->PrintSizes(); |
1451 megamorphic_cache_table()->PrintSizes(); | 1452 megamorphic_cache_table()->PrintSizes(); |
1452 Symbols::DumpStats(); | 1453 Symbols::DumpStats(); |
1453 OS::Print("[-] Stopping isolate:\n" | 1454 OS::Print("[-] Stopping isolate:\n" |
1454 "\tisolate: %s\n", name()); | 1455 "\tisolate: %s\n", name()); |
1455 } | 1456 } |
1456 } | 1457 } |
1457 | 1458 |
1458 // TODO(5411455): For now just make sure there are no current isolates | 1459 // TODO(5411455): For now just make sure there are no current isolates |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2034 serialized_message_, serialized_message_len_); | 2035 serialized_message_, serialized_message_len_); |
2035 } | 2036 } |
2036 | 2037 |
2037 | 2038 |
2038 void IsolateSpawnState::Cleanup() { | 2039 void IsolateSpawnState::Cleanup() { |
2039 SwitchIsolateScope switch_scope(I); | 2040 SwitchIsolateScope switch_scope(I); |
2040 Dart::ShutdownIsolate(); | 2041 Dart::ShutdownIsolate(); |
2041 } | 2042 } |
2042 | 2043 |
2043 } // namespace dart | 2044 } // namespace dart |
OLD | NEW |