Mercurial > hg > truffle
comparison src/share/vm/opto/mathexactnode.hpp @ 18041:52b4284cb496
Merge with jdk8u20-b26
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 15 Oct 2014 16:02:50 +0200 |
parents | 4ca6dc0799b6 |
children |
comparison
equal
deleted
inserted
replaced
17606:45d7b2c7029d | 18041:52b4284cb496 |
---|---|
25 #ifndef SHARE_VM_OPTO_MATHEXACTNODE_HPP | 25 #ifndef SHARE_VM_OPTO_MATHEXACTNODE_HPP |
26 #define SHARE_VM_OPTO_MATHEXACTNODE_HPP | 26 #define SHARE_VM_OPTO_MATHEXACTNODE_HPP |
27 | 27 |
28 #include "opto/multnode.hpp" | 28 #include "opto/multnode.hpp" |
29 #include "opto/node.hpp" | 29 #include "opto/node.hpp" |
30 #include "opto/addnode.hpp" | |
30 #include "opto/subnode.hpp" | 31 #include "opto/subnode.hpp" |
31 #include "opto/type.hpp" | 32 #include "opto/type.hpp" |
32 | |
33 class BoolNode; | |
34 class IfNode; | |
35 class Node; | |
36 | 33 |
37 class PhaseGVN; | 34 class PhaseGVN; |
38 class PhaseTransform; | 35 class PhaseTransform; |
39 | 36 |
40 class MathExactNode : public MultiNode { | 37 class OverflowNode : public CmpNode { |
41 public: | 38 public: |
42 MathExactNode(Node* ctrl, Node* in1); | 39 OverflowNode(Node* in1, Node* in2) : CmpNode(in1, in2) {} |
43 MathExactNode(Node* ctrl, Node* in1, Node* in2); | |
44 enum { | |
45 result_proj_node = 0, | |
46 flags_proj_node = 1 | |
47 }; | |
48 virtual int Opcode() const; | |
49 virtual Node* Identity(PhaseTransform* phase) { return this; } | |
50 virtual Node* Ideal(PhaseGVN* phase, bool can_reshape) { return NULL; } | |
51 virtual const Type* Value(PhaseTransform* phase) const { return bottom_type(); } | |
52 virtual uint hash() const { return NO_HASH; } | |
53 virtual bool is_CFG() const { return false; } | |
54 virtual uint ideal_reg() const { return NotAMachineReg; } | |
55 | 40 |
56 ProjNode* result_node() const { return proj_out(result_proj_node); } | 41 virtual uint ideal_reg() const { return Op_RegFlags; } |
57 ProjNode* flags_node() const { return proj_out(flags_proj_node); } | 42 virtual const Type* sub(const Type* t1, const Type* t2) const; |
58 Node* control_node() const; | |
59 Node* non_throwing_branch() const; | |
60 protected: | |
61 IfNode* if_node() const; | |
62 BoolNode* bool_node() const; | |
63 Node* no_overflow(PhaseGVN *phase, Node* new_result); | |
64 }; | 43 }; |
65 | 44 |
66 class MathExactINode : public MathExactNode { | 45 class OverflowINode : public OverflowNode { |
67 public: | 46 public: |
68 MathExactINode(Node* ctrl, Node* in1) : MathExactNode(ctrl, in1) {} | 47 typedef TypeInt TypeClass; |
69 MathExactINode(Node* ctrl, Node* in1, Node* in2) : MathExactNode(ctrl, in1, in2) {} | |
70 virtual int Opcode() const; | |
71 virtual Node* match(const ProjNode* proj, const Matcher* m); | |
72 virtual const Type* bottom_type() const { return TypeTuple::INT_CC_PAIR; } | |
73 }; | |
74 | 48 |
75 class MathExactLNode : public MathExactNode { | 49 OverflowINode(Node* in1, Node* in2) : OverflowNode(in1, in2) {} |
76 public: | 50 virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); |
77 MathExactLNode(Node* ctrl, Node* in1) : MathExactNode(ctrl, in1) {} | 51 virtual const Type* Value(PhaseTransform* phase) const; |
78 MathExactLNode(Node* ctrl, Node* in1, Node* in2) : MathExactNode(ctrl, in1, in2) {} | |
79 virtual int Opcode() const; | |
80 virtual Node* match(const ProjNode* proj, const Matcher* m); | |
81 virtual const Type* bottom_type() const { return TypeTuple::LONG_CC_PAIR; } | |
82 }; | |
83 | 52 |
84 class AddExactINode : public MathExactINode { | 53 virtual bool will_overflow(jint v1, jint v2) const = 0; |
85 public: | 54 virtual bool can_overflow(const Type* t1, const Type* t2) const = 0; |
86 AddExactINode(Node* ctrl, Node* in1, Node* in2) : MathExactINode(ctrl, in1, in2) {} | |
87 virtual int Opcode() const; | |
88 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); | |
89 }; | |
90 | |
91 class AddExactLNode : public MathExactLNode { | |
92 public: | |
93 AddExactLNode(Node* ctrl, Node* in1, Node* in2) : MathExactLNode(ctrl, in1, in2) {} | |
94 virtual int Opcode() const; | |
95 virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); | |
96 }; | |
97 | |
98 class SubExactINode : public MathExactINode { | |
99 public: | |
100 SubExactINode(Node* ctrl, Node* in1, Node* in2) : MathExactINode(ctrl, in1, in2) {} | |
101 virtual int Opcode() const; | |
102 virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); | |
103 }; | |
104 | |
105 class SubExactLNode : public MathExactLNode { | |
106 public: | |
107 SubExactLNode(Node* ctrl, Node* in1, Node* in2) : MathExactLNode(ctrl, in1, in2) {} | |
108 virtual int Opcode() const; | |
109 virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); | |
110 }; | |
111 | |
112 class NegExactINode : public MathExactINode { | |
113 public: | |
114 NegExactINode(Node* ctrl, Node* in1) : MathExactINode(ctrl, in1) {} | |
115 virtual int Opcode() const; | |
116 virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); | |
117 }; | |
118 | |
119 class NegExactLNode : public MathExactLNode { | |
120 public: | |
121 NegExactLNode(Node* ctrl, Node* in1) : MathExactLNode(ctrl, in1) {} | |
122 virtual int Opcode() const; | |
123 virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); | |
124 }; | |
125 | |
126 class MulExactINode : public MathExactINode { | |
127 public: | |
128 MulExactINode(Node* ctrl, Node* in1, Node* in2) : MathExactINode(ctrl, in1, in2) {} | |
129 virtual int Opcode() const; | |
130 virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); | |
131 }; | |
132 | |
133 class MulExactLNode : public MathExactLNode { | |
134 public: | |
135 MulExactLNode(Node* ctrl, Node* in1, Node* in2) : MathExactLNode(ctrl, in1, in2) {} | |
136 virtual int Opcode() const; | |
137 virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); | |
138 }; | |
139 | |
140 class FlagsProjNode : public ProjNode { | |
141 public: | |
142 FlagsProjNode(Node* src, uint con) : ProjNode(src, con) { | |
143 init_class_id(Class_FlagsProj); | |
144 } | |
145 | |
146 virtual int Opcode() const; | |
147 virtual bool is_CFG() const { return false; } | |
148 virtual const Type* bottom_type() const { return TypeInt::CC; } | |
149 virtual uint ideal_reg() const { return Op_RegFlags; } | |
150 }; | 55 }; |
151 | 56 |
152 | 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(PhaseTransform* 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 | |
153 #endif | 136 #endif |
154 | 137 |