Make sure HMathMinMax always has a supported representation
authorjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 10 Dec 2012 12:10:23 +0000 (12:10 +0000)
committerjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 10 Dec 2012 12:10:23 +0000 (12:10 +0000)
Review URL: https://codereview.chromium.org/11467021

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

src/hydrogen-instructions.cc
src/hydrogen-instructions.h

index d9590a9..0e6ea00 100644 (file)
@@ -1689,6 +1689,14 @@ void HBinaryOperation::AssumeRepresentation(Representation r) {
 }
 
 
+void HMathMinMax::InferRepresentation(HInferRepresentation* h_infer) {
+  ASSERT(CheckFlag(kFlexibleRepresentation));
+  Representation new_rep = RepresentationFromInputs();
+  UpdateRepresentation(new_rep, h_infer, "inputs");
+  // Do not care about uses.
+}
+
+
 Range* HBitwise::InferRange(Zone* zone) {
   if (op() == Token::BIT_XOR) return HValue::InferRange(zone);
   const int32_t kDefaultMask = static_cast<int32_t>(0xffffffff);
index c6bf71d..80685f0 100644 (file)
@@ -3726,6 +3726,8 @@ class HMathMinMax: public HArithmeticBinaryOperation {
     return RequiredInputRepresentation(index);
   }
 
+  virtual void InferRepresentation(HInferRepresentation* h_infer);
+
   virtual Representation RepresentationFromInputs() {
     Representation left_rep = left()->representation();
     Representation right_rep = right()->representation();