In the absence of type feedback, pessimistically force Tagged representation for UnaryAdd

BUG=v8:2527

Review URL: https://codereview.chromium.org/12390026

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13890 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent a2e996a5
......@@ -8648,6 +8648,11 @@ void HOptimizedGraphBuilder::VisitAdd(UnaryOperation* expr) {
HValue* context = environment()->LookupContext();
HInstruction* instr =
HMul::New(zone(), context, value, graph()->GetConstant1());
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());
}
return ast_context()->ReturnInstruction(instr, expr->id());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment