| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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_reload.h" | 5 #include "vm/isolate_reload.h" |
| 6 | 6 |
| 7 #include "vm/become.h" | 7 #include "vm/become.h" |
| 8 #include "vm/code_generator.h" | 8 #include "vm/code_generator.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/dart_api_impl.h" | 10 #include "vm/dart_api_impl.h" |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 } | 226 } |
| 227 | 227 |
| 228 | 228 |
| 229 void IsolateReloadContext::ReportSuccess() { | 229 void IsolateReloadContext::ReportSuccess() { |
| 230 ServiceEvent service_event(Isolate::Current(), ServiceEvent::kIsolateReload); | 230 ServiceEvent service_event(Isolate::Current(), ServiceEvent::kIsolateReload); |
| 231 Service::HandleEvent(&service_event); | 231 Service::HandleEvent(&service_event); |
| 232 } | 232 } |
| 233 | 233 |
| 234 | 234 |
| 235 void IsolateReloadContext::StartReload() { | 235 void IsolateReloadContext::StartReload() { |
| 236 TIMELINE_SCOPE(Reload); |
| 236 Thread* thread = Thread::Current(); | 237 Thread* thread = Thread::Current(); |
| 237 | 238 |
| 238 // Grab root library before calling CheckpointBeforeReload. | 239 // Grab root library before calling CheckpointBeforeReload. |
| 239 const Library& root_lib = Library::Handle(object_store()->root_library()); | 240 const Library& root_lib = Library::Handle(object_store()->root_library()); |
| 240 ASSERT(!root_lib.IsNull()); | 241 ASSERT(!root_lib.IsNull()); |
| 241 const String& root_lib_url = String::Handle(root_lib.url()); | 242 const String& root_lib_url = String::Handle(root_lib.url()); |
| 242 | 243 |
| 243 // Disable the background compiler while we are performing the reload. | 244 // Disable the background compiler while we are performing the reload. |
| 244 BackgroundCompiler::Disable(); | 245 BackgroundCompiler::Disable(); |
| 245 | 246 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 if (frame->IsDartFrame()) { | 340 if (frame->IsDartFrame()) { |
| 340 func = frame->LookupDartFunction(); | 341 func = frame->LookupDartFunction(); |
| 341 ASSERT(!func.IsNull()); | 342 ASSERT(!func.IsNull()); |
| 342 func.EnsureHasCompiledUnoptimizedCode(); | 343 func.EnsureHasCompiledUnoptimizedCode(); |
| 343 } | 344 } |
| 344 } | 345 } |
| 345 } | 346 } |
| 346 | 347 |
| 347 | 348 |
| 348 void IsolateReloadContext::DeoptimizeDependentCode() { | 349 void IsolateReloadContext::DeoptimizeDependentCode() { |
| 350 TIMELINE_SCOPE(DeoptimizeDependentCode); |
| 349 ClassTable* class_table = I->class_table(); | 351 ClassTable* class_table = I->class_table(); |
| 350 | 352 |
| 351 const intptr_t bottom = Dart::vm_isolate()->class_table()->NumCids(); | 353 const intptr_t bottom = Dart::vm_isolate()->class_table()->NumCids(); |
| 352 const intptr_t top = I->class_table()->NumCids(); | 354 const intptr_t top = I->class_table()->NumCids(); |
| 353 Class& cls = Class::Handle(); | 355 Class& cls = Class::Handle(); |
| 354 Array& fields = Array::Handle(); | 356 Array& fields = Array::Handle(); |
| 355 Field& field = Field::Handle(); | 357 Field& field = Field::Handle(); |
| 356 for (intptr_t cls_idx = bottom; cls_idx < top; cls_idx++) { | 358 for (intptr_t cls_idx = bottom; cls_idx < top; cls_idx++) { |
| 357 if (!class_table->HasValidClassAt(cls_idx)) { | 359 if (!class_table->HasValidClassAt(cls_idx)) { |
| 358 // Skip. | 360 // Skip. |
| (...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 ASSERT(!super_cls.IsNull()); | 1158 ASSERT(!super_cls.IsNull()); |
| 1157 super_cls.AddDirectSubclass(cls); | 1159 super_cls.AddDirectSubclass(cls); |
| 1158 } | 1160 } |
| 1159 } | 1161 } |
| 1160 } | 1162 } |
| 1161 } | 1163 } |
| 1162 | 1164 |
| 1163 #endif // !PRODUCT | 1165 #endif // !PRODUCT |
| 1164 | 1166 |
| 1165 } // namespace dart | 1167 } // namespace dart |
| OLD | NEW |