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

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

Issue 9967001: Fix bug where constants were not correctly canonicalized. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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/compile_time_constants.dart
diff --git a/lib/compiler/implementation/compile_time_constants.dart b/lib/compiler/implementation/compile_time_constants.dart
index d7cbf87a4afc246991dadaddaa74725ce344c33f..e9004e71342e4a2b1b5d8c5f75af1d87d97a7d4c 100644
--- a/lib/compiler/implementation/compile_time_constants.dart
+++ b/lib/compiler/implementation/compile_time_constants.dart
@@ -613,6 +613,11 @@ class ConstantHandler extends CompilerTask {
return buffer;
}
+ StringBuffer writeCanonicalizedJsCode(StringBuffer buffer, Constant value) {
ngeoffray 2012/03/30 08:28:32 How about using this as the only entry point for w
floitsch 2012/03/30 18:11:49 Done.
+ value.writeCanonicalizedJsCode(buffer, this);
+ return buffer;
+ }
+
StringBuffer writeJsCodeForVariable(StringBuffer buffer,
VariableElement element) {
if (!initialVariableValues.containsKey(element)) {
@@ -620,12 +625,7 @@ class ConstantHandler extends CompilerTask {
element: element);
}
Constant constant = initialVariableValues[element];
- if (constant.isObject()) {
- String name = compiledConstants[constant];
- buffer.add("${compiler.namer.ISOLATE}.prototype.$name");
- } else {
- writeJsCode(buffer, constant);
- }
+ constant.writeCanonicalizedJsCode(buffer, this);
return buffer;
}
« no previous file with comments | « no previous file | lib/compiler/implementation/emitter.dart » ('j') | lib/compiler/implementation/ssa/codegen.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698