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 js_backend.backend; | 5 library js_backend.backend; |
6 | 6 |
7 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; | 7 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; |
8 | 8 |
9 import '../common.dart'; | 9 import '../common.dart'; |
10 import '../common/backend_api.dart' | 10 import '../common/backend_api.dart' |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 _interceptorData = interceptorDataBuilder.onResolutionComplete(closedWorld); | 792 _interceptorData = interceptorDataBuilder.onResolutionComplete(closedWorld); |
793 _oneShotInterceptorData = | 793 _oneShotInterceptorData = |
794 new OneShotInterceptorData(interceptorData, helpers); | 794 new OneShotInterceptorData(interceptorData, helpers); |
795 mirrorsResolutionAnalysis.onResolutionComplete(); | 795 mirrorsResolutionAnalysis.onResolutionComplete(); |
796 } | 796 } |
797 | 797 |
798 void onTypeInferenceComplete(GlobalTypeInferenceResults results) { | 798 void onTypeInferenceComplete(GlobalTypeInferenceResults results) { |
799 noSuchMethodRegistry.onTypeInferenceComplete(results); | 799 noSuchMethodRegistry.onTypeInferenceComplete(results); |
800 } | 800 } |
801 | 801 |
802 /// Returns the [WorldImpact] of enabling deferred loading. | |
803 WorldImpact computeDeferredLoadingImpact() { | |
804 backendUsageBuilder.processBackendImpact(impacts.deferredLoading); | |
805 return impacts.deferredLoading.createImpact(compiler.elementEnvironment); | |
806 } | |
807 | |
808 /// Called when resolving a call to a foreign function. | 802 /// Called when resolving a call to a foreign function. |
809 native.NativeBehavior resolveForeignCall(Send node, Element element, | 803 native.NativeBehavior resolveForeignCall(Send node, Element element, |
810 CallStructure callStructure, ForeignResolver resolver) { | 804 CallStructure callStructure, ForeignResolver resolver) { |
811 if (element.name == BackendHelpers.JS) { | 805 if (element.name == BackendHelpers.JS) { |
812 return _nativeDataResolver.resolveJsCall(node, resolver); | 806 return _nativeDataResolver.resolveJsCall(node, resolver); |
813 } else if (element.name == BackendHelpers.JS_EMBEDDED_GLOBAL) { | 807 } else if (element.name == BackendHelpers.JS_EMBEDDED_GLOBAL) { |
814 return _nativeDataResolver.resolveJsEmbeddedGlobalCall(node, resolver); | 808 return _nativeDataResolver.resolveJsEmbeddedGlobalCall(node, resolver); |
815 } else if (element.name == BackendHelpers.JS_BUILTIN) { | 809 } else if (element.name == BackendHelpers.JS_BUILTIN) { |
816 return _nativeDataResolver.resolveJsBuiltinCall(node, resolver); | 810 return _nativeDataResolver.resolveJsBuiltinCall(node, resolver); |
817 } else if (element.name == BackendHelpers.JS_INTERCEPTOR_CONSTANT) { | 811 } else if (element.name == BackendHelpers.JS_INTERCEPTOR_CONSTANT) { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
893 interceptorDataBuilder, | 887 interceptorDataBuilder, |
894 backendUsageBuilder, | 888 backendUsageBuilder, |
895 rtiNeedBuilder, | 889 rtiNeedBuilder, |
896 mirrorsDataBuilder, | 890 mirrorsDataBuilder, |
897 noSuchMethodRegistry, | 891 noSuchMethodRegistry, |
898 customElementsResolutionAnalysis, | 892 customElementsResolutionAnalysis, |
899 lookupMapResolutionAnalysis, | 893 lookupMapResolutionAnalysis, |
900 mirrorsResolutionAnalysis, | 894 mirrorsResolutionAnalysis, |
901 typeVariableResolutionAnalysis, | 895 typeVariableResolutionAnalysis, |
902 _nativeResolutionEnqueuer, | 896 _nativeResolutionEnqueuer, |
| 897 compiler.deferredLoadTask, |
903 kernelTask), | 898 kernelTask), |
904 new ElementResolutionWorldBuilder( | 899 new ElementResolutionWorldBuilder( |
905 this, compiler.resolution, const OpenWorldStrategy()), | 900 this, compiler.resolution, const OpenWorldStrategy()), |
906 new ResolutionWorkItemBuilder(compiler.resolution)); | 901 new ResolutionWorkItemBuilder(compiler.resolution)); |
907 } | 902 } |
908 | 903 |
909 /// Creates an [Enqueuer] for code generation specific to this backend. | 904 /// Creates an [Enqueuer] for code generation specific to this backend. |
910 CodegenEnqueuer createCodegenEnqueuer( | 905 CodegenEnqueuer createCodegenEnqueuer( |
911 CompilerTask task, Compiler compiler, ClosedWorld closedWorld) { | 906 CompilerTask task, Compiler compiler, ClosedWorld closedWorld) { |
912 _typeVariableCodegenAnalysis = | 907 _typeVariableCodegenAnalysis = |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1606 | 1601 |
1607 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) { | 1602 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) { |
1608 return !selector.isGetter; | 1603 return !selector.isGetter; |
1609 } | 1604 } |
1610 | 1605 |
1611 /// Returns `true` if [member] is called from a subclass via `super`. | 1606 /// Returns `true` if [member] is called from a subclass via `super`. |
1612 bool isAliasedSuperMember(MemberEntity member) { | 1607 bool isAliasedSuperMember(MemberEntity member) { |
1613 return _aliasedSuperMembers.contains(member); | 1608 return _aliasedSuperMembers.contains(member); |
1614 } | 1609 } |
1615 } | 1610 } |
OLD | NEW |