Chromium Code Reviews| 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); |
| } |