From 9e0801c306cd736ce13c8e9a4c5a2c45aca6ed80 Mon Sep 17 00:00:00 2001 From: "titzer@chromium.org" Date: Wed, 24 Sep 2014 08:49:32 +0000 Subject: [PATCH] Translate NumberDivide/NumberModulus operators to Int32Div, Int32Mod in representation-change.h. R=mstarzinger@chromium.org BUG= Review URL: https://codereview.chromium.org/597083002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24171 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/compiler/change-lowering.h | 2 -- src/compiler/machine-operator-reducer.cc | 1 - src/compiler/representation-change.h | 12 ++++++++++++ src/globals.h | 3 +++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/compiler/change-lowering.h b/src/compiler/change-lowering.h index 9f01feb..5d7ab41 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(); diff --git a/src/compiler/machine-operator-reducer.cc b/src/compiler/machine-operator-reducer.cc index 53ee810..9328547 100644 --- a/src/compiler/machine-operator-reducer.cc +++ b/src/compiler/machine-operator-reducer.cc @@ -443,7 +443,6 @@ Reduction MachineOperatorReducer::Reduce(Node* node) { if (m.IsChangeFloat32ToFloat64()) return Replace(m.node()->InputAt(0)); break; } - // TODO(turbofan): strength-reduce and fold floating point operations. default: break; } diff --git a/src/compiler/representation-change.h b/src/compiler/representation-change.h index 3ba5b4e..aaa248e 100644 --- a/src/compiler/representation-change.h +++ b/src/compiler/representation-change.h @@ -235,6 +235,12 @@ class RepresentationChanger { return machine()->Int32Add(); case IrOpcode::kNumberSubtract: return machine()->Int32Sub(); + case IrOpcode::kNumberMultiply: + return machine()->Int32Mul(); + case IrOpcode::kNumberDivide: + return machine()->Int32Div(); + case IrOpcode::kNumberModulus: + return machine()->Int32Mod(); case IrOpcode::kNumberEqual: return machine()->Word32Equal(); case IrOpcode::kNumberLessThan: @@ -253,6 +259,12 @@ class RepresentationChanger { return machine()->Int32Add(); case IrOpcode::kNumberSubtract: return machine()->Int32Sub(); + case IrOpcode::kNumberMultiply: + return machine()->Int32Mul(); + case IrOpcode::kNumberDivide: + return machine()->Int32UDiv(); + case IrOpcode::kNumberModulus: + return machine()->Int32UMod(); case IrOpcode::kNumberEqual: return machine()->Word32Equal(); case IrOpcode::kNumberLessThan: diff --git a/src/globals.h b/src/globals.h index 38deb3e..609ab88 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, -- 2.7.4