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 d9590a946e28a21ae10120df6f243c03f901ac97..0e6ea00058f299ab0966d2e5055e1a70f6da9858 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 c6bf71d8356d58b1020128c10cbcc8009de984de..80685f077fbc0d9cbac354d5554cef88c2d39684 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();