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

Side by Side Diff: pkg/compiler/lib/src/constants/constant_system.dart

Issue 2603263002: Prefix resolution_types with Resolution. (Closed)
Patch Set: Rebased Created 3 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 dart2js.constant_system; 5 library dart2js.constant_system;
6 6
7 import '../compiler.dart' show Compiler; 7 import '../compiler.dart' show Compiler;
8 import '../elements/resolution_types.dart'; 8 import '../elements/resolution_types.dart';
9 import '../resolution/operators.dart'; 9 import '../resolution/operators.dart';
10 import '../tree/dartstring.dart' show DartString; 10 import '../tree/dartstring.dart' show DartString;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 BinaryOperation get codeUnitAt; 56 BinaryOperation get codeUnitAt;
57 UnaryOperation get round; 57 UnaryOperation get round;
58 58
59 const ConstantSystem(); 59 const ConstantSystem();
60 60
61 ConstantValue createInt(int i); 61 ConstantValue createInt(int i);
62 ConstantValue createDouble(double d); 62 ConstantValue createDouble(double d);
63 ConstantValue createString(DartString string); 63 ConstantValue createString(DartString string);
64 ConstantValue createBool(bool value); 64 ConstantValue createBool(bool value);
65 ConstantValue createNull(); 65 ConstantValue createNull();
66 ConstantValue createList(InterfaceType type, List<ConstantValue> values); 66 ConstantValue createList(
67 ResolutionInterfaceType type, List<ConstantValue> values);
67 // TODO(johnniwinther): Remove the need for [compiler]. 68 // TODO(johnniwinther): Remove the need for [compiler].
68 ConstantValue createMap(Compiler compiler, InterfaceType type, 69 ConstantValue createMap(Compiler compiler, ResolutionInterfaceType type,
69 List<ConstantValue> keys, List<ConstantValue> values); 70 List<ConstantValue> keys, List<ConstantValue> values);
70 // TODO(johnniwinther): Remove the need for [compiler]. 71 // TODO(johnniwinther): Remove the need for [compiler].
71 ConstantValue createType(Compiler compiler, DartType type); 72 ConstantValue createType(Compiler compiler, ResolutionDartType type);
72 // TODO(johnniwinther): Remove the need for [compiler]. 73 // TODO(johnniwinther): Remove the need for [compiler].
73 ConstantValue createSymbol(Compiler compiler, String text); 74 ConstantValue createSymbol(Compiler compiler, String text);
74 75
75 // We need to special case the subtype check for JavaScript constant 76 // We need to special case the subtype check for JavaScript constant
76 // system because an int is a double at runtime. 77 // system because an int is a double at runtime.
77 bool isSubtype(DartTypes types, DartType s, DartType t); 78 bool isSubtype(DartTypes types, ResolutionDartType s, ResolutionDartType t);
78 79
79 /** Returns true if the [constant] is an integer at runtime. */ 80 /** Returns true if the [constant] is an integer at runtime. */
80 bool isInt(ConstantValue constant); 81 bool isInt(ConstantValue constant);
81 /** Returns true if the [constant] is a double at runtime. */ 82 /** Returns true if the [constant] is a double at runtime. */
82 bool isDouble(ConstantValue constant); 83 bool isDouble(ConstantValue constant);
83 /** Returns true if the [constant] is a string at runtime. */ 84 /** Returns true if the [constant] is a string at runtime. */
84 bool isString(ConstantValue constant); 85 bool isString(ConstantValue constant);
85 /** Returns true if the [constant] is a boolean at runtime. */ 86 /** Returns true if the [constant] is a boolean at runtime. */
86 bool isBool(ConstantValue constant); 87 bool isBool(ConstantValue constant);
87 /** Returns true if the [constant] is null at runtime. */ 88 /** Returns true if the [constant] is null at runtime. */
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 return greaterEqual; 139 return greaterEqual;
139 case BinaryOperatorKind.EQ: 140 case BinaryOperatorKind.EQ:
140 return equal; 141 return equal;
141 case BinaryOperatorKind.IF_NULL: 142 case BinaryOperatorKind.IF_NULL:
142 return ifNull; 143 return ifNull;
143 default: 144 default:
144 return null; 145 return null;
145 } 146 }
146 } 147 }
147 } 148 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/constants/constant_constructors.dart ('k') | pkg/compiler/lib/src/constants/constructors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698