Chromium Code Reviews| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 #include "vm/visitor.h" | 48 #include "vm/visitor.h" |
| 49 | 49 |
| 50 | 50 |
| 51 namespace dart { | 51 namespace dart { |
| 52 | 52 |
| 53 DECLARE_FLAG(bool, print_metrics); | 53 DECLARE_FLAG(bool, print_metrics); |
| 54 DECLARE_FLAG(bool, timing); | 54 DECLARE_FLAG(bool, timing); |
| 55 DECLARE_FLAG(bool, trace_service); | 55 DECLARE_FLAG(bool, trace_service); |
| 56 DECLARE_FLAG(bool, trace_reload); | 56 DECLARE_FLAG(bool, trace_reload); |
| 57 DECLARE_FLAG(bool, warn_on_pause_with_no_debugger); | 57 DECLARE_FLAG(bool, warn_on_pause_with_no_debugger); |
| 58 DECLARE_FLAG(bool, check_reloaded); | |
| 58 | 59 |
| 59 NOT_IN_PRODUCT( | 60 NOT_IN_PRODUCT( |
| 60 static void CheckedModeHandler(bool value) { | 61 static void CheckedModeHandler(bool value) { |
| 61 FLAG_enable_asserts = value; | 62 FLAG_enable_asserts = value; |
| 62 FLAG_enable_type_checks = value; | 63 FLAG_enable_type_checks = value; |
| 63 } | 64 } |
| 64 | 65 |
| 65 // --enable-checked-mode and --checked both enable checked mode which is | 66 // --enable-checked-mode and --checked both enable checked mode which is |
| 66 // equivalent to setting --enable-asserts and --enable-type-checks. | 67 // equivalent to setting --enable-asserts and --enable-type-checks. |
| 67 DEFINE_FLAG_HANDLER(CheckedModeHandler, | 68 DEFINE_FLAG_HANDLER(CheckedModeHandler, |
| (...skipping 1618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1686 | 1687 |
| 1687 // Wait for background finalization to finish before shutting down. | 1688 // Wait for background finalization to finish before shutting down. |
| 1688 { | 1689 { |
| 1689 MonitorLocker ml(heap_->finalization_tasks_lock()); | 1690 MonitorLocker ml(heap_->finalization_tasks_lock()); |
| 1690 while (heap_->finalization_tasks() > 0) { | 1691 while (heap_->finalization_tasks() > 0) { |
| 1691 ml.Wait(); | 1692 ml.Wait(); |
| 1692 } | 1693 } |
| 1693 } | 1694 } |
| 1694 } | 1695 } |
| 1695 | 1696 |
| 1697 if (FLAG_check_reloaded && | |
| 1698 !ServiceIsolate::IsServiceIsolateDescendant(this)) { | |
| 1699 if (!HasAttemptedReload()) { | |
| 1700 OS::PrintErr("Isolate did not reload before exiting and " | |
|
rmacnak
2016/07/01 20:53:22
FATAL("...")
Cutch
2016/07/01 21:26:40
Done.
| |
| 1701 "--check-reloaded is enabled.\n"); | |
| 1702 UNREACHABLE(); | |
| 1703 } | |
| 1704 } | |
| 1705 | |
| 1696 // Then, proceed with low-level teardown. | 1706 // Then, proceed with low-level teardown. |
| 1697 LowLevelShutdown(); | 1707 LowLevelShutdown(); |
| 1698 | 1708 |
| 1699 #if defined(DEBUG) | 1709 #if defined(DEBUG) |
| 1700 // No concurrent sweeper tasks should be running at this point. | 1710 // No concurrent sweeper tasks should be running at this point. |
| 1701 if (heap_ != NULL) { | 1711 if (heap_ != NULL) { |
| 1702 PageSpace* old_space = heap_->old_space(); | 1712 PageSpace* old_space = heap_->old_space(); |
| 1703 MonitorLocker ml(old_space->tasks_lock()); | 1713 MonitorLocker ml(old_space->tasks_lock()); |
| 1704 ASSERT(old_space->tasks() == 0); | 1714 ASSERT(old_space->tasks() == 0); |
| 1705 } | 1715 } |
| (...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2816 void IsolateSpawnState::DecrementSpawnCount() { | 2826 void IsolateSpawnState::DecrementSpawnCount() { |
| 2817 ASSERT(spawn_count_monitor_ != NULL); | 2827 ASSERT(spawn_count_monitor_ != NULL); |
| 2818 ASSERT(spawn_count_ != NULL); | 2828 ASSERT(spawn_count_ != NULL); |
| 2819 MonitorLocker ml(spawn_count_monitor_); | 2829 MonitorLocker ml(spawn_count_monitor_); |
| 2820 ASSERT(*spawn_count_ > 0); | 2830 ASSERT(*spawn_count_ > 0); |
| 2821 *spawn_count_ = *spawn_count_ - 1; | 2831 *spawn_count_ = *spawn_count_ - 1; |
| 2822 ml.Notify(); | 2832 ml.Notify(); |
| 2823 } | 2833 } |
| 2824 | 2834 |
| 2825 } // namespace dart | 2835 } // namespace dart |
| OLD | NEW |