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

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
Index: frog/leg/ssa/codegen.dart
===================================================================
--- frog/leg/ssa/codegen.dart (revision 3496)
+++ frog/leg/ssa/codegen.dart (working copy)
@@ -409,9 +409,13 @@
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);
+ if (node.inputs[0] is !HForeignNew) {
floitsch 2012/01/24 11:46:03 Add comment that this avoids adding the generative
ngeoffray 2012/01/24 12:09:39 Done.
+ compiler.registerDynamicInvocation(node.name, argumentCount);
+ }
}
visitInvokeDynamicSetter(HInvokeDynamicSetter node) {
@@ -433,7 +437,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 +449,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);
}

Powered by Google App Engine
This is Rietveld 408576698