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

Unified Diff: runtime/vm/class_finalizer.cc

Issue 463103002: Fix bug with CHA dependencies by recording a set of classes for registering code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
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);
}
}

Powered by Google App Engine
This is Rietveld 408576698