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

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: Merged 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 44c484d1a2f75a98af3a48d1520a0fb188d64181..a2501fd668653c3e292171c825ec0934d74f2d3f 100644
--- a/pkg/compiler/lib/src/js_emitter/metadata_collector.dart
+++ b/pkg/compiler/lib/src/js_emitter/metadata_collector.dart
@@ -110,6 +110,13 @@ 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(representation, outputUnit);
}
@@ -133,8 +140,9 @@ class MetadataCollector {
}
return _typesMap[outputUnit].putIfAbsent(string, () {
- if (types[outputUnit] == null)
+ if (types[outputUnit] == null) {
types[outputUnit] = <jsAst.Expression>[];
+ }
types[outputUnit].add(type);
return types[outputUnit].length - 1;
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698