| 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 part of js_backend; | 5 part of js_backend; |
| 6 | 6 |
| 7 const VERBOSE_OPTIMIZER_HINTS = false; | 7 const VERBOSE_OPTIMIZER_HINTS = false; |
| 8 | 8 |
| 9 class JavaScriptItemCompilationContext extends ItemCompilationContext { | 9 class JavaScriptItemCompilationContext extends ItemCompilationContext { |
| 10 final Set<HInstruction> boundsChecked = new Set<HInstruction>(); | 10 final Set<HInstruction> boundsChecked = new Set<HInstruction>(); |
| (...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 | 601 |
| 602 /// Support for classifying `noSuchMethod` implementations. | 602 /// Support for classifying `noSuchMethod` implementations. |
| 603 NoSuchMethodRegistry noSuchMethodRegistry; | 603 NoSuchMethodRegistry noSuchMethodRegistry; |
| 604 | 604 |
| 605 JavaScriptConstantTask constantCompilerTask; | 605 JavaScriptConstantTask constantCompilerTask; |
| 606 | 606 |
| 607 JavaScriptResolutionCallbacks resolutionCallbacks; | 607 JavaScriptResolutionCallbacks resolutionCallbacks; |
| 608 | 608 |
| 609 PatchResolverTask patchResolverTask; | 609 PatchResolverTask patchResolverTask; |
| 610 | 610 |
| 611 bool get canHandleCompilationFailed => true; | |
| 612 | |
| 613 bool enabledNoSuchMethod = false; | 611 bool enabledNoSuchMethod = false; |
| 614 | 612 |
| 615 JavaScriptBackend(Compiler compiler, | 613 JavaScriptBackend(Compiler compiler, |
| 616 SourceInformationFactory sourceInformationFactory, | 614 SourceInformationFactory sourceInformationFactory, |
| 617 {bool generateSourceMap: true}) | 615 {bool generateSourceMap: true}) |
| 618 : namer = determineNamer(compiler), | 616 : namer = determineNamer(compiler), |
| 619 oneShotInterceptors = new Map<String, Selector>(), | 617 oneShotInterceptors = new Map<String, Selector>(), |
| 620 interceptedElements = new Map<String, Set<Element>>(), | 618 interceptedElements = new Map<String, Set<Element>>(), |
| 621 rti = new RuntimeTypes(compiler), | 619 rti = new RuntimeTypes(compiler), |
| 622 specializedGetInterceptors = new Map<String, Set<ClassElement>>(), | 620 specializedGetInterceptors = new Map<String, Set<ClassElement>>(), |
| (...skipping 2049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2672 enqueue(enqueuer, getAsyncStarHelper(), registry); | 2670 enqueue(enqueuer, getAsyncStarHelper(), registry); |
| 2673 enqueue(enqueuer, getStreamOfController(), registry); | 2671 enqueue(enqueuer, getStreamOfController(), registry); |
| 2674 enqueue(enqueuer, getYieldSingle(), registry); | 2672 enqueue(enqueuer, getYieldSingle(), registry); |
| 2675 enqueue(enqueuer, getYieldStar(), registry); | 2673 enqueue(enqueuer, getYieldStar(), registry); |
| 2676 enqueue(enqueuer, getASyncStarControllerConstructor(), registry); | 2674 enqueue(enqueuer, getASyncStarControllerConstructor(), registry); |
| 2677 enqueue(enqueuer, getStreamIteratorConstructor(), registry); | 2675 enqueue(enqueuer, getStreamIteratorConstructor(), registry); |
| 2678 } | 2676 } |
| 2679 } | 2677 } |
| 2680 | 2678 |
| 2681 @override | 2679 @override |
| 2682 bool registerDeferredLoading(Spannable node, Registry registry) { | 2680 bool enableDeferredLoadingIfSupported(Spannable node, Registry registry) { |
| 2683 registerCheckDeferredIsLoaded(registry); | 2681 registerCheckDeferredIsLoaded(registry); |
| 2684 return true; | 2682 return true; |
| 2685 } | 2683 } |
| 2684 |
| 2685 @override |
| 2686 bool enableCodegenWithErrorsIfSupported(Spannable node) { |
| 2687 if (compiler.useCpsIr) { |
| 2688 compiler.reportHint( |
| 2689 node, |
| 2690 MessageKind.GENERIC, |
| 2691 {'text': "Generation of code with compile time errors is currently " |
| 2692 "not supported with the CPS IR."}); |
| 2693 return false; |
| 2694 } |
| 2695 return true; |
| 2696 } |
| 2686 } | 2697 } |
| 2687 | 2698 |
| 2688 /// Handling of special annotations for tests. | 2699 /// Handling of special annotations for tests. |
| 2689 class Annotations { | 2700 class Annotations { |
| 2690 static final Uri PACKAGE_EXPECT = | 2701 static final Uri PACKAGE_EXPECT = |
| 2691 new Uri(scheme: 'package', path: 'expect/expect.dart'); | 2702 new Uri(scheme: 'package', path: 'expect/expect.dart'); |
| 2692 | 2703 |
| 2693 final Compiler compiler; | 2704 final Compiler compiler; |
| 2694 | 2705 |
| 2695 ClassElement expectNoInlineClass; | 2706 ClassElement expectNoInlineClass; |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2965 } | 2976 } |
| 2966 } | 2977 } |
| 2967 | 2978 |
| 2968 /// Records that [constant] is used by the element behind [registry]. | 2979 /// Records that [constant] is used by the element behind [registry]. |
| 2969 class Dependency { | 2980 class Dependency { |
| 2970 final ConstantValue constant; | 2981 final ConstantValue constant; |
| 2971 final Element annotatedElement; | 2982 final Element annotatedElement; |
| 2972 | 2983 |
| 2973 const Dependency(this.constant, this.annotatedElement); | 2984 const Dependency(this.constant, this.annotatedElement); |
| 2974 } | 2985 } |
| OLD | NEW |