| 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 'package:js_ast/js_ast.dart' as js; |
| 8 |
| 9 import '../dart_types.dart' show DartType, GenericType; |
| 10 import '../elements/elements.dart'; |
| 11 import '../js_backend/codegen/task.dart' show CpsFunctionCompiler; |
| 12 import '../js_backend/js_backend.dart' show JavaScriptBackend; |
| 13 import '../types/types.dart' show TypeMask; |
| 14 import '../universe/call_structure.dart' show CallStructure; |
| 15 import '../universe/selector.dart' show Selector; |
| 16 import '../world.dart' show World; |
| 7 import 'cps_fragment.dart'; | 17 import 'cps_fragment.dart'; |
| 8 import 'cps_ir_builder.dart' show ThisParameterLocal; | 18 import 'cps_ir_builder.dart' show ThisParameterLocal; |
| 9 import 'cps_ir_nodes.dart'; | 19 import 'cps_ir_nodes.dart'; |
| 10 import 'optimizers.dart'; | 20 import 'optimizers.dart'; |
| 11 import 'type_mask_system.dart' show TypeMaskSystem; | 21 import 'type_mask_system.dart' show TypeMaskSystem; |
| 12 import '../dart_types.dart' show DartType, GenericType; | |
| 13 import '../world.dart' show World; | |
| 14 import '../elements/elements.dart'; | |
| 15 import '../js_backend/js_backend.dart' show JavaScriptBackend; | |
| 16 import '../js_backend/codegen/task.dart' show CpsFunctionCompiler; | |
| 17 import '../types/types.dart' | |
| 18 show FlatTypeMask, ForwardingTypeMask, TypeMask, UnionTypeMask; | |
| 19 import '../universe/call_structure.dart' show CallStructure; | |
| 20 import '../universe/selector.dart' show Selector; | |
| 21 import 'package:js_ast/js_ast.dart' as js; | |
| 22 | 22 |
| 23 /// Inlining stack entries. | 23 /// Inlining stack entries. |
| 24 /// | 24 /// |
| 25 /// During inlining, a stack is used to detect cycles in the call graph. | 25 /// During inlining, a stack is used to detect cycles in the call graph. |
| 26 class StackEntry { | 26 class StackEntry { |
| 27 // Dynamically resolved calls might be targeting an adapter function that | 27 // Dynamically resolved calls might be targeting an adapter function that |
| 28 // fills in optional arguments not passed at the call site. Therefore these | 28 // fills in optional arguments not passed at the call site. Therefore these |
| 29 // calls are represented by the eventual target and the call structure at | 29 // calls are represented by the eventual target and the call structure at |
| 30 // the call site, which together identify the target. Statically resolved | 30 // the call site, which together identify the target. Statically resolved |
| 31 // calls are represented by the target element and a null call structure. | 31 // calls are represented by the target element and a null call structure. |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 (enclosingClass == backend.helpers.jsNumberClass || | 604 (enclosingClass == backend.helpers.jsNumberClass || |
| 605 enclosingClass == backend.helpers.jsDoubleClass || | 605 enclosingClass == backend.helpers.jsDoubleClass || |
| 606 enclosingClass == backend.helpers.jsIntClass)) { | 606 enclosingClass == backend.helpers.jsIntClass)) { |
| 607 // These should be handled by operator specialization. | 607 // These should be handled by operator specialization. |
| 608 return true; | 608 return true; |
| 609 } | 609 } |
| 610 if (target == backend.helpers.stringInterpolationHelper) return true; | 610 if (target == backend.helpers.stringInterpolationHelper) return true; |
| 611 return false; | 611 return false; |
| 612 } | 612 } |
| 613 } | 613 } |
| OLD | NEW |