| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |