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

Unified Diff: sdk/lib/_internal/compiler/implementation/compiler.dart

Issue 221873002: Compute frontend/backend specific constants. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes Created 6 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
Index: sdk/lib/_internal/compiler/implementation/compiler.dart
diff --git a/sdk/lib/_internal/compiler/implementation/compiler.dart b/sdk/lib/_internal/compiler/implementation/compiler.dart
index 8cba4eb513cf4160a2f1f02f165d960f50a1d1be..824f203df824104f8e086dfb695e6f457a5b2d66 100644
--- a/sdk/lib/_internal/compiler/implementation/compiler.dart
+++ b/sdk/lib/_internal/compiler/implementation/compiler.dart
@@ -74,11 +74,20 @@ class DeferredTask {
abstract class Backend {
final Compiler compiler;
- final ConstantSystem constantSystem;
- Backend(this.compiler,
- [ConstantSystem constantSystem = DART_CONSTANT_SYSTEM])
- : this.constantSystem = constantSystem;
+ Backend(this.compiler);
+
+ /// The [ConstantSystem] used to interpret compile-time constants for this
+ /// backend.
+ ConstantSystem get constantSystem;
+
+ /// The constant environment for the backend interpretation of compile-time
+ /// constants.
+ BackendConstantEnvironment get constants;
+
+ /// The compiler task responsible for the compilation of constants for both
+ /// the frontend and the backend.
+ ConstantCompilerTask get constantCompilerTask;
// Given a [FunctionElement], return a buffer with the code generated for it
// or null if no code was generated.
@@ -566,7 +575,11 @@ abstract class Compiler implements DiagnosticListener {
IrBuilderTask irBuilder;
ti.TypesTask typesTask;
Backend backend;
- ConstantHandler constantHandler;
+
+ /// The constant environment for the frontend interpretation of compile-time
+ /// constants.
+ ConstantEnvironment constants;
+
EnqueueTask enqueuer;
DeferredLoadTask deferredLoadTask;
MirrorUsageAnalyzerTask mirrorUsageAnalyzerTask;
@@ -679,12 +692,12 @@ abstract class Compiler implements DiagnosticListener {
dietParser = new DietParserTask(this),
parser = new ParserTask(this),
patchParser = new PatchParserTask(this),
- resolver = new ResolverTask(this),
+ resolver = new ResolverTask(this, backend.constantCompilerTask),
closureToClassMapper = new closureMapping.ClosureTask(this, closureNamer),
checker = new TypeCheckerTask(this),
irBuilder = new IrBuilderTask(this),
typesTask = new ti.TypesTask(this),
- constantHandler = new ConstantHandler(this, backend.constantSystem),
+ constants = backend.constantCompilerTask,
deferredLoadTask = new DeferredLoadTask(this),
mirrorUsageAnalyzerTask = new MirrorUsageAnalyzerTask(this),
enqueuer = new EnqueueTask(this),
@@ -943,8 +956,8 @@ abstract class Compiler implements DiagnosticListener {
dynamicClass.ensureResolved(this);
- proxyConstant = constantHandler.compileVariable(
- coreLibrary.find('proxy'), isConst: true);
+ proxyConstant =
+ resolver.constantCompiler.compileConstant(coreLibrary.find('proxy'));
}
Element _unnamedListConstructor;

Powered by Google App Engine
This is Rietveld 408576698