273 init_class_id(Class_CountedLoopEnd);
274 }
275 virtual int Opcode() const;
276
277 Node *cmp_node() const { return (in(TestValue)->req() >=2) ? in(TestValue)->in(1) : NULL; }
278 Node *incr() const { Node *tmp = cmp_node(); return (tmp && tmp->req()==3) ? tmp->in(1) : NULL; }
279 Node *limit() const { Node *tmp = cmp_node(); return (tmp && tmp->req()==3) ? tmp->in(2) : NULL; }
280 Node *stride() const { Node *tmp = incr (); return (tmp && tmp->req()==3) ? tmp->in(2) : NULL; }
281 Node *phi() const { Node *tmp = incr (); return (tmp && tmp->req()==3) ? tmp->in(1) : NULL; }
282 Node *init_trip() const { Node *tmp = phi (); return (tmp && tmp->req()==3) ? tmp->in(1) : NULL; }
283 int stride_con() const;
284 bool stride_is_con() const { Node *tmp = stride (); return (tmp != NULL && tmp->is_Con()); }
285 BoolTest::mask test_trip() const { return in(TestValue)->as_Bool()->_test._test; }
286 CountedLoopNode *loopnode() const {
287 // The CountedLoopNode that goes with this CountedLoopEndNode may
288 // have been optimized out by the IGVN so be cautious with the
289 // pattern matching on the graph
290 if (phi() == NULL) {
291 return NULL;
292 }
293 Node *ln = phi()->in(0);
294 if (ln->is_CountedLoop() && ln->as_CountedLoop()->loopexit() == this) {
295 return (CountedLoopNode*)ln;
296 }
297 return NULL;
298 }
299
300 #ifndef PRODUCT
301 virtual void dump_spec(outputStream *st) const;
302 #endif
303 };
304
305
306 inline CountedLoopEndNode *CountedLoopNode::loopexit() const {
307 Node *bc = back_control();
308 if( bc == NULL ) return NULL;
309 Node *le = bc->in(0);
310 if( le->Opcode() != Op_CountedLoopEnd )
311 return NULL;
312 return (CountedLoopEndNode*)le;
|
273 init_class_id(Class_CountedLoopEnd);
274 }
275 virtual int Opcode() const;
276
277 Node *cmp_node() const { return (in(TestValue)->req() >=2) ? in(TestValue)->in(1) : NULL; }
278 Node *incr() const { Node *tmp = cmp_node(); return (tmp && tmp->req()==3) ? tmp->in(1) : NULL; }
279 Node *limit() const { Node *tmp = cmp_node(); return (tmp && tmp->req()==3) ? tmp->in(2) : NULL; }
280 Node *stride() const { Node *tmp = incr (); return (tmp && tmp->req()==3) ? tmp->in(2) : NULL; }
281 Node *phi() const { Node *tmp = incr (); return (tmp && tmp->req()==3) ? tmp->in(1) : NULL; }
282 Node *init_trip() const { Node *tmp = phi (); return (tmp && tmp->req()==3) ? tmp->in(1) : NULL; }
283 int stride_con() const;
284 bool stride_is_con() const { Node *tmp = stride (); return (tmp != NULL && tmp->is_Con()); }
285 BoolTest::mask test_trip() const { return in(TestValue)->as_Bool()->_test._test; }
286 CountedLoopNode *loopnode() const {
287 // The CountedLoopNode that goes with this CountedLoopEndNode may
288 // have been optimized out by the IGVN so be cautious with the
289 // pattern matching on the graph
290 if (phi() == NULL) {
291 return NULL;
292 }
293 assert(phi()->is_Phi(), "should be PhiNode");
294 Node *ln = phi()->in(0);
295 if (ln->is_CountedLoop() && ln->as_CountedLoop()->loopexit() == this) {
296 return (CountedLoopNode*)ln;
297 }
298 return NULL;
299 }
300
301 #ifndef PRODUCT
302 virtual void dump_spec(outputStream *st) const;
303 #endif
304 };
305
306
307 inline CountedLoopEndNode *CountedLoopNode::loopexit() const {
308 Node *bc = back_control();
309 if( bc == NULL ) return NULL;
310 Node *le = bc->in(0);
311 if( le->Opcode() != Op_CountedLoopEnd )
312 return NULL;
313 return (CountedLoopEndNode*)le;
|