379 // not defined yet. |
381 // not defined yet. |
380 delayed_worklist->push(n); |
382 delayed_worklist->push(n); |
381 break; |
383 break; |
382 } |
384 } |
383 case Op_ConP: |
385 case Op_ConP: |
384 case Op_ConN: { |
386 case Op_ConN: |
|
387 case Op_ConNKlass: { |
385 // assume all oop constants globally escape except for null |
388 // assume all oop constants globally escape except for null |
386 PointsToNode::EscapeState es; |
389 PointsToNode::EscapeState es; |
387 if (igvn->type(n) == TypePtr::NULL_PTR || |
390 if (igvn->type(n) == TypePtr::NULL_PTR || |
388 igvn->type(n) == TypeNarrowOop::NULL_PTR) { |
391 igvn->type(n) == TypeNarrowOop::NULL_PTR) { |
389 es = PointsToNode::NoEscape; |
392 es = PointsToNode::NoEscape; |
456 add_objload_to_connection_graph(n, delayed_worklist); |
459 add_objload_to_connection_graph(n, delayed_worklist); |
457 // fallthrough |
460 // fallthrough |
458 } |
461 } |
459 case Op_StoreP: |
462 case Op_StoreP: |
460 case Op_StoreN: |
463 case Op_StoreN: |
|
464 case Op_StoreNKlass: |
461 case Op_StorePConditional: |
465 case Op_StorePConditional: |
462 case Op_CompareAndSwapP: |
466 case Op_CompareAndSwapP: |
463 case Op_CompareAndSwapN: { |
467 case Op_CompareAndSwapN: { |
464 Node* adr = n->in(MemNode::Address); |
468 Node* adr = n->in(MemNode::Address); |
465 const Type *adr_type = igvn->type(adr); |
469 const Type *adr_type = igvn->type(adr); |
466 adr_type = adr_type->make_ptr(); |
470 adr_type = adr_type->make_ptr(); |
467 if (adr_type->isa_oopptr() || |
471 if (adr_type->isa_oopptr() || |
468 (opcode == Op_StoreP || opcode == Op_StoreN) && |
472 (opcode == Op_StoreP || opcode == Op_StoreN || opcode == Op_StoreNKlass) && |
469 (adr_type == TypeRawPtr::NOTNULL && |
473 (adr_type == TypeRawPtr::NOTNULL && |
470 adr->in(AddPNode::Address)->is_Proj() && |
474 adr->in(AddPNode::Address)->is_Proj() && |
471 adr->in(AddPNode::Address)->in(0)->is_Allocate())) { |
475 adr->in(AddPNode::Address)->in(0)->is_Allocate())) { |
472 delayed_worklist->push(n); // Process it later. |
476 delayed_worklist->push(n); // Process it later. |
473 #ifdef ASSERT |
477 #ifdef ASSERT |
659 } |
666 } |
660 } |
667 } |
661 const Type *adr_type = _igvn->type(adr); |
668 const Type *adr_type = _igvn->type(adr); |
662 adr_type = adr_type->make_ptr(); |
669 adr_type = adr_type->make_ptr(); |
663 if (adr_type->isa_oopptr() || |
670 if (adr_type->isa_oopptr() || |
664 (opcode == Op_StoreP || opcode == Op_StoreN) && |
671 (opcode == Op_StoreP || opcode == Op_StoreN || opcode == Op_StoreNKlass) && |
665 (adr_type == TypeRawPtr::NOTNULL && |
672 (adr_type == TypeRawPtr::NOTNULL && |
666 adr->in(AddPNode::Address)->is_Proj() && |
673 adr->in(AddPNode::Address)->is_Proj() && |
667 adr->in(AddPNode::Address)->in(0)->is_Allocate())) { |
674 adr->in(AddPNode::Address)->in(0)->is_Allocate())) { |
668 // Point Address to Value |
675 // Point Address to Value |
669 PointsToNode* adr_ptn = ptnode_adr(adr->_idx); |
676 PointsToNode* adr_ptn = ptnode_adr(adr->_idx); |
2086 base = base->in(AddPNode::Address); |
2093 base = base->in(AddPNode::Address); |
2087 } |
2094 } |
2088 Node* uncast_base = base->uncast(); |
2095 Node* uncast_base = base->uncast(); |
2089 int opcode = uncast_base->Opcode(); |
2096 int opcode = uncast_base->Opcode(); |
2090 assert(opcode == Op_ConP || opcode == Op_ThreadLocal || |
2097 assert(opcode == Op_ConP || opcode == Op_ThreadLocal || |
2091 opcode == Op_CastX2P || uncast_base->is_DecodeN() || |
2098 opcode == Op_CastX2P || uncast_base->is_DecodeNarrowPtr() || |
2092 (uncast_base->is_Mem() && uncast_base->bottom_type() == TypeRawPtr::NOTNULL) || |
2099 (uncast_base->is_Mem() && uncast_base->bottom_type() == TypeRawPtr::NOTNULL) || |
2093 (uncast_base->is_Proj() && uncast_base->in(0)->is_Allocate()), "sanity"); |
2100 (uncast_base->is_Proj() && uncast_base->in(0)->is_Allocate()), "sanity"); |
2094 } |
2101 } |
2095 return base; |
2102 return base; |
2096 } |
2103 } |
2835 alloc_worklist.append_if_missing(addp2); |
2842 alloc_worklist.append_if_missing(addp2); |
2836 } |
2843 } |
2837 alloc_worklist.append_if_missing(use); |
2844 alloc_worklist.append_if_missing(use); |
2838 } else if (use->is_Phi() || |
2845 } else if (use->is_Phi() || |
2839 use->is_CheckCastPP() || |
2846 use->is_CheckCastPP() || |
2840 use->is_EncodeP() || |
2847 use->is_EncodeNarrowPtr() || |
2841 use->is_DecodeN() || |
2848 use->is_DecodeNarrowPtr() || |
2842 (use->is_ConstraintCast() && use->Opcode() == Op_CastPP)) { |
2849 (use->is_ConstraintCast() && use->Opcode() == Op_CastPP)) { |
2843 alloc_worklist.append_if_missing(use); |
2850 alloc_worklist.append_if_missing(use); |
2844 #ifdef ASSERT |
2851 #ifdef ASSERT |
2845 } else if (use->is_Mem()) { |
2852 } else if (use->is_Mem()) { |
2846 assert(use->in(MemNode::Address) != n, "EA: missing allocation reference path"); |
2853 assert(use->in(MemNode::Address) != n, "EA: missing allocation reference path"); |