< prev index next >

src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp

Print this page
rev 55659 : 8225776: Branch profiling for G1's write post-barrier in C2.

*** 63,72 **** --- 63,85 ---- const TypeTuple *range = TypeTuple::make(TypeFunc::Parms, fields); return TypeFunc::make(domain, range); } + const TypeFunc *G1BarrierSetC2::write_ref_stats_Type() { + const Type **fields = TypeTuple::fields(2); + fields[TypeFunc::Parms+0] = TypeRawPtr::NOTNULL; // HeapWord* dst + fields[TypeFunc::Parms+1] = TypeInstPtr::NOTNULL; // oopDesc* val + const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2, fields); + + // create result type (range) + fields = TypeTuple::fields(0); + const TypeTuple *range = TypeTuple::make(TypeFunc::Parms, fields); + + return TypeFunc::make(domain, range); + } + #define __ ideal. /* * Determine if the G1 pre-barrier can be removed. The pre-barrier is * required by SATB to make sure all objects live at the start of the * marking are kept alive, all reference updates need to any previous
*** 450,459 **** --- 463,476 ---- Node* card_adr = __ AddP(no_base, byte_map_base_node(kit), card_offset ); // If we know the value being stored does it cross regions? if (val != NULL) { + if (UsePerfData && G1WriteBarrierStats) { + const TypeFunc *stats_tf = write_ref_stats_Type(); + __ make_leaf_call(stats_tf, CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_stats), "write_ref_stats", adr, val); + } // Does the store cause us to cross regions? // Should be able to do an unsigned compare of region_size instead of // and extra shift. Do we have an unsigned compare?? // Node* region_size = __ ConI(1 << HeapRegion::LogOfHRGrainBytes);
*** 656,666 **** CallLeafNode *call = node->as_CallLeaf(); if (call->_name == NULL) { return false; } ! return strcmp(call->_name, "write_ref_field_pre_entry") == 0 || strcmp(call->_name, "write_ref_field_post_entry") == 0; } void G1BarrierSetC2::eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const { assert(node->Opcode() == Op_CastP2X, "ConvP2XNode required"); assert(node->outcnt() <= 2, "expects 1 or 2 users: Xor and URShift nodes"); --- 673,683 ---- CallLeafNode *call = node->as_CallLeaf(); if (call->_name == NULL) { return false; } ! return strcmp(call->_name, "write_ref_field_pre_entry") == 0 || strcmp(call->_name, "write_ref_field_post_entry") == 0 || strcmp(call->_name, "write_ref_stats") == 0; } void G1BarrierSetC2::eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const { assert(node->Opcode() == Op_CastP2X, "ConvP2XNode required"); assert(node->outcnt() <= 2, "expects 1 or 2 users: Xor and URShift nodes");
< prev index next >