| 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 import '../closure.dart'; | 5 import '../closure.dart'; |
| 6 import '../common.dart'; | 6 import '../common.dart'; |
| 7 import '../common/backend_api.dart' show BackendClasses; | 7 import '../common/backend_api.dart' show BackendClasses; |
| 8 import '../compiler.dart' show Compiler; | 8 import '../compiler.dart' show Compiler; |
| 9 import '../constants/constant_system.dart'; | 9 import '../constants/constant_system.dart'; |
| 10 import '../constants/values.dart'; | 10 import '../constants/values.dart'; |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 | 264 |
| 265 HConstant addConstantBool(bool value, ClosedWorld closedWorld) { | 265 HConstant addConstantBool(bool value, ClosedWorld closedWorld) { |
| 266 return addConstant( | 266 return addConstant( |
| 267 closedWorld.constantSystem.createBool(value), closedWorld); | 267 closedWorld.constantSystem.createBool(value), closedWorld); |
| 268 } | 268 } |
| 269 | 269 |
| 270 HConstant addConstantNull(ClosedWorld closedWorld) { | 270 HConstant addConstantNull(ClosedWorld closedWorld) { |
| 271 return addConstant(closedWorld.constantSystem.createNull(), closedWorld); | 271 return addConstant(closedWorld.constantSystem.createNull(), closedWorld); |
| 272 } | 272 } |
| 273 | 273 |
| 274 HConstant addConstantUnreachable(ClosedWorld closedWorld) { |
| 275 // A constant with an empty type used as the HInstruction of an expression |
| 276 // in an unreachable context. |
| 277 return addConstant( |
| 278 new SyntheticConstantValue( |
| 279 SyntheticConstantKind.EMPTY_VALUE, const TypeMask.nonNullEmpty()), |
| 280 closedWorld); |
| 281 } |
| 282 |
| 274 void finalize() { | 283 void finalize() { |
| 275 addBlock(exit); | 284 addBlock(exit); |
| 276 exit.open(); | 285 exit.open(); |
| 277 exit.close(new HExit()); | 286 exit.close(new HExit()); |
| 278 assignDominators(); | 287 assignDominators(); |
| 279 } | 288 } |
| 280 | 289 |
| 281 void assignDominators() { | 290 void assignDominators() { |
| 282 // Run through the blocks in order of increasing ids so we are | 291 // Run through the blocks in order of increasing ids so we are |
| 283 // guaranteed that we have computed dominators for all blocks | 292 // guaranteed that we have computed dominators for all blocks |
| (...skipping 3180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3464 class HDynamicType extends HRuntimeType { | 3473 class HDynamicType extends HRuntimeType { |
| 3465 HDynamicType(DynamicType dartType, TypeMask instructionType) | 3474 HDynamicType(DynamicType dartType, TypeMask instructionType) |
| 3466 : super(const <HInstruction>[], dartType, instructionType); | 3475 : super(const <HInstruction>[], dartType, instructionType); |
| 3467 | 3476 |
| 3468 accept(HVisitor visitor) => visitor.visitDynamicType(this); | 3477 accept(HVisitor visitor) => visitor.visitDynamicType(this); |
| 3469 | 3478 |
| 3470 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; | 3479 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; |
| 3471 | 3480 |
| 3472 bool typeEquals(HInstruction other) => other is HDynamicType; | 3481 bool typeEquals(HInstruction other) => other is HDynamicType; |
| 3473 } | 3482 } |
| OLD | NEW |