< prev index next >

src/hotspot/share/opto/memnode.cpp

Print this page




3524   if ((count += 1) > 20)  return false;  // complexity limit
3525   for (uint i = 1; i < n->req(); i++) {
3526     Node* m = n->in(i);
3527     if (m == NULL || m == n || m->is_top())  continue;
3528     uint first_i = n->find_edge(m);
3529     if (i != first_i)  continue;  // process duplicate edge just once
3530     if (!detect_init_independence(m, count)) {
3531       return false;
3532     }
3533   }
3534 
3535   return true;
3536 }
3537 
3538 // Here are all the checks a Store must pass before it can be moved into
3539 // an initialization.  Returns zero if a check fails.
3540 // On success, returns the (constant) offset to which the store applies,
3541 // within the initialized memory.
3542 intptr_t InitializeNode::can_capture_store(StoreNode* st, PhaseTransform* phase, bool can_reshape) {
3543   const int FAIL = 0;
3544   if (st->is_unaligned_access()) {
3545     return FAIL;
3546   }
3547   if (st->req() != MemNode::ValueIn + 1)
3548     return FAIL;                // an inscrutable StoreNode (card mark?)
3549   Node* ctl = st->in(MemNode::Control);
3550   if (!(ctl != NULL && ctl->is_Proj() && ctl->in(0) == this))
3551     return FAIL;                // must be unconditional after the initialization
3552   Node* mem = st->in(MemNode::Memory);
3553   if (!(mem->is_Proj() && mem->in(0) == this))
3554     return FAIL;                // must not be preceded by other stores
3555   Node* adr = st->in(MemNode::Address);
3556   intptr_t offset;
3557   AllocateNode* alloc = AllocateNode::Ideal_allocation(adr, phase, offset);
3558   if (alloc == NULL)
3559     return FAIL;                // inscrutable address
3560   if (alloc != allocation())
3561     return FAIL;                // wrong allocation!  (store needs to float up)
3562   Node* val = st->in(MemNode::ValueIn);
3563   int complexity_count = 0;
3564   if (!detect_init_independence(val, complexity_count))




3524   if ((count += 1) > 20)  return false;  // complexity limit
3525   for (uint i = 1; i < n->req(); i++) {
3526     Node* m = n->in(i);
3527     if (m == NULL || m == n || m->is_top())  continue;
3528     uint first_i = n->find_edge(m);
3529     if (i != first_i)  continue;  // process duplicate edge just once
3530     if (!detect_init_independence(m, count)) {
3531       return false;
3532     }
3533   }
3534 
3535   return true;
3536 }
3537 
3538 // Here are all the checks a Store must pass before it can be moved into
3539 // an initialization.  Returns zero if a check fails.
3540 // On success, returns the (constant) offset to which the store applies,
3541 // within the initialized memory.
3542 intptr_t InitializeNode::can_capture_store(StoreNode* st, PhaseTransform* phase, bool can_reshape) {
3543   const int FAIL = 0;
3544   if (st->is_unaligned_access() || ((get_store_offset(st, phase) % BytesPerInt) != 0)) {
3545     return FAIL;
3546   }
3547   if (st->req() != MemNode::ValueIn + 1)
3548     return FAIL;                // an inscrutable StoreNode (card mark?)
3549   Node* ctl = st->in(MemNode::Control);
3550   if (!(ctl != NULL && ctl->is_Proj() && ctl->in(0) == this))
3551     return FAIL;                // must be unconditional after the initialization
3552   Node* mem = st->in(MemNode::Memory);
3553   if (!(mem->is_Proj() && mem->in(0) == this))
3554     return FAIL;                // must not be preceded by other stores
3555   Node* adr = st->in(MemNode::Address);
3556   intptr_t offset;
3557   AllocateNode* alloc = AllocateNode::Ideal_allocation(adr, phase, offset);
3558   if (alloc == NULL)
3559     return FAIL;                // inscrutable address
3560   if (alloc != allocation())
3561     return FAIL;                // wrong allocation!  (store needs to float up)
3562   Node* val = st->in(MemNode::ValueIn);
3563   int complexity_count = 0;
3564   if (!detect_init_independence(val, complexity_count))


< prev index next >