Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 9ca78ccc84454c2f20140f22614b5951b79911e9..15861a81f85922e3eddddb04eebc6a285b4b14aa 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -3527,7 +3527,12 @@ void HInferRepresentation::Analyze() { |
} |
} |
- // (3a) Use the phi reachability information from step 2 to |
+ // Simplify constant phi inputs where possible. |
+ for (int i = 0; i < phi_count; ++i) { |
+ phi_list->at(i)->SimplifyConstantInputs(); |
+ } |
+ |
+ // Use the phi reachability information from step 2 to |
// push information about values which can't be converted to integer |
// without deoptimization through the phi use-def chains, avoiding |
// unnecessary deoptimizations later. |
@@ -3544,7 +3549,7 @@ void HInferRepresentation::Analyze() { |
} |
} |
- // (3b) Use the phi reachability information from step 2 to |
+ // Use the phi reachability information from step 2 to |
// sum up the non-phi use counts of all connected phis. |
for (int i = 0; i < phi_count; ++i) { |
HPhi* phi = phi_list->at(i); |
@@ -9454,7 +9459,8 @@ void HOptimizedGraphBuilder::VisitSub(UnaryOperation* expr) { |
info = TypeInfo::Unknown(); |
} |
if (instr->IsBinaryOperation()) { |
- HBinaryOperation::cast(instr)->set_observed_input_representation(rep, rep); |
+ HBinaryOperation::cast(instr)->set_observed_input_representation(1, rep); |
+ HBinaryOperation::cast(instr)->set_observed_input_representation(2, rep); |
} |
return ast_context()->ReturnInstruction(instr, expr->id()); |
} |
@@ -9895,7 +9901,8 @@ HInstruction* HOptimizedGraphBuilder::BuildBinaryOperation( |
if (instr->IsBinaryOperation()) { |
HBinaryOperation* binop = HBinaryOperation::cast(instr); |
- binop->set_observed_input_representation(left_rep, right_rep); |
+ binop->set_observed_input_representation(1, left_rep); |
+ binop->set_observed_input_representation(2, right_rep); |
binop->initialize_output_representation(result_rep); |
} |
return instr; |
@@ -10275,7 +10282,8 @@ void HOptimizedGraphBuilder::VisitCompareOperation(CompareOperation* expr) { |
if (combined_rep.IsTagged() || combined_rep.IsNone()) { |
HCompareGeneric* result = |
new(zone()) HCompareGeneric(context, left, right, op); |
- result->set_observed_input_representation(left_rep, right_rep); |
+ result->set_observed_input_representation(1, left_rep); |
+ result->set_observed_input_representation(2, right_rep); |
result->set_position(expr->position()); |
return ast_context()->ReturnInstruction(result, expr->id()); |
} else { |