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

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

Issue 1376603003: dart2js: improve ssa utilization of bool value types (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix issue with parameter values being assigned Created 5 years, 3 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/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 df00807da25519444f7223f320c81e2e5e701fd7..c1d51cc2f797f663aa49234eebffef938b083be1 100644
--- a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
+++ b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
@@ -928,10 +928,11 @@ class DynamicCallSiteTypeInformation extends CallSiteTypeInformation {
return containerTypeMask.elementType;
} else if (inferrer.returnsMapValueType(selector, typeMask)) {
if (typeMask.isDictionary &&
- arguments.positional[0].type.isValue) {
+ arguments.positional[0].type.isValue &&
+ arguments.positional[0].type.value.isString) {
DictionaryTypeMask dictionaryTypeMask = typeMask;
ValueTypeMask arg = arguments.positional[0].type;
- String key = arg.value;
+ String key = arg.value.primitiveValue.slowToString();
if (dictionaryTypeMask.typeMap.containsKey(key)) {
if (_VERBOSE) {
print("Dictionary lookup for $key yields "
@@ -1116,7 +1117,7 @@ class StringLiteralTypeInformation extends ConcreteTypeInformation {
final ast.DartString value;
StringLiteralTypeInformation(value, TypeMask mask)
- : super(new ValueTypeMask(mask, value.slowToString())),
+ : super(new ValueTypeMask(mask, new StringConstantValue(value))),
this.value = value;
String asString() => value.slowToString();
@@ -1131,7 +1132,8 @@ class BoolLiteralTypeInformation extends ConcreteTypeInformation {
final ast.LiteralBool value;
BoolLiteralTypeInformation(value, TypeMask mask)
- : super(new ValueTypeMask(mask, value.value)),
+ : super(new ValueTypeMask(mask,
+ value.value ? new TrueConstantValue() : new FalseConstantValue())),
this.value = value;
String toString() => 'Type $type value ${value.value}';

Powered by Google App Engine
This is Rietveld 408576698