Index: src/hydrogen-instructions.cc |
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc |
index ce1e9db6952a4609f003030a6aae7fcd2f903547..dc1871b3aeae1794e4024e319cbb8d03f60c47ad 100644 |
--- a/src/hydrogen-instructions.cc |
+++ b/src/hydrogen-instructions.cc |
@@ -3251,11 +3251,27 @@ bool HIsObjectAndBranch::KnownSuccessorBlock(HBasicBlock** block) { |
bool HIsStringAndBranch::KnownSuccessorBlock(HBasicBlock** block) { |
+ if (known_successor_index() != kNoKnownSuccessorIndex) { |
+ *block = SuccessorAt(known_successor_index()); |
+ return true; |
+ } |
if (FLAG_fold_constants && value()->IsConstant()) { |
*block = HConstant::cast(value())->HasStringValue() |
? FirstSuccessor() : SecondSuccessor(); |
return true; |
} |
+ if (value()->type().IsString()) { |
+ *block = FirstSuccessor(); |
+ return true; |
+ } |
+ if (value()->type().IsSmi() || |
+ value()->type().IsNull() || |
+ value()->type().IsBoolean() || |
+ value()->type().IsUndefined() || |
+ value()->type().IsJSObject()) { |
+ *block = SecondSuccessor(); |
+ return true; |
+ } |
*block = NULL; |
return false; |
} |