| OLD | NEW |
| 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 => visitInvokeDynamic(node); | 391 => visitInvokeDynamic(node); |
| 392 | 392 |
| 393 visitInvokeDynamicGetter(HInvokeDynamicGetter node) | 393 visitInvokeDynamicGetter(HInvokeDynamicGetter node) |
| 394 => visitInvokeDynamic(node); | 394 => visitInvokeDynamic(node); |
| 395 | 395 |
| 396 visitInvokeStatic(HInvokeStatic node) { | 396 visitInvokeStatic(HInvokeStatic node) { |
| 397 use(node.target); | 397 use(node.target); |
| 398 visitArguments(node.inputs); | 398 visitArguments(node.inputs); |
| 399 } | 399 } |
| 400 | 400 |
| 401 visitInvokeSuper(HInvokeSuper node) { |
| 402 Element superMethod = node.element; |
| 403 Element superClass = superMethod.enclosingElement; |
| 404 String className = compiler.namer.isolatePropertyAccess(superClass); |
| 405 String methodName = compiler.namer.instanceName(superMethod.name); |
| 406 buffer.add('$className.prototype.$methodName.call'); |
| 407 visitArguments(node.inputs); |
| 408 } |
| 409 |
| 401 visitForeign(HForeign node) { | 410 visitForeign(HForeign node) { |
| 402 String code = '${node.code}'; | 411 String code = '${node.code}'; |
| 403 List<HInstruction> inputs = node.inputs; | 412 List<HInstruction> inputs = node.inputs; |
| 404 for (int i = 0; i < inputs.length; i++) { | 413 for (int i = 0; i < inputs.length; i++) { |
| 405 HInstruction input = inputs[i]; | 414 HInstruction input = inputs[i]; |
| 406 String name; | 415 String name; |
| 407 if (input is HParameterValue) { | 416 if (input is HParameterValue) { |
| 408 name = parameter(input); | 417 name = parameter(input); |
| 409 } else { | 418 } else { |
| 410 assert(!input.generateAtUseSite()); | 419 assert(!input.generateAtUseSite()); |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| OLD | NEW |