| Index: src/hydrogen.cc
|
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc
|
| index 127d7a9aa1ed13943d558e7096ec35ca15ae3818..894a1cc26cd3f5c1021affd8e32ea12c659a423c 100644
|
| --- a/src/hydrogen.cc
|
| +++ b/src/hydrogen.cc
|
| @@ -9222,12 +9222,18 @@ void HOptimizedGraphBuilder::VisitAdd(UnaryOperation* expr) {
|
| CHECK_ALIVE(VisitForValue(expr->expression()));
|
| HValue* value = Pop();
|
| HValue* context = environment()->LookupContext();
|
| + TypeInfo left_info, right_info, result_info;
|
| + oracle()->BinaryType(
|
| + expr->UnaryOperationFeedbackId(), &left_info, &right_info, &result_info);
|
| + // Left is constant 1.
|
| + ASSERT(left_info.IsSmi());
|
| + Representation left_rep = ToRepresentation(left_info);
|
| + Representation right_rep = ToRepresentation(right_info);
|
| HInstruction* instr =
|
| - HMul::New(zone(), context, value, graph()->GetConstant1());
|
| + HMul::New(zone(), context, graph()->GetConstant1(), value);
|
| if (instr->IsBinaryOperation()) {
|
| - // Since we don't have type feedback, we must be cautious/pessimistic.
|
| HBinaryOperation::cast(instr)->set_observed_input_representation(
|
| - Representation::Tagged(), Representation::Tagged());
|
| + left_rep, right_rep);
|
| }
|
| return ast_context()->ReturnInstruction(instr, expr->id());
|
| }
|
| @@ -9618,8 +9624,9 @@ HInstruction* HOptimizedGraphBuilder::BuildBinaryOperation(
|
| HValue* left,
|
| HValue* right) {
|
| HValue* context = environment()->LookupContext();
|
| - TypeInfo left_info, right_info, result_info, combined_info;
|
| - oracle()->BinaryType(expr, &left_info, &right_info, &result_info);
|
| + TypeInfo left_info, right_info, result_info;
|
| + oracle()->BinaryType(
|
| + expr->BinaryOperationFeedbackId(), &left_info, &right_info, &result_info);
|
| Representation left_rep = ToRepresentation(left_info);
|
| Representation right_rep = ToRepresentation(right_info);
|
| Representation result_rep = ToRepresentation(result_info);
|
|
|