| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 import 'dart:collection'; | 5 import 'dart:collection'; |
| 6 | 6 |
| 7 import 'package:js_runtime/shared/embedded_names.dart'; | 7 import 'package:js_runtime/shared/embedded_names.dart'; |
| 8 | 8 |
| 9 import '../closure.dart'; | 9 import '../closure.dart'; |
| 10 import '../common.dart'; | 10 import '../common.dart'; |
| (...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 | 618 |
| 619 return false; | 619 return false; |
| 620 } | 620 } |
| 621 | 621 |
| 622 bool get allInlinedFunctionsCalledOnce { | 622 bool get allInlinedFunctionsCalledOnce { |
| 623 return inliningStack.isEmpty || inliningStack.last.allFunctionsCalledOnce; | 623 return inliningStack.isEmpty || inliningStack.last.allFunctionsCalledOnce; |
| 624 } | 624 } |
| 625 | 625 |
| 626 bool isFunctionCalledOnce(MethodElement element) { | 626 bool isFunctionCalledOnce(MethodElement element) { |
| 627 // ConstructorBodyElements are not in the type inference graph. | 627 // ConstructorBodyElements are not in the type inference graph. |
| 628 if (element is ConstructorBodyElement) return false; | 628 if (element is ConstructorBodyEntity) return false; |
| 629 return globalInferenceResults.resultOfMember(element).isCalledOnce; | 629 return globalInferenceResults.resultOfMember(element).isCalledOnce; |
| 630 } | 630 } |
| 631 | 631 |
| 632 bool isCalledOnce(MethodElement element) { | 632 bool isCalledOnce(MethodElement element) { |
| 633 assert(element.isDeclaration); | 633 assert(element.isDeclaration); |
| 634 return allInlinedFunctionsCalledOnce && isFunctionCalledOnce(element); | 634 return allInlinedFunctionsCalledOnce && isFunctionCalledOnce(element); |
| 635 } | 635 } |
| 636 | 636 |
| 637 inlinedFrom(ResolvedAst resolvedAst, f()) { | 637 inlinedFrom(ResolvedAst resolvedAst, f()) { |
| 638 MemberElement element = resolvedAst.element; | 638 MemberElement element = resolvedAst.element; |
| (...skipping 6206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6845 this.oldReturnLocal, | 6845 this.oldReturnLocal, |
| 6846 this.oldReturnType, | 6846 this.oldReturnType, |
| 6847 this.oldResolvedAst, | 6847 this.oldResolvedAst, |
| 6848 this.oldStack, | 6848 this.oldStack, |
| 6849 this.oldLocalsHandler, | 6849 this.oldLocalsHandler, |
| 6850 this.inTryStatement, | 6850 this.inTryStatement, |
| 6851 this.allFunctionsCalledOnce, | 6851 this.allFunctionsCalledOnce, |
| 6852 this.oldElementInferenceResults) | 6852 this.oldElementInferenceResults) |
| 6853 : super(function); | 6853 : super(function); |
| 6854 } | 6854 } |
| OLD | NEW |