< prev index next >

src/hotspot/share/opto/compile.cpp

BarrierSetC2_enhancements

BarrierSetC2
 #include "code/nmethod.hpp"
 #include "compiler/compileBroker.hpp"
 #include "compiler/compileLog.hpp"
 #include "compiler/disassembler.hpp"
 #include "compiler/oopMap.hpp"
+#include "gc/shared/barrierSet.hpp"
+#include "gc/shared/c2/barrierSetC2.hpp"
 #include "memory/resourceArea.hpp"
 #include "opto/addnode.hpp"
 #include "opto/block.hpp"
 #include "opto/c2compiler.hpp"
 #include "opto/callGenerator.hpp"

@@ -412,10 +414,12 Node* opaq = opaque4_node(i); if (!useful.member(opaq)) { remove_opaque4_node(opaq); } } + BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2(); + bs->eliminate_useless_gc_barriers(useful); // clean up the late inline lists remove_useless_late_inlines(&_string_late_inlines, useful); remove_useless_late_inlines(&_boxing_late_inlines, useful); remove_useless_late_inlines(&_late_inlines, useful); debug_only(verify_graph_edges(true/*check for no_dead_code*/);)
@@ -635,10 +639,11 _save_argument_registers(false), _stub_name(NULL), _stub_function(NULL), _stub_entry_point(NULL), _method(target), + _barrier_set_state(BarrierSet::barrier_set()->barrier_set_c2()->create_barrier_state(comp_arena())), _entry_bci(osr_bci), _initial_gvn(NULL), _for_igvn(NULL), _warm_calls(NULL), _subsume_loads(subsume_loads),
@@ -770,21 +775,16 // Normal case. init_tf(TypeFunc::make(method())); StartNode* s = new StartNode(root(), tf()->domain()); initial_gvn()->set_type_bottom(s); init_start(s); - if (method()->intrinsic_id() == vmIntrinsics::_Reference_get && UseG1GC) { + if (method()->intrinsic_id() == vmIntrinsics::_Reference_get) { // With java.lang.ref.reference.get() we must go through the - // intrinsic when G1 is enabled - even when get() is the root + // intrinsic - even when get() is the root // method of the compile - so that, if necessary, the value in // the referent field of the reference object gets recorded by // the pre-barrier code. - // Specifically, if G1 is enabled, the value in the referent - // field is recorded by the G1 SATB pre barrier. This will - // result in the referent being marked live and the reference - // object removed from the list of discovered references during - // reference processing. cg = find_intrinsic(method(), false); } if (cg == NULL) { float past_uses = method()->interpreter_invocation_count(); float expected_uses = past_uses;
@@ -2332,10 +2332,15 loop_opts_cnt--; if (major_progress()) print_method(PHASE_PHASEIDEALLOOP_ITERATIONS, 2); if (failing()) return; } } + + BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2(); + bs->find_dominating_barriers(igvn); + if (failing()) return; + // Ensure that major progress is now clear C->clear_major_progress(); { // Verify that all previous optimizations produced a valid graph
@@ -2348,10 +2353,14 // No more loop optimizations. Remove all range check dependent CastIINodes. C->remove_range_check_casts(igvn); igvn.optimize(); } +#ifdef ASSERT + bs->verify_gc_barriers(false); +#endif + { TracePhase tp("macroExpand", &timers[_t_macroExpand]); PhaseMacroExpand mex(igvn); if (mex.expand_macro_nodes()) { assert(failing(), "must bail out w/ explicit message");
< prev index next >