| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library dart2js.ir_builder; | 5 library dart2js.ir_builder; |
| 6 | 6 |
| 7 import 'ir_nodes.dart'; | 7 import 'ir_nodes.dart'; |
| 8 import '../elements/elements.dart'; | 8 import '../elements/elements.dart'; |
| 9 import '../elements/modelx.dart' show FunctionElementX; | 9 import '../elements/modelx.dart' show FunctionElementX; |
| 10 import '../dart2jslib.dart'; | 10 import '../dart2jslib.dart'; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 }); | 88 }); |
| 89 } | 89 } |
| 90 | 90 |
| 91 bool irEnabled() { | 91 bool irEnabled() { |
| 92 // TODO(lry): support checked-mode checks. | 92 // TODO(lry): support checked-mode checks. |
| 93 if (compiler.enableTypeAssertions || | 93 if (compiler.enableTypeAssertions || |
| 94 compiler.backend is !JavaScriptBackend || | 94 compiler.backend is !JavaScriptBackend || |
| 95 compiler.enableConcreteTypeInference) { | 95 compiler.enableConcreteTypeInference) { |
| 96 return false; | 96 return false; |
| 97 } | 97 } |
| 98 return true; | 98 return const bool.fromEnvironment('enable_ir', defaultValue: true); |
| 99 } | 99 } |
| 100 | 100 |
| 101 bool canBuild(Element element) { | 101 bool canBuild(Element element) { |
| 102 // TODO(lry): support lazy initializers. | 102 // TODO(lry): support lazy initializers. |
| 103 FunctionElement function = element.asFunctionElement(); | 103 FunctionElement function = element.asFunctionElement(); |
| 104 if (function == null) return false; | 104 if (function == null) return false; |
| 105 | 105 |
| 106 // TODO(lry): support functions with parameters. | 106 // TODO(lry): support functions with parameters. |
| 107 FunctionSignature signature = function.computeSignature(compiler); | 107 FunctionSignature signature = function.computeSignature(compiler); |
| 108 if (signature.parameterCount > 0) return false; | 108 if (signature.parameterCount > 0) return false; |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 | 415 |
| 416 void exitBlock() { | 416 void exitBlock() { |
| 417 blockBuilders.removeLast(); | 417 blockBuilders.removeLast(); |
| 418 } | 418 } |
| 419 } | 419 } |
| 420 | 420 |
| 421 class BlockBuilder { | 421 class BlockBuilder { |
| 422 List<IrNode> statements = <IrNode>[]; | 422 List<IrNode> statements = <IrNode>[]; |
| 423 bool hasReturn = false; | 423 bool hasReturn = false; |
| 424 } | 424 } |
| OLD | NEW |