| 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" |
| (...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1517 #define ISOLATE_METRIC_PRINT(type, variable, name, unit) \ | 1517 #define ISOLATE_METRIC_PRINT(type, variable, name, unit) \ |
| 1518 THR_Print("%s\n", metric_##variable##_.ToString()); | 1518 THR_Print("%s\n", metric_##variable##_.ToString()); |
| 1519 | 1519 |
| 1520 ISOLATE_METRIC_LIST(ISOLATE_METRIC_PRINT); | 1520 ISOLATE_METRIC_LIST(ISOLATE_METRIC_PRINT); |
| 1521 #undef ISOLATE_METRIC_PRINT | 1521 #undef ISOLATE_METRIC_PRINT |
| 1522 THR_Print("\n"); | 1522 THR_Print("\n"); |
| 1523 } | 1523 } |
| 1524 } | 1524 } |
| 1525 | 1525 |
| 1526 | 1526 |
| 1527 void Isolate::StopBackgroundCompiler() { |
| 1528 // Wait until all background compilation has finished. |
| 1529 if (background_compiler_ != NULL) { |
| 1530 BackgroundCompiler::Stop(background_compiler_); |
| 1531 } |
| 1532 } |
| 1533 |
| 1534 |
| 1527 void Isolate::Shutdown() { | 1535 void Isolate::Shutdown() { |
| 1528 ASSERT(this == Isolate::Current()); | 1536 ASSERT(this == Isolate::Current()); |
| 1529 // Wait until all background compilation has finished. | 1537 StopBackgroundCompiler(); |
| 1530 if (background_compiler_ != NULL) { | |
| 1531 BackgroundCompiler::Stop(background_compiler_); | |
| 1532 } | |
| 1533 | 1538 |
| 1534 #if defined(DEBUG) | 1539 #if defined(DEBUG) |
| 1535 if (heap_ != NULL) { | 1540 if (heap_ != NULL) { |
| 1536 // The VM isolate keeps all objects marked. | 1541 // The VM isolate keeps all objects marked. |
| 1537 heap_->Verify(this == Dart::vm_isolate() ? kRequireMarked : kForbidMarked); | 1542 heap_->Verify(this == Dart::vm_isolate() ? kRequireMarked : kForbidMarked); |
| 1538 } | 1543 } |
| 1539 #endif // DEBUG | 1544 #endif // DEBUG |
| 1540 | 1545 |
| 1541 Thread* thread = Thread::Current(); | 1546 Thread* thread = Thread::Current(); |
| 1542 | 1547 |
| (...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2637 void IsolateSpawnState::DecrementSpawnCount() { | 2642 void IsolateSpawnState::DecrementSpawnCount() { |
| 2638 ASSERT(spawn_count_monitor_ != NULL); | 2643 ASSERT(spawn_count_monitor_ != NULL); |
| 2639 ASSERT(spawn_count_ != NULL); | 2644 ASSERT(spawn_count_ != NULL); |
| 2640 MonitorLocker ml(spawn_count_monitor_); | 2645 MonitorLocker ml(spawn_count_monitor_); |
| 2641 ASSERT(*spawn_count_ > 0); | 2646 ASSERT(*spawn_count_ > 0); |
| 2642 *spawn_count_ = *spawn_count_ - 1; | 2647 *spawn_count_ = *spawn_count_ - 1; |
| 2643 ml.Notify(); | 2648 ml.Notify(); |
| 2644 } | 2649 } |
| 2645 | 2650 |
| 2646 } // namespace dart | 2651 } // namespace dart |
| OLD | NEW |