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 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 } | 672 } |
673 | 673 |
674 void registerCannotThrow(Element element) { | 674 void registerCannotThrow(Element element) { |
675 elementsThatCannotThrow.add(element); | 675 elementsThatCannotThrow.add(element); |
676 } | 676 } |
677 | 677 |
678 bool getCannotThrow(Element element) { | 678 bool getCannotThrow(Element element) { |
679 return elementsThatCannotThrow.contains(element); | 679 return elementsThatCannotThrow.contains(element); |
680 } | 680 } |
681 | 681 |
| 682 void registerImplicitSuperCall(Registry registry, |
| 683 FunctionElement superConstructor) { |
| 684 registry.registerDependency(superConstructor); |
| 685 } |
| 686 |
682 void registerMightBePassedToApply(Element element) { | 687 void registerMightBePassedToApply(Element element) { |
683 functionsThatMightBePassedToApply.add(element); | 688 functionsThatMightBePassedToApply.add(element); |
684 } | 689 } |
685 | 690 |
686 bool getMightBePassedToApply(Element element) { | 691 bool getMightBePassedToApply(Element element) { |
687 // We have to check whether the element we look at was created after | 692 // We have to check whether the element we look at was created after |
688 // type inference ran. This is currently only the case for the call | 693 // type inference ran. This is currently only the case for the call |
689 // method of function classes that were generated for function | 694 // method of function classes that were generated for function |
690 // expressions. In such a case, we have to look at the original | 695 // expressions. In such a case, we have to look at the original |
691 // function expressions's element. | 696 // function expressions's element. |
692 // TODO(herhut): Generate classes for function expressions earlier. | 697 // TODO(herhut): Generate classes for function expressions earlier. |
693 if (element is SynthesizedCallMethodElementX) { | 698 if (element is SynthesizedCallMethodElementX) { |
694 return getMightBePassedToApply(element.expression); | 699 return getMightBePassedToApply(element.expression); |
695 } | 700 } |
696 return functionsThatMightBePassedToApply.contains(element); | 701 return functionsThatMightBePassedToApply.contains(element); |
697 } | 702 } |
698 | 703 |
699 bool get hasClosedWorldAssumption => !compiler.hasIncrementalSupport; | 704 bool get hasClosedWorldAssumption => !compiler.hasIncrementalSupport; |
700 } | 705 } |
OLD | NEW |