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

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

Issue 2852603003: Move JsInteropAnalysis.onQueueClosed to AnnotationProcessor.processJsInteropAnnotation (Closed)
Patch Set: Register anonymous classes correctly + add test Created 3 years, 7 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 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 .getThisType(commonElements.jsExtendableArrayClass); 754 .getThisType(commonElements.jsExtendableArrayClass);
755 755
756 validateInterceptorImplementsAllObjectMethods( 756 validateInterceptorImplementsAllObjectMethods(
757 commonElements.jsInterceptorClass); 757 commonElements.jsInterceptorClass);
758 // The null-interceptor must also implement *all* methods. 758 // The null-interceptor must also implement *all* methods.
759 validateInterceptorImplementsAllObjectMethods(commonElements.jsNullClass); 759 validateInterceptorImplementsAllObjectMethods(commonElements.jsNullClass);
760 } 760 }
761 761
762 /// Called when the resolution queue has been closed. 762 /// Called when the resolution queue has been closed.
763 void onResolutionEnd() { 763 void onResolutionEnd() {
764 compiler.frontEndStrategy.annotationProcesser
765 .processJsInteropAnnotations(nativeBasicData, nativeDataBuilder);
764 _backendUsage = backendUsageBuilder.close(); 766 _backendUsage = backendUsageBuilder.close();
765 _interceptorData = interceptorDataBuilder.onResolutionComplete(); 767 _interceptorData = interceptorDataBuilder.onResolutionComplete();
766 } 768 }
767 769
768 /// Called when the closed world from resolution has been computed. 770 /// Called when the closed world from resolution has been computed.
769 void onResolutionClosedWorld( 771 void onResolutionClosedWorld(
770 ClosedWorld closedWorld, ClosedWorldRefiner closedWorldRefiner) { 772 ClosedWorld closedWorld, ClosedWorldRefiner closedWorldRefiner) {
771 for (MemberEntity entity 773 for (MemberEntity entity
772 in compiler.enqueuer.resolution.processedEntities) { 774 in compiler.enqueuer.resolution.processedEntities) {
773 processAnnotations(entity, closedWorldRefiner); 775 processAnnotations(entity, closedWorldRefiner);
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 inlineCache.markAsNonInlinable(commonElements.getInterceptorMethod, 1108 inlineCache.markAsNonInlinable(commonElements.getInterceptorMethod,
1107 insideLoop: true); 1109 insideLoop: true);
1108 1110
1109 specialOperatorEqClasses 1111 specialOperatorEqClasses
1110 ..add(commonElements.objectClass) 1112 ..add(commonElements.objectClass)
1111 ..add(commonElements.jsInterceptorClass) 1113 ..add(commonElements.jsInterceptorClass)
1112 ..add(commonElements.jsNullClass); 1114 ..add(commonElements.jsNullClass);
1113 } 1115 }
1114 } 1116 }
1115 1117
1116 /// Called after the queue is closed. [onQueueEmpty] may be called multiple
1117 /// times, but [onQueueClosed] is only called once.
1118 void onQueueClosed() {
1119 jsInteropAnalysis.onQueueClosed();
1120 }
1121
1122 // TODO(johnniwinther): Create a CodegenPhase object for the backend to hold 1118 // TODO(johnniwinther): Create a CodegenPhase object for the backend to hold
1123 // data only available during code generation. 1119 // data only available during code generation.
1124 ClosedWorld _closedWorldCache; 1120 ClosedWorld _closedWorldCache;
1125 ClosedWorld get _closedWorld { 1121 ClosedWorld get _closedWorld {
1126 assert(invariant(NO_LOCATION_SPANNABLE, _closedWorldCache != null, 1122 assert(invariant(NO_LOCATION_SPANNABLE, _closedWorldCache != null,
1127 message: "ClosedWorld has not be set yet.")); 1123 message: "ClosedWorld has not be set yet."));
1128 return _closedWorldCache; 1124 return _closedWorldCache;
1129 } 1125 }
1130 1126
1131 void set _closedWorld(ClosedWorld value) { 1127 void set _closedWorld(ClosedWorld value) {
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
1450 1446
1451 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) { 1447 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) {
1452 return !selector.isGetter; 1448 return !selector.isGetter;
1453 } 1449 }
1454 1450
1455 /// Returns `true` if [member] is called from a subclass via `super`. 1451 /// Returns `true` if [member] is called from a subclass via `super`.
1456 bool isAliasedSuperMember(MemberEntity member) { 1452 bool isAliasedSuperMember(MemberEntity member) {
1457 return _aliasedSuperMembers.contains(member); 1453 return _aliasedSuperMembers.contains(member);
1458 } 1454 }
1459 } 1455 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/frontend_strategy.dart ('k') | pkg/compiler/lib/src/js_backend/js_interop_analysis.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698