| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import '../compiler.dart'; | 5 import '../compiler.dart'; |
| 6 import '../io/source_information.dart'; | 6 import '../io/source_information.dart'; |
| 7 import '../js_backend/js_backend.dart'; | 7 import '../js_backend/js_backend.dart'; |
| 8 import '../tree/tree.dart' as ast; | 8 import '../tree/tree.dart' as ast; |
| 9 | 9 |
| 10 import 'graph_builder.dart'; | 10 import 'graph_builder.dart'; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 builder.push(new HNot(builder.pop(), builder.commonMasks.boolType)); | 164 builder.push(new HNot(builder.pop(), builder.commonMasks.boolType)); |
| 165 } | 165 } |
| 166 } | 166 } |
| 167 | 167 |
| 168 void visitThen() { | 168 void visitThen() { |
| 169 right(); | 169 right(); |
| 170 boolifiedRight = builder.popBoolified(); | 170 boolifiedRight = builder.popBoolified(); |
| 171 } | 171 } |
| 172 | 172 |
| 173 handleIf(visitCondition, visitThen, null); | 173 handleIf(visitCondition, visitThen, null); |
| 174 HConstant notIsAnd = builder.graph.addConstantBool(!isAnd, compiler); | 174 HConstant notIsAnd = |
| 175 builder.graph.addConstantBool(!isAnd, builder.closedWorld); |
| 175 HPhi result = new HPhi.manyInputs( | 176 HPhi result = new HPhi.manyInputs( |
| 176 null, | 177 null, |
| 177 <HInstruction>[boolifiedRight, notIsAnd], | 178 <HInstruction>[boolifiedRight, notIsAnd], |
| 178 builder.commonMasks.dynamicType); | 179 builder.commonMasks.dynamicType); |
| 179 builder.current.addPhi(result); | 180 builder.current.addPhi(result); |
| 180 builder.stack.add(result); | 181 builder.stack.add(result); |
| 181 } | 182 } |
| 182 | 183 |
| 183 void _handleDiamondBranch( | 184 void _handleDiamondBranch( |
| 184 void visitCondition(), void visitThen(), void visitElse(), | 185 void visitCondition(), void visitThen(), void visitElse(), |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 new HSubGraphBlockInformation(elseBranch.graph)); | 220 new HSubGraphBlockInformation(elseBranch.graph)); |
| 220 | 221 |
| 221 HBasicBlock conditionStartBlock = conditionBranch.block; | 222 HBasicBlock conditionStartBlock = conditionBranch.block; |
| 222 conditionStartBlock.setBlockFlow(info, joinBlock); | 223 conditionStartBlock.setBlockFlow(info, joinBlock); |
| 223 SubGraph conditionGraph = conditionBranch.graph; | 224 SubGraph conditionGraph = conditionBranch.graph; |
| 224 HIf branch = conditionGraph.end.last; | 225 HIf branch = conditionGraph.end.last; |
| 225 assert(branch is HIf); | 226 assert(branch is HIf); |
| 226 branch.blockInformation = conditionStartBlock.blockFlow; | 227 branch.blockInformation = conditionStartBlock.blockFlow; |
| 227 } | 228 } |
| 228 } | 229 } |
| OLD | NEW |