Chromium Code Reviews| Index: runtime/vm/class_finalizer.cc |
| =================================================================== |
| --- runtime/vm/class_finalizer.cc (revision 39070) |
| +++ runtime/vm/class_finalizer.cc (working copy) |
| @@ -93,6 +93,25 @@ |
| } |
| +static void CollectImmediateSuperInterfaces( |
| + const Class& cls, GrowableArray<intptr_t>* cids) { |
| + const Array& interfaces = Array::Handle(cls.interfaces()); |
| + Class& ifc = Class::Handle(); |
| + AbstractType& type = AbstractType::Handle(); |
| + for (intptr_t i = 0; i < interfaces.Length(); ++i) { |
| + type ^= interfaces.At(i); |
| + ifc ^= type.type_class(); |
|
Vyacheslav Egorov (Google)
2014/08/13 11:40:28
I wonder if you need to skip Malformed types here?
Florian Schneider
2014/08/13 12:08:58
Done.
|
| + for (intptr_t j = 0; j < cids->length(); ++j) { |
| + if ((*cids)[j] == ifc.id()) { |
| + // Already added. |
| + return; |
| + } |
| + } |
| + cids->Add(ifc.id()); |
| + } |
| +} |
| + |
| + |
| // Processing ObjectStore::pending_classes_ occurs: |
| // a) when bootstrap process completes (VerifyBootstrapClasses). |
| // b) after the user classes are loaded (dart_api). |
| @@ -2287,8 +2306,6 @@ |
| // the class conflict with inherited methods. |
| ApplyMixinMembers(cls); |
| } |
| - GrowableArray<intptr_t> added_subclass_to_cids; |
| - CollectFinalizedSuperClasses(cls, &added_subclass_to_cids); |
| // Ensure super class is finalized. |
| const Class& super = Class::Handle(cls.SuperClass()); |
| if (!super.IsNull()) { |
| @@ -2317,7 +2334,10 @@ |
| CheckForLegalConstClass(cls); |
| } |
| if (FLAG_use_cha) { |
| - RemoveCHAOptimizedCode(added_subclass_to_cids); |
| + GrowableArray<intptr_t> cids; |
| + CollectFinalizedSuperClasses(cls, &cids); |
| + CollectImmediateSuperInterfaces(cls, &cids); |
| + RemoveCHAOptimizedCode(cids); |
| } |
| } |