| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 cps_ir.optimization.inline; | 5 library cps_ir.optimization.inline; |
| 6 | 6 |
| 7 import 'cps_fragment.dart'; | 7 import 'cps_fragment.dart'; |
| 8 import 'cps_ir_builder.dart' show ThisParameterLocal; | 8 import 'cps_ir_builder.dart' show ThisParameterLocal; |
| 9 import 'cps_ir_nodes.dart'; | 9 import 'cps_ir_nodes.dart'; |
| 10 import 'optimizers.dart'; | 10 import 'optimizers.dart'; |
| 11 import 'type_mask_system.dart' show TypeMaskSystem; | 11 import 'type_mask_system.dart' show TypeMaskSystem; |
| 12 import '../compiler.dart' show Compiler; | |
| 13 import '../dart_types.dart' show DartType, GenericType; | 12 import '../dart_types.dart' show DartType, GenericType; |
| 14 import '../io/source_information.dart' show SourceInformation; | |
| 15 import '../world.dart' show World; | 13 import '../world.dart' show World; |
| 16 import '../constants/values.dart' show ConstantValue; | |
| 17 import '../elements/elements.dart'; | 14 import '../elements/elements.dart'; |
| 18 import '../js_backend/js_backend.dart' show JavaScriptBackend; | 15 import '../js_backend/js_backend.dart' show JavaScriptBackend; |
| 19 import '../js_backend/codegen/task.dart' show CpsFunctionCompiler; | 16 import '../js_backend/codegen/task.dart' show CpsFunctionCompiler; |
| 20 import '../types/types.dart' show | 17 import '../types/types.dart' show |
| 21 FlatTypeMask, ForwardingTypeMask, TypeMask, UnionTypeMask; | 18 FlatTypeMask, ForwardingTypeMask, TypeMask, UnionTypeMask; |
| 22 import '../universe/call_structure.dart' show CallStructure; | 19 import '../universe/call_structure.dart' show CallStructure; |
| 23 import '../universe/selector.dart' show Selector; | 20 import '../universe/selector.dart' show Selector; |
| 24 | 21 |
| 25 /// Inlining stack entries. | 22 /// Inlining stack entries. |
| 26 /// | 23 /// |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 // We cannot inline a constructor invocation containing type arguments | 506 // We cannot inline a constructor invocation containing type arguments |
| 510 // because CreateInstance in the body does not know the type arguments. | 507 // because CreateInstance in the body does not know the type arguments. |
| 511 // We would incorrectly instantiate a class like A instead of A<B>. | 508 // We would incorrectly instantiate a class like A instead of A<B>. |
| 512 // TODO(kmillikin): try to fix this. | 509 // TODO(kmillikin): try to fix this. |
| 513 GenericType generic = node.dartType; | 510 GenericType generic = node.dartType; |
| 514 if (generic.typeArguments.any((DartType t) => !t.isDynamic)) return null; | 511 if (generic.typeArguments.any((DartType t) => !t.isDynamic)) return null; |
| 515 } | 512 } |
| 516 return tryInlining(node, node.target, null); | 513 return tryInlining(node, node.target, null); |
| 517 } | 514 } |
| 518 } | 515 } |
| OLD | NEW |