Revision: 16129
Author:   [email protected]
Date:     Fri Aug  9 05:03:40 2013
Log: Replace MathFloor/Round by HChange if the input representation does not match the output representation

[email protected]

Review URL: https://chromiumcodereview.appspot.com/22398009
http://code.google.com/p/v8/source/detail?r=16129

Modified:
 /branches/bleeding_edge/src/hydrogen-instructions.cc

=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.cc Fri Aug 9 04:21:03 2013 +++ /branches/bleeding_edge/src/hydrogen-instructions.cc Fri Aug 9 05:03:40 2013
@@ -1291,7 +1291,15 @@

     // If the input is integer32 then we replace the round instruction
     // with its input.
-    if (val->representation().IsSmiOrInteger32()) return val;
+    if (val->representation().IsSmiOrInteger32()) {
+      if (!val->representation().Equals(representation())) {
+        HChange* result = new(block()->zone()) HChange(
+            val, representation(), false, false, false);
+        result->InsertBefore(this);
+        return result;
+      }
+      return val;
+    }
   }

   if (op() == kMathFloor) {
@@ -1300,7 +1308,15 @@

     // If the input is integer32 then we replace the floor instruction
     // with its input.
-    if (val->representation().IsSmiOrInteger32()) return val;
+    if (val->representation().IsSmiOrInteger32()) {
+      if (!val->representation().Equals(representation())) {
+        HChange* result = new(block()->zone()) HChange(
+            val, representation(), false, false, false);
+        result->InsertBefore(this);
+        return result;
+      }
+      return val;
+    }

     if (val->IsDiv() && (val->UseCount() == 1)) {
       HDiv* hdiv = HDiv::cast(val);

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to