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

Unified Diff: runtime/vm/class_finalizer.cc

Issue 269253005: Put metadata fields in their owner class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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
Index: runtime/vm/class_finalizer.cc
diff --git a/runtime/vm/class_finalizer.cc b/runtime/vm/class_finalizer.cc
index 9e90e410515ed048e2e481eb1ff739f91e3d5c29..ea6303aeabfd10da15191a9677a9574e5da9a4e5 100644
--- a/runtime/vm/class_finalizer.cc
+++ b/runtime/vm/class_finalizer.cc
@@ -2146,7 +2146,7 @@ void ClassFinalizer::ApplyMixinMembers(const Class& cls) {
// Now clone the fields from the mixin class. There should be no
// existing fields in the mixin application class.
ASSERT(Array::Handle(cls.fields()).Length() == 0);
- Array& fields = Array::Handle(isolate, mixin_cls.fields());
+ const Array& fields = Array::Handle(isolate, mixin_cls.fields());
Field& field = Field::Handle(isolate);
const GrowableObjectArray& cloned_fields =
GrowableObjectArray::Handle(isolate, GrowableObjectArray::New());
@@ -2158,8 +2158,7 @@ void ClassFinalizer::ApplyMixinMembers(const Class& cls) {
cloned_fields.Add(field);
}
}
- fields = Array::MakeArray(cloned_fields);
- cls.SetFields(fields);
+ cls.AddFields(cloned_fields);
if (FLAG_trace_class_finalization) {
OS::Print("Done applying mixin members of %s to %s\n",
@@ -2289,7 +2288,6 @@ void ClassFinalizer::FinalizeTypesInClass(const Class& cls) {
// This class should not contain any fields or functions yet, because it has
Ivan Posva 2014/05/08 05:18:50 Please update the comment. Especially since it app
rmacnak 2014/05/08 18:14:54 Noted the class might contain metadata fields for
// not been compiled yet. Since 'ResolveAndFinalizeMemberTypes(cls)' has not
// been called yet, unfinalized member types could choke the snapshotter.
- ASSERT(Array::Handle(cls.fields()).Length() == 0);
ASSERT(Array::Handle(cls.functions()).Length() == 0);
}
}
« no previous file with comments | « runtime/tests/vm/vm.status ('k') | runtime/vm/object.h » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698