< prev index next >

src/share/vm/opto/macro.cpp

Print this page

        

*** 22,31 **** --- 22,32 ---- * */ #include "precompiled.hpp" #include "compiler/compileLog.hpp" + #include "gc_implementation/shenandoah/shenandoahBrooksPointer.hpp" #include "libadt/vectset.hpp" #include "opto/addnode.hpp" #include "opto/callnode.hpp" #include "opto/cfgnode.hpp" #include "opto/compile.hpp"
*** 36,45 **** --- 37,47 ---- #include "opto/memnode.hpp" #include "opto/node.hpp" #include "opto/phaseX.hpp" #include "opto/rootnode.hpp" #include "opto/runtime.hpp" + #include "opto/shenandoahSupport.hpp" #include "opto/subnode.hpp" #include "opto/type.hpp" #include "runtime/sharedRuntime.hpp"
*** 442,452 **** return NULL; // can't find a value on this path } if (val == mem) { values.at_put(j, mem); } else if (val->is_Store()) { ! values.at_put(j, val->in(MemNode::ValueIn)); } else if(val->is_Proj() && val->in(0) == alloc) { values.at_put(j, _igvn.zerocon(ft)); } else if (val->is_Phi()) { val = value_from_mem_phi(val, ft, phi_type, adr_t, alloc, value_phis, level-1); if (val == NULL) { --- 444,454 ---- return NULL; // can't find a value on this path } if (val == mem) { values.at_put(j, mem); } else if (val->is_Store()) { ! values.at_put(j, ShenandoahBarrierNode::skip_through_barrier(val->in(MemNode::ValueIn))); } else if(val->is_Proj() && val->in(0) == alloc) { values.at_put(j, _igvn.zerocon(ft)); } else if (val->is_Phi()) { val = value_from_mem_phi(val, ft, phi_type, adr_t, alloc, value_phis, level-1); if (val == NULL) {
*** 544,554 **** if (mem != NULL) { if (mem == start_mem || mem == alloc_mem) { // hit a sentinel, return appropriate 0 value return _igvn.zerocon(ft); } else if (mem->is_Store()) { ! return mem->in(MemNode::ValueIn); } else if (mem->is_Phi()) { // attempt to produce a Phi reflecting the values on the input paths of the Phi Node_Stack value_phis(a, 8); Node * phi = value_from_mem_phi(mem, ft, ftype, adr_t, alloc, &value_phis, ValueSearchLimit); if (phi != NULL) { --- 546,556 ---- if (mem != NULL) { if (mem == start_mem || mem == alloc_mem) { // hit a sentinel, return appropriate 0 value return _igvn.zerocon(ft); } else if (mem->is_Store()) { ! return ShenandoahBarrierNode::skip_through_barrier(mem->in(MemNode::ValueIn)); } else if (mem->is_Phi()) { // attempt to produce a Phi reflecting the values on the input paths of the Phi Node_Stack value_phis(a, 8); Node * phi = value_from_mem_phi(mem, ft, ftype, adr_t, alloc, &value_phis, ValueSearchLimit); if (phi != NULL) {
*** 611,621 **** break; } for (DUIterator_Fast kmax, k = use->fast_outs(kmax); k < kmax && can_eliminate; k++) { Node* n = use->fast_out(k); ! if (!n->is_Store() && n->Opcode() != Op_CastP2X) { DEBUG_ONLY(disq_node = n;) if (n->is_Load() || n->is_LoadStore()) { NOT_PRODUCT(fail_eliminate = "Field load";) } else { NOT_PRODUCT(fail_eliminate = "Not store field referrence";) --- 613,624 ---- break; } for (DUIterator_Fast kmax, k = use->fast_outs(kmax); k < kmax && can_eliminate; k++) { Node* n = use->fast_out(k); ! if (!n->is_Store() && n->Opcode() != Op_CastP2X && ! (!UseShenandoahGC || !n->is_g1_wb_pre_call())) { DEBUG_ONLY(disq_node = n;) if (n->is_Load() || n->is_LoadStore()) { NOT_PRODUCT(fail_eliminate = "Field load";) } else { NOT_PRODUCT(fail_eliminate = "Not store field referrence";)
*** 882,896 **** --- 885,902 ---- mb->in(MemBarNode::Precedent) != n, "MemBarVolatile should be eliminated for non-escaping object"); } #endif _igvn.replace_node(n, n->in(MemNode::Memory)); + } else if (UseShenandoahGC && n->is_g1_wb_pre_call()) { + C->shenandoah_eliminate_g1_wb_pre(n, &_igvn); } else { eliminate_card_mark(n); } k -= (oc2 - use->outcnt()); } + _igvn.remove_dead_node(use); } else { eliminate_card_mark(use); } j -= (oc1 - res->outcnt()); }
*** 1282,1291 **** --- 1288,1305 ---- ? new (C) LoadPNode (ctrl, contended_phi_rawmem, eden_top_adr, TypeRawPtr::BOTTOM, TypeRawPtr::BOTTOM, MemNode::unordered) : new (C) LoadPLockedNode(contended_region, contended_phi_rawmem, eden_top_adr, MemNode::acquire); transform_later(old_eden_top); // Add to heap top to get a new heap top + + Node* init_size_in_bytes = size_in_bytes; + if (UseShenandoahGC) { + // Allocate several words more for the Shenandoah brooks pointer. + size_in_bytes = new (C) AddXNode(size_in_bytes, _igvn.MakeConX(ShenandoahBrooksPointer::byte_size())); + transform_later(size_in_bytes); + } + Node *new_eden_top = new (C) AddPNode(top(), old_eden_top, size_in_bytes); transform_later(new_eden_top); // Check for needing a GC; compare against heap end Node *needgc_cmp = new (C) CmpPNode(new_eden_top, eden_end); transform_later(needgc_cmp);
*** 1372,1385 **** transform_later(new_alloc_bytes); fast_oop_rawmem = make_store(fast_oop_ctrl, store_eden_top, alloc_bytes_adr, 0, new_alloc_bytes, T_LONG); } InitializeNode* init = alloc->initialization(); fast_oop_rawmem = initialize_object(alloc, fast_oop_ctrl, fast_oop_rawmem, fast_oop, ! klass_node, length, size_in_bytes); // If initialization is performed by an array copy, any required // MemBarStoreStore was already added. If the object does not // escape no need for a MemBarStoreStore. Otherwise we need a // MemBarStoreStore so that stores that initialize this object --- 1386,1405 ---- transform_later(new_alloc_bytes); fast_oop_rawmem = make_store(fast_oop_ctrl, store_eden_top, alloc_bytes_adr, 0, new_alloc_bytes, T_LONG); } + if (UseShenandoahGC) { + // Bump up object for Shenandoah brooks pointer. + fast_oop = new (C) AddPNode(top(), fast_oop, _igvn.MakeConX(ShenandoahBrooksPointer::byte_size())); + transform_later(fast_oop); + } + InitializeNode* init = alloc->initialization(); fast_oop_rawmem = initialize_object(alloc, fast_oop_ctrl, fast_oop_rawmem, fast_oop, ! klass_node, length, init_size_in_bytes); // If initialization is performed by an array copy, any required // MemBarStoreStore was already added. If the object does not // escape no need for a MemBarStoreStore. Otherwise we need a // MemBarStoreStore so that stores that initialize this object
*** 1655,1664 **** --- 1675,1689 ---- ciKlass* k = _igvn.type(klass_node)->is_klassptr()->klass(); if (k->is_array_klass()) // we know the exact header size in most cases: header_size = Klass::layout_helper_header_size(k->layout_helper()); } + if (UseShenandoahGC) { + // Initialize Shenandoah brooks pointer to point to the object itself. + rawmem = make_store(control, rawmem, object, ShenandoahBrooksPointer::byte_offset(), object, T_OBJECT); + } + // Clear the object body, if necessary. if (init == NULL) { // The init has somehow disappeared; be cautious and clear everything. // // This can happen if a node is allocated but an uncommon trap occurs
< prev index next >