Mercurial > hg > truffle
comparison src/share/vm/opto/idealKit.hpp @ 8883:b9a918201d47
Merge with hsx25
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Sat, 06 Apr 2013 20:04:06 +0200 |
parents | 30f42e691e70 |
children | de6a9e811145 2113136690bc |
comparison
equal
deleted
inserted
replaced
8660:d47b52b0ff68 | 8883:b9a918201d47 |
---|---|
100 // for variables points to the RegionNode for the control edges. | 100 // for variables points to the RegionNode for the control edges. |
101 protected: | 101 protected: |
102 Compile * const C; | 102 Compile * const C; |
103 PhaseGVN &_gvn; | 103 PhaseGVN &_gvn; |
104 GrowableArray<Node*>* _pending_cvstates; // stack of cvstates | 104 GrowableArray<Node*>* _pending_cvstates; // stack of cvstates |
105 GrowableArray<Node*>* _delay_transform; // delay invoking gvn.transform until drain | |
106 Node* _cvstate; // current cvstate (control, memory and variables) | 105 Node* _cvstate; // current cvstate (control, memory and variables) |
107 uint _var_ct; // number of variables | 106 uint _var_ct; // number of variables |
108 bool _delay_all_transforms; // flag forcing all transforms to be delayed | 107 bool _delay_all_transforms; // flag forcing all transforms to be delayed |
109 Node* _initial_ctrl; // saves initial control until variables declared | 108 Node* _initial_ctrl; // saves initial control until variables declared |
110 Node* _initial_memory; // saves initial memory until variables declared | 109 Node* _initial_memory; // saves initial memory until variables declared |
119 void set_memory(Node* mem, uint alias_idx ); | 118 void set_memory(Node* mem, uint alias_idx ); |
120 void do_memory_merge(Node* merging, Node* join); | 119 void do_memory_merge(Node* merging, Node* join); |
121 void clear(Node* m); // clear a cvstate | 120 void clear(Node* m); // clear a cvstate |
122 void stop() { clear(_cvstate); } // clear current cvstate | 121 void stop() { clear(_cvstate); } // clear current cvstate |
123 Node* delay_transform(Node* n); | 122 Node* delay_transform(Node* n); |
124 Node* transform(Node* n); // gvn.transform or push node on delay list | 123 Node* transform(Node* n); // gvn.transform or skip it |
125 Node* promote_to_phi(Node* n, Node* reg);// Promote "n" to a phi on region "reg" | 124 Node* promote_to_phi(Node* n, Node* reg);// Promote "n" to a phi on region "reg" |
126 bool was_promoted_to_phi(Node* n, Node* reg) { | 125 bool was_promoted_to_phi(Node* n, Node* reg) { |
127 return (n->is_Phi() && n->in(0) == reg); | 126 return (n->is_Phi() && n->in(0) == reg); |
128 } | 127 } |
129 void declare(IdealVariable* v) { v->set_id(_var_ct++); } | 128 void declare(IdealVariable* v) { v->set_id(_var_ct++); } |
144 | 143 |
145 public: | 144 public: |
146 IdealKit(GraphKit* gkit, bool delay_all_transforms = false, bool has_declarations = false); | 145 IdealKit(GraphKit* gkit, bool delay_all_transforms = false, bool has_declarations = false); |
147 ~IdealKit() { | 146 ~IdealKit() { |
148 stop(); | 147 stop(); |
149 drain_delay_transform(); | |
150 } | 148 } |
151 void sync_kit(GraphKit* gkit); | 149 void sync_kit(GraphKit* gkit); |
152 | 150 |
153 // Control | 151 // Control |
154 Node* ctrl() { return _cvstate->in(TypeFunc::Control); } | 152 Node* ctrl() { return _cvstate->in(TypeFunc::Control); } |
171 void end_loop(); | 169 void end_loop(); |
172 Node* make_label(int goto_ct); | 170 Node* make_label(int goto_ct); |
173 void bind(Node* lab); | 171 void bind(Node* lab); |
174 void goto_(Node* lab, bool bind = false); | 172 void goto_(Node* lab, bool bind = false); |
175 void declarations_done(); | 173 void declarations_done(); |
176 void drain_delay_transform(); | |
177 | 174 |
178 Node* IfTrue(IfNode* iff) { return transform(new (C) IfTrueNode(iff)); } | 175 Node* IfTrue(IfNode* iff) { return transform(new (C) IfTrueNode(iff)); } |
179 Node* IfFalse(IfNode* iff) { return transform(new (C) IfFalseNode(iff)); } | 176 Node* IfFalse(IfNode* iff) { return transform(new (C) IfFalseNode(iff)); } |
180 | 177 |
181 // Data | 178 // Data |
196 | 193 |
197 // TLS | 194 // TLS |
198 Node* thread() { return gvn().transform(new (C) ThreadLocalNode()); } | 195 Node* thread() { return gvn().transform(new (C) ThreadLocalNode()); } |
199 | 196 |
200 // Pointers | 197 // Pointers |
201 Node* AddP(Node *base, Node *ptr, Node *off) { return transform(new (C) AddPNode(base, ptr, off)); } | 198 |
199 // Raw address should be transformed regardless 'delay_transform' flag | |
200 // to produce canonical form CastX2P(offset). | |
201 Node* AddP(Node *base, Node *ptr, Node *off) { return _gvn.transform(new (C) AddPNode(base, ptr, off)); } | |
202 | |
202 Node* CmpP(Node* l, Node* r) { return transform(new (C) CmpPNode(l, r)); } | 203 Node* CmpP(Node* l, Node* r) { return transform(new (C) CmpPNode(l, r)); } |
203 #ifdef _LP64 | 204 #ifdef _LP64 |
204 Node* XorX(Node* l, Node* r) { return transform(new (C) XorLNode(l, r)); } | 205 Node* XorX(Node* l, Node* r) { return transform(new (C) XorLNode(l, r)); } |
205 #else // _LP64 | 206 #else // _LP64 |
206 Node* XorX(Node* l, Node* r) { return transform(new (C) XorINode(l, r)); } | 207 Node* XorX(Node* l, Node* r) { return transform(new (C) XorINode(l, r)); } |
207 #endif // _LP64 | 208 #endif // _LP64 |
208 Node* URShiftX(Node* l, Node* r) { return transform(new (C) URShiftXNode(l, r)); } | 209 Node* URShiftX(Node* l, Node* r) { return transform(new (C) URShiftXNode(l, r)); } |
209 Node* ConX(jint k) { return (Node*)gvn().MakeConX(k); } | 210 Node* ConX(jint k) { return (Node*)gvn().MakeConX(k); } |
210 Node* CastPX(Node* ctl, Node* p) { return transform(new (C) CastP2XNode(ctl, p)); } | 211 Node* CastPX(Node* ctl, Node* p) { return transform(new (C) CastP2XNode(ctl, p)); } |
211 // Add a fixed offset to a pointer | |
212 Node* basic_plus_adr(Node* base, Node* ptr, intptr_t offset); | |
213 | 212 |
214 // Memory operations | 213 // Memory operations |
215 | 214 |
216 // This is the base version which is given an alias index. | 215 // This is the base version which is given an alias index. |
217 Node* load(Node* ctl, | 216 Node* load(Node* ctl, |