Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(397)

Side by Side Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 2826673002: Remove JavaScriptBackend from ClosedWorldBase (Closed)
Patch Set: Fix Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 '../common.dart'; 7 import '../common.dart';
8 import '../common/backend_api.dart' 8 import '../common/backend_api.dart'
9 show ForeignResolver, NativeRegistry, ImpactTransformer; 9 show ForeignResolver, NativeRegistry, ImpactTransformer;
10 import '../common/codegen.dart' show CodegenImpact, CodegenWorkItem; 10 import '../common/codegen.dart' show CodegenImpact, CodegenWorkItem;
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 // differences. 743 // differences.
744 assert(invariant(interceptorMember, 744 assert(invariant(interceptorMember,
745 interceptorMember.enclosingClass == interceptorClass, 745 interceptorMember.enclosingClass == interceptorClass,
746 message: 746 message:
747 "Member ${member.name} not overridden in ${interceptorClass}. " 747 "Member ${member.name} not overridden in ${interceptorClass}. "
748 "Found $interceptorMember from " 748 "Found $interceptorMember from "
749 "${interceptorMember.enclosingClass}.")); 749 "${interceptorMember.enclosingClass}."));
750 }); 750 });
751 } 751 }
752 752
753 /// Called before processing of the resolution queue is started.
753 void onResolutionStart(ResolutionEnqueuer enqueuer) { 754 void onResolutionStart(ResolutionEnqueuer enqueuer) {
754 // TODO(johnniwinther): Avoid the compiler.elementEnvironment.getThisType 755 // TODO(johnniwinther): Avoid the compiler.elementEnvironment.getThisType
755 // calls. Currently needed to ensure resolution of the classes for various 756 // calls. Currently needed to ensure resolution of the classes for various
756 // queries in native behavior computation, inference and codegen. 757 // queries in native behavior computation, inference and codegen.
757 compiler.elementEnvironment.getThisType(commonElements.jsArrayClass); 758 compiler.elementEnvironment.getThisType(commonElements.jsArrayClass);
758 compiler.elementEnvironment 759 compiler.elementEnvironment
759 .getThisType(commonElements.jsExtendableArrayClass); 760 .getThisType(commonElements.jsExtendableArrayClass);
760 761
761 validateInterceptorImplementsAllObjectMethods( 762 validateInterceptorImplementsAllObjectMethods(
762 commonElements.jsInterceptorClass); 763 commonElements.jsInterceptorClass);
763 // The null-interceptor must also implement *all* methods. 764 // The null-interceptor must also implement *all* methods.
764 validateInterceptorImplementsAllObjectMethods(commonElements.jsNullClass); 765 validateInterceptorImplementsAllObjectMethods(commonElements.jsNullClass);
765 } 766 }
766 767
767 void onResolutionComplete( 768 /// Called when the resolution queue has been closed.
769 void onResolutionEnd() {
770 _backendUsage = backendUsageBuilder.close();
771 _interceptorData = interceptorDataBuilder.onResolutionComplete();
772 }
773
774 /// Called when the closed world from resolution has been computed.
775 void onResolutionClosedWorld(
768 ClosedWorld closedWorld, ClosedWorldRefiner closedWorldRefiner) { 776 ClosedWorld closedWorld, ClosedWorldRefiner closedWorldRefiner) {
769 for (MemberEntity entity 777 for (MemberEntity entity
770 in compiler.enqueuer.resolution.processedEntities) { 778 in compiler.enqueuer.resolution.processedEntities) {
771 processAnnotations(entity, closedWorldRefiner); 779 processAnnotations(entity, closedWorldRefiner);
772 } 780 }
773 mirrorsDataBuilder.computeMembersNeededForReflection( 781 mirrorsDataBuilder.computeMembersNeededForReflection(
774 compiler.enqueuer.resolution.worldBuilder, closedWorld); 782 compiler.enqueuer.resolution.worldBuilder, closedWorld);
775 _backendUsage = backendUsageBuilder.close();
776 _rtiNeed = rtiNeedBuilder.computeRuntimeTypesNeed( 783 _rtiNeed = rtiNeedBuilder.computeRuntimeTypesNeed(
777 compiler.enqueuer.resolution.worldBuilder, 784 compiler.enqueuer.resolution.worldBuilder,
778 closedWorld, 785 closedWorld,
779 compiler.types, 786 compiler.types,
780 commonElements, 787 commonElements,
781 _backendUsage, 788 _backendUsage,
782 enableTypeAssertions: compiler.options.enableTypeAssertions); 789 enableTypeAssertions: compiler.options.enableTypeAssertions);
783 _interceptorData = interceptorDataBuilder.onResolutionComplete(closedWorld);
784 _oneShotInterceptorData = 790 _oneShotInterceptorData =
785 new OneShotInterceptorData(interceptorData, commonElements); 791 new OneShotInterceptorData(interceptorData, commonElements);
786 mirrorsResolutionAnalysis.onResolutionComplete(); 792 mirrorsResolutionAnalysis.onResolutionComplete();
787 } 793 }
788 794
789 void onTypeInferenceComplete(GlobalTypeInferenceResults results) { 795 void onTypeInferenceComplete(GlobalTypeInferenceResults results) {
790 noSuchMethodRegistry.onTypeInferenceComplete(results); 796 noSuchMethodRegistry.onTypeInferenceComplete(results);
791 } 797 }
792 798
793 /// Called when resolving a call to a foreign function. 799 /// Called when resolving a call to a foreign function.
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
1464 1470
1465 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) { 1471 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) {
1466 return !selector.isGetter; 1472 return !selector.isGetter;
1467 } 1473 }
1468 1474
1469 /// Returns `true` if [member] is called from a subclass via `super`. 1475 /// Returns `true` if [member] is called from a subclass via `super`.
1470 bool isAliasedSuperMember(MemberEntity member) { 1476 bool isAliasedSuperMember(MemberEntity member) {
1471 return _aliasedSuperMembers.contains(member); 1477 return _aliasedSuperMembers.contains(member);
1472 } 1478 }
1473 } 1479 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/js_backend/interceptor_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698