Reviewers: Michael Starzinger,

Description:
Translate NumberDivide/NumberModulus operators to Int32Div, Int32Mod in
representation-change.h.

[email protected]
BUG=

Please review this at https://codereview.chromium.org/597083002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+11, -3 lines):
  M src/compiler/change-lowering.h
  M src/compiler/machine-operator-reducer.cc
  M src/compiler/representation-change.h
  M src/globals.h


Index: src/compiler/change-lowering.h
diff --git a/src/compiler/change-lowering.h b/src/compiler/change-lowering.h
index 9f01febb9119ab8108ebe7244db55f3574b3a502..5d7ab41b833119f66c225bfff4723d55185909d6 100644
--- a/src/compiler/change-lowering.h
+++ b/src/compiler/change-lowering.h
@@ -26,8 +26,6 @@ class ChangeLowering FINAL : public Reducer {
   virtual Reduction Reduce(Node* node) OVERRIDE;

  private:
-  enum Signedness { kSigned, kUnsigned };
-
   Node* HeapNumberValueIndexConstant();
   Node* SmiMaxValueConstant();
   Node* SmiShiftBitsConstant();
Index: src/compiler/machine-operator-reducer.cc
diff --git a/src/compiler/machine-operator-reducer.cc b/src/compiler/machine-operator-reducer.cc index 936deca8b636deb3e1121cfb9cb360c6a23fc842..5e8444b28a3c936fefe67050bb1cfc026e4f526c 100644
--- a/src/compiler/machine-operator-reducer.cc
+++ b/src/compiler/machine-operator-reducer.cc
@@ -427,7 +427,6 @@ Reduction MachineOperatorReducer::Reduce(Node* node) {
       if (m.IsChangeInt32ToInt64()) return Replace(m.node()->InputAt(0));
       break;
     }
-    // TODO(turbofan): strength-reduce and fold floating point operations.
     default:
       break;
   }
Index: src/compiler/representation-change.h
diff --git a/src/compiler/representation-change.h b/src/compiler/representation-change.h index 3ba5b4e5cb6b670fa6a2370135f208a9d431c583..0e0e01b03ea2eb8d65bca099443cf9bc46bba18c 100644
--- a/src/compiler/representation-change.h
+++ b/src/compiler/representation-change.h
@@ -235,6 +235,10 @@ class RepresentationChanger {
         return machine()->Int32Add();
       case IrOpcode::kNumberSubtract:
         return machine()->Int32Sub();
+      case IrOpcode::kNumberDivide:
+        return machine()->Int32Div();
+      case IrOpcode::kNumberModulus:
+        return machine()->Int32Mod();
       case IrOpcode::kNumberEqual:
         return machine()->Word32Equal();
       case IrOpcode::kNumberLessThan:
@@ -253,6 +257,10 @@ class RepresentationChanger {
         return machine()->Int32Add();
       case IrOpcode::kNumberSubtract:
         return machine()->Int32Sub();
+      case IrOpcode::kNumberDivide:
+        return machine()->Int32UDiv();
+      case IrOpcode::kNumberModulus:
+        return machine()->Int32UMod();
       case IrOpcode::kNumberEqual:
         return machine()->Word32Equal();
       case IrOpcode::kNumberLessThan:
Index: src/globals.h
diff --git a/src/globals.h b/src/globals.h
index 38deb3e88e69f98c96814faea49f97e19dca5a17..609ab8871f1bd3cbf04048915a7c1ba89fd68919 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -769,6 +769,9 @@ enum MinusZeroMode {
 };


+enum Signedness { kSigned, kUnsigned };
+
+
 enum FunctionKind {
   kNormalFunction = 0,
   kArrowFunction = 1,


--
--
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/d/optout.

Reply via email to