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

Unified Diff: pkg/compiler/lib/src/resolution/members.dart

Issue 2265473004: Introduce "CommonElements" (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: cl Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/resolution/class_members.dart ('k') | pkg/compiler/lib/src/resolution/resolution.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/resolution/members.dart
diff --git a/pkg/compiler/lib/src/resolution/members.dart b/pkg/compiler/lib/src/resolution/members.dart
index d2ca86e0c7c10e1553e8092edf0f869619473947..efc6e0da4f5c9bd4f9d503a6de9b6a722a586e60 100644
--- a/pkg/compiler/lib/src/resolution/members.dart
+++ b/pkg/compiler/lib/src/resolution/members.dart
@@ -2623,12 +2623,12 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
// of parse errors to make [element] erroneous. Fix this!
member.computeType(resolution);
- if (member == resolution.mirrorSystemGetNameFunction &&
+ if (resolution.commonElements.isMirrorSystemGetNameFunction(member) &&
!resolution.mirrorUsageAnalyzerTask.hasMirrorUsage(enclosingElement)) {
- reporter
- .reportHintMessage(node.selector, MessageKind.STATIC_FUNCTION_BLOAT, {
- 'class': resolution.mirrorSystemClass.name,
- 'name': resolution.mirrorSystemGetNameFunction.name
+ reporter.reportHintMessage(
+ node.selector, MessageKind.STATIC_FUNCTION_BLOAT, {
+ 'class': resolution.commonElements.mirrorSystemClass.name,
+ 'name': member.name
});
}
@@ -2654,7 +2654,7 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
registry.registerStaticUse(
new StaticUse.staticInvoke(semantics.element, callStructure));
handleForeignCall(node, semantics.element, callStructure);
- if (method == resolution.identicalFunction &&
+ if (method == resolution.commonElements.identicalFunction &&
argumentsResult.isValidAsConstant) {
result = new ConstantResult(
node,
@@ -3677,7 +3677,7 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
registry.registerTypeUse(new TypeUse.instantiation(redirectionTarget
.enclosingClass.thisType
.subst(type.typeArguments, targetClass.typeVariables)));
- if (enclosingElement == resolution.symbolConstructor) {
+ if (resolution.commonElements.isSymbolConstructor(enclosingElement)) {
registry.registerFeature(Feature.SYMBOL_CONSTRUCTOR);
}
if (isValidAsConstant) {
@@ -3887,7 +3887,8 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
if (node.isConst) {
bool isValidAsConstant = !isInvalid && constructor.isConst;
- if (constructor == resolution.symbolConstructor) {
+ CommonElements commonElements = resolution.commonElements;
+ if (commonElements.isSymbolConstructor(constructor)) {
Node argumentNode = node.send.arguments.head;
ConstantExpression constant = resolver.constantCompiler
.compileNode(argumentNode, registry.mapping);
@@ -3903,7 +3904,7 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
registry.registerConstSymbol(nameString);
}
}
- } else if (constructor == resolution.mirrorsUsedConstructor) {
+ } else if (commonElements.isMirrorsUsedConstructor(constructor)) {
resolution.mirrorUsageAnalyzerTask.validate(node, registry.mapping);
}
@@ -3963,7 +3964,7 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
analyzeConstantDeferred(node, onAnalyzed: onAnalyzed);
} else {
// Not constant.
- if (constructor == resolution.symbolConstructor &&
+ if (resolution.commonElements.isSymbolConstructor(constructor) &&
!resolution.mirrorUsageAnalyzerTask
.hasMirrorUsage(enclosingElement)) {
reporter.reportHintMessage(node.newToken, MessageKind.NON_CONST_BLOAT,
« no previous file with comments | « pkg/compiler/lib/src/resolution/class_members.dart ('k') | pkg/compiler/lib/src/resolution/resolution.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698