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

Unified Diff: dart/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart

Issue 760383003: Incremental compilation of constants. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r42279 and CL 760383003. Created 6 years 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: dart/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
diff --git a/dart/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart b/dart/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
index 89c4d2bc951befc98b8d5dc1d0f42acfc463ff8a..6df667c9e6849be2954751a14032053687653c82 100644
--- a/dart/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
+++ b/dart/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
@@ -1110,10 +1110,7 @@ class OldEmitter implements Emitter {
if (cachedEmittedConstants.contains(constant)) continue;
cachedEmittedConstants.add(constant);
}
- String name = namer.constantName(constant);
- jsAst.Expression init = js('#.# = #',
- [namer.globalObjectForConstant(constant), name,
- constantInitializerExpression(constant)]);
+ jsAst.Expression init = buildConstantInitializer(constant);
buffer.write(jsAst.prettyPrint(init, compiler,
monitor: compiler.dumpInfoTask));
buffer.write('$N');
@@ -1123,6 +1120,13 @@ class OldEmitter implements Emitter {
}
}
+ jsAst.Expression buildConstantInitializer(ConstantValue constant) {
+ String name = namer.constantName(constant);
+ return js('#.# = #',
+ [namer.globalObjectForConstant(constant), name,
+ constantInitializerExpression(constant)]);
+ }
+
jsAst.Template get makeConstantListTemplate {
// TODO(floitsch): there is no harm in caching the template.
return jsAst.js.uncachedExpressionTemplate(

Powered by Google App Engine
This is Rietveld 408576698