In the absence of type feedback, pessimistically force Tagged representation for...
authorjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 11 Mar 2013 08:42:07 +0000 (08:42 +0000)
committerjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 11 Mar 2013 08:42:07 +0000 (08:42 +0000)
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

src/hydrogen.cc

index 0feb119..bbcdd3b 100644 (file)
@@ -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());
 }