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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 RawClass** local_saved_class_table = | 401 RawClass** local_saved_class_table = |
402 reinterpret_cast<RawClass**>(malloc(sizeof(RawClass*) * saved_num_cids_)); | 402 reinterpret_cast<RawClass**>(malloc(sizeof(RawClass*) * saved_num_cids_)); |
403 | 403 |
404 Class& cls = Class::Handle(); | 404 Class& cls = Class::Handle(); |
405 UnorderedHashSet<ClassMapTraits> old_classes_set(old_classes_set_storage_); | 405 UnorderedHashSet<ClassMapTraits> old_classes_set(old_classes_set_storage_); |
406 for (intptr_t i = 0; i < saved_num_cids_; i++) { | 406 for (intptr_t i = 0; i < saved_num_cids_; i++) { |
407 if (class_table->IsValidIndex(i) && | 407 if (class_table->IsValidIndex(i) && |
408 class_table->HasValidClassAt(i)) { | 408 class_table->HasValidClassAt(i)) { |
409 // Copy the class into the saved class table and add it to the set. | 409 // Copy the class into the saved class table and add it to the set. |
410 local_saved_class_table[i] = class_table->At(i); | 410 local_saved_class_table[i] = class_table->At(i); |
411 if (i != kFreeListElement) { | 411 if (i != kFreeListElement && i != kForwardingCorpse) { |
412 cls = class_table->At(i); | 412 cls = class_table->At(i); |
413 bool already_present = old_classes_set.Insert(cls); | 413 bool already_present = old_classes_set.Insert(cls); |
414 ASSERT(!already_present); | 414 ASSERT(!already_present); |
415 } | 415 } |
416 } else { | 416 } else { |
417 // No class at this index, mark it as NULL. | 417 // No class at this index, mark it as NULL. |
418 local_saved_class_table[i] = NULL; | 418 local_saved_class_table[i] = NULL; |
419 } | 419 } |
420 } | 420 } |
421 old_classes_set_storage_ = old_classes_set.Release().raw(); | 421 old_classes_set_storage_ = old_classes_set.Release().raw(); |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 IsolateReloadContext* reload_context) | 964 IsolateReloadContext* reload_context) |
965 : ObjectVisitor(), | 965 : ObjectVisitor(), |
966 handle_(Object::Handle()), | 966 handle_(Object::Handle()), |
967 owning_class_(Class::Handle()), | 967 owning_class_(Class::Handle()), |
968 owning_lib_(Library::Handle()), | 968 owning_lib_(Library::Handle()), |
969 code_(Code::Handle()), | 969 code_(Code::Handle()), |
970 reload_context_(reload_context) { | 970 reload_context_(reload_context) { |
971 } | 971 } |
972 | 972 |
973 virtual void VisitObject(RawObject* obj) { | 973 virtual void VisitObject(RawObject* obj) { |
974 // Free-list elements cannot even be wrapped in handles. | 974 if (obj->IsPseudoObject()) { |
975 if (obj->IsFreeListElement()) { | 975 // Cannot even be wrapped in handles. |
976 return; | 976 return; |
977 } | 977 } |
978 handle_ = obj; | 978 handle_ = obj; |
979 if (handle_.IsFunction()) { | 979 if (handle_.IsFunction()) { |
980 const Function& func = Function::Cast(handle_); | 980 const Function& func = Function::Cast(handle_); |
981 | 981 |
982 // Switch to unoptimized code or the lazy compilation stub. | 982 // Switch to unoptimized code or the lazy compilation stub. |
983 func.SwitchToLazyCompiledUnoptimizedCode(); | 983 func.SwitchToLazyCompiledUnoptimizedCode(); |
984 | 984 |
985 // Grab the current code. | 985 // Grab the current code. |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1186 ASSERT(!super_cls.IsNull()); | 1186 ASSERT(!super_cls.IsNull()); |
1187 super_cls.AddDirectSubclass(cls); | 1187 super_cls.AddDirectSubclass(cls); |
1188 } | 1188 } |
1189 } | 1189 } |
1190 } | 1190 } |
1191 } | 1191 } |
1192 | 1192 |
1193 #endif // !PRODUCT | 1193 #endif // !PRODUCT |
1194 | 1194 |
1195 } // namespace dart | 1195 } // namespace dart |
OLD | NEW |