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

Unified Diff: pkg/compiler/lib/src/js_emitter/metadata_collector.dart

Issue 1123413002: dart2js: build metadata-types lazily in the new emitter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Better name and comment. Created 5 years, 7 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: pkg/compiler/lib/src/js_emitter/metadata_collector.dart
diff --git a/pkg/compiler/lib/src/js_emitter/metadata_collector.dart b/pkg/compiler/lib/src/js_emitter/metadata_collector.dart
index bd4ab2977a33f45cc8051c6ee5843a4bb8377247..cad4338308896d7dfdacf6b2f3e3105986b5d73e 100644
--- a/pkg/compiler/lib/src/js_emitter/metadata_collector.dart
+++ b/pkg/compiler/lib/src/js_emitter/metadata_collector.dart
@@ -112,6 +112,12 @@ class MetadataCollector {
return _backend.isAccessibleByReflection(typedef.element);
});
+ if (representation is jsAst.LiteralString) {
+ // We don't want the representation to be a string, since we use
+ // strings as indicator for non-initialized types in the lazy emitter.
+ _compiler.internalError(
+ NO_LOCATION_SPANNABLE, 'reified types should not be strings.');
+ }
return addTypeInOutputUnit(
jsAst.prettyPrint(representation, _compiler).getText(), outputUnit);
}
@@ -133,8 +139,9 @@ class MetadataCollector {
}
return _typesMap[outputUnit].putIfAbsent(compiledType, () {
- if (types[outputUnit] == null)
+ if (types[outputUnit] == null) {
types[outputUnit] = <String>[];
+ }
types[outputUnit].add(compiledType);
return types[outputUnit].length - 1;

Powered by Google App Engine
This is Rietveld 408576698