465 if (adr_type == TypeRawPtr::NOTNULL) { |
465 if (adr_type == TypeRawPtr::NOTNULL) { |
466 // Verify a raw address for a store captured by Initialize node. |
466 // Verify a raw address for a store captured by Initialize node. |
467 int offs = (int)igvn->find_intptr_t_con(adr->in(AddPNode::Offset), Type::OffsetBot); |
467 int offs = (int)igvn->find_intptr_t_con(adr->in(AddPNode::Offset), Type::OffsetBot); |
468 assert(offs != Type::OffsetBot, "offset must be a constant"); |
468 assert(offs != Type::OffsetBot, "offset must be a constant"); |
469 } |
469 } |
|
470 #endif |
470 } else { |
471 } else { |
471 // Ignore copy the displaced header to the BoxNode (OSR compilation). |
472 // Ignore copy the displaced header to the BoxNode (OSR compilation). |
472 if (adr->is_BoxLock()) |
473 if (adr->is_BoxLock()) |
473 break; |
474 break; |
474 |
475 // Stored value escapes in unsafe access. |
475 if (!adr->is_AddP()) { |
476 if ((opcode == Op_StoreP) && (adr_type == TypeRawPtr::BOTTOM)) { |
476 n->dump(1); |
477 // Pointer stores in G1 barriers looks like unsafe access. |
477 assert(adr->is_AddP(), "expecting an AddP"); |
478 // Ignore such stores to be able scalar replace non-escaping |
478 } |
479 // allocations. |
479 // Ignore G1 barrier's stores. |
480 if (UseG1GC && adr->is_AddP()) { |
480 if (!UseG1GC || (opcode != Op_StoreP) || |
481 Node* base = get_addp_base(adr); |
481 (adr_type != TypeRawPtr::BOTTOM)) { |
482 if (base->Opcode() == Op_LoadP && |
482 n->dump(1); |
483 base->in(MemNode::Address)->is_AddP()) { |
483 assert(false, "not G1 barrier raw StoreP"); |
484 adr = base->in(MemNode::Address); |
484 } |
485 Node* tls = get_addp_base(adr); |
|
486 if (tls->Opcode() == Op_ThreadLocal) { |
|
487 int offs = (int)igvn->find_intptr_t_con(adr->in(AddPNode::Offset), Type::OffsetBot); |
|
488 if (offs == in_bytes(JavaThread::satb_mark_queue_offset() + |
|
489 PtrQueue::byte_offset_of_buf())) { |
|
490 break; // G1 pre barier previous oop value store. |
|
491 } |
|
492 if (offs == in_bytes(JavaThread::dirty_card_queue_offset() + |
|
493 PtrQueue::byte_offset_of_buf())) { |
|
494 break; // G1 post barier card address store. |
|
495 } |
|
496 } |
|
497 } |
|
498 } |
|
499 delayed_worklist->push(n); // Process unsafe access later. |
|
500 break; |
|
501 } |
|
502 #ifdef ASSERT |
|
503 n->dump(1); |
|
504 assert(false, "not unsafe or G1 barrier raw StoreP"); |
485 #endif |
505 #endif |
486 } |
506 } |
487 break; |
507 break; |
488 } |
508 } |
489 case Op_AryEq: |
509 case Op_AryEq: |
633 adr_ptn->as_Field()->is_oop(), "node should be registered"); |
653 adr_ptn->as_Field()->is_oop(), "node should be registered"); |
634 Node *val = n->in(MemNode::ValueIn); |
654 Node *val = n->in(MemNode::ValueIn); |
635 PointsToNode* ptn = ptnode_adr(val->_idx); |
655 PointsToNode* ptn = ptnode_adr(val->_idx); |
636 assert(ptn != NULL, "node should be registered"); |
656 assert(ptn != NULL, "node should be registered"); |
637 add_edge(adr_ptn, ptn); |
657 add_edge(adr_ptn, ptn); |
|
658 break; |
|
659 } else if ((opcode == Op_StoreP) && (adr_type == TypeRawPtr::BOTTOM)) { |
|
660 // Stored value escapes in unsafe access. |
|
661 Node *val = n->in(MemNode::ValueIn); |
|
662 PointsToNode* ptn = ptnode_adr(val->_idx); |
|
663 assert(ptn != NULL, "node should be registered"); |
|
664 ptn->set_escape_state(PointsToNode::GlobalEscape); |
|
665 // Add edge to object for unsafe access with offset. |
|
666 PointsToNode* adr_ptn = ptnode_adr(adr->_idx); |
|
667 assert(adr_ptn != NULL, "node should be registered"); |
|
668 if (adr_ptn->is_Field()) { |
|
669 assert(adr_ptn->as_Field()->is_oop(), "should be oop field"); |
|
670 add_edge(adr_ptn, ptn); |
|
671 } |
638 break; |
672 break; |
639 } |
673 } |
640 ELSE_FAIL("Op_StoreP"); |
674 ELSE_FAIL("Op_StoreP"); |
641 } |
675 } |
642 case Op_AryEq: |
676 case Op_AryEq: |