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

Unified Diff: pkg/compiler/lib/src/ssa/optimize.dart

Issue 1381793002: Revert "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 | « pkg/compiler/lib/src/inferrer/type_graph_nodes.dart ('k') | pkg/compiler/lib/src/types/types.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/optimize.dart
diff --git a/pkg/compiler/lib/src/ssa/optimize.dart b/pkg/compiler/lib/src/ssa/optimize.dart
index a24b0c16d96c78a23105f4acd5a2d130ccb1af30..07611f654a3292066d02ec241076f47e28dc7c3b 100644
--- a/pkg/compiler/lib/src/ssa/optimize.dart
+++ b/pkg/compiler/lib/src/ssa/optimize.dart
@@ -200,32 +200,6 @@ class SsaInstructionSimplifier extends HBaseVisitor
return node;
}
- ConstantValue getConstantFromType(HInstruction node) {
- if (node.isValue() && !node.canBeNull()) {
- ValueTypeMask valueMask = node.instructionType;
- if (valueMask.value.isBool) {
- return valueMask.value;
- }
- // TODO(het): consider supporting other values (short strings?)
- }
- return null;
- }
-
- void propagateConstantValueToUses(HInstruction known) {
- if (known.usedBy.isEmpty) return;
- ConstantValue value = getConstantFromType(known);
- if (value != null) {
- for (HInstruction user in known.usedBy.toList()) {
- user.changeUse(known, graph.addConstant(value, compiler));
- }
- }
- }
-
- HInstruction visitParameterValue(HParameterValue node) {
- propagateConstantValueToUses(node);
- return node;
- }
-
HInstruction visitBoolify(HBoolify node) {
List<HInstruction> inputs = node.inputs;
assert(inputs.length == 1);
@@ -398,7 +372,6 @@ class SsaInstructionSimplifier extends HBaseVisitor
}
HInstruction visitInvokeDynamicMethod(HInvokeDynamicMethod node) {
- propagateConstantValueToUses(node);
if (node.isInterceptedCall) {
HInstruction folded = handleInterceptedCall(node);
if (folded != node) return folded;
@@ -833,7 +806,6 @@ class SsaInstructionSimplifier extends HBaseVisitor
}
HInstruction visitInvokeDynamicGetter(HInvokeDynamicGetter node) {
- propagateConstantValueToUses(node);
if (node.isInterceptedCall) {
HInstruction folded = handleInterceptedCall(node);
if (folded != node) return folded;
@@ -895,7 +867,6 @@ class SsaInstructionSimplifier extends HBaseVisitor
}
HInstruction visitInvokeStatic(HInvokeStatic node) {
- propagateConstantValueToUses(node);
if (node.element == backend.getCheckConcurrentModificationError()) {
if (node.inputs.length == 2) {
HInstruction firstArgument = node.inputs[0];
@@ -1335,6 +1306,13 @@ class SsaLiveBlockAnalyzer extends HBaseVisitor {
} else {
markBlockLive(instruction.elseBlock);
}
+ } else if (condition.isValue()) {
+ ValueTypeMask valueType = condition.instructionType;
+ if (valueType.value == true) {
+ markBlockLive(instruction.thenBlock);
+ } else {
+ markBlockLive(instruction.elseBlock);
+ }
} else {
visitControlFlow(instruction);
}
« no previous file with comments | « pkg/compiler/lib/src/inferrer/type_graph_nodes.dart ('k') | pkg/compiler/lib/src/types/types.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698