Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/compile_time_constants.dart |
| =================================================================== |
| --- sdk/lib/_internal/compiler/implementation/compile_time_constants.dart (revision 14840) |
| +++ sdk/lib/_internal/compiler/implementation/compile_time_constants.dart (working copy) |
| @@ -339,7 +339,7 @@ |
| classElement.ensureResolved(compiler); |
| // TODO(floitsch): copy over the generic type. |
| DartType type = new InterfaceType(classElement); |
| - compiler.enqueuer.codegen.registerInstantiatedClass(classElement); |
| + enqueue(classElement); |
| Constant constant = new MapConstant(type, keysList, values, protoValue); |
| compiler.constantHandler.registerCompileTimeConstant(constant); |
| return constant; |
| @@ -349,7 +349,16 @@ |
| return constantSystem.createNull(); |
| } |
| + void enqueue(ClassElement element) { |
|
ahe
2012/11/13 12:42:41
How about renaming this to registerInstantiatedCla
ngeoffray
2012/11/13 12:51:50
Done.
|
| + compiler.enqueuer.codegen.registerInstantiatedClass(element); |
| + } |
| + |
| + void enqueueStringClass() { |
|
ahe
2012/11/13 12:42:41
registerStringInstance()?
ngeoffray
2012/11/13 12:51:50
Done.
|
| + enqueue(compiler.stringClass); |
| + } |
| + |
| Constant visitLiteralString(LiteralString node) { |
| + enqueueStringClass(); |
| return constantSystem.createString(node.dartString, node); |
| } |
| @@ -357,6 +366,7 @@ |
| StringConstant left = evaluate(node.first); |
| StringConstant right = evaluate(node.second); |
| if (left == null || right == null) return null; |
| + enqueueStringClass(); |
| return constantSystem.createString( |
| new DartString.concat(left.value, right.value), node); |
| } |
| @@ -384,6 +394,7 @@ |
| if (partString == null) return null; |
| accumulator = new DartString.concat(accumulator, partString.value); |
| }; |
| + enqueueStringClass(); |
| return constantSystem.createString(accumulator, node); |
| } |