| 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 part of ssa; | 5 part of ssa; |
| 6 | 6 |
| 7 class SsaFunctionCompiler implements FunctionCompiler { | 7 class SsaFunctionCompiler implements FunctionCompiler { |
| 8 SsaCodeGeneratorTask generator; | 8 SsaCodeGeneratorTask generator; |
| 9 SsaBuilderTask builder; | 9 SsaBuilderTask builder; |
| 10 SsaOptimizerTask optimizer; | 10 SsaOptimizerTask optimizer; |
| (...skipping 7536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7547 | 7547 |
| 7548 if (isExpression) { | 7548 if (isExpression) { |
| 7549 assert(thenValue != null && elseValue != null); | 7549 assert(thenValue != null && elseValue != null); |
| 7550 JavaScriptBackend backend = builder.backend; | 7550 JavaScriptBackend backend = builder.backend; |
| 7551 HPhi phi = new HPhi.manyInputs( | 7551 HPhi phi = new HPhi.manyInputs( |
| 7552 null, <HInstruction>[thenValue, elseValue], backend.dynamicType); | 7552 null, <HInstruction>[thenValue, elseValue], backend.dynamicType); |
| 7553 joinBranch.block.addPhi(phi); | 7553 joinBranch.block.addPhi(phi); |
| 7554 builder.stack.add(phi); | 7554 builder.stack.add(phi); |
| 7555 } | 7555 } |
| 7556 | 7556 |
| 7557 HBasicBlock thenBlock = thenBranch.block; | |
| 7558 HBasicBlock elseBlock = elseBranch.block; | |
| 7559 HBasicBlock joinBlock; | 7557 HBasicBlock joinBlock; |
| 7560 // If at least one branch did not abort, open the joinBranch. | 7558 // If at least one branch did not abort, open the joinBranch. |
| 7561 if (!joinBranch.block.predecessors.isEmpty) { | 7559 if (!joinBranch.block.predecessors.isEmpty) { |
| 7562 startBranch(joinBranch); | 7560 startBranch(joinBranch); |
| 7563 joinBlock = joinBranch.block; | 7561 joinBlock = joinBranch.block; |
| 7564 } | 7562 } |
| 7565 | 7563 |
| 7566 HIfBlockInformation info = | 7564 HIfBlockInformation info = |
| 7567 new HIfBlockInformation( | 7565 new HIfBlockInformation( |
| 7568 new HSubExpressionBlockInformation(conditionBranch.graph), | 7566 new HSubExpressionBlockInformation(conditionBranch.graph), |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7664 if (unaliased is TypedefType) throw 'unable to unalias $type'; | 7662 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
| 7665 unaliased.accept(this, builder); | 7663 unaliased.accept(this, builder); |
| 7666 } | 7664 } |
| 7667 | 7665 |
| 7668 void visitDynamicType(DynamicType type, SsaBuilder builder) { | 7666 void visitDynamicType(DynamicType type, SsaBuilder builder) { |
| 7669 JavaScriptBackend backend = builder.compiler.backend; | 7667 JavaScriptBackend backend = builder.compiler.backend; |
| 7670 ClassElement cls = backend.findHelper('DynamicRuntimeType'); | 7668 ClassElement cls = backend.findHelper('DynamicRuntimeType'); |
| 7671 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); | 7669 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); |
| 7672 } | 7670 } |
| 7673 } | 7671 } |
| OLD | NEW |