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

Unified Diff: pkg/compiler/lib/src/js_backend/runtime_types.dart

Issue 861733002: Do not use full substitution when only computing single type variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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/old_emitter/class_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_backend/runtime_types.dart
diff --git a/pkg/compiler/lib/src/js_backend/runtime_types.dart b/pkg/compiler/lib/src/js_backend/runtime_types.dart
index 9aa327d3c95b1bd48eddd7d89a1858a5f373351d..f8aa7b15c6a930dd527ffd4505ed05a4db4772ae 100644
--- a/pkg/compiler/lib/src/js_backend/runtime_types.dart
+++ b/pkg/compiler/lib/src/js_backend/runtime_types.dart
@@ -898,6 +898,27 @@ class Substitution {
}
}
}
+
+ jsAst.Expression getCodeForVariable(int index, RuntimeTypes rti) {
+ jsAst.Expression declaration(TypeVariableType variable) {
+ return new jsAst.Parameter(
+ rti.backend.namer.safeVariableName(variable.name));
+ }
+
+ jsAst.Expression use(TypeVariableType variable) {
+ return new jsAst.VariableUse(
+ rti.backend.namer.safeVariableName(variable.name));
+ }
+
+ if (arguments[index].isDynamic) {
+ return rti.backend.emitter.emitter.generateFunctionThatReturnsNull();
+ } else {
+ jsAst.Expression value =
+ rti.getTypeRepresentation(arguments[index], use);
+ Iterable<jsAst.Expression> formals = parameters.map(declaration);
+ return js('function(#) { return # }', [formals, value]);
+ }
+ }
}
/**
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698