< prev index next >

src/share/vm/opto/escape.cpp

Print this page

        

*** 23,32 **** --- 23,33 ---- */ #include "precompiled.hpp" #include "ci/bcEscapeAnalyzer.hpp" #include "compiler/compileLog.hpp" + #include "gc/shenandoah/brooksPointer.hpp" #include "libadt/vectset.hpp" #include "memory/allocation.hpp" #include "opto/c2compiler.hpp" #include "opto/arraycopynode.hpp" #include "opto/callnode.hpp"
*** 34,43 **** --- 35,45 ---- #include "opto/compile.hpp" #include "opto/escape.hpp" #include "opto/phaseX.hpp" #include "opto/movenode.hpp" #include "opto/rootnode.hpp" + #include "opto/shenandoahSupport.hpp" ConnectionGraph::ConnectionGraph(Compile * C, PhaseIterGVN *igvn) : _nodes(C->comp_arena(), C->unique(), C->unique(), NULL), _in_worklist(C->comp_arena()), _next_pidx(0),
*** 528,538 **** // Stored value escapes in unsafe access. if ((opcode == Op_StoreP) && adr_type->isa_rawptr()) { // Pointer stores in G1 barriers looks like unsafe access. // Ignore such stores to be able scalar replace non-escaping // allocations. ! if (UseG1GC && adr->is_AddP()) { Node* base = get_addp_base(adr); if (base->Opcode() == Op_LoadP && base->in(MemNode::Address)->is_AddP()) { adr = base->in(MemNode::Address); Node* tls = get_addp_base(adr); --- 530,540 ---- // Stored value escapes in unsafe access. if ((opcode == Op_StoreP) && adr_type->isa_rawptr()) { // Pointer stores in G1 barriers looks like unsafe access. // Ignore such stores to be able scalar replace non-escaping // allocations. ! if ((UseG1GC || UseShenandoahGC) && adr->is_AddP()) { Node* base = get_addp_base(adr); if (base->Opcode() == Op_LoadP && base->in(MemNode::Address)->is_AddP()) { adr = base->in(MemNode::Address); Node* tls = get_addp_base(adr);
*** 570,579 **** --- 572,587 ---- } case Op_ThreadLocal: { add_java_object(n, PointsToNode::ArgEscape); break; } + case Op_ShenandoahReadBarrier: + case Op_ShenandoahWriteBarrier: + // Barriers 'pass through' its arguments. I.e. what goes in, comes out. + // It doesn't escape. + add_local_var_and_edge(n, PointsToNode::NoEscape, n->in(ShenandoahBarrierNode::ValueIn), delayed_worklist); + break; default: ; // Do nothing for nodes not related to EA. } return; }
*** 764,773 **** --- 772,787 ---- add_edge(n_ptn, ptn); } } break; } + case Op_ShenandoahReadBarrier: + case Op_ShenandoahWriteBarrier: + // Barriers 'pass through' its arguments. I.e. what goes in, comes out. + // It doesn't escape. + add_local_var_and_edge(n, PointsToNode::NoEscape, n->in(ShenandoahBarrierNode::ValueIn), NULL); + break; default: { // This method should be called only for EA specific nodes which may // miss some edges when they were created. #ifdef ASSERT n->dump(1);
*** 959,968 **** --- 973,984 ---- #ifdef ASSERT if (!(is_arraycopy || (call->as_CallLeaf()->_name != NULL && (strcmp(call->as_CallLeaf()->_name, "g1_wb_pre") == 0 || strcmp(call->as_CallLeaf()->_name, "g1_wb_post") == 0 || + strcmp(call->as_CallLeaf()->_name, "shenandoah_clone_barrier") == 0 || + strcmp(call->as_CallLeaf()->_name, "shenandoah_cas_obj") == 0 || strcmp(call->as_CallLeaf()->_name, "updateBytesCRC32") == 0 || strcmp(call->as_CallLeaf()->_name, "updateBytesCRC32C") == 0 || strcmp(call->as_CallLeaf()->_name, "updateBytesAdler32") == 0 || strcmp(call->as_CallLeaf()->_name, "aescrypt_encryptBlock") == 0 || strcmp(call->as_CallLeaf()->_name, "aescrypt_decryptBlock") == 0 ||
*** 2052,2061 **** --- 2068,2080 ---- } } } else if (adr_type->isa_aryptr()) { if (offset == arrayOopDesc::length_offset_in_bytes()) { // Ignore array length load. + } else if (UseShenandoahGC && offset == BrooksPointer::BYTE_OFFSET) { + // Shenandoah read barrier. + bt = T_ARRAY; } else if (find_second_addp(n, n->in(AddPNode::Base)) != NULL) { // Ignore first AddP. } else { const Type* elemtype = adr_type->isa_aryptr()->elem(); bt = elemtype->array_element_basic_type();
*** 3003,3012 **** --- 3022,3032 ---- if (!split_AddP(n, base)) continue; // wrong type from dead path } else if (n->is_Phi() || n->is_CheckCastPP() || n->is_EncodeP() || n->is_DecodeN() || + n->is_ShenandoahBarrier() || (n->is_ConstraintCast() && n->Opcode() == Op_CastPP)) { if (visited.test_set(n->_idx)) { assert(n->is_Phi(), "loops only through Phi's"); continue; // already processed }
*** 3073,3082 **** --- 3093,3103 ---- alloc_worklist.append_if_missing(use); } else if (use->is_Phi() || use->is_CheckCastPP() || use->is_EncodeNarrowPtr() || use->is_DecodeNarrowPtr() || + use->is_ShenandoahBarrier() || (use->is_ConstraintCast() && use->Opcode() == Op_CastPP)) { alloc_worklist.append_if_missing(use); #ifdef ASSERT } else if (use->is_Mem()) { assert(use->in(MemNode::Address) != n, "EA: missing allocation reference path");
*** 3097,3107 **** } else { uint op = use->Opcode(); if (!(op == Op_CmpP || op == Op_Conv2B || op == Op_CastP2X || op == Op_StoreCM || op == Op_FastLock || op == Op_AryEq || op == Op_StrComp || ! op == Op_StrEquals || op == Op_StrIndexOf)) { n->dump(); use->dump(); assert(false, "EA: missing allocation reference path"); } #endif --- 3118,3129 ---- } else { uint op = use->Opcode(); if (!(op == Op_CmpP || op == Op_Conv2B || op == Op_CastP2X || op == Op_StoreCM || op == Op_FastLock || op == Op_AryEq || op == Op_StrComp || ! op == Op_StrEquals || op == Op_StrIndexOf || ! op == Op_ShenandoahWBMemProj)) { n->dump(); use->dump(); assert(false, "EA: missing allocation reference path"); } #endif
< prev index next >