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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart

Issue 363223003: Revert "Emit declarations for typedefs that are needed by reflection." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
index 43a7c0639cf1a88c71afae8663ed28372d0ea5a9..93d02784641af6493c904987245a7204a777f0ff 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -326,6 +326,9 @@ class JavaScriptBackend extends Backend {
/// List of elements that the backend may use.
final Set<Element> helpersUsed = new Set<Element>();
+ /// Set of typedefs that are used as type literals.
+ final Set<TypedefElement> typedefTypeLiterals = new Set<TypedefElement>();
+
/// All the checked mode helpers.
static const checkedModeHelpers = CheckedModeHelper.helpers;
@@ -1907,13 +1910,11 @@ class JavaScriptBackend extends Backend {
if (foundClosure) {
reflectableMembers.add(closureClass);
}
+ // It would be nice to have a better means to select
Set<Element> closurizedMembers = compiler.resolverWorld.closurizedMembers;
if (closurizedMembers.any(reflectableMembers.contains)) {
reflectableMembers.add(boundClosureClass);
}
- // Add typedefs.
- reflectableMembers
- .addAll(compiler.world.allTypedefs.where(referencedFromMirrorSystem));
// Register all symbols of reflectable elements
for (Element element in reflectableMembers) {
symbolsUsed.add(element.name);
@@ -2134,7 +2135,7 @@ class JavaScriptionResolutionCallbacks extends ResolutionCallbacks {
// when reflection is used. However, as long as we disable tree-shaking
// eagerly it doesn't matter.
if (type.isTypedef) {
- backend.compiler.world.allTypedefs.add(type.element);
+ backend.typedefTypeLiterals.add(type.element);
}
backend.customElementsAnalysis.registerTypeLiteral(type, registry);
}

Powered by Google App Engine
This is Rietveld 408576698