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

Unified Diff: pkg/compiler/lib/src/constant_system_dart.dart

Issue 2684783003: Refactor ConstantSystem (Closed)
Patch Set: Updated cf. comments. 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/constant_system_dart.dart
diff --git a/pkg/compiler/lib/src/constant_system_dart.dart b/pkg/compiler/lib/src/constant_system_dart.dart
index f8aaaaf9eac7a3f815155397fcbb3b60eb1e6001..7097cd9e8a0a2846d0b652a894912c44079db2cd 100644
--- a/pkg/compiler/lib/src/constant_system_dart.dart
+++ b/pkg/compiler/lib/src/constant_system_dart.dart
@@ -4,10 +4,12 @@
library dart2js.constant_system.dart;
-import 'compiler.dart' show Compiler;
+import 'common/backend_api.dart' show BackendClasses;
import 'constants/constant_system.dart';
import 'constants/values.dart';
-import 'elements/resolution_types.dart';
+import 'core_types.dart' show CommonElements;
+import 'elements/types.dart';
+import 'elements/resolution_types.dart' show DartTypes;
import 'tree/dartstring.dart' show DartString;
const DART_CONSTANT_SYSTEM = const DartConstantSystem();
@@ -442,30 +444,34 @@ class DartConstantSystem extends ConstantSystem {
NullConstantValue createNull() => new NullConstantValue();
@override
- ListConstantValue createList(
- ResolutionInterfaceType type, List<ConstantValue> values) {
+ ListConstantValue createList(InterfaceType type, List<ConstantValue> values) {
return new ListConstantValue(type, values);
}
@override
- MapConstantValue createMap(Compiler compiler, ResolutionInterfaceType type,
- List<ConstantValue> keys, List<ConstantValue> values) {
+ MapConstantValue createMap(
+ CommonElements commonElements,
+ BackendClasses backendClasses,
+ InterfaceType type,
+ List<ConstantValue> keys,
+ List<ConstantValue> values) {
return new MapConstantValue(type, keys, values);
}
@override
- ConstantValue createType(Compiler compiler, ResolutionDartType type) {
+ ConstantValue createType(CommonElements commonElements,
+ BackendClasses backendClasses, DartType type) {
// TODO(johnniwinther): Change the `Type` type to
// `compiler.commonElements.typeType` and check the backend specific value
// in [checkConstMapKeysDontOverrideEquals] in 'members.dart'.
- ResolutionInterfaceType implementationType =
- compiler.backend.backendClasses.typeType;
+ InterfaceType implementationType = backendClasses.typeType;
return new TypeConstantValue(type, implementationType);
}
@override
- ConstantValue createSymbol(Compiler compiler, String text) {
- throw new UnsupportedError('DartConstantSystem.evaluate');
+ ConstantValue createSymbol(CommonElements commonElements,
+ BackendClasses backendClasses, String text) {
+ throw new UnsupportedError('DartConstantSystem.createSymbol');
}
bool isInt(ConstantValue constant) => constant.isInt;
@@ -474,7 +480,7 @@ class DartConstantSystem extends ConstantSystem {
bool isBool(ConstantValue constant) => constant.isBool;
bool isNull(ConstantValue constant) => constant.isNull;
- bool isSubtype(DartTypes types, ResolutionDartType s, ResolutionDartType t) {
+ bool isSubtype(DartTypes types, DartType s, DartType t) {
return types.isSubtype(s, t);
}
}
« no previous file with comments | « pkg/compiler/lib/src/compile_time_constants.dart ('k') | pkg/compiler/lib/src/constants/constant_system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698