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 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 | 1083 |
1084 | 1084 |
1085 #ifndef PRODUCT | 1085 #ifndef PRODUCT |
1086 void Isolate::ReportReloadError(const Error& error) { | 1086 void Isolate::ReportReloadError(const Error& error) { |
1087 ASSERT(IsReloading()); | 1087 ASSERT(IsReloading()); |
1088 reload_context_->AbortReload(error); | 1088 reload_context_->AbortReload(error); |
1089 } | 1089 } |
1090 | 1090 |
1091 | 1091 |
1092 void Isolate::ReloadSources(bool dont_delete_reload_context) { | 1092 void Isolate::ReloadSources(bool dont_delete_reload_context) { |
1093 // TODO(asiva): Add verification of canonical objects. | |
1094 ASSERT(!IsReloading()); | 1093 ASSERT(!IsReloading()); |
1095 has_attempted_reload_ = true; | 1094 has_attempted_reload_ = true; |
1096 reload_context_ = new IsolateReloadContext(this); | 1095 reload_context_ = new IsolateReloadContext(this); |
1097 reload_context_->StartReload(); | 1096 reload_context_->StartReload(); |
1098 // TODO(asiva): Add verification of canonical objects. | |
1099 if (dont_delete_reload_context) { | 1097 if (dont_delete_reload_context) { |
1100 // Unit tests use the reload context later. Caller is responsible | 1098 // Unit tests use the reload context later. Caller is responsible |
1101 // for deleting the context. | 1099 // for deleting the context. |
1102 return; | 1100 return; |
1103 } | 1101 } |
1104 DeleteReloadContext(); | 1102 DeleteReloadContext(); |
| 1103 #if defined(DEBUG) |
| 1104 { |
| 1105 Thread* thread = Thread::Current(); |
| 1106 Isolate* isolate = thread->isolate(); |
| 1107 isolate->heap()->CollectAllGarbage(); |
| 1108 VerifyCanonicalVisitor check_canonical(thread); |
| 1109 isolate->heap()->IterateObjects(&check_canonical); |
| 1110 } |
| 1111 #endif // DEBUG |
1105 } | 1112 } |
1106 | 1113 |
1107 | 1114 |
1108 void Isolate::DeleteReloadContext() { | 1115 void Isolate::DeleteReloadContext() { |
1109 delete reload_context_; | 1116 delete reload_context_; |
1110 reload_context_ = NULL; | 1117 reload_context_ = NULL; |
1111 } | 1118 } |
1112 #endif // !PRODUCT | 1119 #endif // !PRODUCT |
1113 | 1120 |
1114 | 1121 |
(...skipping 1776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2891 void IsolateSpawnState::DecrementSpawnCount() { | 2898 void IsolateSpawnState::DecrementSpawnCount() { |
2892 ASSERT(spawn_count_monitor_ != NULL); | 2899 ASSERT(spawn_count_monitor_ != NULL); |
2893 ASSERT(spawn_count_ != NULL); | 2900 ASSERT(spawn_count_ != NULL); |
2894 MonitorLocker ml(spawn_count_monitor_); | 2901 MonitorLocker ml(spawn_count_monitor_); |
2895 ASSERT(*spawn_count_ > 0); | 2902 ASSERT(*spawn_count_ > 0); |
2896 *spawn_count_ = *spawn_count_ - 1; | 2903 *spawn_count_ = *spawn_count_ - 1; |
2897 ml.Notify(); | 2904 ml.Notify(); |
2898 } | 2905 } |
2899 | 2906 |
2900 } // namespace dart | 2907 } // namespace dart |
OLD | NEW |