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

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

Issue 9166010: Implement super calls. (Closed) Base URL: https://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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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(WorkElement work, HGraph graph) { 9 String generate(WorkElement work, HGraph graph) {
10 return measure(() { 10 return measure(() {
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 393
394 visitInvokeDynamicGetter(HInvokeDynamicGetter node) 394 visitInvokeDynamicGetter(HInvokeDynamicGetter node)
395 => visitInvokeDynamic(node); 395 => visitInvokeDynamic(node);
396 396
397 visitInvokeStatic(HInvokeStatic node) { 397 visitInvokeStatic(HInvokeStatic node) {
398 compiler.registerStaticInvocation(node.element); 398 compiler.registerStaticInvocation(node.element);
399 use(node.target); 399 use(node.target);
400 visitArguments(node.inputs); 400 visitArguments(node.inputs);
401 } 401 }
402 402
403 visitInvokeSuper(HInvokeSuper node) {
404 Element superMethod = node.element;
405 Element superClass = superMethod.enclosingElement;
406 String className = compiler.namer.isolatePropertyAccess(superClass);
407 String methodName = compiler.namer.instanceName(superMethod.name);
408 buffer.add('$className.prototype.$methodName.call');
409 visitArguments(node.inputs);
410 }
411
403 visitForeign(HForeign node) { 412 visitForeign(HForeign node) {
404 String code = '${node.code}'; 413 String code = '${node.code}';
405 List<HInstruction> inputs = node.inputs; 414 List<HInstruction> inputs = node.inputs;
406 for (int i = 0; i < inputs.length; i++) { 415 for (int i = 0; i < inputs.length; i++) {
407 HInstruction input = inputs[i]; 416 HInstruction input = inputs[i];
408 String name; 417 String name;
409 if (input is HParameterValue) { 418 if (input is HParameterValue) {
410 name = parameter(input); 419 name = parameter(input);
411 } else { 420 } else {
412 assert(!input.generateAtUseSite()); 421 assert(!input.generateAtUseSite());
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 secondBlock.last.tryGenerateAtUseSite(); 936 secondBlock.last.tryGenerateAtUseSite();
928 } 937 }
929 938
930 void visitBasicBlock(HBasicBlock block) { 939 void visitBasicBlock(HBasicBlock block) {
931 if (!block.phis.isEmpty() && 940 if (!block.phis.isEmpty() &&
932 block.phis.first == block.phis.last) { 941 block.phis.first == block.phis.last) {
933 detectLogicControlFlow(block.phis.first); 942 detectLogicControlFlow(block.phis.first);
934 } 943 }
935 } 944 }
936 } 945 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698