< prev index next >

src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp

BarrierSetC1

14  *                                                                                                                                   
15  * You should have received a copy of the GNU General Public License version                                                         
16  * 2 along with this work; if not, write to the Free Software Foundation,                                                            
17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.                                                                     
18  *                                                                                                                                   
19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA                                                           
20  * or visit www.oracle.com if you need additional information or have any                                                            
21  * questions.                                                                                                                        
22  *                                                                                                                                   
23  */                                                                                                                                  
24 
25 #include "precompiled.hpp"                                                                                                           
26 #include "c1/c1_CodeStubs.hpp"                                                                                                       
27 #include "c1/c1_FrameMap.hpp"                                                                                                        
28 #include "c1/c1_LIRAssembler.hpp"                                                                                                    
29 #include "c1/c1_MacroAssembler.hpp"                                                                                                  
30 #include "c1/c1_Runtime1.hpp"                                                                                                        
31 #include "nativeInst_aarch64.hpp"                                                                                                    
32 #include "runtime/sharedRuntime.hpp"                                                                                                 
33 #include "vmreg_aarch64.inline.hpp"                                                                                                  
34 #if INCLUDE_ALL_GCS                                                                                                                  
35 #include "gc/g1/g1BarrierSet.hpp"                                                                                                    
36 #endif                                                                                                                               
37 
38 
39 #define __ ce->masm()->                                                                                                              
40 
41 void CounterOverflowStub::emit_code(LIR_Assembler* ce) {                                                                             
42   __ bind(_entry);                                                                                                                   
43   Metadata *m = _method->as_constant_ptr()->as_metadata();                                                                           
44   __ mov_metadata(rscratch1, m);                                                                                                     
45   ce->store_parameter(rscratch1, 1);                                                                                                 
46   ce->store_parameter(_bci, 0);                                                                                                      
47   __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::counter_overflow_id)));                                                   
48   ce->add_call_info_here(_info);                                                                                                     
49   ce->verify_oop_map(_info);                                                                                                         
50   __ b(_continuation);                                                                                                               
51 }                                                                                                                                    
52 
53 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index,                                                                    
54                                bool throw_index_out_of_bounds_exception)                                                             
55   : _throw_index_out_of_bounds_exception(throw_index_out_of_bounds_exception)                                                        

14  *
15  * You should have received a copy of the GNU General Public License version
16  * 2 along with this work; if not, write to the Free Software Foundation,
17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18  *
19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20  * or visit www.oracle.com if you need additional information or have any
21  * questions.
22  *
23  */
24 
25 #include "precompiled.hpp"
26 #include "c1/c1_CodeStubs.hpp"
27 #include "c1/c1_FrameMap.hpp"
28 #include "c1/c1_LIRAssembler.hpp"
29 #include "c1/c1_MacroAssembler.hpp"
30 #include "c1/c1_Runtime1.hpp"
31 #include "nativeInst_aarch64.hpp"
32 #include "runtime/sharedRuntime.hpp"
33 #include "vmreg_aarch64.inline.hpp"



34 
35 
36 #define __ ce->masm()->
37 
38 void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
39   __ bind(_entry);
40   Metadata *m = _method->as_constant_ptr()->as_metadata();
41   __ mov_metadata(rscratch1, m);
42   ce->store_parameter(rscratch1, 1);
43   ce->store_parameter(_bci, 0);
44   __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::counter_overflow_id)));
45   ce->add_call_info_here(_info);
46   ce->verify_oop_map(_info);
47   __ b(_continuation);
48 }
49 
50 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index,
51                                bool throw_index_out_of_bounds_exception)
52   : _throw_index_out_of_bounds_exception(throw_index_out_of_bounds_exception)

331   ce->emit_static_call_stub();                                                                                                       
332   if (ce->compilation()->bailed_out()) {                                                                                             
333     return; // CodeCache is full                                                                                                     
334   }                                                                                                                                  
335   Address resolve(SharedRuntime::get_resolve_static_call_stub(),                                                                     
336                   relocInfo::static_call_type);                                                                                      
337   address call = __ trampoline_call(resolve);                                                                                        
338   if (call == NULL) {                                                                                                                
339     ce->bailout("trampoline stub overflow");                                                                                         
340     return;                                                                                                                          
341   }                                                                                                                                  
342   ce->add_call_info_here(info());                                                                                                    
343 
344 #ifndef PRODUCT                                                                                                                      
345   __ lea(rscratch2, ExternalAddress((address)&Runtime1::_arraycopy_slowcase_cnt));                                                   
346   __ incrementw(Address(rscratch2));                                                                                                 
347 #endif                                                                                                                               
348 
349   __ b(_continuation);                                                                                                               
350 }                                                                                                                                    
351                                                                                                                                      
352                                                                                                                                      
353 /////////////////////////////////////////////////////////////////////////////                                                        
354 #if INCLUDE_ALL_GCS                                                                                                                  
355                                                                                                                                      
356 void G1PreBarrierStub::emit_code(LIR_Assembler* ce) {                                                                                
357   // At this point we know that marking is in progress.                                                                              
358   // If do_load() is true then we have to emit the                                                                                   
359   // load of the previous value; otherwise it has already                                                                            
360   // been loaded into _pre_val.                                                                                                      
361                                                                                                                                      
362   __ bind(_entry);                                                                                                                   
363   assert(pre_val()->is_register(), "Precondition.");                                                                                 
364                                                                                                                                      
365   Register pre_val_reg = pre_val()->as_register();                                                                                   
366                                                                                                                                      
367   if (do_load()) {                                                                                                                   
368     ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false /*wide*/, false /*unaligned*/);                             
369   }                                                                                                                                  
370   __ cbz(pre_val_reg, _continuation);                                                                                                
371   ce->store_parameter(pre_val()->as_register(), 0);                                                                                  
372   __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::g1_pre_barrier_slow_id)));                                                
373   __ b(_continuation);                                                                                                               
374 }                                                                                                                                    
375                                                                                                                                      
376 void G1PostBarrierStub::emit_code(LIR_Assembler* ce) {                                                                               
377   __ bind(_entry);                                                                                                                   
378   assert(addr()->is_register(), "Precondition.");                                                                                    
379   assert(new_val()->is_register(), "Precondition.");                                                                                 
380   Register new_val_reg = new_val()->as_register();                                                                                   
381   __ cbz(new_val_reg, _continuation);                                                                                                
382   ce->store_parameter(addr()->as_pointer_register(), 0);                                                                             
383   __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::g1_post_barrier_slow_id)));                                               
384   __ b(_continuation);                                                                                                               
385 }                                                                                                                                    
386                                                                                                                                      
387 #endif // INCLUDE_ALL_GCS                                                                                                            
388 /////////////////////////////////////////////////////////////////////////////                                                        
389 
390 #undef __                                                                                                                            

328   ce->emit_static_call_stub();
329   if (ce->compilation()->bailed_out()) {
330     return; // CodeCache is full
331   }
332   Address resolve(SharedRuntime::get_resolve_static_call_stub(),
333                   relocInfo::static_call_type);
334   address call = __ trampoline_call(resolve);
335   if (call == NULL) {
336     ce->bailout("trampoline stub overflow");
337     return;
338   }
339   ce->add_call_info_here(info());
340 
341 #ifndef PRODUCT
342   __ lea(rscratch2, ExternalAddress((address)&Runtime1::_arraycopy_slowcase_cnt));
343   __ incrementw(Address(rscratch2));
344 #endif
345 
346   __ b(_continuation);
347 }






































348 
349 #undef __
< prev index next >