< prev index next >

src/hotspot/share/opto/graphKit.cpp

Print this page
rev 48500 : 8194988: 8 Null pointer dereference defect groups related to MultiNode::proj_out()


3737                                              intptr_t& offset) {
3738   Node* base = AddPNode::Ideal_base_and_offset(ptr, phase, offset);
3739   if (base == NULL)  return NULL;
3740   return Ideal_allocation(base, phase);
3741 }
3742 
3743 // Trace Initialize <- Proj[Parm] <- Allocate
3744 AllocateNode* InitializeNode::allocation() {
3745   Node* rawoop = in(InitializeNode::RawAddress);
3746   if (rawoop->is_Proj()) {
3747     Node* alloc = rawoop->in(0);
3748     if (alloc->is_Allocate()) {
3749       return alloc->as_Allocate();
3750     }
3751   }
3752   return NULL;
3753 }
3754 
3755 // Trace Allocate -> Proj[Parm] -> Initialize
3756 InitializeNode* AllocateNode::initialization() {
3757   ProjNode* rawoop = proj_out(AllocateNode::RawAddress);
3758   if (rawoop == NULL)  return NULL;
3759   for (DUIterator_Fast imax, i = rawoop->fast_outs(imax); i < imax; i++) {
3760     Node* init = rawoop->fast_out(i);
3761     if (init->is_Initialize()) {
3762       assert(init->as_Initialize()->allocation() == this, "2-way link");
3763       return init->as_Initialize();
3764     }
3765   }
3766   return NULL;
3767 }
3768 
3769 //----------------------------- loop predicates ---------------------------
3770 
3771 //------------------------------add_predicate_impl----------------------------
3772 void GraphKit::add_predicate_impl(Deoptimization::DeoptReason reason, int nargs) {
3773   // Too many traps seen?
3774   if (too_many_traps(reason)) {
3775 #ifdef ASSERT
3776     if (TraceLoopPredicate) {
3777       int tc = C->trap_count(reason);




3737                                              intptr_t& offset) {
3738   Node* base = AddPNode::Ideal_base_and_offset(ptr, phase, offset);
3739   if (base == NULL)  return NULL;
3740   return Ideal_allocation(base, phase);
3741 }
3742 
3743 // Trace Initialize <- Proj[Parm] <- Allocate
3744 AllocateNode* InitializeNode::allocation() {
3745   Node* rawoop = in(InitializeNode::RawAddress);
3746   if (rawoop->is_Proj()) {
3747     Node* alloc = rawoop->in(0);
3748     if (alloc->is_Allocate()) {
3749       return alloc->as_Allocate();
3750     }
3751   }
3752   return NULL;
3753 }
3754 
3755 // Trace Allocate -> Proj[Parm] -> Initialize
3756 InitializeNode* AllocateNode::initialization() {
3757   ProjNode* rawoop = proj_out_or_null(AllocateNode::RawAddress);
3758   if (rawoop == NULL)  return NULL;
3759   for (DUIterator_Fast imax, i = rawoop->fast_outs(imax); i < imax; i++) {
3760     Node* init = rawoop->fast_out(i);
3761     if (init->is_Initialize()) {
3762       assert(init->as_Initialize()->allocation() == this, "2-way link");
3763       return init->as_Initialize();
3764     }
3765   }
3766   return NULL;
3767 }
3768 
3769 //----------------------------- loop predicates ---------------------------
3770 
3771 //------------------------------add_predicate_impl----------------------------
3772 void GraphKit::add_predicate_impl(Deoptimization::DeoptReason reason, int nargs) {
3773   // Too many traps seen?
3774   if (too_many_traps(reason)) {
3775 #ifdef ASSERT
3776     if (TraceLoopPredicate) {
3777       int tc = C->trap_count(reason);


< prev index next >