23 */ |
23 */ |
24 |
24 |
25 #include "precompiled.hpp" |
25 #include "precompiled.hpp" |
26 #include "asm/macroAssembler.hpp" |
26 #include "asm/macroAssembler.hpp" |
27 #include "asm/macroAssembler.inline.hpp" |
27 #include "asm/macroAssembler.inline.hpp" |
|
28 #include "gc/shared/cardTable.hpp" |
|
29 #include "gc/shared/cardTableModRefBS.hpp" |
28 #include "interpreter/interpreter.hpp" |
30 #include "interpreter/interpreter.hpp" |
29 #include "nativeInst_x86.hpp" |
31 #include "nativeInst_x86.hpp" |
30 #include "oops/instanceOop.hpp" |
32 #include "oops/instanceOop.hpp" |
31 #include "oops/method.hpp" |
33 #include "oops/method.hpp" |
32 #include "oops/objArrayKlass.hpp" |
34 #include "oops/objArrayKlass.hpp" |
737 __ popa(); |
736 __ popa(); |
738 } |
737 } |
739 break; |
738 break; |
740 #endif // INCLUDE_ALL_GCS |
739 #endif // INCLUDE_ALL_GCS |
741 |
740 |
742 case BarrierSet::CardTableForRS: |
741 case BarrierSet::CardTableModRef: |
743 case BarrierSet::CardTableExtension: |
|
744 { |
742 { |
745 CardTableModRefBS* ct = barrier_set_cast<CardTableModRefBS>(bs); |
743 CardTableModRefBS* ctbs = barrier_set_cast<CardTableModRefBS>(bs); |
746 assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code"); |
744 CardTable* ct = ctbs->card_table(); |
|
745 assert(sizeof(*ct->byte_map_base()) == sizeof(jbyte), "adjust this code"); |
747 |
746 |
748 Label L_loop; |
747 Label L_loop; |
749 const Register end = count; // elements count; end == start+count-1 |
748 const Register end = count; // elements count; end == start+count-1 |
750 assert_different_registers(start, end); |
749 assert_different_registers(start, end); |
751 |
750 |
752 __ lea(end, Address(start, count, Address::times_ptr, -wordSize)); |
751 __ lea(end, Address(start, count, Address::times_ptr, -wordSize)); |
753 __ shrptr(start, CardTableModRefBS::card_shift); |
752 __ shrptr(start, CardTable::card_shift); |
754 __ shrptr(end, CardTableModRefBS::card_shift); |
753 __ shrptr(end, CardTable::card_shift); |
755 __ subptr(end, start); // end --> count |
754 __ subptr(end, start); // end --> count |
756 __ BIND(L_loop); |
755 __ BIND(L_loop); |
757 intptr_t disp = (intptr_t) ct->byte_map_base; |
756 intptr_t disp = (intptr_t) ct->byte_map_base(); |
758 Address cardtable(start, count, Address::times_1, disp); |
757 Address cardtable(start, count, Address::times_1, disp); |
759 __ movb(cardtable, 0); |
758 __ movb(cardtable, 0); |
760 __ decrement(count); |
759 __ decrement(count); |
761 __ jcc(Assembler::greaterEqual, L_loop); |
760 __ jcc(Assembler::greaterEqual, L_loop); |
762 } |
761 } |