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

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

Issue 24305003: Fix invocation_mirror_test.dart. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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 | sdk/lib/_internal/compiler/implementation/types/type_graph_inferrer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/ssa/builder.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/builder.dart (revision 27700)
+++ sdk/lib/_internal/compiler/implementation/ssa/builder.dart (working copy)
@@ -3277,7 +3277,7 @@
List<HInstruction> arguments) {
SourceString name = selector.name;
- ClassElement cls = currentElement.getEnclosingClass();
+ ClassElement cls = currentNonClosureClass;
Element element = cls.lookupSuperMember(Compiler.NO_SUCH_METHOD);
if (element.enclosingElement.declaration != compiler.objectClass) {
// Register the call as dynamic if [noSuchMethod] on the super
@@ -3286,8 +3286,11 @@
// [JSInvocationMirror._invokeOn].
compiler.enqueuer.codegen.registerSelectorUse(selector);
}
+ String publicName = name.slowToString();
+ if (selector.isSetter()) publicName += '=';
+
Constant nameConstant = constantSystem.createString(
- new DartString.literal(name.slowToString()), node);
+ new DartString.literal(publicName), node);
String internalName = backend.namer.invocationName(selector);
Constant internalNameConstant =
@@ -3345,15 +3348,19 @@
if (node.isPropertyAccess) {
push(buildInvokeSuper(selector, element, inputs));
} else if (element.isFunction() || element.isGenerativeConstructor()) {
- // TODO(5347): Try to avoid the need for calling [implementation] before
- // calling [addStaticSendArgumentsToList].
- FunctionElement function = element.implementation;
- bool succeeded = addStaticSendArgumentsToList(selector, node.arguments,
- function, inputs);
- if (!succeeded) {
+ if (selector.applies(element, compiler)) {
+ // TODO(5347): Try to avoid the need for calling [implementation] before
+ // calling [addStaticSendArgumentsToList].
+ FunctionElement function = element.implementation;
+ bool succeeded = addStaticSendArgumentsToList(selector, node.arguments,
+ function, inputs);
+ assert(succeeded);
+ push(buildInvokeSuper(selector, element, inputs));
+ } else if (element.isGenerativeConstructor()) {
generateWrongArgumentCountError(node, element, node.arguments);
} else {
- push(buildInvokeSuper(selector, element, inputs));
+ addGenericSendArgumentsToList(node.arguments, inputs);
+ generateSuperNoSuchMethodSend(node, selector, inputs);
}
} else {
HInstruction target = buildInvokeSuper(selector, element, inputs);
@@ -3929,8 +3936,13 @@
selector,
inputs,
isSetter: selector.isSetter() || selector.isIndexSet());
- instruction.instructionType =
- new HType.inferredReturnTypeForElement(element, compiler);
+ if (selector.isGetter()) {
+ instruction.instructionType =
+ new HType.inferredTypeForElement(element, compiler);
+ } else {
+ instruction.instructionType =
+ new HType.inferredReturnTypeForElement(element, compiler);
+ }
instruction.sideEffects = compiler.world.getSideEffectsOfElement(element);
return instruction;
}
@@ -4004,7 +4016,8 @@
}
}
Selector setterSelector = elements.getSelector(node);
- if (Elements.isUnresolved(element)) {
+ if (Elements.isUnresolved(element)
+ || !setterSelector.applies(element, compiler)) {
generateSuperNoSuchMethodSend(
node, setterSelector, setterInputs);
pop();
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/types/type_graph_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698