31 #include "gc/shared/gc_globals.hpp"
32
33 #define __ masm->
34
35 #ifdef PRODUCT
36 #define BLOCK_COMMENT(str) /* nothing */
37 #else
38 #define BLOCK_COMMENT(str) __ block_comment(str)
39 #endif
40
41 #define BIND(label) bind(label); BLOCK_COMMENT(#label ":")
42
43 #define TIMES_OOP (UseCompressedOops ? Address::times_4 : Address::times_8)
44
45 void CardTableBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembler* masm, DecoratorSet decorators,
46 Register addr, Register count, Register tmp) {
47 BarrierSet *bs = BarrierSet::barrier_set();
48 CardTableBarrierSet* ctbs = barrier_set_cast<CardTableBarrierSet>(bs);
49 CardTable* ct = ctbs->card_table();
50 intptr_t disp = (intptr_t) ct->byte_map_base();
51
52 Label L_loop, L_done;
53 const Register end = count;
54 assert_different_registers(addr, end);
55
56 __ testl(count, count);
57 __ jcc(Assembler::zero, L_done); // zero count - nothing to do
58
59
60 #ifdef _LP64
61 __ leaq(end, Address(addr, count, TIMES_OOP, 0)); // end == addr+count*oop_size
62 __ subptr(end, BytesPerHeapOop); // end - 1 to make inclusive
63 __ shrptr(addr, CardTable::card_shift());
64 __ shrptr(end, CardTable::card_shift());
65 __ subptr(end, addr); // end --> cards count
66
67 __ mov64(tmp, disp);
68 __ addptr(addr, tmp);
69 __ BIND(L_loop);
70 __ movb(Address(addr, count, Address::times_1), 0);
|
31 #include "gc/shared/gc_globals.hpp"
32
33 #define __ masm->
34
35 #ifdef PRODUCT
36 #define BLOCK_COMMENT(str) /* nothing */
37 #else
38 #define BLOCK_COMMENT(str) __ block_comment(str)
39 #endif
40
41 #define BIND(label) bind(label); BLOCK_COMMENT(#label ":")
42
43 #define TIMES_OOP (UseCompressedOops ? Address::times_4 : Address::times_8)
44
45 void CardTableBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembler* masm, DecoratorSet decorators,
46 Register addr, Register count, Register tmp) {
47 BarrierSet *bs = BarrierSet::barrier_set();
48 CardTableBarrierSet* ctbs = barrier_set_cast<CardTableBarrierSet>(bs);
49 CardTable* ct = ctbs->card_table();
50 intptr_t disp = (intptr_t) ct->byte_map_base();
51 SHENANDOAHGC_ONLY(assert(!UseShenandoahGC, "Shenandoah byte_map_base is not constant.");)
52
53 Label L_loop, L_done;
54 const Register end = count;
55 assert_different_registers(addr, end);
56
57 __ testl(count, count);
58 __ jcc(Assembler::zero, L_done); // zero count - nothing to do
59
60
61 #ifdef _LP64
62 __ leaq(end, Address(addr, count, TIMES_OOP, 0)); // end == addr+count*oop_size
63 __ subptr(end, BytesPerHeapOop); // end - 1 to make inclusive
64 __ shrptr(addr, CardTable::card_shift());
65 __ shrptr(end, CardTable::card_shift());
66 __ subptr(end, addr); // end --> cards count
67
68 __ mov64(tmp, disp);
69 __ addptr(addr, tmp);
70 __ BIND(L_loop);
71 __ movb(Address(addr, count, Address::times_1), 0);
|