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

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

Issue 2828873002: Revert "Remove JavaScriptBackend from ClosedWorldBase" (Closed)
Patch Set: 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 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 // differences. 750 // differences.
751 assert(invariant(interceptorMember, 751 assert(invariant(interceptorMember,
752 interceptorMember.enclosingClass == interceptorClass, 752 interceptorMember.enclosingClass == interceptorClass,
753 message: 753 message:
754 "Member ${member.name} not overridden in ${interceptorClass}. " 754 "Member ${member.name} not overridden in ${interceptorClass}. "
755 "Found $interceptorMember from " 755 "Found $interceptorMember from "
756 "${interceptorMember.enclosingClass}.")); 756 "${interceptorMember.enclosingClass}."));
757 }); 757 });
758 } 758 }
759 759
760 /// Called before processing of the resolution queue is started.
761 void onResolutionStart(ResolutionEnqueuer enqueuer) { 760 void onResolutionStart(ResolutionEnqueuer enqueuer) {
762 // TODO(johnniwinther): Avoid the compiler.elementEnvironment.getThisType 761 // TODO(johnniwinther): Avoid the compiler.elementEnvironment.getThisType
763 // calls. Currently needed to ensure resolution of the classes for various 762 // calls. Currently needed to ensure resolution of the classes for various
764 // queries in native behavior computation, inference and codegen. 763 // queries in native behavior computation, inference and codegen.
765 compiler.elementEnvironment.getThisType(commonElements.jsArrayClass); 764 compiler.elementEnvironment.getThisType(commonElements.jsArrayClass);
766 compiler.elementEnvironment 765 compiler.elementEnvironment
767 .getThisType(commonElements.jsExtendableArrayClass); 766 .getThisType(commonElements.jsExtendableArrayClass);
768 767
769 validateInterceptorImplementsAllObjectMethods( 768 validateInterceptorImplementsAllObjectMethods(
770 commonElements.jsInterceptorClass); 769 commonElements.jsInterceptorClass);
771 // The null-interceptor must also implement *all* methods. 770 // The null-interceptor must also implement *all* methods.
772 validateInterceptorImplementsAllObjectMethods(commonElements.jsNullClass); 771 validateInterceptorImplementsAllObjectMethods(commonElements.jsNullClass);
773 } 772 }
774 773
775 /// Called when the resolution queue has been closed. 774 void onResolutionComplete(
776 void onResolutionEnd() {
777 _backendUsage = backendUsageBuilder.close();
778 _interceptorData = interceptorDataBuilder.onResolutionComplete();
779 }
780
781 /// Called when the closed world from resolution has been computed.
782 void onResolutionClosedWorld(
783 ClosedWorld closedWorld, ClosedWorldRefiner closedWorldRefiner) { 775 ClosedWorld closedWorld, ClosedWorldRefiner closedWorldRefiner) {
784 for (MemberEntity entity 776 for (MemberEntity entity
785 in compiler.enqueuer.resolution.processedEntities) { 777 in compiler.enqueuer.resolution.processedEntities) {
786 processAnnotations(entity, closedWorldRefiner); 778 processAnnotations(entity, closedWorldRefiner);
787 } 779 }
788 mirrorsDataBuilder.computeMembersNeededForReflection( 780 mirrorsDataBuilder.computeMembersNeededForReflection(
789 compiler.enqueuer.resolution.worldBuilder, closedWorld); 781 compiler.enqueuer.resolution.worldBuilder, closedWorld);
782 _backendUsage = backendUsageBuilder.close();
790 _rtiNeed = rtiNeedBuilder.computeRuntimeTypesNeed( 783 _rtiNeed = rtiNeedBuilder.computeRuntimeTypesNeed(
791 compiler.enqueuer.resolution.worldBuilder, 784 compiler.enqueuer.resolution.worldBuilder,
792 closedWorld, 785 closedWorld,
793 compiler.types, 786 compiler.types,
794 commonElements, 787 commonElements,
795 _backendUsage, 788 _backendUsage,
796 enableTypeAssertions: compiler.options.enableTypeAssertions); 789 enableTypeAssertions: compiler.options.enableTypeAssertions);
790 _interceptorData = interceptorDataBuilder.onResolutionComplete(closedWorld);
797 _oneShotInterceptorData = 791 _oneShotInterceptorData =
798 new OneShotInterceptorData(interceptorData, commonElements); 792 new OneShotInterceptorData(interceptorData, commonElements);
799 mirrorsResolutionAnalysis.onResolutionComplete(); 793 mirrorsResolutionAnalysis.onResolutionComplete();
800 } 794 }
801 795
802 void onTypeInferenceComplete(GlobalTypeInferenceResults results) { 796 void onTypeInferenceComplete(GlobalTypeInferenceResults results) {
803 noSuchMethodRegistry.onTypeInferenceComplete(results); 797 noSuchMethodRegistry.onTypeInferenceComplete(results);
804 } 798 }
805 799
806 /// Called when resolving a call to a foreign function. 800 /// Called when resolving a call to a foreign function.
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
1485 1479
1486 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) { 1480 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) {
1487 return !selector.isGetter; 1481 return !selector.isGetter;
1488 } 1482 }
1489 1483
1490 /// Returns `true` if [member] is called from a subclass via `super`. 1484 /// Returns `true` if [member] is called from a subclass via `super`.
1491 bool isAliasedSuperMember(MemberEntity member) { 1485 bool isAliasedSuperMember(MemberEntity member) {
1492 return _aliasedSuperMembers.contains(member); 1486 return _aliasedSuperMembers.contains(member);
1493 } 1487 }
1494 } 1488 }
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