Chromium Code Reviews| 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); |
| } |
| } |