< prev index next >

src/hotspot/share/code/compiledMethod.inline.hpp


23 
24 #ifndef SHARE_VM_CODE_COMPILEDMETHOD_INLINE_HPP                                                                                      
25 #define SHARE_VM_CODE_COMPILEDMETHOD_INLINE_HPP                                                                                      
26 
27 #include "code/compiledMethod.hpp"                                                                                                   
28 #include "code/nativeInst.hpp"                                                                                                       
29 #include "runtime/frame.hpp"                                                                                                         
30 #include "runtime/orderAccess.hpp"                                                                                                   
31 
32 inline bool CompiledMethod::is_deopt_pc(address pc) { return is_deopt_entry(pc) || is_deopt_mh_entry(pc); }                          
33 
34 // When using JVMCI the address might be off by the size of a call instruction.                                                      
35 inline bool CompiledMethod::is_deopt_entry(address pc) {                                                                             
36   return pc == deopt_handler_begin()                                                                                                 
37 #if INCLUDE_JVMCI                                                                                                                    
38     || (is_compiled_by_jvmci() && pc == (deopt_handler_begin() + NativeCall::instruction_size))                                      
39 #endif                                                                                                                               
40     ;                                                                                                                                
41 }                                                                                                                                    
42 
43 inline void CompiledMethod::release_set_exception_cache(ExceptionCache *ec) {                                                        
44   OrderAccess::release_store(&_exception_cache, ec);                                                                                 
45 }                                                                                                                                    
46                                                                                                                                      
47 // -----------------------------------------------------------------------------                                                     
48 // CompiledMethod::get_deopt_original_pc                                                                                             
49 //                                                                                                                                   
50 // Return the original PC for the given PC if:                                                                                       
51 // (a) the given PC belongs to a nmethod and                                                                                         
52 // (b) it is a deopt PC                                                                                                              
53 
54 inline address CompiledMethod::get_deopt_original_pc(const frame* fr) {                                                              
55   if (fr->cb() == NULL)  return NULL;                                                                                                
56 
57   CompiledMethod* cm = fr->cb()->as_compiled_method_or_null();                                                                       
58   if (cm != NULL && cm->is_deopt_pc(fr->pc()))                                                                                       
59     return cm->get_original_pc(fr);                                                                                                  
60 
61   return NULL;                                                                                                                       
62 }                                                                                                                                    
63 
64 
65 // class ExceptionCache methods                                                                                                      

23 
24 #ifndef SHARE_VM_CODE_COMPILEDMETHOD_INLINE_HPP
25 #define SHARE_VM_CODE_COMPILEDMETHOD_INLINE_HPP
26 
27 #include "code/compiledMethod.hpp"
28 #include "code/nativeInst.hpp"
29 #include "runtime/frame.hpp"
30 #include "runtime/orderAccess.hpp"
31 
32 inline bool CompiledMethod::is_deopt_pc(address pc) { return is_deopt_entry(pc) || is_deopt_mh_entry(pc); }
33 
34 // When using JVMCI the address might be off by the size of a call instruction.
35 inline bool CompiledMethod::is_deopt_entry(address pc) {
36   return pc == deopt_handler_begin()
37 #if INCLUDE_JVMCI
38     || (is_compiled_by_jvmci() && pc == (deopt_handler_begin() + NativeCall::instruction_size))
39 #endif
40     ;
41 }
42 




43 // -----------------------------------------------------------------------------
44 // CompiledMethod::get_deopt_original_pc
45 //
46 // Return the original PC for the given PC if:
47 // (a) the given PC belongs to a nmethod and
48 // (b) it is a deopt PC
49 
50 inline address CompiledMethod::get_deopt_original_pc(const frame* fr) {
51   if (fr->cb() == NULL)  return NULL;
52 
53   CompiledMethod* cm = fr->cb()->as_compiled_method_or_null();
54   if (cm != NULL && cm->is_deopt_pc(fr->pc()))
55     return cm->get_original_pc(fr);
56 
57   return NULL;
58 }
59 
60 
61 // class ExceptionCache methods
< prev index next >