< prev index next >

src/share/vm/opto/mathexactnode.hpp

Print this page




  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_OPTO_MATHEXACTNODE_HPP
  26 #define SHARE_VM_OPTO_MATHEXACTNODE_HPP
  27 
  28 #include "opto/multnode.hpp"
  29 #include "opto/node.hpp"
  30 #include "opto/addnode.hpp"
  31 #include "opto/subnode.hpp"
  32 #include "opto/type.hpp"
  33 
  34 class PhaseGVN;
  35 class PhaseTransform;
  36 
  37 class OverflowNode : public CmpNode {
  38 public:
  39   OverflowNode(Node* in1, Node* in2) : CmpNode(in1, in2) {}
  40 
  41   virtual uint ideal_reg() const { return Op_RegFlags; }
  42   virtual const Type* sub(const Type* t1, const Type* t2) const;
  43 };
  44 
  45 class OverflowINode : public OverflowNode {
  46 public:
  47   typedef TypeInt TypeClass;
  48 
  49   OverflowINode(Node* in1, Node* in2) : OverflowNode(in1, in2) {}
  50   virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
  51   virtual const Type* Value(PhaseGVN* phase) const;
  52 
  53   virtual bool will_overflow(jint v1, jint v2) const = 0;
  54   virtual bool can_overflow(const Type* t1, const Type* t2) const = 0;
  55 };
  56 
  57 
  58 class OverflowLNode : public OverflowNode {
  59 public:
  60   typedef TypeLong TypeClass;
  61 
  62   OverflowLNode(Node* in1, Node* in2) : OverflowNode(in1, in2) {}
  63   virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
  64   virtual const Type* Value(PhaseGVN* phase) const;
  65 
  66   virtual bool will_overflow(jlong v1, jlong v2) const = 0;
  67   virtual bool can_overflow(const Type* t1, const Type* t2) const = 0;
  68 };
  69 
  70 class OverflowAddINode : public OverflowINode {
  71 public:
  72   typedef AddINode MathOp;
  73 
  74   OverflowAddINode(Node* in1, Node* in2) : OverflowINode(in1, in2) {}
  75   virtual int Opcode() const;
  76 
  77   virtual bool will_overflow(jint v1, jint v2) const;
  78   virtual bool can_overflow(const Type* t1, const Type* t2) const;
  79 };
  80 
  81 class OverflowSubINode : public OverflowINode {
  82 public:
  83   typedef SubINode MathOp;
  84 
  85   OverflowSubINode(Node* in1, Node* in2) : OverflowINode(in1, in2) {}
  86   virtual int Opcode() const;
  87 
  88   virtual bool will_overflow(jint v1, jint v2) const;
  89   virtual bool can_overflow(const Type* t1, const Type* t2) const;
  90 };
  91 
  92 class OverflowMulINode : public OverflowINode {
  93 public:
  94   typedef MulINode MathOp;
  95 
  96   OverflowMulINode(Node* in1, Node* in2) : OverflowINode(in1, in2) {}
  97   virtual int Opcode() const;
  98 
  99   virtual bool will_overflow(jint v1, jint v2) const;
 100   virtual bool can_overflow(const Type* t1, const Type* t2) const;
 101 };
 102 
 103 class OverflowAddLNode : public OverflowLNode {
 104 public:
 105   typedef AddLNode MathOp;
 106 
 107   OverflowAddLNode(Node* in1, Node* in2) : OverflowLNode(in1, in2) {}
 108   virtual int Opcode() const;
 109 
 110   virtual bool will_overflow(jlong v1, jlong v2) const;
 111   virtual bool can_overflow(const Type* t1, const Type* t2) const;
 112 };
 113 
 114 class OverflowSubLNode : public OverflowLNode {
 115 public:
 116   typedef SubLNode MathOp;
 117 
 118   OverflowSubLNode(Node* in1, Node* in2) : OverflowLNode(in1, in2) {}
 119   virtual int Opcode() const;
 120 
 121   virtual bool will_overflow(jlong v1, jlong v2) const;
 122   virtual bool can_overflow(const Type* t1, const Type* t2) const;
 123 };
 124 
 125 class OverflowMulLNode : public OverflowLNode {
 126 public:
 127   typedef MulLNode MathOp;
 128 
 129   OverflowMulLNode(Node* in1, Node* in2) : OverflowLNode(in1, in2) {}
 130   virtual int Opcode() const;
 131 
 132   virtual bool will_overflow(jlong v1, jlong v2) const;
 133   virtual bool can_overflow(const Type* t1, const Type* t2) const;
 134 };
 135 
 136 #endif
 137 


  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_OPTO_MATHEXACTNODE_HPP
  26 #define SHARE_VM_OPTO_MATHEXACTNODE_HPP
  27 
  28 #include "opto/multnode.hpp"
  29 #include "opto/node.hpp"
  30 #include "opto/addnode.hpp"
  31 #include "opto/subnode.hpp"
  32 #include "opto/type.hpp"
  33 
  34 class PhaseGVN;
  35 class PhaseTransform;
  36 
  37 class OverflowNode : public CmpNode {
  38 public:
  39   OverflowNode(Node* in1, Node* in2) : CmpNode(in1, in2) {}
  40 
  41   virtual Opcodes ideal_reg() const { return Opcodes::Op_RegFlags; }
  42   virtual const Type* sub(const Type* t1, const Type* t2) const;
  43 };
  44 
  45 class OverflowINode : public OverflowNode {
  46 public:
  47   typedef TypeInt TypeClass;
  48 
  49   OverflowINode(Node* in1, Node* in2) : OverflowNode(in1, in2) {}
  50   virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
  51   virtual const Type* Value(PhaseGVN* phase) const;
  52 
  53   virtual bool will_overflow(jint v1, jint v2) const = 0;
  54   virtual bool can_overflow(const Type* t1, const Type* t2) const = 0;
  55 };
  56 
  57 
  58 class OverflowLNode : public OverflowNode {
  59 public:
  60   typedef TypeLong TypeClass;
  61 
  62   OverflowLNode(Node* in1, Node* in2) : OverflowNode(in1, in2) {}
  63   virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
  64   virtual const Type* Value(PhaseGVN* phase) const;
  65 
  66   virtual bool will_overflow(jlong v1, jlong v2) const = 0;
  67   virtual bool can_overflow(const Type* t1, const Type* t2) const = 0;
  68 };
  69 
  70 class OverflowAddINode : public OverflowINode {
  71 public:
  72   typedef AddINode MathOp;
  73 
  74   OverflowAddINode(Node* in1, Node* in2) : OverflowINode(in1, in2) {}
  75   virtual Opcodes Opcode() const;
  76 
  77   virtual bool will_overflow(jint v1, jint v2) const;
  78   virtual bool can_overflow(const Type* t1, const Type* t2) const;
  79 };
  80 
  81 class OverflowSubINode : public OverflowINode {
  82 public:
  83   typedef SubINode MathOp;
  84 
  85   OverflowSubINode(Node* in1, Node* in2) : OverflowINode(in1, in2) {}
  86   virtual Opcodes Opcode() const;
  87 
  88   virtual bool will_overflow(jint v1, jint v2) const;
  89   virtual bool can_overflow(const Type* t1, const Type* t2) const;
  90 };
  91 
  92 class OverflowMulINode : public OverflowINode {
  93 public:
  94   typedef MulINode MathOp;
  95 
  96   OverflowMulINode(Node* in1, Node* in2) : OverflowINode(in1, in2) {}
  97   virtual Opcodes Opcode() const;
  98 
  99   virtual bool will_overflow(jint v1, jint v2) const;
 100   virtual bool can_overflow(const Type* t1, const Type* t2) const;
 101 };
 102 
 103 class OverflowAddLNode : public OverflowLNode {
 104 public:
 105   typedef AddLNode MathOp;
 106 
 107   OverflowAddLNode(Node* in1, Node* in2) : OverflowLNode(in1, in2) {}
 108   virtual Opcodes Opcode() const;
 109 
 110   virtual bool will_overflow(jlong v1, jlong v2) const;
 111   virtual bool can_overflow(const Type* t1, const Type* t2) const;
 112 };
 113 
 114 class OverflowSubLNode : public OverflowLNode {
 115 public:
 116   typedef SubLNode MathOp;
 117 
 118   OverflowSubLNode(Node* in1, Node* in2) : OverflowLNode(in1, in2) {}
 119   virtual Opcodes Opcode() const;
 120 
 121   virtual bool will_overflow(jlong v1, jlong v2) const;
 122   virtual bool can_overflow(const Type* t1, const Type* t2) const;
 123 };
 124 
 125 class OverflowMulLNode : public OverflowLNode {
 126 public:
 127   typedef MulLNode MathOp;
 128 
 129   OverflowMulLNode(Node* in1, Node* in2) : OverflowLNode(in1, in2) {}
 130   virtual Opcodes Opcode() const;
 131 
 132   virtual bool will_overflow(jlong v1, jlong v2) const;
 133   virtual bool can_overflow(const Type* t1, const Type* t2) const;
 134 };
 135 
 136 #endif
 137 
< prev index next >