src/share/vm/opto/memnode.cpp

changeset 9703
2fdf635bcf28
parent 9041
95a08233f46c
parent 9686
025ce746a942
child 9756
2be326848943
equal deleted inserted replaced
9647:42d198677884 9703:2fdf635bcf28
1512 if (p) return (p == NodeSentinel) ? NULL : p; 1512 if (p) return (p == NodeSentinel) ? NULL : p;
1513 1513
1514 Node* ctrl = in(MemNode::Control); 1514 Node* ctrl = in(MemNode::Control);
1515 Node* address = in(MemNode::Address); 1515 Node* address = in(MemNode::Address);
1516 1516
1517 bool addr_mark = ((phase->type(address)->isa_oopptr() || phase->type(address)->isa_narrowoop()) &&
1518 phase->type(address)->is_ptr()->offset() == oopDesc::mark_offset_in_bytes());
1519
1517 // Skip up past a SafePoint control. Cannot do this for Stores because 1520 // Skip up past a SafePoint control. Cannot do this for Stores because
1518 // pointer stores & cardmarks must stay on the same side of a SafePoint. 1521 // pointer stores & cardmarks must stay on the same side of a SafePoint.
1519 if( ctrl != NULL && ctrl->Opcode() == Op_SafePoint && 1522 if( ctrl != NULL && ctrl->Opcode() == Op_SafePoint &&
1520 phase->C->get_alias_index(phase->type(address)->is_ptr()) != Compile::AliasIdxRaw ) { 1523 phase->C->get_alias_index(phase->type(address)->is_ptr()) != Compile::AliasIdxRaw &&
1524 !addr_mark ) {
1521 ctrl = ctrl->in(0); 1525 ctrl = ctrl->in(0);
1522 set_req(MemNode::Control,ctrl); 1526 set_req(MemNode::Control,ctrl);
1523 } 1527 }
1524 1528
1525 intptr_t ignore = 0; 1529 intptr_t ignore = 0;
3347 // an initialization. Returns zero if a check fails. 3351 // an initialization. Returns zero if a check fails.
3348 // On success, returns the (constant) offset to which the store applies, 3352 // On success, returns the (constant) offset to which the store applies,
3349 // within the initialized memory. 3353 // within the initialized memory.
3350 intptr_t InitializeNode::can_capture_store(StoreNode* st, PhaseTransform* phase, bool can_reshape) { 3354 intptr_t InitializeNode::can_capture_store(StoreNode* st, PhaseTransform* phase, bool can_reshape) {
3351 const int FAIL = 0; 3355 const int FAIL = 0;
3352 if (st->is_unaligned_access()) {
3353 return FAIL;
3354 }
3355 if (st->req() != MemNode::ValueIn + 1) 3356 if (st->req() != MemNode::ValueIn + 1)
3356 return FAIL; // an inscrutable StoreNode (card mark?) 3357 return FAIL; // an inscrutable StoreNode (card mark?)
3357 Node* ctl = st->in(MemNode::Control); 3358 Node* ctl = st->in(MemNode::Control);
3358 if (!(ctl != NULL && ctl->is_Proj() && ctl->in(0) == this)) 3359 if (!(ctl != NULL && ctl->is_Proj() && ctl->in(0) == this))
3359 return FAIL; // must be unconditional after the initialization 3360 return FAIL; // must be unconditional after the initialization
3365 AllocateNode* alloc = AllocateNode::Ideal_allocation(adr, phase, offset); 3366 AllocateNode* alloc = AllocateNode::Ideal_allocation(adr, phase, offset);
3366 if (alloc == NULL) 3367 if (alloc == NULL)
3367 return FAIL; // inscrutable address 3368 return FAIL; // inscrutable address
3368 if (alloc != allocation()) 3369 if (alloc != allocation())
3369 return FAIL; // wrong allocation! (store needs to float up) 3370 return FAIL; // wrong allocation! (store needs to float up)
3371 int size_in_bytes = st->memory_size();
3372 if ((size_in_bytes != 0) && (offset % size_in_bytes) != 0) {
3373 return FAIL; // mismatched access
3374 }
3370 Node* val = st->in(MemNode::ValueIn); 3375 Node* val = st->in(MemNode::ValueIn);
3371 int complexity_count = 0; 3376 int complexity_count = 0;
3372 if (!detect_init_independence(val, complexity_count)) 3377 if (!detect_init_independence(val, complexity_count))
3373 return FAIL; // stored value must be 'simple enough' 3378 return FAIL; // stored value must be 'simple enough'
3374 3379

mercurial