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
This commit is contained in:
jkummerow@chromium.org 2013-03-11 08:42:07 +00:00
parent a2e996a5fa
commit 00df65117d

View File

@ -8648,6 +8648,11 @@ void HOptimizedGraphBuilder::VisitAdd(UnaryOperation* expr) {
HValue* context = environment()->LookupContext(); HValue* context = environment()->LookupContext();
HInstruction* instr = HInstruction* instr =
HMul::New(zone(), context, value, graph()->GetConstant1()); 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()); return ast_context()->ReturnInstruction(instr, expr->id());
} }