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

Unified Diff: pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.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
Index: pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart
index d593fae74e1b6c85f9cd16475555ec19707e1f3f..7cd47ff6829f3bbcb9af4982b0bcbc5f04a757ea 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart
@@ -601,22 +601,21 @@ class ClassEmitter extends CodeEmitterHelper {
ClassBuilder builder,
TypeVariableElement element) {
String name = namer.readTypeVariableName(element);
- jsAst.Expression index =
- js.number(RuntimeTypes.getTypeVariableIndex(element));
+ int index = RuntimeTypes.getTypeVariableIndex(element);
jsAst.Expression computeTypeVariable;
Substitution substitution =
backend.rti.computeSubstitution(
cls, element.typeDeclaration, alwaysGenerateFunction: true);
if (substitution != null) {
- jsAst.Expression typeArguments =
- js(r'#.apply(null, this.$builtinTypeInfo)',
- substitution.getCode(backend.rti));
- computeTypeVariable = js('#[#]', [typeArguments, index]);
+ computeTypeVariable =
+ js(r'#(this.$builtinTypeInfo)',
+ substitution.getCodeForVariable(index, backend.rti));
} else {
// TODO(ahe): These can be generated dynamically.
computeTypeVariable =
- js(r'this.$builtinTypeInfo && this.$builtinTypeInfo[#]', index);
+ js(r'this.$builtinTypeInfo && this.$builtinTypeInfo[#]',
+ js.number(index));
}
jsAst.Expression convertRtiToRuntimeType = emitter
.staticFunctionAccess(backend.findHelper('convertRtiToRuntimeType'));
« no previous file with comments | « pkg/compiler/lib/src/js_backend/runtime_types.dart ('k') | pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698