Chromium Code Reviews| 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 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 529 name = "this"; | 529 name = "this"; |
| 530 } else if (input is HParameterValue) { | 530 } else if (input is HParameterValue) { |
| 531 HParameterValue parameter = input; | 531 HParameterValue parameter = input; |
| 532 name = parameterNames[parameter.element]; | 532 name = parameterNames[parameter.element]; |
| 533 } else { | 533 } else { |
| 534 assert(!input.generateAtUseSite()); | 534 assert(!input.generateAtUseSite()); |
| 535 name = temporary(input); | 535 name = temporary(input); |
| 536 } | 536 } |
| 537 code = code.replaceAll('\$$i', name); | 537 code = code.replaceAll('\$$i', name); |
| 538 } | 538 } |
| 539 buffer.add('($code)'); | 539 buffer.add('$code'); |
|
floitsch
2012/02/19 00:59:43
Afair we do 'generateAtUseSite' for HForeigns. Unl
ngeoffray
2012/02/20 17:00:02
Added a test generateAtUseSite to know if we need
| |
| 540 } | 540 } |
| 541 | 541 |
| 542 visitForeignNew(HForeignNew node) { | 542 visitForeignNew(HForeignNew node) { |
| 543 String jsClassReference = compiler.namer.isolateAccess(node.element); | 543 String jsClassReference = compiler.namer.isolateAccess(node.element); |
| 544 buffer.add('new $jsClassReference('); | 544 buffer.add('new $jsClassReference('); |
| 545 // We can't use 'visitArguments', since our arguments start at input[0]. | 545 // We can't use 'visitArguments', since our arguments start at input[0]. |
| 546 List<HInstruction> inputs = node.inputs; | 546 List<HInstruction> inputs = node.inputs; |
| 547 for (int i = 0; i < inputs.length; i++) { | 547 for (int i = 0; i < inputs.length; i++) { |
| 548 if (i != 0) buffer.add(', '); | 548 if (i != 0) buffer.add(', '); |
| 549 use(inputs[i]); | 549 use(inputs[i]); |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1145 startBailoutSwitch(); | 1145 startBailoutSwitch(); |
| 1146 } | 1146 } |
| 1147 } | 1147 } |
| 1148 | 1148 |
| 1149 void endElse(HIf node) { | 1149 void endElse(HIf node) { |
| 1150 if (node.elseBlock.hasBailouts()) { | 1150 if (node.elseBlock.hasBailouts()) { |
| 1151 endBailoutSwitch(); | 1151 endBailoutSwitch(); |
| 1152 } | 1152 } |
| 1153 } | 1153 } |
| 1154 } | 1154 } |
| OLD | NEW |