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 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 } | 1095 } |
1096 | 1096 |
1097 | 1097 |
1098 bool Isolate::ReloadSources(JSONStream* js, | 1098 bool Isolate::ReloadSources(JSONStream* js, |
1099 bool force_reload, | 1099 bool force_reload, |
1100 bool dont_delete_reload_context) { | 1100 bool dont_delete_reload_context) { |
1101 // TODO(asiva): Add verification of canonical objects. | 1101 // TODO(asiva): Add verification of canonical objects. |
1102 ASSERT(!IsReloading()); | 1102 ASSERT(!IsReloading()); |
1103 has_attempted_reload_ = true; | 1103 has_attempted_reload_ = true; |
1104 reload_context_ = new IsolateReloadContext(this, js); | 1104 reload_context_ = new IsolateReloadContext(this, js); |
1105 reload_context_->StartReload(force_reload); | 1105 reload_context_->Reload(force_reload); |
1106 bool success = !reload_context_->has_error(); | 1106 bool success = !reload_context_->reload_aborted(); |
1107 // TODO(asiva): Add verification of canonical objects. | 1107 // TODO(asiva): Add verification of canonical objects. |
1108 if (dont_delete_reload_context) { | 1108 if (dont_delete_reload_context) { |
1109 // Unit tests use the reload context later. Caller is responsible | 1109 // Unit tests use the reload context later. Caller is responsible |
1110 // for deleting the context. | 1110 // for deleting the context. |
1111 return success; | 1111 return success; |
1112 } | 1112 } |
1113 DeleteReloadContext(); | 1113 DeleteReloadContext(); |
1114 return success; | 1114 return success; |
1115 } | 1115 } |
1116 | 1116 |
1117 | 1117 |
1118 void Isolate::DeleteReloadContext() { | 1118 void Isolate::DeleteReloadContext() { |
1119 delete reload_context_; | 1119 delete reload_context_; |
1120 reload_context_ = NULL; | 1120 reload_context_ = NULL; |
1121 } | 1121 } |
1122 #endif // !PRODUCT | 1122 #endif // !PRODUCT |
1123 | 1123 |
1124 | 1124 |
1125 void Isolate::DoneFinalizing() { | 1125 void Isolate::DoneFinalizing() { |
1126 NOT_IN_PRODUCT( | 1126 NOT_IN_PRODUCT( |
1127 if (IsReloading()) { | 1127 if (IsReloading()) { |
1128 reload_context_->FinishReload(); | 1128 reload_context_->FinalizeLoading(); |
1129 } | 1129 } |
1130 ) | 1130 ) |
1131 } | 1131 } |
1132 | 1132 |
1133 | 1133 |
1134 | 1134 |
1135 bool Isolate::MakeRunnable() { | 1135 bool Isolate::MakeRunnable() { |
1136 ASSERT(Isolate::Current() == NULL); | 1136 ASSERT(Isolate::Current() == NULL); |
1137 | 1137 |
1138 MutexLocker ml(mutex_); | 1138 MutexLocker ml(mutex_); |
(...skipping 1753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2892 void IsolateSpawnState::DecrementSpawnCount() { | 2892 void IsolateSpawnState::DecrementSpawnCount() { |
2893 ASSERT(spawn_count_monitor_ != NULL); | 2893 ASSERT(spawn_count_monitor_ != NULL); |
2894 ASSERT(spawn_count_ != NULL); | 2894 ASSERT(spawn_count_ != NULL); |
2895 MonitorLocker ml(spawn_count_monitor_); | 2895 MonitorLocker ml(spawn_count_monitor_); |
2896 ASSERT(*spawn_count_ > 0); | 2896 ASSERT(*spawn_count_ > 0); |
2897 *spawn_count_ = *spawn_count_ - 1; | 2897 *spawn_count_ = *spawn_count_ - 1; |
2898 ml.Notify(); | 2898 ml.Notify(); |
2899 } | 2899 } |
2900 | 2900 |
2901 } // namespace dart | 2901 } // namespace dart |
OLD | NEW |