< 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"

521   int barriers = 0;
522   if (!can_remove_pre_barrier) {
523     barriers |= G1C2BarrierPre;
524   }
525   if (!can_remove_post_barrier) {
526     barriers |= G1C2BarrierPost;
527   }
528 
529   return barriers;
530 }
531 
532 void G1BarrierSetC2::late_barrier_analysis() const {
533   compute_liveness_at_stubs();
534 }
535 
536 void G1BarrierSetC2::emit_stubs(CodeBuffer& cb) const {
537   MacroAssembler masm(&cb);
538   GrowableArray<G1BarrierStubC2*>* const stubs = barrier_set_state()->stubs();
539   for (int i = 0; i < stubs->length(); i++) {
540     // Make sure there is enough space in the code buffer
541     if (cb.insts()->maybe_expand_to_ensure_remaining(PhaseOutput::MAX_inst_size) && cb.blob() == nullptr) {
542       ciEnv::current()->record_failure("CodeCache is full");
543       return;
544     }
545     stubs->at(i)->emit_code(masm);
546   }
547   masm.flush();
548 }
549 
550 #ifndef PRODUCT
551 void G1BarrierSetC2::dump_barrier_data(const MachNode* mach, outputStream* st) const {
552   if ((mach->barrier_data() & G1C2BarrierPre) != 0) {
553     st->print("pre ");
554   }
555   if ((mach->barrier_data() & G1C2BarrierPost) != 0) {
556     st->print("post ");
557   }
558   if ((mach->barrier_data() & G1C2BarrierPostNotNull) != 0) {
559     st->print("notnull ");
560   }
561 }

  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"

524   int barriers = 0;
525   if (!can_remove_pre_barrier) {
526     barriers |= G1C2BarrierPre;
527   }
528   if (!can_remove_post_barrier) {
529     barriers |= G1C2BarrierPost;
530   }
531 
532   return barriers;
533 }
534 
535 void G1BarrierSetC2::late_barrier_analysis() const {
536   compute_liveness_at_stubs();
537 }
538 
539 void G1BarrierSetC2::emit_stubs(CodeBuffer& cb) const {
540   MacroAssembler masm(&cb);
541   GrowableArray<G1BarrierStubC2*>* const stubs = barrier_set_state()->stubs();
542   for (int i = 0; i < stubs->length(); i++) {
543     // Make sure there is enough space in the code buffer
544     if (cb.insts()->maybe_expand_to_ensure_remaining(PhaseOutput::max_inst_gcstub_size()) && cb.blob() == nullptr) {
545       ciEnv::current()->record_failure("CodeCache is full");
546       return;
547     }
548     stubs->at(i)->emit_code(masm);
549   }
550   masm.flush();
551 }
552 
553 #ifndef PRODUCT
554 void G1BarrierSetC2::dump_barrier_data(const MachNode* mach, outputStream* st) const {
555   if ((mach->barrier_data() & G1C2BarrierPre) != 0) {
556     st->print("pre ");
557   }
558   if ((mach->barrier_data() & G1C2BarrierPost) != 0) {
559     st->print("post ");
560   }
561   if ((mach->barrier_data() & G1C2BarrierPostNotNull) != 0) {
562     st->print("notnull ");
563   }
564 }
< prev index next >