< prev index next >

src/hotspot/cpu/sparc/c1_Runtime1_sparc.cpp

G1BarrierSet_merge

23 
24 #include "precompiled.hpp"                                                                                                           
25 #include "c1/c1_Defs.hpp"                                                                                                            
26 #include "c1/c1_MacroAssembler.hpp"                                                                                                  
27 #include "c1/c1_Runtime1.hpp"                                                                                                        
28 #include "ci/ciUtilities.hpp"                                                                                                        
29 #include "gc/shared/cardTable.hpp"                                                                                                   
30 #include "gc/shared/cardTableModRefBS.hpp"                                                                                           
31 #include "interpreter/interpreter.hpp"                                                                                               
32 #include "nativeInst_sparc.hpp"                                                                                                      
33 #include "oops/compiledICHolder.hpp"                                                                                                 
34 #include "oops/oop.inline.hpp"                                                                                                       
35 #include "prims/jvmtiExport.hpp"                                                                                                     
36 #include "runtime/sharedRuntime.hpp"                                                                                                 
37 #include "runtime/signature.hpp"                                                                                                     
38 #include "runtime/vframeArray.hpp"                                                                                                   
39 #include "utilities/macros.hpp"                                                                                                      
40 #include "utilities/align.hpp"                                                                                                       
41 #include "vmreg_sparc.inline.hpp"                                                                                                    
42 #if INCLUDE_ALL_GCS                                                                                                                  
                                                                                                                                     
43 #include "gc/g1/g1CardTable.hpp"                                                                                                     
44 #include "gc/g1/g1SATBCardTableModRefBS.hpp"                                                                                         
45 #endif                                                                                                                               
46 
47 // Implementation of StubAssembler                                                                                                   
48 
49 int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry_point, int number_of_arguments) {           
50   // for sparc changing the number of arguments doesn't change                                                                       
51   // anything about the frame size so we'll always lie and claim that                                                                
52   // we are only passing 1 argument.                                                                                                 
53   set_num_rt_args(1);                                                                                                                
54 
55   assert_not_delayed();                                                                                                              
56   // bang stack before going to runtime                                                                                              
57   set(-os::vm_page_size() + STACK_BIAS, G3_scratch);                                                                                 
58   st(G0, SP, G3_scratch);                                                                                                            
59 
60   // debugging support                                                                                                               
61   assert(number_of_arguments >= 0   , "cannot have negative number of arguments");                                                   
62 
63   set_last_Java_frame(SP, noreg);                                                                                                    

23 
24 #include "precompiled.hpp"
25 #include "c1/c1_Defs.hpp"
26 #include "c1/c1_MacroAssembler.hpp"
27 #include "c1/c1_Runtime1.hpp"
28 #include "ci/ciUtilities.hpp"
29 #include "gc/shared/cardTable.hpp"
30 #include "gc/shared/cardTableModRefBS.hpp"
31 #include "interpreter/interpreter.hpp"
32 #include "nativeInst_sparc.hpp"
33 #include "oops/compiledICHolder.hpp"
34 #include "oops/oop.inline.hpp"
35 #include "prims/jvmtiExport.hpp"
36 #include "runtime/sharedRuntime.hpp"
37 #include "runtime/signature.hpp"
38 #include "runtime/vframeArray.hpp"
39 #include "utilities/macros.hpp"
40 #include "utilities/align.hpp"
41 #include "vmreg_sparc.inline.hpp"
42 #if INCLUDE_ALL_GCS
43 #include "gc/g1/g1BarrierSet.hpp"
44 #include "gc/g1/g1CardTable.hpp"

45 #endif
46 
47 // Implementation of StubAssembler
48 
49 int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry_point, int number_of_arguments) {
50   // for sparc changing the number of arguments doesn't change
51   // anything about the frame size so we'll always lie and claim that
52   // we are only passing 1 argument.
53   set_num_rt_args(1);
54 
55   assert_not_delayed();
56   // bang stack before going to runtime
57   set(-os::vm_page_size() + STACK_BIAS, G3_scratch);
58   st(G0, SP, G3_scratch);
59 
60   // debugging support
61   assert(number_of_arguments >= 0   , "cannot have negative number of arguments");
62 
63   set_last_Java_frame(SP, noreg);

744         // we can't gc here so skip the oopmap but make sure that all                                                                
745         // the live registers get saved.                                                                                             
746         save_live_registers(sasm);                                                                                                   
747 
748         __ save_thread(L7_thread_cache);                                                                                             
749         __ call(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc),                                                       
750                 relocInfo::runtime_call_type);                                                                                       
751         __ delayed()->mov(I0, O0);                                                                                                   
752         __ restore_thread(L7_thread_cache);                                                                                          
753 
754         restore_live_registers(sasm);                                                                                                
755         __ ret();                                                                                                                    
756         __ delayed()->restore();                                                                                                     
757       }                                                                                                                              
758       break;                                                                                                                         
759 
760 #if INCLUDE_ALL_GCS                                                                                                                  
761     case g1_pre_barrier_slow_id:                                                                                                     
762       { // G4: previous value of memory                                                                                              
763         BarrierSet* bs = Universe::heap()->barrier_set();                                                                            
764         if (bs->kind() != BarrierSet::G1SATBCTLogging) {                                                                             
765           __ save_frame(0);                                                                                                          
766           __ set((int)id, O1);                                                                                                       
767           __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), I0);                                              
768           __ should_not_reach_here();                                                                                                
769           break;                                                                                                                     
770         }                                                                                                                            
771 
772         __ set_info("g1_pre_barrier_slow_id", dont_gc_arguments);                                                                    
773 
774         Register pre_val = G4;                                                                                                       
775         Register tmp  = G1_scratch;                                                                                                  
776         Register tmp2 = G3_scratch;                                                                                                  
777 
778         Label refill, restart;                                                                                                       
779         int satb_q_active_byte_offset =                                                                                              
780           in_bytes(JavaThread::satb_mark_queue_offset() +                                                                            
781                    SATBMarkQueue::byte_offset_of_active());                                                                          
782         int satb_q_index_byte_offset =                                                                                               
783           in_bytes(JavaThread::satb_mark_queue_offset() +                                                                            

744         // we can't gc here so skip the oopmap but make sure that all
745         // the live registers get saved.
746         save_live_registers(sasm);
747 
748         __ save_thread(L7_thread_cache);
749         __ call(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc),
750                 relocInfo::runtime_call_type);
751         __ delayed()->mov(I0, O0);
752         __ restore_thread(L7_thread_cache);
753 
754         restore_live_registers(sasm);
755         __ ret();
756         __ delayed()->restore();
757       }
758       break;
759 
760 #if INCLUDE_ALL_GCS
761     case g1_pre_barrier_slow_id:
762       { // G4: previous value of memory
763         BarrierSet* bs = Universe::heap()->barrier_set();
764         if (bs->kind() != BarrierSet::G1BarrierSet) {
765           __ save_frame(0);
766           __ set((int)id, O1);
767           __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), I0);
768           __ should_not_reach_here();
769           break;
770         }
771 
772         __ set_info("g1_pre_barrier_slow_id", dont_gc_arguments);
773 
774         Register pre_val = G4;
775         Register tmp  = G1_scratch;
776         Register tmp2 = G3_scratch;
777 
778         Label refill, restart;
779         int satb_q_active_byte_offset =
780           in_bytes(JavaThread::satb_mark_queue_offset() +
781                    SATBMarkQueue::byte_offset_of_active());
782         int satb_q_index_byte_offset =
783           in_bytes(JavaThread::satb_mark_queue_offset() +

815 
816         __ bind(refill);                                                                                                             
817 
818         save_live_registers(sasm);                                                                                                   
819 
820         __ call_VM_leaf(L7_thread_cache,                                                                                             
821                         CAST_FROM_FN_PTR(address,                                                                                    
822                                          SATBMarkQueueSet::handle_zero_index_for_thread),                                            
823                                          G2_thread);                                                                                 
824 
825         restore_live_registers(sasm);                                                                                                
826 
827         __ br(Assembler::always, /*annul*/false, Assembler::pt, restart);                                                            
828         __ delayed()->restore();                                                                                                     
829       }                                                                                                                              
830       break;                                                                                                                         
831 
832     case g1_post_barrier_slow_id:                                                                                                    
833       {                                                                                                                              
834         BarrierSet* bs = Universe::heap()->barrier_set();                                                                            
835         if (bs->kind() != BarrierSet::G1SATBCTLogging) {                                                                             
836           __ save_frame(0);                                                                                                          
837           __ set((int)id, O1);                                                                                                       
838           __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), I0);                                              
839           __ should_not_reach_here();                                                                                                
840           break;                                                                                                                     
841         }                                                                                                                            
842 
843         __ set_info("g1_post_barrier_slow_id", dont_gc_arguments);                                                                   
844 
845         Register addr = G4;                                                                                                          
846         Register cardtable = G5;                                                                                                     
847         Register tmp  = G1_scratch;                                                                                                  
848         Register tmp2 = G3_scratch;                                                                                                  
849         jbyte* byte_map_base = ci_card_table_address();                                                                              
850 
851         Label not_already_dirty, restart, refill, young_card;                                                                        
852 
853         __ srlx(addr, CardTable::card_shift, addr);                                                                                  
854 

815 
816         __ bind(refill);
817 
818         save_live_registers(sasm);
819 
820         __ call_VM_leaf(L7_thread_cache,
821                         CAST_FROM_FN_PTR(address,
822                                          SATBMarkQueueSet::handle_zero_index_for_thread),
823                                          G2_thread);
824 
825         restore_live_registers(sasm);
826 
827         __ br(Assembler::always, /*annul*/false, Assembler::pt, restart);
828         __ delayed()->restore();
829       }
830       break;
831 
832     case g1_post_barrier_slow_id:
833       {
834         BarrierSet* bs = Universe::heap()->barrier_set();
835         if (bs->kind() != BarrierSet::G1BarrierSet) {
836           __ save_frame(0);
837           __ set((int)id, O1);
838           __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), I0);
839           __ should_not_reach_here();
840           break;
841         }
842 
843         __ set_info("g1_post_barrier_slow_id", dont_gc_arguments);
844 
845         Register addr = G4;
846         Register cardtable = G5;
847         Register tmp  = G1_scratch;
848         Register tmp2 = G3_scratch;
849         jbyte* byte_map_base = ci_card_table_address();
850 
851         Label not_already_dirty, restart, refill, young_card;
852 
853         __ srlx(addr, CardTable::card_shift, addr);
854 
< prev index next >