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

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

Issue 2653203002: Use entities in CommonElements interface. (Closed)
Patch Set: Created 3 years, 10 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 | « pkg/compiler/lib/src/ssa/builder_kernel.dart ('k') | pkg/compiler/lib/src/typechecker.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:js_runtime/shared/embedded_names.dart'; 5 import 'package:js_runtime/shared/embedded_names.dart';
6 import 'package:kernel/ast.dart' as ir; 6 import 'package:kernel/ast.dart' as ir;
7 7
8 import '../common.dart'; 8 import '../common.dart';
9 import '../common/names.dart'; 9 import '../common/names.dart';
10 import '../compiler.dart'; 10 import '../compiler.dart';
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 631
632 ResolutionDartType getDartTypeIfValid(ir.DartType type) { 632 ResolutionDartType getDartTypeIfValid(ir.DartType type) {
633 if (type is ir.InvalidType) return null; 633 if (type is ir.InvalidType) return null;
634 return _typeConverter.convert(type); 634 return _typeConverter.convert(type);
635 } 635 }
636 636
637 List<ResolutionDartType> getDartTypes(List<ir.DartType> types) { 637 List<ResolutionDartType> getDartTypes(List<ir.DartType> types) {
638 return types.map(getDartType).toList(); 638 return types.map(getDartType).toList();
639 } 639 }
640 640
641 ResolutionDartType getDartTypeOfListLiteral(ir.ListLiteral list) { 641 ResolutionInterfaceType getDartTypeOfListLiteral(ir.ListLiteral list) {
642 ast.Node node = getNodeOrNull(list); 642 ast.Node node = getNodeOrNull(list);
643 if (node != null) return elements.getType(node); 643 if (node != null) return elements.getType(node);
644 assertNodeIsSynthetic(list); 644 assertNodeIsSynthetic(list);
645 return _compiler.commonElements.listType(getDartType(list.typeArgument)); 645 return _compiler.commonElements.listType(getDartType(list.typeArgument));
646 } 646 }
647 647
648 ResolutionDartType getDartTypeOfMapLiteral(ir.MapLiteral literal) { 648 ResolutionInterfaceType getDartTypeOfMapLiteral(ir.MapLiteral literal) {
649 ast.Node node = getNodeOrNull(literal); 649 ast.Node node = getNodeOrNull(literal);
650 if (node != null) return elements.getType(node); 650 if (node != null) return elements.getType(node);
651 assertNodeIsSynthetic(literal); 651 assertNodeIsSynthetic(literal);
652 return _compiler.commonElements 652 return _compiler.commonElements
653 .mapType(getDartType(literal.keyType), getDartType(literal.valueType)); 653 .mapType(getDartType(literal.keyType), getDartType(literal.valueType));
654 } 654 }
655 655
656 ResolutionDartType getFunctionReturnType(ir.FunctionNode node) { 656 ResolutionDartType getFunctionReturnType(ir.FunctionNode node) {
657 if (node.returnType is ir.InvalidType) return const ResolutionDynamicType(); 657 if (node.returnType is ir.InvalidType) return const ResolutionDynamicType();
658 return getDartType(node.returnType); 658 return getDartType(node.returnType);
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
1199 JumpTarget continueTarget = 1199 JumpTarget continueTarget =
1200 astAdapter.getJumpTarget(switchCase, isContinueTarget: true); 1200 astAdapter.getJumpTarget(switchCase, isContinueTarget: true);
1201 assert(continueTarget is KernelJumpTarget); 1201 assert(continueTarget is KernelJumpTarget);
1202 targetIndexMap[continueTarget] = switchIndex; 1202 targetIndexMap[continueTarget] = switchIndex;
1203 assert(builder.jumpTargets[continueTarget] == null); 1203 assert(builder.jumpTargets[continueTarget] == null);
1204 builder.jumpTargets[continueTarget] = this; 1204 builder.jumpTargets[continueTarget] = this;
1205 switchIndex++; 1205 switchIndex++;
1206 } 1206 }
1207 } 1207 }
1208 } 1208 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder_kernel.dart ('k') | pkg/compiler/lib/src/typechecker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698