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

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: 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 cbd205d4cc6757c487a70320587e106dd0adf790..418223895a6ac55875a62563a4e949f3d2e130b4 100644
--- a/sdk/lib/_internal/compiler/implementation/compiler.dart
+++ b/sdk/lib/_internal/compiler/implementation/compiler.dart
@@ -189,6 +189,7 @@ abstract class Compiler implements DiagnosticListener {
ti.TypesTask typesTask;
Backend backend;
ConstantHandler constantHandler;
+ ConstantHandler metadataHandler;
EnqueueTask enqueuer;
static const SourceString MAIN = const SourceString('main');
@@ -248,6 +249,7 @@ abstract class Compiler implements DiagnosticListener {
disallowUnsafeEval) :
new dart_backend.DartBackend(this, strips);
constantHandler = new ConstantHandler(this, backend.constantSystem);
+ metadataHandler = new ConstantHandler(this, backend.constantSystem);
enqueuer = new EnqueueTask(this);
tasks = [scanner, dietParser, parser, patchParser, libraryLoader,
resolver, closureToClassMapper, checker, typesTask,
@@ -724,27 +726,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