Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: runtime/vm/isolate_reload.cc

Issue 2194333002: RELOAD: Maintain identity of static tear-offs. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: . Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/isolate_reload_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 942 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 953
954 #ifdef DEBUG 954 #ifdef DEBUG
955 VerifyMaps(); 955 VerifyMaps();
956 #endif 956 #endif
957 957
958 { 958 {
959 TIMELINE_SCOPE(CopyStaticFieldsAndPatchFieldsAndFunctions); 959 TIMELINE_SCOPE(CopyStaticFieldsAndPatchFieldsAndFunctions);
960 // Copy static field values from the old classes to the new classes. 960 // Copy static field values from the old classes to the new classes.
961 // Patch fields and functions in the old classes so that they retain 961 // Patch fields and functions in the old classes so that they retain
962 // the old script. 962 // the old script.
963 Class& cls = Class::Handle(); 963 Class& old_cls = Class::Handle();
964 Class& new_cls = Class::Handle(); 964 Class& new_cls = Class::Handle();
965
966 UnorderedHashMap<ClassMapTraits> class_map(class_map_storage_); 965 UnorderedHashMap<ClassMapTraits> class_map(class_map_storage_);
967 966
968 { 967 {
969 UnorderedHashMap<ClassMapTraits>::Iterator it(&class_map); 968 UnorderedHashMap<ClassMapTraits>::Iterator it(&class_map);
970 while (it.MoveNext()) { 969 while (it.MoveNext()) {
971 const intptr_t entry = it.Current(); 970 const intptr_t entry = it.Current();
972 new_cls = Class::RawCast(class_map.GetKey(entry)); 971 new_cls = Class::RawCast(class_map.GetKey(entry));
973 cls = Class::RawCast(class_map.GetPayload(entry, 0)); 972 old_cls = Class::RawCast(class_map.GetPayload(entry, 0));
974 if (new_cls.raw() != cls.raw()) { 973 if (new_cls.raw() != old_cls.raw()) {
975 ASSERT(new_cls.is_enum_class() == cls.is_enum_class()); 974 ASSERT(new_cls.is_enum_class() == old_cls.is_enum_class());
976 if (new_cls.is_enum_class() && new_cls.is_finalized()) { 975 if (new_cls.is_enum_class() && new_cls.is_finalized()) {
977 new_cls.ReplaceEnum(cls); 976 new_cls.ReplaceEnum(old_cls);
978 } else { 977 } else {
979 new_cls.CopyStaticFieldValues(cls); 978 new_cls.CopyStaticFieldValues(old_cls);
980 } 979 }
981 cls.PatchFieldsAndFunctions(); 980 old_cls.PatchFieldsAndFunctions();
981 old_cls.MigrateImplicitStaticClosures(this, new_cls);
982 } 982 }
983 } 983 }
984 } 984 }
985 985
986 class_map.Release(); 986 class_map.Release();
987 } 987 }
988 988
989 // Copy over certain properties of libraries, e.g. is the library 989 // Copy over certain properties of libraries, e.g. is the library
990 // debuggable? 990 // debuggable?
991 { 991 {
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
1586 ASSERT(!super_cls.IsNull()); 1586 ASSERT(!super_cls.IsNull());
1587 super_cls.AddDirectSubclass(cls); 1587 super_cls.AddDirectSubclass(cls);
1588 } 1588 }
1589 } 1589 }
1590 } 1590 }
1591 } 1591 }
1592 1592
1593 #endif // !PRODUCT 1593 #endif // !PRODUCT
1594 1594
1595 } // namespace dart 1595 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/isolate_reload_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698