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

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

Issue 26472002: Add TypeVariable object on runtime to support reflection on type variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 754e5aa0bad1b1481b6868da298300901da924c3..ee1589190d8b71d21efe615b911b2be1ef9c3d5c 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -406,6 +406,8 @@ class JavaScriptBackend extends Backend {
checkedModeHelpers,
key: (helper) => helper.name.slowToString());
+ TypeVariableConstantHandler typeVarHandler;
ahe 2013/10/14 13:07:07 Rename to typeVariableHandler (please don't abbrev
zarah 2013/10/15 14:20:02 Done.
+
/// Number of methods compiled before considering reflection.
int preMirrorsMethodCount = 0;
@@ -420,6 +422,7 @@ class JavaScriptBackend extends Backend {
builder = new SsaBuilderTask(this);
optimizer = new SsaOptimizerTask(this);
generator = new SsaCodeGeneratorTask(this);
+ typeVarHandler = new TypeVariableConstantHandler(this);
}
static Namer determineNamer(Compiler compiler) {
@@ -663,6 +666,8 @@ class JavaScriptBackend extends Backend {
new TypeMask.nonNullExact(jsFixedArrayClass));
extendableArrayType = new HBoundedType(
new TypeMask.nonNullExact(jsExtendableArrayClass));
+
+ typeVarHandler.initializeHelperClass();
ahe 2013/10/14 13:07:07 I think I would prefer if the helper class was ini
zarah 2013/10/15 14:20:02 Done.
}
void validateInterceptorImplementsAllObjectMethods(
@@ -790,6 +795,10 @@ class JavaScriptBackend extends Backend {
void registerInstantiatedClass(ClassElement cls,
Enqueuer enqueuer,
TreeElements elements) {
+ if (!cls.typeVariables.isEmpty) {
+ typeVarHandler.registerClassWithTypeVars(cls);
+ }
+
if (!seenAnyClass) {
seenAnyClass = true;
if (enqueuer.isResolutionQueue) {
@@ -1806,6 +1815,14 @@ class JavaScriptBackend extends Backend {
}
metadataConstants.clear();
}
+
+ if (isTreeShakingDisabled) {
+ if (enqueuer.isResolutionQueue) {
+ typeVarHandler.onResolutionQueueEmpty(enqueuer);
+ } else {
+ typeVarHandler.onCodegenQueueEmpty();
+ }
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698