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

Unified Diff: pkg/compiler/lib/src/inferrer/type_graph_nodes.dart

Issue 2864363002: Remove DartString from constants. (Closed)
Patch Set: Remove toDartString Created 3 years, 7 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
« no previous file with comments | « pkg/compiler/lib/src/inferrer/type_graph_dump.dart ('k') | pkg/compiler/lib/src/inferrer/type_system.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
diff --git a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
index 0fa960c921ae539c7acfa6d1b750fcde956f1bb8..8bf8c87b6b72e8776a664109606827fa299aadb7 100644
--- a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
+++ b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
@@ -19,8 +19,7 @@ import '../elements/resolution_types.dart'
ResolutionInterfaceType,
ResolutionTypeKind;
import '../js_backend/backend.dart';
-import '../tree/dartstring.dart' show DartString;
-import '../tree/tree.dart' as ast show Node, LiteralBool, Send;
+import '../tree/tree.dart' as ast show Node, Send;
import '../types/masks.dart'
show
CommonMasks,
@@ -1041,7 +1040,7 @@ class DynamicCallSiteTypeInformation extends CallSiteTypeInformation {
TypeMask arg = arguments.positional[0].type;
if (arg is ValueTypeMask && arg.value.isString) {
DictionaryTypeMask dictionaryTypeMask = typeMask;
- String key = arg.value.primitiveValue.slowToString();
+ String key = arg.value.primitiveValue;
if (dictionaryTypeMask.typeMap.containsKey(key)) {
if (debug.VERBOSE) {
print("Dictionary lookup for $key yields "
@@ -1222,14 +1221,13 @@ class ConcreteTypeInformation extends TypeInformation {
}
class StringLiteralTypeInformation extends ConcreteTypeInformation {
- final DartString value;
+ final String value;
- StringLiteralTypeInformation(value, TypeMask mask)
- : super(new ValueTypeMask(mask, new StringConstantValue(value))),
- this.value = value;
+ StringLiteralTypeInformation(this.value, TypeMask mask)
+ : super(new ValueTypeMask(mask, new StringConstantValue(value)));
- String asString() => value.slowToString();
- String toString() => 'Type $type value ${value.slowToString()}';
+ String asString() => value;
+ String toString() => 'Type $type value ${value}';
accept(TypeInformationVisitor visitor) {
return visitor.visitStringLiteralTypeInformation(this);
@@ -1237,14 +1235,13 @@ class StringLiteralTypeInformation extends ConcreteTypeInformation {
}
class BoolLiteralTypeInformation extends ConcreteTypeInformation {
- final ast.LiteralBool value;
+ final bool value;
- BoolLiteralTypeInformation(value, TypeMask mask)
- : super(new ValueTypeMask(mask,
- value.value ? new TrueConstantValue() : new FalseConstantValue())),
- this.value = value;
+ BoolLiteralTypeInformation(this.value, TypeMask mask)
+ : super(new ValueTypeMask(
+ mask, value ? new TrueConstantValue() : new FalseConstantValue()));
- String toString() => 'Type $type value ${value.value}';
+ String toString() => 'Type $type value ${value}';
accept(TypeInformationVisitor visitor) {
return visitor.visitBoolLiteralTypeInformation(this);
« no previous file with comments | « pkg/compiler/lib/src/inferrer/type_graph_dump.dart ('k') | pkg/compiler/lib/src/inferrer/type_system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698