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

Side by Side Diff: pkg/compiler/lib/src/ssa/builder_kernel.dart

Issue 2566563002: dart2js-kernel: Handle ir.TypeLiteral for type variables (Closed)
Patch Set: Created 4 years 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/ssa/kernel_ast_adapter.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 import 'package:kernel/ast.dart' as ir; 5 import 'package:kernel/ast.dart' as ir;
6 import 'package:kernel/text/ast_to_text.dart' show debugNodeToString; 6 import 'package:kernel/text/ast_to_text.dart' show debugNodeToString;
7 7
8 import '../closure.dart'; 8 import '../closure.dart';
9 import '../common.dart'; 9 import '../common.dart';
10 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; 10 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem;
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 990
991 @override 991 @override
992 void visitTypeLiteral(ir.TypeLiteral typeLiteral) { 992 void visitTypeLiteral(ir.TypeLiteral typeLiteral) {
993 ir.DartType type = typeLiteral.type; 993 ir.DartType type = typeLiteral.type;
994 if (type is ir.InterfaceType) { 994 if (type is ir.InterfaceType) {
995 ConstantValue constant = astAdapter.getConstantForType(type); 995 ConstantValue constant = astAdapter.getConstantForType(type);
996 stack.add(graph.addConstant(constant, compiler)); 996 stack.add(graph.addConstant(constant, compiler));
997 return; 997 return;
998 } 998 }
999 if (type is ir.TypeParameterType) { 999 if (type is ir.TypeParameterType) {
1000 // TODO(27394): Load type parameter from current 'this' object. 1000 // TODO(sra): Convert the type logic here to use ir.DartType.
1001 defaultExpression(typeLiteral); 1001 DartType dartType = astAdapter.getDartType(type);
1002 dartType = localsHandler.substInContext(dartType);
1003 HInstruction value = typeBuilder.analyzeTypeArgument(
1004 dartType, sourceElement,
1005 sourceInformation: null);
1006 _pushStaticInvocation(astAdapter.runtimeTypeToString,
1007 <HInstruction>[value], backend.stringType);
1008 _pushStaticInvocation(astAdapter.createRuntimeType, <HInstruction>[pop()],
1009 astAdapter.createRuntimeTypeReturnType);
1002 return; 1010 return;
1003 } 1011 }
1004 // TODO(27394): 'dynamic' and function types observed. Where are they from? 1012 // TODO(27394): 'dynamic' and function types observed. Where are they from?
1005 defaultExpression(typeLiteral); 1013 defaultExpression(typeLiteral);
1006 return; 1014 return;
1007 } 1015 }
1008 1016
1009 @override 1017 @override
1010 void visitStaticGet(ir.StaticGet staticGet) { 1018 void visitStaticGet(ir.StaticGet staticGet) {
1011 ir.Member staticTarget = staticGet.target; 1019 ir.Member staticTarget = staticGet.target;
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after
1921 push(new HNot(popBoolified(), backend.boolType)); 1929 push(new HNot(popBoolified(), backend.boolType));
1922 } 1930 }
1923 1931
1924 @override 1932 @override
1925 void visitStringConcatenation(ir.StringConcatenation stringConcat) { 1933 void visitStringConcatenation(ir.StringConcatenation stringConcat) {
1926 KernelStringBuilder stringBuilder = new KernelStringBuilder(this); 1934 KernelStringBuilder stringBuilder = new KernelStringBuilder(this);
1927 stringConcat.accept(stringBuilder); 1935 stringConcat.accept(stringBuilder);
1928 stack.add(stringBuilder.result); 1936 stack.add(stringBuilder.result);
1929 } 1937 }
1930 } 1938 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698