30 #include "utilities/macros.hpp"
31
32 #ifdef ASSERT
33 #define __ gen->lir(__FILE__, __LINE__)->
34 #else
35 #define __ gen->lir()->
36 #endif
37
38 void CardTableBarrierSetC1::post_barrier(LIRAccess& access, LIR_Opr addr, LIR_Opr new_val) {
39 DecoratorSet decorators = access.decorators();
40 LIRGenerator* gen = access.gen();
41 bool in_heap = (decorators & IN_HEAP) != 0;
42 if (!in_heap) {
43 return;
44 }
45
46 BarrierSet* bs = BarrierSet::barrier_set();
47 CardTableBarrierSet* ctbs = barrier_set_cast<CardTableBarrierSet>(bs);
48 CardTable* ct = ctbs->card_table();
49 LIR_Const* card_table_base = new LIR_Const(ct->byte_map_base());
50 if (addr->is_address()) {
51 LIR_Address* address = addr->as_address_ptr();
52 // ptr cannot be an object because we use this barrier for array card marks
53 // and addr can point in the middle of an array.
54 LIR_Opr ptr = gen->new_pointer_register();
55 if (!address->index()->is_valid() && address->disp() == 0) {
56 __ move(address->base(), ptr);
57 } else {
58 assert(address->disp() != max_jint, "lea doesn't support patched addresses!");
59 __ leal(addr, ptr);
60 }
61 addr = ptr;
62 }
63 assert(addr->is_register(), "must be a register at this point");
64
65 #ifdef CARDTABLEBARRIERSET_POST_BARRIER_HELPER
66 gen->CardTableBarrierSet_post_barrier_helper(addr, card_table_base);
67 #else
68 LIR_Opr tmp = gen->new_pointer_register();
69 if (two_operand_lir_form) {
|
30 #include "utilities/macros.hpp"
31
32 #ifdef ASSERT
33 #define __ gen->lir(__FILE__, __LINE__)->
34 #else
35 #define __ gen->lir()->
36 #endif
37
38 void CardTableBarrierSetC1::post_barrier(LIRAccess& access, LIR_Opr addr, LIR_Opr new_val) {
39 DecoratorSet decorators = access.decorators();
40 LIRGenerator* gen = access.gen();
41 bool in_heap = (decorators & IN_HEAP) != 0;
42 if (!in_heap) {
43 return;
44 }
45
46 BarrierSet* bs = BarrierSet::barrier_set();
47 CardTableBarrierSet* ctbs = barrier_set_cast<CardTableBarrierSet>(bs);
48 CardTable* ct = ctbs->card_table();
49 LIR_Const* card_table_base = new LIR_Const(ct->byte_map_base());
50 SHENANDOAHGC_ONLY(assert(!UseShenandoahGC, "Shenandoah byte_map_base is not constant.");)
51
52 if (addr->is_address()) {
53 LIR_Address* address = addr->as_address_ptr();
54 // ptr cannot be an object because we use this barrier for array card marks
55 // and addr can point in the middle of an array.
56 LIR_Opr ptr = gen->new_pointer_register();
57 if (!address->index()->is_valid() && address->disp() == 0) {
58 __ move(address->base(), ptr);
59 } else {
60 assert(address->disp() != max_jint, "lea doesn't support patched addresses!");
61 __ leal(addr, ptr);
62 }
63 addr = ptr;
64 }
65 assert(addr->is_register(), "must be a register at this point");
66
67 #ifdef CARDTABLEBARRIERSET_POST_BARRIER_HELPER
68 gen->CardTableBarrierSet_post_barrier_helper(addr, card_table_base);
69 #else
70 LIR_Opr tmp = gen->new_pointer_register();
71 if (two_operand_lir_form) {
|