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

Unified Diff: runtime/vm/object_reload.cc

Issue 2199173002: Become the old E.values into the new E.values (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Become the old E.values into the new E.values Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object_reload.cc
diff --git a/runtime/vm/object_reload.cc b/runtime/vm/object_reload.cc
index 046333438cb6f655df89e1730501f5610f1865ed..726e18fdaadfb3438ff11b82052428a331b14466 100644
--- a/runtime/vm/object_reload.cc
+++ b/runtime/vm/object_reload.cc
@@ -232,7 +232,10 @@ void Class::ReplaceEnum(const Class& old_enum) const {
String& enum_ident = String::Handle();
Instance& old_enum_value = Instance::Handle(zone);
Instance& enum_value = Instance::Handle(zone);
-
+ // The E.values array.
+ Instance& old_enum_values = Instance::Handle(zone);
+ // The E.values array.
+ Instance& enum_values = Instance::Handle(zone);
Array& enum_map_storage = Array::Handle(zone,
HashTables::New<UnorderedHashMap<EnumMapTraits> >(4));
ASSERT(!enum_map_storage.IsNull());
@@ -251,6 +254,7 @@ void Class::ReplaceEnum(const Class& old_enum) const {
continue;
}
if (enum_ident.Equals(Symbols::Values())) {
+ old_enum_values = field.StaticValue();
// Non-enum instance.
continue;
}
@@ -279,6 +283,7 @@ void Class::ReplaceEnum(const Class& old_enum) const {
continue;
}
if (enum_ident.Equals(Symbols::Values())) {
+ enum_values = field.StaticValue();
// Non-enum instance.
continue;
}
@@ -302,6 +307,11 @@ void Class::ReplaceEnum(const Class& old_enum) const {
enum_map_storage = enum_map.Release().raw();
}
+ // Map the old E.values array to the new E.values array.
+ ASSERT(!old_enum_values.IsNull());
+ ASSERT(!enum_values.IsNull());
+ reload_context->AddEnumBecomeMapping(old_enum_values, enum_values);
+
if (enums_deleted && FLAG_trace_reload_verbose) {
// TODO(johnmccutchan): Add this to the reload 'notices' list.
VTIR_Print("The following enum values were deleted and are forever lost in "
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698