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

Unified Diff: pkg/compiler/lib/src/elements/common.dart

Issue 2428543002: Optimize needNoSuchMethodHandling computation (Closed)
Patch Set: Created 4 years, 2 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: pkg/compiler/lib/src/elements/common.dart
diff --git a/pkg/compiler/lib/src/elements/common.dart b/pkg/compiler/lib/src/elements/common.dart
index 3e430d2ae90d3e38eb46b0d17060c285539de532..15bc49aaeec2ded0bbaab61a6215d3ce3db3c995 100644
--- a/pkg/compiler/lib/src/elements/common.dart
+++ b/pkg/compiler/lib/src/elements/common.dart
@@ -215,20 +215,22 @@ abstract class ClassElementCommon implements ClassElement {
* When called on the implementation element both members declared in the
* origin and the patch class are returned.
*/
- Element lookupByName(Name memberName) {
- return internalLookupByName(memberName, isSuperLookup: false);
+ Element lookupByName(Name memberName, {ClassElement stopAtSuperclass}) {
+ return internalLookupByName(memberName,
+ isSuperLookup: false, stopAtSuperclass: stopAtSuperclass);
}
Element lookupSuperByName(Name memberName) {
return internalLookupByName(memberName, isSuperLookup: true);
}
- Element internalLookupByName(Name memberName, {bool isSuperLookup}) {
+ Element internalLookupByName(Name memberName,
+ {bool isSuperLookup, ClassElement stopAtSuperclass}) {
String name = memberName.text;
bool isPrivate = memberName.isPrivate;
LibraryElement library = memberName.library;
for (ClassElement current = isSuperLookup ? superclass : this;
- current != null;
+ current != null && current != stopAtSuperclass;
current = current.superclass) {
Element member = current.lookupLocalMember(name);
if (member == null && current.isPatched) {
« no previous file with comments | « no previous file | pkg/compiler/lib/src/elements/elements.dart » ('j') | pkg/compiler/lib/src/elements/elements.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698