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

Side by Side Diff: pkg/compiler/lib/src/js_backend/codegen/codegen.dart

Issue 1151443002: dart2js cps: Fix in how type variables are accessed. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/codegen/glue.dart » ('j') | 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library code_generator; 5 library code_generator;
6 6
7 import 'glue.dart'; 7 import 'glue.dart';
8 8
9 import '../../tree_ir/tree_ir_nodes.dart' as tree_ir; 9 import '../../tree_ir/tree_ir_nodes.dart' as tree_ir;
10 import '../../js/js.dart' as js; 10 import '../../js/js.dart' as js;
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 return buildStaticHelperInvocation(createType, 629 return buildStaticHelperInvocation(createType,
630 [buildStaticHelperInvocation(typeToString, 630 [buildStaticHelperInvocation(typeToString,
631 [visitExpression(node.value)])]); 631 [visitExpression(node.value)])]);
632 } 632 }
633 633
634 @override 634 @override
635 js.Expression visitReadTypeVariable(tree_ir.ReadTypeVariable node) { 635 js.Expression visitReadTypeVariable(tree_ir.ReadTypeVariable node) {
636 ClassElement context = node.variable.element.enclosingClass; 636 ClassElement context = node.variable.element.enclosingClass;
637 js.Expression index = js.number(glue.getTypeVariableIndex(node.variable)); 637 js.Expression index = js.number(glue.getTypeVariableIndex(node.variable));
638 if (glue.needsSubstitutionForTypeVariableAccess(context)) { 638 if (glue.needsSubstitutionForTypeVariableAccess(context)) {
639 js.Expression substitution = glue.getSubstitutionName(context); 639 js.Expression typeName = glue.getRuntimeTypeName(context);
640 return buildStaticHelperInvocation( 640 return buildStaticHelperInvocation(
641 glue.getTypeArgumentWithSubstitution(), 641 glue.getRuntimeTypeArgument(),
642 [visitExpression(node.target), substitution, index]); 642 [visitExpression(node.target), typeName, index]);
643 } else { 643 } else {
644 return buildStaticHelperInvocation( 644 return buildStaticHelperInvocation(
645 glue.getTypeArgumentByIndex(), 645 glue.getTypeArgumentByIndex(),
646 [visitExpression(node.target), index]); 646 [visitExpression(node.target), index]);
647 } 647 }
648 } 648 }
649 649
650 @override 650 @override
651 js.Expression visitTypeExpression(tree_ir.TypeExpression node) { 651 js.Expression visitTypeExpression(tree_ir.TypeExpression node) {
652 List<js.Expression> arguments = 652 List<js.Expression> arguments =
(...skipping 20 matching lines...) Expand all
673 673
674 @override 674 @override
675 visitVariableDeclaration(tree_ir.VariableDeclaration node) { 675 visitVariableDeclaration(tree_ir.VariableDeclaration node) {
676 return errorUnsupportedNode(node); 676 return errorUnsupportedNode(node);
677 } 677 }
678 678
679 errorUnsupportedNode(tree_ir.DartSpecificNode node) { 679 errorUnsupportedNode(tree_ir.DartSpecificNode node) {
680 throw "Unsupported node in JS backend: $node"; 680 throw "Unsupported node in JS backend: $node";
681 } 681 }
682 } 682 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/codegen/glue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698