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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/old_emitter/class_emitter.dart

Issue 859983002: Fix computation of 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 class ClassEmitter extends CodeEmitterHelper { 7 class ClassEmitter extends CodeEmitterHelper {
8 8
9 ClassStubGenerator get _stubGenerator => 9 ClassStubGenerator get _stubGenerator =>
10 new ClassStubGenerator(compiler, namer, backend); 10 new ClassStubGenerator(compiler, namer, backend);
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 TypeVariableElement element) { 602 TypeVariableElement element) {
603 String name = namer.readTypeVariableName(element); 603 String name = namer.readTypeVariableName(element);
604 int index = RuntimeTypes.getTypeVariableIndex(element); 604 int index = RuntimeTypes.getTypeVariableIndex(element);
605 jsAst.Expression computeTypeVariable; 605 jsAst.Expression computeTypeVariable;
606 606
607 Substitution substitution = 607 Substitution substitution =
608 backend.rti.computeSubstitution( 608 backend.rti.computeSubstitution(
609 cls, element.typeDeclaration, alwaysGenerateFunction: true); 609 cls, element.typeDeclaration, alwaysGenerateFunction: true);
610 if (substitution != null) { 610 if (substitution != null) {
611 computeTypeVariable = 611 computeTypeVariable =
612 js(r'#(this.$builtinTypeInfo)', 612 js(r'#.apply(null, this.$builtinTypeInfo)',
613 substitution.getCodeForVariable(index, backend.rti)); 613 substitution.getCodeForVariable(index, backend.rti));
614 } else { 614 } else {
615 // TODO(ahe): These can be generated dynamically. 615 // TODO(ahe): These can be generated dynamically.
616 computeTypeVariable = 616 computeTypeVariable =
617 js(r'this.$builtinTypeInfo && this.$builtinTypeInfo[#]', 617 js(r'this.$builtinTypeInfo && this.$builtinTypeInfo[#]',
618 js.number(index)); 618 js.number(index));
619 } 619 }
620 jsAst.Expression convertRtiToRuntimeType = emitter 620 jsAst.Expression convertRtiToRuntimeType = emitter
621 .staticFunctionAccess(backend.findHelper('convertRtiToRuntimeType')); 621 .staticFunctionAccess(backend.findHelper('convertRtiToRuntimeType'));
622 compiler.dumpInfoTask.registerElementAst(element, 622 compiler.dumpInfoTask.registerElementAst(element,
623 builder.addProperty(name, 623 builder.addProperty(name,
624 js('function () { return #(#) }', 624 js('function () { return #(#) }',
625 [convertRtiToRuntimeType, computeTypeVariable]))); 625 [convertRtiToRuntimeType, computeTypeVariable])));
626 } 626 }
627 } 627 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698