| 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 "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "platform/text_buffer.h" | 10 #include "platform/text_buffer.h" |
| 11 #include "vm/class_finalizer.h" | 11 #include "vm/class_finalizer.h" |
| 12 #include "vm/code_observers.h" | 12 #include "vm/code_observers.h" |
| 13 #include "vm/compiler.h" | 13 #include "vm/compiler.h" |
| 14 #include "vm/compiler_stats.h" | 14 #include "vm/compiler_stats.h" |
| 15 #include "vm/coverage.h" | |
| 16 #include "vm/dart_api_message.h" | 15 #include "vm/dart_api_message.h" |
| 17 #include "vm/dart_api_state.h" | 16 #include "vm/dart_api_state.h" |
| 18 #include "vm/dart_entry.h" | 17 #include "vm/dart_entry.h" |
| 19 #include "vm/debugger.h" | 18 #include "vm/debugger.h" |
| 20 #include "vm/deopt_instructions.h" | 19 #include "vm/deopt_instructions.h" |
| 21 #include "vm/flags.h" | 20 #include "vm/flags.h" |
| 22 #include "vm/heap.h" | 21 #include "vm/heap.h" |
| 23 #include "vm/lockers.h" | 22 #include "vm/lockers.h" |
| 24 #include "vm/log.h" | 23 #include "vm/log.h" |
| 25 #include "vm/message_handler.h" | 24 #include "vm/message_handler.h" |
| (...skipping 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1554 | 1553 |
| 1555 // Don't allow anymore dart code to execution on this isolate. | 1554 // Don't allow anymore dart code to execution on this isolate. |
| 1556 thread->ClearStackLimit(); | 1555 thread->ClearStackLimit(); |
| 1557 | 1556 |
| 1558 // First, perform higher-level cleanup that may need to allocate. | 1557 // First, perform higher-level cleanup that may need to allocate. |
| 1559 { | 1558 { |
| 1560 // Ensure we have a zone and handle scope so that we can call VM functions. | 1559 // Ensure we have a zone and handle scope so that we can call VM functions. |
| 1561 StackZone stack_zone(thread); | 1560 StackZone stack_zone(thread); |
| 1562 HandleScope handle_scope(thread); | 1561 HandleScope handle_scope(thread); |
| 1563 | 1562 |
| 1564 // Write out the coverage data if collection has been enabled. | |
| 1565 if ((this != Dart::vm_isolate()) && | |
| 1566 !ServiceIsolate::IsServiceIsolateDescendant(this)) { | |
| 1567 CodeCoverage::Write(thread); | |
| 1568 } | |
| 1569 | |
| 1570 // Write compiler stats data if enabled. | 1563 // Write compiler stats data if enabled. |
| 1571 if (FLAG_support_compiler_stats && FLAG_compiler_stats | 1564 if (FLAG_support_compiler_stats && FLAG_compiler_stats |
| 1572 && !ServiceIsolate::IsServiceIsolateDescendant(this) | 1565 && !ServiceIsolate::IsServiceIsolateDescendant(this) |
| 1573 && (this != Dart::vm_isolate())) { | 1566 && (this != Dart::vm_isolate())) { |
| 1574 OS::Print("%s", compiler_stats()->PrintToZone()); | 1567 OS::Print("%s", compiler_stats()->PrintToZone()); |
| 1575 } | 1568 } |
| 1576 } | 1569 } |
| 1577 | 1570 |
| 1578 // Remove this isolate from the list *before* we start tearing it down, to | 1571 // Remove this isolate from the list *before* we start tearing it down, to |
| 1579 // avoid exposing it in a state of decay. | 1572 // avoid exposing it in a state of decay. |
| (...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2649 void IsolateSpawnState::DecrementSpawnCount() { | 2642 void IsolateSpawnState::DecrementSpawnCount() { |
| 2650 ASSERT(spawn_count_monitor_ != NULL); | 2643 ASSERT(spawn_count_monitor_ != NULL); |
| 2651 ASSERT(spawn_count_ != NULL); | 2644 ASSERT(spawn_count_ != NULL); |
| 2652 MonitorLocker ml(spawn_count_monitor_); | 2645 MonitorLocker ml(spawn_count_monitor_); |
| 2653 ASSERT(*spawn_count_ > 0); | 2646 ASSERT(*spawn_count_ > 0); |
| 2654 *spawn_count_ = *spawn_count_ - 1; | 2647 *spawn_count_ = *spawn_count_ - 1; |
| 2655 ml.Notify(); | 2648 ml.Notify(); |
| 2656 } | 2649 } |
| 2657 | 2650 |
| 2658 } // namespace dart | 2651 } // namespace dart |
| OLD | NEW |