Index: src/hydrogen-instructions.cc |
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc |
index 6b55da09673d096e68971fb9ec83ab1105196a3a..61da776e21eb18b89be428ca1c4fb8b2c2b81c4a 100644 |
--- a/src/hydrogen-instructions.cc |
+++ b/src/hydrogen-instructions.cc |
@@ -509,6 +509,17 @@ const char* HValue::Mnemonic() const { |
} |
+bool HValue::CanReplaceWithDummyUses() { |
+ return FLAG_unreachable_code_elimination && |
+ !(block()->IsReachable() || |
+ IsBlockEntry() || |
+ IsControlInstruction() || |
+ IsSimulate() || |
+ IsEnterInlined() || |
+ IsLeaveInlined()); |
+} |
+ |
+ |
bool HValue::IsInteger32Constant() { |
return IsConstant() && HConstant::cast(this)->HasInteger32Value(); |
} |
@@ -1053,6 +1064,21 @@ Representation HBranch::observed_input_representation(int index) { |
} |
+bool HBranch::KnownSuccessorBlock(HBasicBlock** block) { |
+ HValue* value = this->value(); |
+ if (value->EmitAtUses()) { |
+ ASSERT(value->IsConstant()); |
+ ASSERT(!value->representation().IsDouble()); |
+ *block = HConstant::cast(value)->BooleanValue() |
+ ? FirstSuccessor() |
+ : SecondSuccessor(); |
+ return true; |
+ } |
+ *block = NULL; |
+ return false; |
+} |
+ |
+ |
void HCompareMap::PrintDataTo(StringStream* stream) { |
value()->PrintNameTo(stream); |
stream->Add(" (%p)", *map().handle()); |
@@ -2860,6 +2886,20 @@ void HCompareObjectEqAndBranch::PrintDataTo(StringStream* stream) { |
} |
+bool HCompareObjectEqAndBranch::KnownSuccessorBlock(HBasicBlock** block) { |
+ if (left()->IsConstant() && right()->IsConstant()) { |
+ bool comparison_result = |
+ HConstant::cast(left())->Equals(HConstant::cast(right())); |
+ *block = comparison_result |
+ ? FirstSuccessor() |
+ : SecondSuccessor(); |
+ return true; |
+ } |
+ *block = NULL; |
+ return false; |
+} |
+ |
+ |
void HCompareHoleAndBranch::InferRepresentation( |
HInferRepresentationPhase* h_infer) { |
ChangeRepresentation(value()->representation()); |