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

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

Issue 1881013002: Expand ResolvedAst to handle synthetic constructors. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments + fix test, cps and compilation units for injected members. 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/codegen.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 825176c0fbf10e57c32de81c7d585ca782223919..b9cbb559d3162f0369de53c13c960cf8dcf74ec5 100644
--- a/pkg/compiler/lib/src/compile_time_constants.dart
+++ b/pkg/compiler/lib/src/compile_time_constants.dart
@@ -1092,6 +1092,7 @@ class ConstructorEvaluator extends CompileTimeConstantEvaluator {
final ConstructorElement constructor;
final Map<Element, AstConstant> definitions;
final Map<Element, AstConstant> fieldValues;
+ final ResolvedAst resolvedAst;
/**
* Documentation wanted -- johnniwinther
@@ -1103,11 +1104,14 @@ class ConstructorEvaluator extends CompileTimeConstantEvaluator {
: this.constructor = constructor,
this.definitions = new Map<Element, AstConstant>(),
this.fieldValues = new Map<Element, AstConstant>(),
- super(handler, _analyzeElementEagerly(compiler, constructor), compiler,
- isConst: true) {
+ this.resolvedAst = _analyzeElementEagerly(compiler, constructor),
+ super(handler, null, compiler, isConst: true) {
assert(invariant(constructor, constructor.isImplementation));
}
+ @override
+ TreeElements get elements => resolvedAst.elements;
+
AstConstant visitSend(Send send) {
Element element = elements[send];
if (Elements.isLocal(element)) {
@@ -1333,9 +1337,9 @@ class ErroneousAstConstant extends AstConstant {
}
// TODO(johnniwinther): Clean this up.
-TreeElements _analyzeElementEagerly(Compiler compiler, AstElement element) {
+ResolvedAst _analyzeElementEagerly(Compiler compiler, AstElement element) {
compiler.resolution.computeWorldImpact(element.declaration);
- return element.resolvedAst.elements;
+ return element.resolvedAst;
}
class _CompilerEnvironment implements Environment {
« no previous file with comments | « pkg/compiler/lib/src/common/codegen.dart ('k') | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698