| OLD | NEW |
| 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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 visitInvokeSuper(HInvokeSuper node) { | 449 visitInvokeSuper(HInvokeSuper node) { |
| 450 Element superMethod = node.element; | 450 Element superMethod = node.element; |
| 451 Element superClass = superMethod.enclosingElement; | 451 Element superClass = superMethod.enclosingElement; |
| 452 // Remove the element and 'this'. | 452 // Remove the element and 'this'. |
| 453 int argumentCount = node.inputs.length - 2; | 453 int argumentCount = node.inputs.length - 2; |
| 454 String className = compiler.namer.isolatePropertyAccess(superClass); | 454 String className = compiler.namer.isolatePropertyAccess(superClass); |
| 455 String methodName = compiler.namer.instanceMethodName( | 455 String methodName = compiler.namer.instanceMethodName( |
| 456 superMethod.name, argumentCount); | 456 superMethod.name, argumentCount); |
| 457 buffer.add('$className.prototype.$methodName.call'); | 457 buffer.add('$className.prototype.$methodName.call'); |
| 458 visitArguments(node.inputs); | 458 visitArguments(node.inputs); |
| 459 compiler.registerStaticUse(superMethod); |
| 459 } | 460 } |
| 460 | 461 |
| 461 visitForeign(HForeign node) { | 462 visitForeign(HForeign node) { |
| 462 String code = '${node.code}'; | 463 String code = '${node.code}'; |
| 463 List<HInstruction> inputs = node.inputs; | 464 List<HInstruction> inputs = node.inputs; |
| 464 for (int i = 0; i < inputs.length; i++) { | 465 for (int i = 0; i < inputs.length; i++) { |
| 465 HInstruction input = inputs[i]; | 466 HInstruction input = inputs[i]; |
| 466 String name; | 467 String name; |
| 467 if (input is HParameterValue) { | 468 if (input is HParameterValue) { |
| 468 name = parameter(input); | 469 name = parameter(input); |
| (...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1082 startBailoutSwitch(); | 1083 startBailoutSwitch(); |
| 1083 } | 1084 } |
| 1084 } | 1085 } |
| 1085 | 1086 |
| 1086 void endElse(HIf node) { | 1087 void endElse(HIf node) { |
| 1087 if (node.elseBlock.hasBailouts()) { | 1088 if (node.elseBlock.hasBailouts()) { |
| 1088 endBailoutSwitch(); | 1089 endBailoutSwitch(); |
| 1089 } | 1090 } |
| 1090 } | 1091 } |
| 1091 } | 1092 } |
| OLD | NEW |