35 #ifdef ASSERT
36 #define __ gen->lir(__FILE__, __LINE__)->
37 #else
38 #define __ gen->lir()->
39 #endif
40
41 void G1PreBarrierStub::emit_code(LIR_Assembler* ce) {
42 G1BarrierSetAssembler* bs = (G1BarrierSetAssembler*)BarrierSet::barrier_set()->barrier_set_assembler();
43 bs->gen_pre_barrier_stub(ce, this);
44 }
45
46 void G1PostBarrierStub::emit_code(LIR_Assembler* ce) {
47 G1BarrierSetAssembler* bs = (G1BarrierSetAssembler*)BarrierSet::barrier_set()->barrier_set_assembler();
48 bs->gen_post_barrier_stub(ce, this);
49 }
50
51 void G1BarrierSetC1::pre_barrier(LIRAccess& access, LIR_Opr addr_opr,
52 LIR_Opr pre_val, CodeEmitInfo* info) {
53 LIRGenerator* gen = access.gen();
54 DecoratorSet decorators = access.decorators();
55 bool in_heap = (decorators & IN_HEAP) != 0;
56 bool in_conc_root = (decorators & IN_CONCURRENT_ROOT) != 0;
57 if (!in_heap && !in_conc_root) {
58 return;
59 }
60
61 // First we test whether marking is in progress.
62 BasicType flag_type;
63 bool patch = (decorators & C1_NEEDS_PATCHING) != 0;
64 bool do_load = pre_val == LIR_OprFact::illegalOpr;
65 if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
66 flag_type = T_INT;
67 } else {
68 guarantee(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1,
69 "Assumption");
70 // Use unsigned type T_BOOLEAN here rather than signed T_BYTE since some platforms, eg. ARM,
71 // need to use unsigned instructions to use the large offset to load the satb_mark_queue.
72 flag_type = T_BOOLEAN;
73 }
74 LIR_Opr thrd = gen->getThreadPointer();
75 LIR_Address* mark_active_flag_addr =
76 new LIR_Address(thrd,
77 in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset()),
78 flag_type);
79 // Read the marking-in-progress flag.
|
35 #ifdef ASSERT
36 #define __ gen->lir(__FILE__, __LINE__)->
37 #else
38 #define __ gen->lir()->
39 #endif
40
41 void G1PreBarrierStub::emit_code(LIR_Assembler* ce) {
42 G1BarrierSetAssembler* bs = (G1BarrierSetAssembler*)BarrierSet::barrier_set()->barrier_set_assembler();
43 bs->gen_pre_barrier_stub(ce, this);
44 }
45
46 void G1PostBarrierStub::emit_code(LIR_Assembler* ce) {
47 G1BarrierSetAssembler* bs = (G1BarrierSetAssembler*)BarrierSet::barrier_set()->barrier_set_assembler();
48 bs->gen_post_barrier_stub(ce, this);
49 }
50
51 void G1BarrierSetC1::pre_barrier(LIRAccess& access, LIR_Opr addr_opr,
52 LIR_Opr pre_val, CodeEmitInfo* info) {
53 LIRGenerator* gen = access.gen();
54 DecoratorSet decorators = access.decorators();
55
56 // First we test whether marking is in progress.
57 BasicType flag_type;
58 bool patch = (decorators & C1_NEEDS_PATCHING) != 0;
59 bool do_load = pre_val == LIR_OprFact::illegalOpr;
60 if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
61 flag_type = T_INT;
62 } else {
63 guarantee(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1,
64 "Assumption");
65 // Use unsigned type T_BOOLEAN here rather than signed T_BYTE since some platforms, eg. ARM,
66 // need to use unsigned instructions to use the large offset to load the satb_mark_queue.
67 flag_type = T_BOOLEAN;
68 }
69 LIR_Opr thrd = gen->getThreadPointer();
70 LIR_Address* mark_active_flag_addr =
71 new LIR_Address(thrd,
72 in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset()),
73 flag_type);
74 // Read the marking-in-progress flag.
|