< prev index next >

src/hotspot/cpu/sparc/c1_CodeStubs_sparc.cpp

BarrierSetC1

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 "c1/c1_CodeStubs.hpp"                                                                                                       
26 #include "c1/c1_FrameMap.hpp"                                                                                                        
27 #include "c1/c1_LIRAssembler.hpp"                                                                                                    
28 #include "c1/c1_MacroAssembler.hpp"                                                                                                  
29 #include "c1/c1_Runtime1.hpp"                                                                                                        
30 #include "nativeInst_sparc.hpp"                                                                                                      
31 #include "runtime/sharedRuntime.hpp"                                                                                                 
32 #include "utilities/macros.hpp"                                                                                                      
33 #include "vmreg_sparc.inline.hpp"                                                                                                    
34 #if INCLUDE_ALL_GCS                                                                                                                  
35 #include "gc/g1/g1BarrierSet.hpp"                                                                                                    
36 #endif // INCLUDE_ALL_GCS                                                                                                            
37 
38 #define __ ce->masm()->                                                                                                              
39 
40 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index,                                                                    
41                                bool throw_index_out_of_bounds_exception)                                                             
42   : _throw_index_out_of_bounds_exception(throw_index_out_of_bounds_exception)                                                        
43   , _index(index)                                                                                                                    
44 {                                                                                                                                    
45   assert(info != NULL, "must have info");                                                                                            
46   _info = new CodeEmitInfo(info);                                                                                                    
47 }                                                                                                                                    
48 
49 
50 void RangeCheckStub::emit_code(LIR_Assembler* ce) {                                                                                  
51   __ bind(_entry);                                                                                                                   
52 
53   if (_info->deoptimize_on_exception()) {                                                                                            
54     address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);                                                             
55     __ call(a, relocInfo::runtime_call_type);                                                                                        

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 "c1/c1_CodeStubs.hpp"
26 #include "c1/c1_FrameMap.hpp"
27 #include "c1/c1_LIRAssembler.hpp"
28 #include "c1/c1_MacroAssembler.hpp"
29 #include "c1/c1_Runtime1.hpp"
30 #include "nativeInst_sparc.hpp"
31 #include "runtime/sharedRuntime.hpp"
32 #include "utilities/macros.hpp"
33 #include "vmreg_sparc.inline.hpp"



34 
35 #define __ ce->masm()->
36 
37 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index,
38                                bool throw_index_out_of_bounds_exception)
39   : _throw_index_out_of_bounds_exception(throw_index_out_of_bounds_exception)
40   , _index(index)
41 {
42   assert(info != NULL, "must have info");
43   _info = new CodeEmitInfo(info);
44 }
45 
46 
47 void RangeCheckStub::emit_code(LIR_Assembler* ce) {
48   __ bind(_entry);
49 
50   if (_info->deoptimize_on_exception()) {
51     address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
52     __ call(a, relocInfo::runtime_call_type);

435   ce->emit_static_call_stub();                                                                                                       
436   if (ce->compilation()->bailed_out()) {                                                                                             
437     return; // CodeCache is full                                                                                                     
438   }                                                                                                                                  
439 
440   __ call(SharedRuntime::get_resolve_static_call_stub(), relocInfo::static_call_type);                                               
441   __ delayed()->nop();                                                                                                               
442   ce->add_call_info_here(info());                                                                                                    
443   ce->verify_oop_map(info());                                                                                                        
444 
445 #ifndef PRODUCT                                                                                                                      
446   __ set((intptr_t)&Runtime1::_arraycopy_slowcase_cnt, O0);                                                                          
447   __ ld(O0, 0, O1);                                                                                                                  
448   __ inc(O1);                                                                                                                        
449   __ st(O1, 0, O0);                                                                                                                  
450 #endif                                                                                                                               
451 
452   __ br(Assembler::always, false, Assembler::pt, _continuation);                                                                     
453   __ delayed()->nop();                                                                                                               
454 }                                                                                                                                    
455                                                                                                                                      
456                                                                                                                                      
457 ///////////////////////////////////////////////////////////////////////////////////                                                  
458 #if INCLUDE_ALL_GCS                                                                                                                  
459                                                                                                                                      
460 void G1PreBarrierStub::emit_code(LIR_Assembler* ce) {                                                                                
461   // At this point we know that marking is in progress.                                                                              
462   // If do_load() is true then we have to emit the                                                                                   
463   // load of the previous value; otherwise it has already                                                                            
464   // been loaded into _pre_val.                                                                                                      
465                                                                                                                                      
466   __ bind(_entry);                                                                                                                   
467                                                                                                                                      
468   assert(pre_val()->is_register(), "Precondition.");                                                                                 
469   Register pre_val_reg = pre_val()->as_register();                                                                                   
470                                                                                                                                      
471   if (do_load()) {                                                                                                                   
472     ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false /*wide*/, false /*unaligned*/);                             
473   }                                                                                                                                  
474                                                                                                                                      
475   if (__ is_in_wdisp16_range(_continuation)) {                                                                                       
476     __ br_null(pre_val_reg, /*annul*/false, Assembler::pt, _continuation);                                                           
477   } else {                                                                                                                           
478     __ cmp(pre_val_reg, G0);                                                                                                         
479     __ brx(Assembler::equal, false, Assembler::pn, _continuation);                                                                   
480   }                                                                                                                                  
481   __ delayed()->nop();                                                                                                               
482                                                                                                                                      
483   __ call(Runtime1::entry_for(Runtime1::Runtime1::g1_pre_barrier_slow_id));                                                          
484   __ delayed()->mov(pre_val_reg, G4);                                                                                                
485   __ br(Assembler::always, false, Assembler::pt, _continuation);                                                                     
486   __ delayed()->nop();                                                                                                               
487                                                                                                                                      
488 }                                                                                                                                    
489                                                                                                                                      
490 void G1PostBarrierStub::emit_code(LIR_Assembler* ce) {                                                                               
491   __ bind(_entry);                                                                                                                   
492                                                                                                                                      
493   assert(addr()->is_register(), "Precondition.");                                                                                    
494   assert(new_val()->is_register(), "Precondition.");                                                                                 
495   Register addr_reg = addr()->as_pointer_register();                                                                                 
496   Register new_val_reg = new_val()->as_register();                                                                                   
497                                                                                                                                      
498   if (__ is_in_wdisp16_range(_continuation)) {                                                                                       
499     __ br_null(new_val_reg, /*annul*/false, Assembler::pt, _continuation);                                                           
500   } else {                                                                                                                           
501     __ cmp(new_val_reg, G0);                                                                                                         
502     __ brx(Assembler::equal, false, Assembler::pn, _continuation);                                                                   
503   }                                                                                                                                  
504   __ delayed()->nop();                                                                                                               
505                                                                                                                                      
506   __ call(Runtime1::entry_for(Runtime1::Runtime1::g1_post_barrier_slow_id));                                                         
507   __ delayed()->mov(addr_reg, G4);                                                                                                   
508   __ br(Assembler::always, false, Assembler::pt, _continuation);                                                                     
509   __ delayed()->nop();                                                                                                               
510 }                                                                                                                                    
511                                                                                                                                      
512 #endif // INCLUDE_ALL_GCS                                                                                                            
513 ///////////////////////////////////////////////////////////////////////////////////                                                  
514 
515 #undef __                                                                                                                            

432   ce->emit_static_call_stub();
433   if (ce->compilation()->bailed_out()) {
434     return; // CodeCache is full
435   }
436 
437   __ call(SharedRuntime::get_resolve_static_call_stub(), relocInfo::static_call_type);
438   __ delayed()->nop();
439   ce->add_call_info_here(info());
440   ce->verify_oop_map(info());
441 
442 #ifndef PRODUCT
443   __ set((intptr_t)&Runtime1::_arraycopy_slowcase_cnt, O0);
444   __ ld(O0, 0, O1);
445   __ inc(O1);
446   __ st(O1, 0, O0);
447 #endif
448 
449   __ br(Assembler::always, false, Assembler::pt, _continuation);
450   __ delayed()->nop();
451 }



























































452 
453 #undef __
< prev index next >