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

Side by Side Diff: frog/leg/ssa/codegen.dart

Issue 9316026: Support named arguments for dynamic calls. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class SsaCodeGeneratorTask extends CompilerTask { 5 class SsaCodeGeneratorTask extends CompilerTask {
6 SsaCodeGeneratorTask(Compiler compiler) : super(compiler); 6 SsaCodeGeneratorTask(Compiler compiler) : super(compiler);
7 String get name() => 'SSA code generator'; 7 String get name() => 'SSA code generator';
8 8
9 String generate(WorkItem work, HGraph graph) { 9 String generate(WorkItem work, HGraph graph) {
10 return measure(() { 10 return measure(() {
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 assert(dominatedCount == 3); 400 assert(dominatedCount == 3);
401 assert(dominated.last().isExitBlock()); 401 assert(dominated.last().isExitBlock());
402 visitBasicBlock(dominated[1]); 402 visitBasicBlock(dominated[1]);
403 visitBasicBlock(dominated[2]); 403 visitBasicBlock(dominated[2]);
404 } 404 }
405 } 405 }
406 406
407 visitInvokeDynamicMethod(HInvokeDynamicMethod node) { 407 visitInvokeDynamicMethod(HInvokeDynamicMethod node) {
408 use(node.receiver); 408 use(node.receiver);
409 buffer.add('.'); 409 buffer.add('.');
410 // Remove 'this' from the number of arguments.
411 int argumentCount = node.inputs.length - 1;
412 buffer.add(compiler.namer.instanceMethodName(node.name, argumentCount));
413 visitArguments(node.inputs);
414 // Avoid adding the generative constructor name to the list of 410 // Avoid adding the generative constructor name to the list of
415 // seen selectors. 411 // seen selectors.
416 if (node.inputs[0] is !HForeignNew) { 412 if (node.inputs[0] is HForeignNew) {
413 // Remove 'this' from the number of arguments.
414 int argumentCount = node.inputs.length - 1;
415 buffer.add(compiler.namer.instanceMethodName(node.name, argumentCount));
416 visitArguments(node.inputs);
417 } else {
418 buffer.add(compiler.namer.instanceMethodInvocationName(
419 node.name, node.selector));
420 visitArguments(node.inputs);
417 compiler.registerDynamicInvocation(node.name, node.selector); 421 compiler.registerDynamicInvocation(node.name, node.selector);
418 } 422 }
419 } 423 }
420 424
421 visitInvokeDynamicSetter(HInvokeDynamicSetter node) { 425 visitInvokeDynamicSetter(HInvokeDynamicSetter node) {
422 use(node.receiver); 426 use(node.receiver);
423 buffer.add('.'); 427 buffer.add('.');
424 buffer.add(compiler.namer.setterName(node.name)); 428 buffer.add(compiler.namer.setterName(node.name));
425 visitArguments(node.inputs); 429 visitArguments(node.inputs);
426 compiler.registerDynamicSetter(node.name); 430 compiler.registerDynamicSetter(node.name);
427 } 431 }
428 432
429 visitInvokeDynamicGetter(HInvokeDynamicGetter node) { 433 visitInvokeDynamicGetter(HInvokeDynamicGetter node) {
430 use(node.receiver); 434 use(node.receiver);
431 buffer.add('.'); 435 buffer.add('.');
432 buffer.add(compiler.namer.getterName(node.name)); 436 buffer.add(compiler.namer.getterName(node.name));
433 visitArguments(node.inputs); 437 visitArguments(node.inputs);
434 compiler.registerDynamicGetter(node.name); 438 compiler.registerDynamicGetter(node.name);
435 } 439 }
436 440
437 visitInvokeClosure(HInvokeClosure node) { 441 visitInvokeClosure(HInvokeClosure node) {
438 use(node.receiver); 442 use(node.receiver);
439 buffer.add('.'); 443 buffer.add('.');
440 buffer.add(compiler.namer.closureInvocationName(node.inputs.length - 1)); 444 buffer.add(compiler.namer.closureInvocationName(node.selector));
441 visitArguments(node.inputs); 445 visitArguments(node.inputs);
442 } 446 }
443 447
444 visitInvokeStatic(HInvokeStatic node) { 448 visitInvokeStatic(HInvokeStatic node) {
445 use(node.target); 449 use(node.target);
446 visitArguments(node.inputs); 450 visitArguments(node.inputs);
447 } 451 }
448 452
449 visitInvokeSuper(HInvokeSuper node) { 453 visitInvokeSuper(HInvokeSuper node) {
450 Element superMethod = node.element; 454 Element superMethod = node.element;
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 startBailoutSwitch(); 1087 startBailoutSwitch();
1084 } 1088 }
1085 } 1089 }
1086 1090
1087 void endElse(HIf node) { 1091 void endElse(HIf node) {
1088 if (node.elseBlock.hasBailouts()) { 1092 if (node.elseBlock.hasBailouts()) {
1089 endBailoutSwitch(); 1093 endBailoutSwitch();
1090 } 1094 }
1091 } 1095 }
1092 } 1096 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698