< prev index next >

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

Print this page

  6  * under the terms of the GNU General Public License version 2 only, as
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #include "classfile/javaClasses.hpp"



 26 #include "code/vmreg.inline.hpp"
 27 #include "gc/g1/c2/g1BarrierSetC2.hpp"
 28 #include "gc/g1/g1BarrierSet.hpp"
 29 #include "gc/g1/g1BarrierSetAssembler.hpp"
 30 #include "gc/g1/g1BarrierSetRuntime.hpp"
 31 #include "gc/g1/g1CardTable.hpp"
 32 #include "gc/g1/g1ThreadLocalData.hpp"
 33 #include "gc/g1/g1HeapRegion.hpp"
 34 #include "opto/arraycopynode.hpp"
 35 #include "opto/block.hpp"
 36 #include "opto/compile.hpp"
 37 #include "opto/escape.hpp"
 38 #include "opto/graphKit.hpp"
 39 #include "opto/idealKit.hpp"
 40 #include "opto/machnode.hpp"
 41 #include "opto/macro.hpp"
 42 #include "opto/memnode.hpp"
 43 #include "opto/node.hpp"
 44 #include "opto/output.hpp"
 45 #include "opto/regalloc.hpp"

578         break;
579       }
580     }
581   }
582 
583   // Find dominating allocations for each memory access (store or atomic
584   // operation) and elide barriers if there is no safepoint poll in between.
585   elide_dominated_barriers(accesses, allocations);
586 }
587 
588 void G1BarrierSetC2::late_barrier_analysis() const {
589   compute_liveness_at_stubs();
590   analyze_dominating_barriers();
591 }
592 
593 void G1BarrierSetC2::emit_stubs(CodeBuffer& cb) const {
594   MacroAssembler masm(&cb);
595   GrowableArray<G1BarrierStubC2*>* const stubs = barrier_set_state()->stubs();
596   for (int i = 0; i < stubs->length(); i++) {
597     // Make sure there is enough space in the code buffer
598     if (cb.insts()->maybe_expand_to_ensure_remaining(PhaseOutput::MAX_inst_size) && cb.blob() == nullptr) {
599       ciEnv::current()->record_failure("CodeCache is full");
600       return;
601     }
602     stubs->at(i)->emit_code(masm);
603   }
604   masm.flush();
605 }
606 
607 #ifndef PRODUCT
608 void G1BarrierSetC2::dump_barrier_data(const MachNode* mach, outputStream* st) const {
609   if ((mach->barrier_data() & G1C2BarrierPre) != 0) {
610     st->print("pre ");
611   }
612   if ((mach->barrier_data() & G1C2BarrierPost) != 0) {
613     st->print("post ");
614   }
615   if ((mach->barrier_data() & G1C2BarrierPostNotNull) != 0) {
616     st->print("notnull ");
617   }
618 }

  6  * under the terms of the GNU General Public License version 2 only, as
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #include "classfile/javaClasses.hpp"
 26 #if INCLUDE_CDS
 27 #include "code/SCCache.hpp"
 28 #endif
 29 #include "code/vmreg.inline.hpp"
 30 #include "gc/g1/c2/g1BarrierSetC2.hpp"
 31 #include "gc/g1/g1BarrierSet.hpp"
 32 #include "gc/g1/g1BarrierSetAssembler.hpp"
 33 #include "gc/g1/g1BarrierSetRuntime.hpp"
 34 #include "gc/g1/g1CardTable.hpp"
 35 #include "gc/g1/g1ThreadLocalData.hpp"
 36 #include "gc/g1/g1HeapRegion.hpp"
 37 #include "opto/arraycopynode.hpp"
 38 #include "opto/block.hpp"
 39 #include "opto/compile.hpp"
 40 #include "opto/escape.hpp"
 41 #include "opto/graphKit.hpp"
 42 #include "opto/idealKit.hpp"
 43 #include "opto/machnode.hpp"
 44 #include "opto/macro.hpp"
 45 #include "opto/memnode.hpp"
 46 #include "opto/node.hpp"
 47 #include "opto/output.hpp"
 48 #include "opto/regalloc.hpp"

581         break;
582       }
583     }
584   }
585 
586   // Find dominating allocations for each memory access (store or atomic
587   // operation) and elide barriers if there is no safepoint poll in between.
588   elide_dominated_barriers(accesses, allocations);
589 }
590 
591 void G1BarrierSetC2::late_barrier_analysis() const {
592   compute_liveness_at_stubs();
593   analyze_dominating_barriers();
594 }
595 
596 void G1BarrierSetC2::emit_stubs(CodeBuffer& cb) const {
597   MacroAssembler masm(&cb);
598   GrowableArray<G1BarrierStubC2*>* const stubs = barrier_set_state()->stubs();
599   for (int i = 0; i < stubs->length(); i++) {
600     // Make sure there is enough space in the code buffer
601     if (cb.insts()->maybe_expand_to_ensure_remaining(PhaseOutput::max_inst_gcstub_size()) && cb.blob() == nullptr) {
602       ciEnv::current()->record_failure("CodeCache is full");
603       return;
604     }
605     stubs->at(i)->emit_code(masm);
606   }
607   masm.flush();
608 }
609 
610 #ifndef PRODUCT
611 void G1BarrierSetC2::dump_barrier_data(const MachNode* mach, outputStream* st) const {
612   if ((mach->barrier_data() & G1C2BarrierPre) != 0) {
613     st->print("pre ");
614   }
615   if ((mach->barrier_data() & G1C2BarrierPost) != 0) {
616     st->print("post ");
617   }
618   if ((mach->barrier_data() & G1C2BarrierPostNotNull) != 0) {
619     st->print("notnull ");
620   }
621 }
< prev index next >