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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/enqueue.dart

Issue 17315012: Generate less code when importing dart:mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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: dart/sdk/lib/_internal/compiler/implementation/enqueue.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/enqueue.dart b/dart/sdk/lib/_internal/compiler/implementation/enqueue.dart
index 1352ceaf87e01300c5033dbec7cc80964f4d660e..ef07dab9116bf10cfbabec590d42f9ceec780165 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/enqueue.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/enqueue.dart
@@ -152,11 +152,7 @@ abstract class Enqueuer {
void registerTypeLiteral(Element element, TreeElements elements) {
registerInstantiatedClass(compiler.typeClass, elements);
- compiler.backend.registerTypeLiteral(elements);
- if (compiler.mirrorsEnabled) {
- // In order to use reflectClass, we need to find the constructor.
- registerInstantiatedClass(element, elements);
- }
+ compiler.backend.registerTypeLiteral(element, elements);
}
bool checkNoEnqueuedInvokedInstanceMethods() {
@@ -333,18 +329,7 @@ abstract class Enqueuer {
/// Called when [:const Symbol(name):] is seen.
void registerConstSymbol(String name, TreeElements elements) {
- // If dart:mirrors is loaded, a const symbol may be used to call a
- // static/top-level method or accessor, instantiate a class, call
- // an instance method or accessor with the given name.
- if (!compiler.mirrorsEnabled) return;
-
- task.ensureAllElementsByName();
-
- for (var link = task.allElementsByName[name];
- link != null && !link.isEmpty;
- link = link.tail) {
- pretendElementWasUsed(link.head, elements);
- }
+ compiler.backend.registerConstSymbol(name, elements);
}
void pretendElementWasUsed(Element element, TreeElements elements) {
@@ -388,6 +373,7 @@ abstract class Enqueuer {
/// Called when [:new Symbol(...):] is seen.
void registerNewSymbol(TreeElements elements) {
+ compiler.backend.registerNewSymbol(elements);
}
void enqueueEverything() {

Powered by Google App Engine
This is Rietveld 408576698