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

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: address remaining comments 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
« no previous file with comments | « runtime/vm/cha_test.cc ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_finalizer.cc
===================================================================
--- runtime/vm/class_finalizer.cc (revision 39070)
+++ runtime/vm/class_finalizer.cc (working copy)
@@ -93,6 +93,27 @@
}
+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);
+ if (type.IsMalformed()) continue;
+ if (!type.HasResolvedTypeClass()) continue;
+ ifc ^= type.type_class();
+ 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 +2308,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 +2336,10 @@
CheckForLegalConstClass(cls);
}
if (FLAG_use_cha) {
- RemoveCHAOptimizedCode(added_subclass_to_cids);
+ GrowableArray<intptr_t> cids;
+ CollectFinalizedSuperClasses(cls, &cids);
+ CollectImmediateSuperInterfaces(cls, &cids);
+ RemoveCHAOptimizedCode(cids);
}
}
« no previous file with comments | « runtime/vm/cha_test.cc ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698