| 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 | 9 |
| 10 String buildJavaScriptFunction(FunctionElement element, | 10 String buildJavaScriptFunction(FunctionElement element, |
| (...skipping 2240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2251 } else { | 2251 } else { |
| 2252 assert(guard.guarded is HParameterValue); | 2252 assert(guard.guarded is HParameterValue); |
| 2253 buffer.add(' 0'); | 2253 buffer.add(' 0'); |
| 2254 } | 2254 } |
| 2255 buffer.add(')'); | 2255 buffer.add(')'); |
| 2256 } | 2256 } |
| 2257 | 2257 |
| 2258 void visitTypeGuard(HTypeGuard node) { | 2258 void visitTypeGuard(HTypeGuard node) { |
| 2259 addIndentation(); | 2259 addIndentation(); |
| 2260 HInstruction input = node.guarded; | 2260 HInstruction input = node.guarded; |
| 2261 assert(!isGenerateAtUseSite(input) || input.isCodeMotionInvariant()); | |
| 2262 if (node.isInteger()) { | 2261 if (node.isInteger()) { |
| 2263 buffer.add('if ('); | 2262 buffer.add('if ('); |
| 2264 checkInt(input, '!=='); | 2263 checkInt(input, '!=='); |
| 2265 buffer.add(') '); | 2264 buffer.add(') '); |
| 2266 bailout(node, 'Not an integer'); | 2265 bailout(node, 'Not an integer'); |
| 2267 } else if (node.isNumber()) { | 2266 } else if (node.isNumber()) { |
| 2268 buffer.add('if ('); | 2267 buffer.add('if ('); |
| 2269 checkNum(input, '!=='); | 2268 checkNum(input, '!=='); |
| 2270 buffer.add(') '); | 2269 buffer.add(') '); |
| 2271 bailout(node, 'Not a number'); | 2270 bailout(node, 'Not a number'); |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2611 startBailoutSwitch(); | 2610 startBailoutSwitch(); |
| 2612 } | 2611 } |
| 2613 } | 2612 } |
| 2614 | 2613 |
| 2615 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { | 2614 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { |
| 2616 if (labeledBlockInfo.body.start.hasGuards()) { | 2615 if (labeledBlockInfo.body.start.hasGuards()) { |
| 2617 endBailoutSwitch(); | 2616 endBailoutSwitch(); |
| 2618 } | 2617 } |
| 2619 } | 2618 } |
| 2620 } | 2619 } |
| OLD | NEW |