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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart

Issue 1678053002: Fix super noSuchMethod handling. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | pkg/compiler/lib/src/info/send_info.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
index 37dc74b9d18c41776c02584a3b20fefbd0e0194d..0d5067ed22372f8f86d59e97e31582f09dfa908d 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
@@ -7,6 +7,7 @@ library dart2js.ir_builder_task;
import '../closure.dart' as closure;
import '../common.dart';
import '../common/names.dart' show
+ Identifiers,
Names,
Selectors;
import '../common/tasks.dart' show
@@ -1899,6 +1900,15 @@ class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
}
@override
+ ir.Primitive visitUnresolvedSuperSet(
+ ast.Send node,
+ Element element,
+ ast.Node rhs, _) {
+ return buildInstanceNoSuchMethod(
+ elements.getSelector(node), elements.getTypeMask(node), [visit(rhs)]);
+ }
+
+ @override
ir.Primitive visitThisGet(ast.Identifier node, _) {
if (irBuilder.state.thisParameter == null) {
// TODO(asgerf,johnniwinther): Should be in a visitInvalidThis method.
@@ -3330,10 +3340,15 @@ class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
ir.Primitive buildInstanceNoSuchMethod(Selector selector,
TypeMask mask,
List<ir.Primitive> arguments) {
asgerf 2016/02/08 18:42:44 The name of this method doesn't seem right anymore
Johnni Winther 2016/02/09 08:37:29 Done.
- return irBuilder.buildDynamicInvocation(
- irBuilder.buildThis(),
- Selectors.noSuchMethod_,
- mask,
+ ClassElement cls = elements.analyzedElement.enclosingClass;
+ MethodElement element = cls.lookupSuperMember(Identifiers.noSuchMethod_);
+ if (!Selectors.noSuchMethod_.signatureApplies(element)) {
+ element = compiler.coreClasses.objectClass.lookupMember(
+ Identifiers.noSuchMethod_);
+ }
+ return irBuilder.buildSuperMethodInvocation(
+ element,
+ Selectors.noSuchMethod_.callStructure,
[irBuilder.buildInvocationMirror(selector, arguments)]);
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/info/send_info.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698