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

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

Issue 10825386: Use JavaScript runtime semantics when constant folding. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove top-level constanst. Created 8 years, 4 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: lib/compiler/implementation/compiler.dart
diff --git a/lib/compiler/implementation/compiler.dart b/lib/compiler/implementation/compiler.dart
index bf51eb7a1c4a8ee12d839c316677aecbf2256d27..554e59592e5cdab909f2375fb4354bba28c69022 100644
--- a/lib/compiler/implementation/compiler.dart
+++ b/lib/compiler/implementation/compiler.dart
@@ -154,14 +154,18 @@ class Compiler implements DiagnosticListener {
Compiler([this.tracer = const Tracer(),
this.enableTypeAssertions = false,
this.enableUserAssertions = false,
- bool emitJavascript = true,
+ bool emitJavaScript = true,
validateUnparse = false,
generateSourceMap = true])
: libraries = new Map<String, LibraryElement>(),
world = new World(),
progress = new Stopwatch.start() {
namer = new Namer(this);
- constantHandler = new ConstantHandler(this);
+ constantHandler =
+ new ConstantHandler(this,
+ emitJavaScript
+ ? const JavaScriptFoldingOperations()
+ : const DartFoldingOperations());
scanner = new ScannerTask(this);
dietParser = new DietParserTask(this);
parser = new ParserTask(this);
@@ -171,7 +175,7 @@ class Compiler implements DiagnosticListener {
closureToClassMapper = new closureMapping.ClosureTask(this);
checker = new TypeCheckerTask(this);
typesTask = new ti.TypesTask(this);
- backend = emitJavascript ?
+ backend = emitJavaScript ?
new js_backend.JavaScriptBackend(this, generateSourceMap) :
new dart_backend.DartBackend(this, validateUnparse);
enqueuer = new EnqueueTask(this);

Powered by Google App Engine
This is Rietveld 408576698