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

Unified Diff: runtime/vm/cha.cc

Issue 1158673004: Do not eagerly add guarded leaf classes with CHA; do not add them for private names. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: a Created 5 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
« no previous file with comments | « runtime/vm/cha.h ('k') | runtime/vm/cha_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/cha.cc
diff --git a/runtime/vm/cha.cc b/runtime/vm/cha.cc
index 065931c57f5b4ee4e25b99162f42fdabb58c2dcf..4b005049772d29cebab6280f7674c5d6b6cdeb54 100644
--- a/runtime/vm/cha.cc
+++ b/runtime/vm/cha.cc
@@ -37,12 +37,7 @@ bool CHA::HasSubclasses(const Class& cls) {
}
const GrowableObjectArray& direct_subclasses =
GrowableObjectArray::Handle(thread_->zone(), cls.direct_subclasses());
- bool result =
- !direct_subclasses.IsNull() && (direct_subclasses.Length() > 0);
- if (!result) {
- AddToLeafClasses(cls);
- }
- return result;
+ return !direct_subclasses.IsNull() && (direct_subclasses.Length() > 0);
}
@@ -62,11 +57,7 @@ bool CHA::IsImplemented(const Class& cls) {
// classes.
if (cls.InVMHeap()) return true;
- bool result = cls.is_implemented();
- if (!result) {
- AddToLeafClasses(cls);
- }
- return result;
+ return cls.is_implemented();
}
@@ -80,7 +71,6 @@ bool CHA::HasOverride(const Class& cls, const String& function_name) {
}
if (cls_direct_subclasses.IsNull()) {
- AddToLeafClasses(cls);
return false;
}
Class& direct_subclass = Class::Handle(thread_->zone());
@@ -97,7 +87,6 @@ bool CHA::HasOverride(const Class& cls, const String& function_name) {
return true;
}
}
- AddToLeafClasses(cls);
return false;
}
« no previous file with comments | « runtime/vm/cha.h ('k') | runtime/vm/cha_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698