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

Unified Diff: frog/leg/ssa/codegen.dart

Issue 9193016: Add the arity to calls, and support noSuchMethodException. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 11 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 | « frog/leg/ssa/builder.dart ('k') | frog/leg/universe.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/leg/ssa/codegen.dart
===================================================================
--- frog/leg/ssa/codegen.dart (revision 3539)
+++ frog/leg/ssa/codegen.dart (working copy)
@@ -409,9 +409,15 @@
visitInvokeDynamicMethod(HInvokeDynamicMethod node) {
use(node.receiver);
buffer.add('.');
- buffer.add(compiler.namer.instanceName(node.name));
+ // Remove 'this' from the number of arguments.
+ int argumentCount = node.inputs.length - 1;
+ buffer.add(compiler.namer.instanceMethodName(node.name, argumentCount));
visitArguments(node.inputs);
- compiler.registerDynamicInvocation(node.name);
+ // Avoid adding the generative constructor name to the list of
+ // seen selectors.
+ if (node.inputs[0] is !HForeignNew) {
+ compiler.registerDynamicInvocation(node.name, argumentCount);
+ }
}
visitInvokeDynamicSetter(HInvokeDynamicSetter node) {
@@ -433,7 +439,7 @@
visitInvokeClosure(HInvokeClosure node) {
use(node.receiver);
buffer.add('.');
- buffer.add(compiler.namer.closureInvocationName());
+ buffer.add(compiler.namer.closureInvocationName(node.inputs.length - 1));
visitArguments(node.inputs);
}
@@ -445,8 +451,11 @@
visitInvokeSuper(HInvokeSuper node) {
Element superMethod = node.element;
Element superClass = superMethod.enclosingElement;
+ // Remove the element and 'this'.
+ int argumentCount = node.inputs.length - 2;
String className = compiler.namer.isolatePropertyAccess(superClass);
- String methodName = compiler.namer.instanceName(superMethod.name);
+ String methodName = compiler.namer.instanceMethodName(
+ superMethod.name, argumentCount);
buffer.add('$className.prototype.$methodName.call');
visitArguments(node.inputs);
}
« no previous file with comments | « frog/leg/ssa/builder.dart ('k') | frog/leg/universe.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698