| 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'; | |
| 8 | |
| 9 import '../../closure.dart' show ClosureClassElement; | 7 import '../../closure.dart' show ClosureClassElement; |
| 10 import '../../common/codegen.dart' show CodegenRegistry; | 8 import '../../common/codegen.dart' show CodegenRegistry; |
| 11 import '../../constants/values.dart'; | 9 import '../../constants/values.dart'; |
| 12 import '../../dart_types.dart'; | 10 import '../../dart_types.dart'; |
| 13 import '../../elements/elements.dart'; | 11 import '../../elements/elements.dart'; |
| 14 import '../../io/source_information.dart' show SourceInformation; | 12 import '../../io/source_information.dart' show SourceInformation; |
| 15 import '../../js/js.dart' as js; | 13 import '../../js/js.dart' as js; |
| 16 import '../../tree_ir/tree_ir_nodes.dart' as tree_ir; | 14 import '../../tree_ir/tree_ir_nodes.dart' as tree_ir; |
| 17 import '../../tree_ir/tree_ir_nodes.dart' | 15 import '../../tree_ir/tree_ir_nodes.dart' |
| 18 show BuiltinMethod, BuiltinOperator, isCompoundableOperator; | 16 show BuiltinMethod, BuiltinOperator, isCompoundableOperator; |
| 19 import '../../types/types.dart' show TypeMask; | 17 import '../../types/types.dart' show TypeMask; |
| 20 import '../../universe/call_structure.dart' show CallStructure; | 18 import '../../universe/call_structure.dart' show CallStructure; |
| 21 import '../../universe/selector.dart' show Selector; | 19 import '../../universe/selector.dart' show Selector; |
| 22 import '../../universe/use.dart' show DynamicUse, StaticUse, TypeUse; | 20 import '../../universe/use.dart' show DynamicUse, StaticUse, TypeUse; |
| 23 import '../../util/maplet.dart'; | 21 import '../../util/maplet.dart'; |
| 22 import 'glue.dart'; |
| 24 | 23 |
| 25 class CodegenBailout { | 24 class CodegenBailout { |
| 26 final tree_ir.Node node; | 25 final tree_ir.Node node; |
| 27 final String reason; | 26 final String reason; |
| 28 CodegenBailout(this.node, this.reason); | 27 CodegenBailout(this.node, this.reason); |
| 29 String get message { | 28 String get message { |
| 30 return 'bailout${node != null ? " on $node" : ""}: $reason'; | 29 return 'bailout${node != null ? " on $node" : ""}: $reason'; |
| 31 } | 30 } |
| 32 } | 31 } |
| 33 | 32 |
| (...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1232 void registerDefaultParameterValues(ExecutableElement element) { | 1231 void registerDefaultParameterValues(ExecutableElement element) { |
| 1233 if (element is! FunctionElement) return; | 1232 if (element is! FunctionElement) return; |
| 1234 FunctionElement function = element; | 1233 FunctionElement function = element; |
| 1235 if (function.isStatic) return; // Defaults are inlined at call sites. | 1234 if (function.isStatic) return; // Defaults are inlined at call sites. |
| 1236 function.functionSignature.forEachOptionalParameter((param) { | 1235 function.functionSignature.forEachOptionalParameter((param) { |
| 1237 ConstantValue constant = glue.getDefaultParameterValue(param); | 1236 ConstantValue constant = glue.getDefaultParameterValue(param); |
| 1238 registry.registerCompileTimeConstant(constant); | 1237 registry.registerCompileTimeConstant(constant); |
| 1239 }); | 1238 }); |
| 1240 } | 1239 } |
| 1241 } | 1240 } |
| OLD | NEW |