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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart

Issue 11707002: Revert "NoSuchMethod on different super accesses/invocations handled." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
index 86019a1e014d7bb5c15678a28b3698450712d506..324cc599a50d235d10fafe3be26c5cd7b8fc2830 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
@@ -1672,7 +1672,7 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
visitInvokeSuper(HInvokeSuper node) {
Element superMethod = node.element;
Element superClass = superMethod.getEnclosingClass();
- if (superMethod.isField()) {
+ if (superMethod.kind == ElementKind.FIELD) {
ClassElement currentClass = work.element.getEnclosingClass();
if (currentClass.isClosure()) {
ClosureClassElement closure = currentClass;
@@ -1689,45 +1689,32 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
use(node.inputs[1]);
js.PropertyAccess access =
new js.PropertyAccess.field(pop(), fieldName);
- if (node.isSendSet) {
+ if (node.isSetter) {
use(node.value);
push(new js.Assignment(access, pop()), node);
} else {
push(access, node);
}
} else {
- bool isPropertyAccess = false;
String methodName;
- if (superMethod.isGetter()) {
+ if (superMethod.kind == ElementKind.FUNCTION ||
+ superMethod.kind == ElementKind.GENERATIVE_CONSTRUCTOR) {
+ methodName = backend.namer.instanceMethodName(superMethod);
+ } else if (superMethod.kind == ElementKind.GETTER) {
methodName =
backend.namer.getterName(currentLibrary, superMethod.name);
- } else if (node.isSendSet || superMethod.isSetter()) {
+ } else {
+ assert(superMethod.kind == ElementKind.SETTER);
methodName =
backend.namer.setterName(currentLibrary, superMethod.name);
- } else if (superMethod.isFunction() ||
- superMethod.isGenerativeConstructor()) {
- if (node.isPropertyAccess) {
- methodName =
- backend.namer.getterName(currentLibrary, superMethod.name);
- isPropertyAccess = true;
- } else {
- methodName = backend.namer.instanceMethodName(superMethod);
- }
}
String className = backend.namer.isolateAccess(superClass);
js.VariableUse classReference = new js.VariableUse(className);
js.PropertyAccess prototype =
new js.PropertyAccess.field(classReference, "prototype");
- if (isPropertyAccess) {
- // Property access of a function. Obtain the bound closure instead of
- // invoking the function.
- push(jsPropertyCall(prototype, methodName,
- visitArguments(node.inputs)), node);
- } else {
- js.PropertyAccess method =
- new js.PropertyAccess.field(prototype, methodName);
- push(jsPropertyCall(method, "call", visitArguments(node.inputs)), node);
- }
+ js.PropertyAccess method =
+ new js.PropertyAccess.field(prototype, methodName);
+ push(jsPropertyCall(method, "call", visitArguments(node.inputs)), node);
}
world.registerStaticUse(superMethod);
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/builder.dart ('k') | sdk/lib/_internal/compiler/implementation/ssa/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698