Use type feedback for unary minus, improving the performance on e.g. 3d-cube by
authorsvenpanne@chromium.org <svenpanne@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 13 May 2011 08:21:35 +0000 (08:21 +0000)
committersvenpanne@chromium.org <svenpanne@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 13 May 2011 08:21:35 +0000 (08:21 +0000)
7.2% and math-cordic by 5.7%.
Review URL: http://codereview.chromium.org/7013025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7882 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/hydrogen.cc

index 97d7c8394b79c0316a7562f3a193572ee2b13857..eb6cbe0c9fded1e381f10aeb0238bf9c53b873a8 100644 (file)
@@ -4633,6 +4633,10 @@ void HGraphBuilder::VisitSub(UnaryOperation* expr) {
   CHECK_ALIVE(VisitForValue(expr->expression()));
   HValue* value = Pop();
   HInstruction* instr = new(zone()) HMul(value, graph_->GetConstantMinus1());
+  TypeInfo info = oracle()->UnaryType(expr);
+  Representation rep = ToRepresentation(info);
+  TraceRepresentation(expr->op(), info, instr, rep);
+  AssumeRepresentation(instr, rep);
   ast_context()->ReturnInstruction(instr, expr->id());
 }