< prev index next >

src/hotspot/share/opto/callnode.cpp

Print this page




1177     set_prec(req(), n);
1178   }
1179 }
1180 
1181 
1182 //----------------------------next_exception-----------------------------------
1183 SafePointNode* SafePointNode::next_exception() const {
1184   if (len() == req()) {
1185     return NULL;
1186   } else {
1187     Node* n = in(req());
1188     assert(n == NULL || n->Opcode() == Op_SafePoint, "no other uses of prec edges");
1189     return (SafePointNode*) n;
1190   }
1191 }
1192 
1193 
1194 //------------------------------Ideal------------------------------------------
1195 // Skip over any collapsed Regions
1196 Node *SafePointNode::Ideal(PhaseGVN *phase, bool can_reshape) {
1197   if (remove_dead_region(phase, can_reshape)) {
1198     return this;
1199   }
1200   if (jvms() != NULL) {
1201     bool progress = false;
1202     // A ValueTypeNode that was already heap allocated in the debug
1203     // info?  Reference the object directly. Helps removal of useless
1204     // value type allocations with incremental inlining.
1205     for (uint i = jvms()->debug_start(); i < jvms()->debug_end(); i++) {
1206       Node *arg = in(i);
1207       if (arg->is_ValueType()) {
1208         ValueTypeNode* vt = arg->as_ValueType();
1209         Node* in_oop = vt->get_oop();
1210         const Type* oop_type = phase->type(in_oop);
1211         if (!TypePtr::NULL_PTR->higher_equal(oop_type)) {
1212           set_req(i, in_oop);
1213           progress = true;
1214         }
1215       }
1216     }
1217     if (progress) {
1218       return this;
1219     }
1220   }
1221   return NULL;
1222 }
1223 
1224 //------------------------------Identity---------------------------------------
1225 // Remove obviously duplicate safepoints
1226 Node* SafePointNode::Identity(PhaseGVN* phase) {
1227 
1228   // If you have back to back safepoints, remove one
1229   if( in(TypeFunc::Control)->is_SafePoint() )
1230     return in(TypeFunc::Control);
1231 
1232   if( in(0)->is_Proj() ) {
1233     Node *n0 = in(0)->in(0);
1234     // Check if he is a call projection (except Leaf Call)
1235     if( n0->is_Catch() ) {
1236       n0 = n0->in(0)->in(0);
1237       assert( n0->is_Call(), "expect a call here" );
1238     }
1239     if( n0->is_Call() && n0->as_Call()->guaranteed_safepoint() ) {
1240       // Don't remove a safepoint belonging to an OuterStripMinedLoopEndNode.
1241       // If the loop dies, they will be removed together.




1177     set_prec(req(), n);
1178   }
1179 }
1180 
1181 
1182 //----------------------------next_exception-----------------------------------
1183 SafePointNode* SafePointNode::next_exception() const {
1184   if (len() == req()) {
1185     return NULL;
1186   } else {
1187     Node* n = in(req());
1188     assert(n == NULL || n->Opcode() == Op_SafePoint, "no other uses of prec edges");
1189     return (SafePointNode*) n;
1190   }
1191 }
1192 
1193 
1194 //------------------------------Ideal------------------------------------------
1195 // Skip over any collapsed Regions
1196 Node *SafePointNode::Ideal(PhaseGVN *phase, bool can_reshape) {
1197   return remove_dead_region(phase, can_reshape) ? this : NULL;
























1198 }
1199 
1200 //------------------------------Identity---------------------------------------
1201 // Remove obviously duplicate safepoints
1202 Node* SafePointNode::Identity(PhaseGVN* phase) {
1203 
1204   // If you have back to back safepoints, remove one
1205   if( in(TypeFunc::Control)->is_SafePoint() )
1206     return in(TypeFunc::Control);
1207 
1208   if( in(0)->is_Proj() ) {
1209     Node *n0 = in(0)->in(0);
1210     // Check if he is a call projection (except Leaf Call)
1211     if( n0->is_Catch() ) {
1212       n0 = n0->in(0)->in(0);
1213       assert( n0->is_Call(), "expect a call here" );
1214     }
1215     if( n0->is_Call() && n0->as_Call()->guaranteed_safepoint() ) {
1216       // Don't remove a safepoint belonging to an OuterStripMinedLoopEndNode.
1217       // If the loop dies, they will be removed together.


< prev index next >