< prev index next >

src/hotspot/cpu/x86/c1_Runtime1_x86.cpp

G1BarrierSet_merge

24 #include "precompiled.hpp"                                                                                                           
25 #include "asm/assembler.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_x86.hpp"                                                                                                        
34 #include "oops/compiledICHolder.hpp"                                                                                                 
35 #include "oops/oop.inline.hpp"                                                                                                       
36 #include "prims/jvmtiExport.hpp"                                                                                                     
37 #include "register_x86.hpp"                                                                                                          
38 #include "runtime/sharedRuntime.hpp"                                                                                                 
39 #include "runtime/signature.hpp"                                                                                                     
40 #include "runtime/vframeArray.hpp"                                                                                                   
41 #include "utilities/macros.hpp"                                                                                                      
42 #include "vmreg_x86.inline.hpp"                                                                                                      
43 #if INCLUDE_ALL_GCS                                                                                                                  
                                                                                                                                     
44 #include "gc/g1/g1CardTable.hpp"                                                                                                     
45 #include "gc/g1/g1SATBCardTableModRefBS.hpp"                                                                                         
46 #endif                                                                                                                               
47 
48 
49 // Implementation of StubAssembler                                                                                                   
50 
51 int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry, int args_size) {                           
52   // setup registers                                                                                                                 
53   const Register thread = NOT_LP64(rdi) LP64_ONLY(r15_thread); // is callee-saved register (Visual C++ calling conventions)          
54   assert(!(oop_result1->is_valid() || metadata_result->is_valid()) || oop_result1 != metadata_result, "registers must be different");
55   assert(oop_result1 != thread && metadata_result != thread, "registers must be different");                                         
56   assert(args_size >= 0, "illegal args_size");                                                                                       
57   bool align_stack = false;                                                                                                          
58 #ifdef _LP64                                                                                                                         
59   // At a method handle call, the stack may not be properly aligned                                                                  
60   // when returning with an exception.                                                                                               
61   align_stack = (stub_id() == Runtime1::handle_exception_from_callee_id);                                                            
62 #endif                                                                                                                               
63 
64 #ifdef _LP64                                                                                                                         

24 #include "precompiled.hpp"
25 #include "asm/assembler.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_x86.hpp"
34 #include "oops/compiledICHolder.hpp"
35 #include "oops/oop.inline.hpp"
36 #include "prims/jvmtiExport.hpp"
37 #include "register_x86.hpp"
38 #include "runtime/sharedRuntime.hpp"
39 #include "runtime/signature.hpp"
40 #include "runtime/vframeArray.hpp"
41 #include "utilities/macros.hpp"
42 #include "vmreg_x86.inline.hpp"
43 #if INCLUDE_ALL_GCS
44 #include "gc/g1/g1BarrierSet.hpp"
45 #include "gc/g1/g1CardTable.hpp"

46 #endif
47 
48 
49 // Implementation of StubAssembler
50 
51 int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry, int args_size) {
52   // setup registers
53   const Register thread = NOT_LP64(rdi) LP64_ONLY(r15_thread); // is callee-saved register (Visual C++ calling conventions)
54   assert(!(oop_result1->is_valid() || metadata_result->is_valid()) || oop_result1 != metadata_result, "registers must be different");
55   assert(oop_result1 != thread && metadata_result != thread, "registers must be different");
56   assert(args_size >= 0, "illegal args_size");
57   bool align_stack = false;
58 #ifdef _LP64
59   // At a method handle call, the stack may not be properly aligned
60   // when returning with an exception.
61   align_stack = (stub_id() == Runtime1::handle_exception_from_callee_id);
62 #endif
63 
64 #ifdef _LP64

1545 #else                                                                                                                                
1546         __ xorptr(rax, rax);                                                                                                         
1547 #endif // _LP64                                                                                                                      
1548 
1549         __ bind(do_return);                                                                                                          
1550         __ addptr(rsp, 32);                                                                                                          
1551         LP64_ONLY(__ pop(rdx);)                                                                                                      
1552         __ pop(rcx);                                                                                                                 
1553         __ pop(rsi);                                                                                                                 
1554         __ ret(0);                                                                                                                   
1555       }                                                                                                                              
1556       break;                                                                                                                         
1557 
1558 #if INCLUDE_ALL_GCS                                                                                                                  
1559     case g1_pre_barrier_slow_id:                                                                                                     
1560       {                                                                                                                              
1561         StubFrame f(sasm, "g1_pre_barrier", dont_gc_arguments);                                                                      
1562         // arg0 : previous value of memory                                                                                           
1563 
1564         BarrierSet* bs = Universe::heap()->barrier_set();                                                                            
1565         if (bs->kind() != BarrierSet::G1SATBCTLogging) {                                                                             
1566           __ movptr(rax, (int)id);                                                                                                   
1567           __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), rax);                                             
1568           __ should_not_reach_here();                                                                                                
1569           break;                                                                                                                     
1570         }                                                                                                                            
1571         __ push(rax);                                                                                                                
1572         __ push(rdx);                                                                                                                
1573 
1574         const Register pre_val = rax;                                                                                                
1575         const Register thread = NOT_LP64(rax) LP64_ONLY(r15_thread);                                                                 
1576         const Register tmp = rdx;                                                                                                    
1577 
1578         NOT_LP64(__ get_thread(thread);)                                                                                             
1579 
1580         Address queue_active(thread, in_bytes(JavaThread::satb_mark_queue_offset() +                                                 
1581                                               SATBMarkQueue::byte_offset_of_active()));                                              
1582         Address queue_index(thread, in_bytes(JavaThread::satb_mark_queue_offset() +                                                  
1583                                              SATBMarkQueue::byte_offset_of_index()));                                                
1584         Address buffer(thread, in_bytes(JavaThread::satb_mark_queue_offset() +                                                       

1545 #else
1546         __ xorptr(rax, rax);
1547 #endif // _LP64
1548 
1549         __ bind(do_return);
1550         __ addptr(rsp, 32);
1551         LP64_ONLY(__ pop(rdx);)
1552         __ pop(rcx);
1553         __ pop(rsi);
1554         __ ret(0);
1555       }
1556       break;
1557 
1558 #if INCLUDE_ALL_GCS
1559     case g1_pre_barrier_slow_id:
1560       {
1561         StubFrame f(sasm, "g1_pre_barrier", dont_gc_arguments);
1562         // arg0 : previous value of memory
1563 
1564         BarrierSet* bs = Universe::heap()->barrier_set();
1565         if (bs->kind() != BarrierSet::G1BarrierSet) {
1566           __ movptr(rax, (int)id);
1567           __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), rax);
1568           __ should_not_reach_here();
1569           break;
1570         }
1571         __ push(rax);
1572         __ push(rdx);
1573 
1574         const Register pre_val = rax;
1575         const Register thread = NOT_LP64(rax) LP64_ONLY(r15_thread);
1576         const Register tmp = rdx;
1577 
1578         NOT_LP64(__ get_thread(thread);)
1579 
1580         Address queue_active(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
1581                                               SATBMarkQueue::byte_offset_of_active()));
1582         Address queue_index(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
1583                                              SATBMarkQueue::byte_offset_of_index()));
1584         Address buffer(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
< prev index next >