src/hotspot/share/opto/memnode.cpp
changeset 54667 f8d2b5ce4491
parent 54327 a4d19817609c
child 54722 f0bce2f93e72
equal deleted inserted replaced
54666:1b5f0a3f9c41 54667:f8d2b5ce4491
  3547 // an initialization.  Returns zero if a check fails.
  3547 // an initialization.  Returns zero if a check fails.
  3548 // On success, returns the (constant) offset to which the store applies,
  3548 // On success, returns the (constant) offset to which the store applies,
  3549 // within the initialized memory.
  3549 // within the initialized memory.
  3550 intptr_t InitializeNode::can_capture_store(StoreNode* st, PhaseTransform* phase, bool can_reshape) {
  3550 intptr_t InitializeNode::can_capture_store(StoreNode* st, PhaseTransform* phase, bool can_reshape) {
  3551   const int FAIL = 0;
  3551   const int FAIL = 0;
  3552   if (st->is_unaligned_access()) {
       
  3553     return FAIL;
       
  3554   }
       
  3555   if (st->req() != MemNode::ValueIn + 1)
  3552   if (st->req() != MemNode::ValueIn + 1)
  3556     return FAIL;                // an inscrutable StoreNode (card mark?)
  3553     return FAIL;                // an inscrutable StoreNode (card mark?)
  3557   Node* ctl = st->in(MemNode::Control);
  3554   Node* ctl = st->in(MemNode::Control);
  3558   if (!(ctl != NULL && ctl->is_Proj() && ctl->in(0) == this))
  3555   if (!(ctl != NULL && ctl->is_Proj() && ctl->in(0) == this))
  3559     return FAIL;                // must be unconditional after the initialization
  3556     return FAIL;                // must be unconditional after the initialization
  3565   AllocateNode* alloc = AllocateNode::Ideal_allocation(adr, phase, offset);
  3562   AllocateNode* alloc = AllocateNode::Ideal_allocation(adr, phase, offset);
  3566   if (alloc == NULL)
  3563   if (alloc == NULL)
  3567     return FAIL;                // inscrutable address
  3564     return FAIL;                // inscrutable address
  3568   if (alloc != allocation())
  3565   if (alloc != allocation())
  3569     return FAIL;                // wrong allocation!  (store needs to float up)
  3566     return FAIL;                // wrong allocation!  (store needs to float up)
       
  3567   int size_in_bytes = st->memory_size();
       
  3568   if ((size_in_bytes != 0) && (offset % size_in_bytes) != 0) {
       
  3569     return FAIL;                // mismatched access
       
  3570   }
  3570   Node* val = st->in(MemNode::ValueIn);
  3571   Node* val = st->in(MemNode::ValueIn);
  3571   int complexity_count = 0;
  3572   int complexity_count = 0;
  3572   if (!detect_init_independence(val, complexity_count))
  3573   if (!detect_init_independence(val, complexity_count))
  3573     return FAIL;                // stored value must be 'simple enough'
  3574     return FAIL;                // stored value must be 'simple enough'
  3574 
  3575