< prev index next >

src/hotspot/cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.cpp

rename things

9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or                                                             
10  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License                                                             
11  * version 2 for more details (a copy is included in the LICENSE file that                                                           
12  * accompanied this code).                                                                                                           
13  *                                                                                                                                   
14  * You should have received a copy of the GNU General Public License version                                                         
15  * 2 along with this work; if not, write to the Free Software Foundation,                                                            
16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.                                                                     
17  *                                                                                                                                   
18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA                                                           
19  * or visit www.oracle.com if you need additional information or have any                                                            
20  * questions.                                                                                                                        
21  *                                                                                                                                   
22  */                                                                                                                                  
23 
24 #include "precompiled.hpp"                                                                                                           
25 #include "asm/macroAssembler.inline.hpp"                                                                                             
26 #include "gc/shared/barrierSet.hpp"                                                                                                  
27 #include "gc/shared/cardTable.hpp"                                                                                                   
28 #include "gc/shared/cardTableBarrierSet.hpp"                                                                                         
29 #include "gc/shared/cardTableModRefBSCodeGen.hpp"                                                                                    
30 #include "gc/shared/collectedHeap.hpp"                                                                                               
31 #include "runtime/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 void CardTableModRefBSCodeGen::gen_write_ref_array_post_barrier(MacroAssembler* masm, DecoratorSet decorators,                       
44                                                                 Register addr, Register count, Register tmp) {                       
45   BLOCK_COMMENT("CardTablePostBarrier");                                                                                             
46   CardTableBarrierSet* ctbs = barrier_set_cast<CardTableBarrierSet>(bs);                                                             
47   CardTable* ct = ctbs->card_table();                                                                                                
48   assert(sizeof(*ct->byte_map_base()) == sizeof(jbyte), "adjust this code");                                                         
49 
50   Label L_cardtable_loop, L_done;                                                                                                    
51 
52   __ cbz_32(count, L_done); // zero count - nothing to do                                                                            
53 
54   __ add_ptr_scaled_int32(count, addr, count, LogBytesPerHeapOop);                                                                   
55   __ sub(count, count, BytesPerHeapOop);                            // last addr                                                     
56 
57   __ logical_shift_right(addr, addr, CardTable::card_shift);                                                                         
58   __ logical_shift_right(count, count, CardTable::card_shift);                                                                       
59   __ sub(count, count, addr); // nb of cards                                                                                         
60 
61   // warning: Rthread has not been preserved                                                                                         
62   __ mov_address(tmp, (address) ct->byte_map_base(), symbolic_Relocation::card_table_reference);                                     
63   __ add(addr,tmp, addr);                                                                                                            

9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
11  * version 2 for more details (a copy is included in the LICENSE file that
12  * accompanied this code).
13  *
14  * You should have received a copy of the GNU General Public License version
15  * 2 along with this work; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17  *
18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19  * or visit www.oracle.com if you need additional information or have any
20  * questions.
21  *
22  */
23 
24 #include "precompiled.hpp"
25 #include "asm/macroAssembler.inline.hpp"
26 #include "gc/shared/barrierSet.hpp"
27 #include "gc/shared/cardTable.hpp"
28 #include "gc/shared/cardTableBarrierSet.hpp"
29 #include "gc/shared/cardTableBarrierSetAssembler.hpp"
30 #include "gc/shared/collectedHeap.hpp"
31 #include "runtime/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 void CardTableBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembler* masm, DecoratorSet decorators,
44                                                                     Register addr, Register count, Register tmp) {
45   BLOCK_COMMENT("CardTablePostBarrier");
46   CardTableBarrierSet* ctbs = barrier_set_cast<CardTableBarrierSet>(bs);
47   CardTable* ct = ctbs->card_table();
48   assert(sizeof(*ct->byte_map_base()) == sizeof(jbyte), "adjust this code");
49 
50   Label L_cardtable_loop, L_done;
51 
52   __ cbz_32(count, L_done); // zero count - nothing to do
53 
54   __ add_ptr_scaled_int32(count, addr, count, LogBytesPerHeapOop);
55   __ sub(count, count, BytesPerHeapOop);                            // last addr
56 
57   __ logical_shift_right(addr, addr, CardTable::card_shift);
58   __ logical_shift_right(count, count, CardTable::card_shift);
59   __ sub(count, count, addr); // nb of cards
60 
61   // warning: Rthread has not been preserved
62   __ mov_address(tmp, (address) ct->byte_map_base(), symbolic_Relocation::card_table_reference);
63   __ add(addr,tmp, addr);
< prev index next >