OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 code_generator; | 5 library code_generator; |
6 | 6 |
7 import 'glue.dart'; | 7 import 'glue.dart'; |
8 | 8 |
9 import '../../tree_ir/tree_ir_nodes.dart' as tree_ir; | 9 import '../../tree_ir/tree_ir_nodes.dart' as tree_ir; |
10 import '../../tree_ir/tree_ir_nodes.dart' show BuiltinOperator; | 10 import '../../tree_ir/tree_ir_nodes.dart' show BuiltinOperator; |
11 import '../../js/js.dart' as js; | 11 import '../../js/js.dart' as js; |
12 import '../../elements/elements.dart'; | 12 import '../../elements/elements.dart'; |
13 import '../../io/source_information.dart' show SourceInformation; | 13 import '../../io/source_information.dart' show SourceInformation; |
14 import '../../util/maplet.dart'; | 14 import '../../util/maplet.dart'; |
15 import '../../constants/values.dart'; | 15 import '../../constants/values.dart'; |
16 import '../../dart2jslib.dart'; | 16 import '../../dart2jslib.dart'; |
17 import '../../dart_types.dart'; | 17 import '../../dart_types.dart'; |
18 import '../../types/types.dart' show TypeMask; | 18 import '../../types/types.dart' show TypeMask; |
19 import '../../universe/universe.dart' show | 19 import '../../universe/universe.dart' show UniverseSelector; |
20 Selector, | |
21 UniverseSelector; | |
22 import '../../util/util.dart' show CURRENT_ELEMENT_SPANNABLE; | |
23 import '../../closure.dart' show ClosureClassElement; | 20 import '../../closure.dart' show ClosureClassElement; |
24 | 21 |
25 class CodegenBailout { | 22 class CodegenBailout { |
26 final tree_ir.Node node; | 23 final tree_ir.Node node; |
27 final String reason; | 24 final String reason; |
28 CodegenBailout(this.node, this.reason); | 25 CodegenBailout(this.node, this.reason); |
29 String get message { | 26 String get message { |
30 return 'bailout${node != null ? " on $node" : ""}: $reason'; | 27 return 'bailout${node != null ? " on $node" : ""}: $reason'; |
31 } | 28 } |
32 } | 29 } |
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 js.Expression visitAwait(tree_ir.Await node) { | 833 js.Expression visitAwait(tree_ir.Await node) { |
837 return new js.Await(visitExpression(node.input)); | 834 return new js.Await(visitExpression(node.input)); |
838 } | 835 } |
839 | 836 |
840 visitFunctionExpression(tree_ir.FunctionExpression node) { | 837 visitFunctionExpression(tree_ir.FunctionExpression node) { |
841 // FunctionExpressions are currently unused. | 838 // FunctionExpressions are currently unused. |
842 // We might need them if we want to emit raw JS nested functions. | 839 // We might need them if we want to emit raw JS nested functions. |
843 throw 'FunctionExpressions should not be used'; | 840 throw 'FunctionExpressions should not be used'; |
844 } | 841 } |
845 } | 842 } |
OLD | NEW |