< prev index next >

src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp

G1BarrierSet_merge

25 #include "precompiled.hpp"                                                                                                           
26 #include "c1/c1_Defs.hpp"                                                                                                            
27 #include "c1/c1_MacroAssembler.hpp"                                                                                                  
28 #include "c1/c1_Runtime1.hpp"                                                                                                        
29 #include "ci/ciUtilities.hpp"                                                                                                        
30 #include "gc/shared/cardTable.hpp"                                                                                                   
31 #include "gc/shared/cardTableModRefBS.hpp"                                                                                           
32 #include "interpreter/interpreter.hpp"                                                                                               
33 #include "nativeInst_ppc.hpp"                                                                                                        
34 #include "oops/compiledICHolder.hpp"                                                                                                 
35 #include "oops/oop.inline.hpp"                                                                                                       
36 #include "prims/jvmtiExport.hpp"                                                                                                     
37 #include "register_ppc.hpp"                                                                                                          
38 #include "runtime/sharedRuntime.hpp"                                                                                                 
39 #include "runtime/signature.hpp"                                                                                                     
40 #include "runtime/vframeArray.hpp"                                                                                                   
41 #include "utilities/align.hpp"                                                                                                       
42 #include "utilities/macros.hpp"                                                                                                      
43 #include "vmreg_ppc.inline.hpp"                                                                                                      
44 #if INCLUDE_ALL_GCS                                                                                                                  
                                                                                                                                     
45 #include "gc/g1/g1CardTable.hpp"                                                                                                     
46 #include "gc/g1/g1SATBCardTableModRefBS.hpp"                                                                                         
47 #endif                                                                                                                               
48 
49 // Implementation of StubAssembler                                                                                                   
50 
51 int StubAssembler::call_RT(Register oop_result1, Register metadata_result,                                                           
52                            address entry_point, int number_of_arguments) {                                                           
53   set_num_rt_args(0); // Nothing on stack                                                                                            
54   assert(!(oop_result1->is_valid() || metadata_result->is_valid()) ||                                                                
55          oop_result1 != metadata_result, "registers must be different");                                                             
56 
57   // Currently no stack banging. We assume that there are enough                                                                     
58   // StackShadowPages (which have been banged in generate_stack_overflow_check)                                                      
59   // for the stub frame and the runtime frames.                                                                                      
60 
61   set_last_Java_frame(R1_SP, noreg);                                                                                                 
62 
63   // ARG1 must hold thread address.                                                                                                  
64   mr(R3_ARG1, R16_thread);                                                                                                           
65 

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

47 #endif
48 
49 // Implementation of StubAssembler
50 
51 int StubAssembler::call_RT(Register oop_result1, Register metadata_result,
52                            address entry_point, int number_of_arguments) {
53   set_num_rt_args(0); // Nothing on stack
54   assert(!(oop_result1->is_valid() || metadata_result->is_valid()) ||
55          oop_result1 != metadata_result, "registers must be different");
56 
57   // Currently no stack banging. We assume that there are enough
58   // StackShadowPages (which have been banged in generate_stack_overflow_check)
59   // for the stub frame and the runtime frames.
60 
61   set_last_Java_frame(R1_SP, noreg);
62 
63   // ARG1 must hold thread address.
64   mr(R3_ARG1, R16_thread);
65 

693 //        // We can't gc here so skip the oopmap but make sure that all                                                              
694 //        // the live registers get saved.                                                                                           
695 //        save_live_registers(sasm);                                                                                                 
696 //                                                                                                                                   
697 //        __ save_thread(L7_thread_cache);                                                                                           
698 //        __ call(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc),                                                     
699 //                relocInfo::runtime_call_type);                                                                                     
700 //        __ delayed()->mov(I0, O0);                                                                                                 
701 //        __ restore_thread(L7_thread_cache);                                                                                        
702 //                                                                                                                                   
703 //        restore_live_registers(sasm);                                                                                              
704 //        __ ret();                                                                                                                  
705 //        __ delayed()->restore();                                                                                                   
706       }                                                                                                                              
707       break;                                                                                                                         
708 
709 #if INCLUDE_ALL_GCS                                                                                                                  
710     case g1_pre_barrier_slow_id:                                                                                                     
711       {                                                                                                                              
712         BarrierSet* bs = Universe::heap()->barrier_set();                                                                            
713         if (bs->kind() != BarrierSet::G1SATBCTLogging) {                                                                             
714           goto unimplemented_entry;                                                                                                  
715         }                                                                                                                            
716 
717         __ set_info("g1_pre_barrier_slow_id", dont_gc_arguments);                                                                    
718 
719         // Using stack slots: pre_val (pre-pushed), spill tmp, spill tmp2.                                                           
720         const int stack_slots = 3;                                                                                                   
721         Register pre_val = R0; // previous value of memory                                                                           
722         Register tmp  = R14;                                                                                                         
723         Register tmp2 = R15;                                                                                                         
724 
725         Label refill, restart, marking_not_active;                                                                                   
726         int satb_q_active_byte_offset =                                                                                              
727           in_bytes(JavaThread::satb_mark_queue_offset() +                                                                            
728                    SATBMarkQueue::byte_offset_of_active());                                                                          
729         int satb_q_index_byte_offset =                                                                                               
730           in_bytes(JavaThread::satb_mark_queue_offset() +                                                                            
731                    SATBMarkQueue::byte_offset_of_index());                                                                           
732         int satb_q_buf_byte_offset =                                                                                                 

693 //        // We can't gc here so skip the oopmap but make sure that all
694 //        // the live registers get saved.
695 //        save_live_registers(sasm);
696 //
697 //        __ save_thread(L7_thread_cache);
698 //        __ call(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc),
699 //                relocInfo::runtime_call_type);
700 //        __ delayed()->mov(I0, O0);
701 //        __ restore_thread(L7_thread_cache);
702 //
703 //        restore_live_registers(sasm);
704 //        __ ret();
705 //        __ delayed()->restore();
706       }
707       break;
708 
709 #if INCLUDE_ALL_GCS
710     case g1_pre_barrier_slow_id:
711       {
712         BarrierSet* bs = Universe::heap()->barrier_set();
713         if (bs->kind() != BarrierSet::G1BarrierSet) {
714           goto unimplemented_entry;
715         }
716 
717         __ set_info("g1_pre_barrier_slow_id", dont_gc_arguments);
718 
719         // Using stack slots: pre_val (pre-pushed), spill tmp, spill tmp2.
720         const int stack_slots = 3;
721         Register pre_val = R0; // previous value of memory
722         Register tmp  = R14;
723         Register tmp2 = R15;
724 
725         Label refill, restart, marking_not_active;
726         int satb_q_active_byte_offset =
727           in_bytes(JavaThread::satb_mark_queue_offset() +
728                    SATBMarkQueue::byte_offset_of_active());
729         int satb_q_index_byte_offset =
730           in_bytes(JavaThread::satb_mark_queue_offset() +
731                    SATBMarkQueue::byte_offset_of_index());
732         int satb_q_buf_byte_offset =

770         __ blr();                                                                                                                    
771 
772         __ bind(refill);                                                                                                             
773         const int nbytes_save = (MacroAssembler::num_volatile_regs + stack_slots) * BytesPerWord;                                    
774         __ save_volatile_gprs(R1_SP, -nbytes_save); // except R0                                                                     
775         __ mflr(R0);                                                                                                                 
776         __ std(R0, _abi(lr), R1_SP);                                                                                                 
777         __ push_frame_reg_args(nbytes_save, R0); // dummy frame for C call                                                           
778         __ call_VM_leaf(CAST_FROM_FN_PTR(address, SATBMarkQueueSet::handle_zero_index_for_thread), R16_thread);                      
779         __ pop_frame();                                                                                                              
780         __ ld(R0, _abi(lr), R1_SP);                                                                                                  
781         __ mtlr(R0);                                                                                                                 
782         __ restore_volatile_gprs(R1_SP, -nbytes_save); // except R0                                                                  
783         __ b(restart);                                                                                                               
784       }                                                                                                                              
785       break;                                                                                                                         
786 
787   case g1_post_barrier_slow_id:                                                                                                      
788     {                                                                                                                                
789         BarrierSet* bs = Universe::heap()->barrier_set();                                                                            
790         if (bs->kind() != BarrierSet::G1SATBCTLogging) {                                                                             
791           goto unimplemented_entry;                                                                                                  
792         }                                                                                                                            
793 
794         __ set_info("g1_post_barrier_slow_id", dont_gc_arguments);                                                                   
795 
796         // Using stack slots: spill addr, spill tmp2                                                                                 
797         const int stack_slots = 2;                                                                                                   
798         Register tmp = R0;                                                                                                           
799         Register addr = R14;                                                                                                         
800         Register tmp2 = R15;                                                                                                         
801         jbyte* byte_map_base = ci_card_table_address();                                                                              
802 
803         Label restart, refill, ret;                                                                                                  
804 
805         // Spill                                                                                                                     
806         __ std(addr, -8, R1_SP);                                                                                                     
807         __ std(tmp2, -16, R1_SP);                                                                                                    
808 
809         __ srdi(addr, R0, CardTable::card_shift); // Addr is passed in R0.                                                           

770         __ blr();
771 
772         __ bind(refill);
773         const int nbytes_save = (MacroAssembler::num_volatile_regs + stack_slots) * BytesPerWord;
774         __ save_volatile_gprs(R1_SP, -nbytes_save); // except R0
775         __ mflr(R0);
776         __ std(R0, _abi(lr), R1_SP);
777         __ push_frame_reg_args(nbytes_save, R0); // dummy frame for C call
778         __ call_VM_leaf(CAST_FROM_FN_PTR(address, SATBMarkQueueSet::handle_zero_index_for_thread), R16_thread);
779         __ pop_frame();
780         __ ld(R0, _abi(lr), R1_SP);
781         __ mtlr(R0);
782         __ restore_volatile_gprs(R1_SP, -nbytes_save); // except R0
783         __ b(restart);
784       }
785       break;
786 
787   case g1_post_barrier_slow_id:
788     {
789         BarrierSet* bs = Universe::heap()->barrier_set();
790         if (bs->kind() != BarrierSet::G1BarrierSet) {
791           goto unimplemented_entry;
792         }
793 
794         __ set_info("g1_post_barrier_slow_id", dont_gc_arguments);
795 
796         // Using stack slots: spill addr, spill tmp2
797         const int stack_slots = 2;
798         Register tmp = R0;
799         Register addr = R14;
800         Register tmp2 = R15;
801         jbyte* byte_map_base = ci_card_table_address();
802 
803         Label restart, refill, ret;
804 
805         // Spill
806         __ std(addr, -8, R1_SP);
807         __ std(tmp2, -16, R1_SP);
808 
809         __ srdi(addr, R0, CardTable::card_shift); // Addr is passed in R0.
< prev index next >