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

Unified Diff: pkg/compiler/lib/src/compile_time_constants.dart

Issue 1917863002: Replace _analyzeElementEagerly with Resolution.ensureResolved (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: dartfmt Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/common/resolution.dart ('k') | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/compile_time_constants.dart
diff --git a/pkg/compiler/lib/src/compile_time_constants.dart b/pkg/compiler/lib/src/compile_time_constants.dart
index b9cbb559d3162f0369de53c13c960cf8dcf74ec5..c4fe1935079f57fc1f50e08a69657306fa9c17aa 100644
--- a/pkg/compiler/lib/src/compile_time_constants.dart
+++ b/pkg/compiler/lib/src/compile_time_constants.dart
@@ -193,7 +193,7 @@ abstract class ConstantCompilerBase implements ConstantCompiler {
AstElement currentElement = element.analyzableElement;
return reporter.withCurrentElement(currentElement, () {
// TODO(johnniwinther): Avoid this eager analysis.
- _analyzeElementEagerly(compiler, currentElement);
+ compiler.resolution.ensureResolved(currentElement.declaration);
ConstantExpression constant = compileVariableWithDefinitions(
element, currentElement.resolvedAst.elements,
@@ -847,7 +847,7 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
// TODO(ahe): This is nasty: we must eagerly analyze the
// constructor to ensure the redirectionTarget has been computed
// correctly. Find a way to avoid this.
- _analyzeElementEagerly(compiler, constructor);
+ resolution.ensureResolved(constructor.declaration);
// The redirection chain of this element may not have been resolved through
// a post-process action, so we have to make sure it is done here.
@@ -1104,7 +1104,8 @@ class ConstructorEvaluator extends CompileTimeConstantEvaluator {
: this.constructor = constructor,
this.definitions = new Map<Element, AstConstant>(),
this.fieldValues = new Map<Element, AstConstant>(),
- this.resolvedAst = _analyzeElementEagerly(compiler, constructor),
+ this.resolvedAst =
+ compiler.resolution.computeResolvedAst(constructor.declaration),
super(handler, null, compiler, isConst: true) {
assert(invariant(constructor, constructor.isImplementation));
}
@@ -1336,12 +1337,6 @@ class ErroneousAstConstant extends AstConstant {
new NullConstantValue());
}
-// TODO(johnniwinther): Clean this up.
-ResolvedAst _analyzeElementEagerly(Compiler compiler, AstElement element) {
- compiler.resolution.computeWorldImpact(element.declaration);
- return element.resolvedAst;
-}
-
class _CompilerEnvironment implements Environment {
final Compiler compiler;
« no previous file with comments | « pkg/compiler/lib/src/common/resolution.dart ('k') | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698