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

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

Issue 2824123003: Make backend.setAnnotations (mostly) handle LibraryEntities. (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 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 element == commonElements.doubleClass || 1084 element == commonElements.doubleClass ||
1085 element == commonElements.jsArrayClass || 1085 element == commonElements.jsArrayClass ||
1086 element == commonElements.jsMutableArrayClass || 1086 element == commonElements.jsMutableArrayClass ||
1087 element == commonElements.jsExtendableArrayClass || 1087 element == commonElements.jsExtendableArrayClass ||
1088 element == commonElements.jsFixedArrayClass || 1088 element == commonElements.jsFixedArrayClass ||
1089 element == commonElements.jsUnmodifiableArrayClass; 1089 element == commonElements.jsUnmodifiableArrayClass;
1090 } 1090 }
1091 1091
1092 /// This method is called immediately after the [library] and its parts have 1092 /// This method is called immediately after the [library] and its parts have
1093 /// been loaded. 1093 /// been loaded.
1094 void setAnnotations(LibraryElement library) { 1094 void setAnnotations(LibraryEntity library) {
1095 if (!compiler.serialization.isDeserialized(library)) { 1095 if (!compiler.serialization.isDeserialized(library)) {
1096 AnnotationProcessor processor = new AnnotationProcessor(compiler);
1096 if (canLibraryUseNative(library)) { 1097 if (canLibraryUseNative(library)) {
1097 library.forEachLocalMember((Element element) { 1098 processor.extractNativeAnnotations(library, nativeBasicDataBuilder);
1098 if (element.isClass) {
1099 checkNativeAnnotation(compiler, element, nativeBasicDataBuilder);
1100 }
1101 });
1102 } 1099 }
1103 checkJsInteropClassAnnotations(compiler, library, nativeBasicDataBuilder); 1100 processor.extractJsInteropAnnotations(library, nativeBasicDataBuilder);
1104 } 1101 }
1105 Uri uri = library.canonicalUri; 1102 Uri uri = library.canonicalUri;
1106 if (uri == Uris.dart_html) { 1103 if (uri == Uris.dart_html) {
1107 htmlLibraryIsLoaded = true; 1104 htmlLibraryIsLoaded = true;
1108 } else if (uri == LookupMapResolutionAnalysis.PACKAGE_LOOKUP_MAP) { 1105 } else if (uri == LookupMapResolutionAnalysis.PACKAGE_LOOKUP_MAP) {
1109 lookupMapResolutionAnalysis.init(library); 1106 lookupMapResolutionAnalysis.init(library);
1110 } 1107 }
1111 annotations.onLibraryLoaded(library); 1108 annotations.onLibraryLoaded(library);
1112 } 1109 }
1113 1110
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
1493 1490
1494 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) { 1491 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) {
1495 return !selector.isGetter; 1492 return !selector.isGetter;
1496 } 1493 }
1497 1494
1498 /// Returns `true` if [member] is called from a subclass via `super`. 1495 /// Returns `true` if [member] is called from a subclass via `super`.
1499 bool isAliasedSuperMember(MemberEntity member) { 1496 bool isAliasedSuperMember(MemberEntity member) {
1500 return _aliasedSuperMembers.contains(member); 1497 return _aliasedSuperMembers.contains(member);
1501 } 1498 }
1502 } 1499 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698