Chromium Code Reviews| 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/bit_vector.h" | 8 #include "vm/bit_vector.h" |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 917 ASSERT(saved_num_cids_ > 0); | 917 ASSERT(saved_num_cids_ > 0); |
| 918 ASSERT(saved_class_table_ != NULL); | 918 ASSERT(saved_class_table_ != NULL); |
| 919 ClassTable* class_table = I->class_table(); | 919 ClassTable* class_table = I->class_table(); |
| 920 class_table->SetNumCids(saved_num_cids_); | 920 class_table->SetNumCids(saved_num_cids_); |
| 921 // Overwrite classes in class table with the saved classes. | 921 // Overwrite classes in class table with the saved classes. |
| 922 for (intptr_t i = 0; i < saved_num_cids_; i++) { | 922 for (intptr_t i = 0; i < saved_num_cids_; i++) { |
| 923 if (class_table->IsValidIndex(i)) { | 923 if (class_table->IsValidIndex(i)) { |
| 924 class_table->SetAt(i, saved_class_table_[i]); | 924 class_table->SetAt(i, saved_class_table_[i]); |
| 925 } | 925 } |
| 926 } | 926 } |
| 927 free(saved_class_table_); | 927 |
| 928 RawClass** local_saved_class_table = saved_class_table_; | |
| 928 saved_class_table_ = NULL; | 929 saved_class_table_ = NULL; |
| 929 saved_num_cids_ = 0; | 930 // Can't free this table immediately as another thread (e.g., the sweeper) may |
| 931 // be suspended between loading the table pointer and loading the table | |
| 932 // element. Table will be freed at the next major GC or isolate shutdown. | |
| 933 class_table->AddOldTable(local_saved_class_table); | |
|
siva
2016/08/12 21:10:45
When does saved_num_cids_ get set to 0?
rmacnak
2016/08/12 21:15:29
Never. We can't set it to zero here because anothe
| |
| 930 } | 934 } |
| 931 | 935 |
| 932 | 936 |
| 933 void IsolateReloadContext::RollbackLibraries() { | 937 void IsolateReloadContext::RollbackLibraries() { |
| 934 TIR_Print("---- ROLLING BACK LIBRARY CHANGES\n"); | 938 TIR_Print("---- ROLLING BACK LIBRARY CHANGES\n"); |
| 935 Thread* thread = Thread::Current(); | 939 Thread* thread = Thread::Current(); |
| 936 Library& lib = Library::Handle(); | 940 Library& lib = Library::Handle(); |
| 937 GrowableObjectArray& saved_libs = GrowableObjectArray::Handle( | 941 GrowableObjectArray& saved_libs = GrowableObjectArray::Handle( |
| 938 Z, saved_libraries()); | 942 Z, saved_libraries()); |
| 939 if (!saved_libs.IsNull()) { | 943 if (!saved_libs.IsNull()) { |
| (...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1661 ASSERT(!super_cls.IsNull()); | 1665 ASSERT(!super_cls.IsNull()); |
| 1662 super_cls.AddDirectSubclass(cls); | 1666 super_cls.AddDirectSubclass(cls); |
| 1663 } | 1667 } |
| 1664 } | 1668 } |
| 1665 } | 1669 } |
| 1666 } | 1670 } |
| 1667 | 1671 |
| 1668 #endif // !PRODUCT | 1672 #endif // !PRODUCT |
| 1669 | 1673 |
| 1670 } // namespace dart | 1674 } // namespace dart |
| OLD | NEW |