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

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

Issue 17315012: Generate less code when importing dart:mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments 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
« no previous file with comments | « no previous file | dart/sdk/lib/_internal/compiler/implementation/compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart b/dart/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
index ecc8645823df3bf0d40b733657bf6dc2bac1a783..1861c4336cafc93c5291a74329a450b0d02f8e60 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
@@ -56,18 +56,27 @@ class ConstantHandler extends CompilerTask {
}
void registerInstantiatedClass(ClassElement element, TreeElements elements) {
- if (isMetadata) return;
+ if (isMetadata) {
+ compiler.backend.registerMetadataInstantiatedClass(element, elements);
+ return;
+ }
compiler.enqueuer.codegen.registerInstantiatedClass(element, elements);
}
void registerStaticUse(Element element) {
- if (isMetadata) return;
+ if (isMetadata) {
+ compiler.backend.registerMetadataStaticUse(element);
+ return;
+ }
compiler.analyzeElement(element.declaration);
compiler.enqueuer.codegen.registerStaticUse(element);
}
void registerGetOfStaticFunction(FunctionElement element) {
- if (isMetadata) return;
+ if (isMetadata) {
+ compiler.backend.registerMetadataGetOfStaticFunction(element);
+ return;
+ }
compiler.analyzeElement(element.declaration);
compiler.enqueuer.codegen.registerGetOfStaticFunction(element);
}
@@ -444,9 +453,7 @@ class CompileTimeConstantEvaluator extends Visitor {
Constant makeTypeConstant(Element element) {
DartType elementType = element.computeType(compiler).asRaw();
- if (compiler.mirrorsEnabled) {
- handler.registerInstantiatedClass(element, elements);
- }
+ compiler.backend.registerTypeLiteral(element, elements);
DartType constantType =
compiler.backend.typeImplementation.computeType(compiler);
Constant constant = new TypeConstant(elementType, constantType);
« no previous file with comments | « no previous file | dart/sdk/lib/_internal/compiler/implementation/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698