| Index: src/hydrogen-instructions.cc
|
| diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
|
| index 1dadb70afb509f5c14a5d549fd14184bd304bc2f..e63d975c9d7b5f6fb77473e4afcab9ff7796d62f 100644
|
| --- a/src/hydrogen-instructions.cc
|
| +++ b/src/hydrogen-instructions.cc
|
| @@ -511,6 +511,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();
|
| }
|
| @@ -975,6 +986,9 @@ void HCallNewArray::PrintDataTo(StringStream* stream) {
|
|
|
| void HCallRuntime::PrintDataTo(StringStream* stream) {
|
| stream->Add("%o ", *name());
|
| + if (save_doubles() == kSaveFPRegs) {
|
| + stream->Add("[save doubles] ");
|
| + }
|
| stream->Add("#%d", argument_count());
|
| }
|
|
|
| @@ -1052,6 +1066,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());
|
| @@ -2802,6 +2831,9 @@ Range* HShl::InferRange(Zone* zone) {
|
|
|
|
|
| Range* HLoadNamedField::InferRange(Zone* zone) {
|
| + if (access().representation().IsByte()) {
|
| + return new(zone) Range(0, 255);
|
| + }
|
| if (access().IsStringLength()) {
|
| return new(zone) Range(0, String::kMaxLength);
|
| }
|
| @@ -2859,6 +2891,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());
|
|
|