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 library dart2js.world; | 5 library dart2js.world; |
6 | 6 |
7 import 'closure.dart' show | 7 import 'closure.dart' show |
8 SynthesizedCallMethodElementX; | 8 SynthesizedCallMethodElementX; |
9 import 'common/backend_api.dart' show | 9 import 'common/backend_api.dart' show |
10 Backend; | 10 Backend; |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 } | 651 } |
652 | 652 |
653 void registerCannotThrow(Element element) { | 653 void registerCannotThrow(Element element) { |
654 elementsThatCannotThrow.add(element); | 654 elementsThatCannotThrow.add(element); |
655 } | 655 } |
656 | 656 |
657 bool getCannotThrow(Element element) { | 657 bool getCannotThrow(Element element) { |
658 return elementsThatCannotThrow.contains(element); | 658 return elementsThatCannotThrow.contains(element); |
659 } | 659 } |
660 | 660 |
661 void registerImplicitSuperCall(Registry registry, | |
662 FunctionElement superConstructor) { | |
663 registry.registerDependency(superConstructor); | |
664 } | |
665 | |
666 void registerMightBePassedToApply(Element element) { | 661 void registerMightBePassedToApply(Element element) { |
667 functionsThatMightBePassedToApply.add(element); | 662 functionsThatMightBePassedToApply.add(element); |
668 } | 663 } |
669 | 664 |
670 bool getMightBePassedToApply(Element element) { | 665 bool getMightBePassedToApply(Element element) { |
671 // We have to check whether the element we look at was created after | 666 // We have to check whether the element we look at was created after |
672 // type inference ran. This is currently only the case for the call | 667 // type inference ran. This is currently only the case for the call |
673 // method of function classes that were generated for function | 668 // method of function classes that were generated for function |
674 // expressions. In such a case, we have to look at the original | 669 // expressions. In such a case, we have to look at the original |
675 // function expressions's element. | 670 // function expressions's element. |
676 // TODO(herhut): Generate classes for function expressions earlier. | 671 // TODO(herhut): Generate classes for function expressions earlier. |
677 if (element is SynthesizedCallMethodElementX) { | 672 if (element is SynthesizedCallMethodElementX) { |
678 return getMightBePassedToApply(element.expression); | 673 return getMightBePassedToApply(element.expression); |
679 } | 674 } |
680 return functionsThatMightBePassedToApply.contains(element); | 675 return functionsThatMightBePassedToApply.contains(element); |
681 } | 676 } |
682 | 677 |
683 bool get hasClosedWorldAssumption => !compiler.hasIncrementalSupport; | 678 bool get hasClosedWorldAssumption => !compiler.hasIncrementalSupport; |
684 } | 679 } |
OLD | NEW |