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

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

Issue 11416280: Decouple the constant handler from the compiler so we can have more than one. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge from master.' Created 8 years, 1 month 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 bf02e1dfcc5fd41f0a4913b87d917ad7ceea7fd9..a7912812f80a3ef1178cc69071f9bf294a75bff4 100644
--- a/sdk/lib/_internal/compiler/implementation/compiler.dart
+++ b/sdk/lib/_internal/compiler/implementation/compiler.dart
@@ -195,6 +195,7 @@ abstract class Compiler implements DiagnosticListener {
ti.TypesTask typesTask;
Backend backend;
ConstantHandler constantHandler;
+ ConstantHandler metadataHandler;
EnqueueTask enqueuer;
CompilerTask fileReadingTask;
@@ -263,6 +264,7 @@ abstract class Compiler implements DiagnosticListener {
enqueuer = new EnqueueTask(this)];
tasks.addAll(backend.tasks);
+ metadataHandler = new ConstantHandler(this, backend.constantSystem);
}
Universe get resolverWorld => enqueuer.resolution.universe;
@@ -737,27 +739,6 @@ abstract class Compiler implements DiagnosticListener {
() => resolver.computeFunctionType(element, signature));
}
- bool isLazilyInitialized(VariableElement element) {
- Constant initialValue = compileVariable(element);
- return initialValue == null;
- }
-
- /**
- * Compiles compile-time constants. Never returns [:null:].
- * If the initial value is not a compile-time constants reports an error.
- */
- Constant compileConstant(VariableElement element) {
- return withCurrentElement(element, () {
- return constantHandler.compileConstant(element);
- });
- }
-
- Constant compileVariable(VariableElement element) {
- return withCurrentElement(element, () {
- return constantHandler.compileVariable(element);
- });
- }
-
reportWarning(Node node, var message) {
if (message is TypeWarning) {
// TODO(ahe): Don't supress these warning when the type checker

Powered by Google App Engine
This is Rietveld 408576698