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

Unified Diff: pkg/compiler/lib/src/cps_ir/type_mask_system.dart

Issue 1376603003: dart2js: improve ssa utilization of bool value types (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/inferrer/type_graph_nodes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/type_mask_system.dart
diff --git a/pkg/compiler/lib/src/cps_ir/type_mask_system.dart b/pkg/compiler/lib/src/cps_ir/type_mask_system.dart
index 893113f3f7730377908fdefa759a5f3e2c9b1c7e..a84d28d4ba5cd333e83868f839722da0da625407 100644
--- a/pkg/compiler/lib/src/cps_ir/type_mask_system.dart
+++ b/pkg/compiler/lib/src/cps_ir/type_mask_system.dart
@@ -133,10 +133,7 @@ class TypeMaskSystem {
if (!mask.isValue) return null;
if (mask.isNullable) return null; // e.g. 'true or null'.
ValueTypeMask valueMask = mask;
- var value = valueMask.value;
- // TODO(sra): Why is ValueTypeMask.value not a ConstantValue?
- if (value == false) return new FalseConstantValue();
- if (value == true) return new TrueConstantValue();
+ if (valueMask.value.isBool) return valueMask.value;
// TODO(sra): Consider other values. Be careful with large strings.
return null;
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/inferrer/type_graph_nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698