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

Unified Diff: pkg/compiler/lib/src/kernel/element_map_mixins.dart

Issue 2964683003: Split implementation of KernelToElementMapImpl (Closed)
Patch Set: Created 3 years, 6 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/kernel/element_map_mixins.dart
diff --git a/pkg/compiler/lib/src/kernel/element_map_mixins.dart b/pkg/compiler/lib/src/kernel/element_map_mixins.dart
index 19f776edcc2ca7f2ee00c80f48182807a71ba52f..0edad4c27fd24d4be4fab60d00a9c5b2a1d31d5f 100644
--- a/pkg/compiler/lib/src/kernel/element_map_mixins.dart
+++ b/pkg/compiler/lib/src/kernel/element_map_mixins.dart
@@ -306,6 +306,30 @@ abstract class KernelToElementMapBaseMixin implements KernelToElementMap {
});
return metadata;
}
+
+ FunctionEntity getSuperNoSuchMethod(ClassEntity cls) {
+ while (cls != null) {
+ cls = elementEnvironment.getSuperClass(cls);
+ MemberEntity member =
+ elementEnvironment.lookupClassMember(cls, Identifiers.noSuchMethod_);
+ if (member != null) {
+ if (member.isFunction) {
+ FunctionEntity function = member;
+ if (function.parameterStructure.positionalParameters >= 1) {
+ return function;
+ }
+ }
+ // If [member] is not a valid `noSuchMethod` the target is
+ // `Object.superNoSuchMethod`.
+ break;
+ }
+ }
+ FunctionEntity function = elementEnvironment.lookupClassMember(
+ commonElements.objectClass, Identifiers.noSuchMethod_);
+ assert(function != null,
+ failedAt(cls, "No super noSuchMethod found for class $cls."));
+ return function;
+ }
}
abstract class KernelToElementMapForImpactMixin
@@ -391,31 +415,6 @@ abstract class KernelToElementMapForImpactMixin
abstract class KernelToElementMapForBuildingMixin
implements KernelToElementMapForBuilding, KernelToElementMapBaseMixin {
- @override
- FunctionEntity getSuperNoSuchMethod(ClassEntity cls) {
- while (cls != null) {
- cls = elementEnvironment.getSuperClass(cls);
- MemberEntity member =
- elementEnvironment.lookupClassMember(cls, Identifiers.noSuchMethod_);
- if (member != null) {
- if (member.isFunction) {
- FunctionEntity function = member;
- if (function.parameterStructure.positionalParameters >= 1) {
- return function;
- }
- }
- // If [member] is not a valid `noSuchMethod` the target is
- // `Object.superNoSuchMethod`.
- break;
- }
- }
- FunctionEntity function = elementEnvironment.lookupClassMember(
- commonElements.objectClass, Identifiers.noSuchMethod_);
- assert(function != null,
- failedAt(cls, "No super noSuchMethod found for class $cls."));
- return function;
- }
-
js.Template getJsBuiltinTemplate(
ConstantValue constant, CodeEmitterTask emitter) {
int index = _extractEnumIndexFromConstantValue(

Powered by Google App Engine
This is Rietveld 408576698