23 */ 24 25 #ifndef SHARE_VM_CI_CIMETHOD_HPP 26 #define SHARE_VM_CI_CIMETHOD_HPP 27 28 #include "ci/ciFlags.hpp" 29 #include "ci/ciInstanceKlass.hpp" 30 #include "ci/ciObject.hpp" 31 #include "ci/ciSignature.hpp" 32 #include "compiler/methodLiveness.hpp" 33 #include "prims/methodHandles.hpp" 34 #include "utilities/bitMap.hpp" 35 #include "trace/tracing.hpp" 36 37 class ciMethodBlocks; 38 class MethodLiveness; 39 class Arena; 40 class BCEscapeAnalyzer; 41 class InlineTree; 42 43 // ciMethod 44 // 45 // This class represents a Method* in the HotSpot virtual 46 // machine. 47 class ciMethod : public ciMetadata { 48 friend class CompileBroker; 49 CI_PACKAGE_ACCESS 50 friend class ciEnv; 51 friend class ciExceptionHandlerStream; 52 friend class ciBytecodeStream; 53 friend class ciMethodHandle; 54 friend class ciReplay; 55 friend class InlineTree; 56 57 private: 58 // General method information. 59 ciFlags _flags; 60 ciSymbol* _name; 61 ciInstanceKlass* _holder; 62 ciSignature* _signature; 231 // Get the interpreters viewpoint on oop liveness. MethodLiveness is 232 // conservative in the sense that it may consider locals to be live which 233 // cannot be live, like in the case where a local could contain an oop or 234 // a primitive along different paths. In that case the local must be 235 // dead when those paths merge. Since the interpreter's viewpoint is 236 // used when gc'ing an interpreter frame we need to use its viewpoint 237 // during OSR when loading the locals. 238 239 ResourceBitMap live_local_oops_at_bci(int bci); 240 241 #ifdef COMPILER1 242 const BitMap& bci_block_start(); 243 #endif 244 245 ciTypeFlow* get_flow_analysis(); 246 ciTypeFlow* get_osr_flow_analysis(int osr_bci); // alternate entry point 247 ciCallProfile call_profile_at_bci(int bci); 248 int interpreter_call_site_count(int bci); 249 250 // Does type profiling provide any useful information at this point? 251 bool argument_profiled_type(int bci, int i, ciKlass*& type, bool& maybe_null); 252 bool parameter_profiled_type(int i, ciKlass*& type, bool& maybe_null); 253 bool return_profiled_type(int bci, ciKlass*& type, bool& maybe_null); 254 255 ciField* get_field_at_bci( int bci, bool &will_link); 256 ciMethod* get_method_at_bci(int bci, bool &will_link, ciSignature* *declared_signature); 257 ciMethod* get_method_at_bci(int bci) { 258 bool ignored_will_link; 259 ciSignature* ignored_declared_signature; 260 return get_method_at_bci(bci, ignored_will_link, &ignored_declared_signature); 261 } 262 263 ciSignature* get_declared_signature_at_bci(int bci) { 264 bool ignored_will_link; 265 ciSignature* declared_signature; 266 get_method_at_bci(bci, ignored_will_link, &declared_signature); 267 assert(declared_signature != NULL, "cannot be null"); 268 return declared_signature; 269 } 270 271 // Given a certain calling environment, find the monomorphic target 272 // for the call. Return NULL if the call is not monomorphic in 273 // its calling environment. | 23 */ 24 25 #ifndef SHARE_VM_CI_CIMETHOD_HPP 26 #define SHARE_VM_CI_CIMETHOD_HPP 27 28 #include "ci/ciFlags.hpp" 29 #include "ci/ciInstanceKlass.hpp" 30 #include "ci/ciObject.hpp" 31 #include "ci/ciSignature.hpp" 32 #include "compiler/methodLiveness.hpp" 33 #include "prims/methodHandles.hpp" 34 #include "utilities/bitMap.hpp" 35 #include "trace/tracing.hpp" 36 37 class ciMethodBlocks; 38 class MethodLiveness; 39 class Arena; 40 class BCEscapeAnalyzer; 41 class InlineTree; 42 43 // Whether profiling found an oop to be always, never or sometimes 44 // null 45 enum ProfilePtrKind { 46 ProfileAlwaysNull, 47 ProfileNeverNull, 48 ProfileMaybeNull 49 }; 50 51 // ciMethod 52 // 53 // This class represents a Method* in the HotSpot virtual 54 // machine. 55 class ciMethod : public ciMetadata { 56 friend class CompileBroker; 57 CI_PACKAGE_ACCESS 58 friend class ciEnv; 59 friend class ciExceptionHandlerStream; 60 friend class ciBytecodeStream; 61 friend class ciMethodHandle; 62 friend class ciReplay; 63 friend class InlineTree; 64 65 private: 66 // General method information. 67 ciFlags _flags; 68 ciSymbol* _name; 69 ciInstanceKlass* _holder; 70 ciSignature* _signature; 239 // Get the interpreters viewpoint on oop liveness. MethodLiveness is 240 // conservative in the sense that it may consider locals to be live which 241 // cannot be live, like in the case where a local could contain an oop or 242 // a primitive along different paths. In that case the local must be 243 // dead when those paths merge. Since the interpreter's viewpoint is 244 // used when gc'ing an interpreter frame we need to use its viewpoint 245 // during OSR when loading the locals. 246 247 ResourceBitMap live_local_oops_at_bci(int bci); 248 249 #ifdef COMPILER1 250 const BitMap& bci_block_start(); 251 #endif 252 253 ciTypeFlow* get_flow_analysis(); 254 ciTypeFlow* get_osr_flow_analysis(int osr_bci); // alternate entry point 255 ciCallProfile call_profile_at_bci(int bci); 256 int interpreter_call_site_count(int bci); 257 258 // Does type profiling provide any useful information at this point? 259 bool argument_profiled_type(int bci, int i, ciKlass*& type, ProfilePtrKind& ptr_kind); 260 bool parameter_profiled_type(int i, ciKlass*& type, ProfilePtrKind& ptr_kind); 261 bool return_profiled_type(int bci, ciKlass*& type, ProfilePtrKind& ptr_kind); 262 263 ciField* get_field_at_bci( int bci, bool &will_link); 264 ciMethod* get_method_at_bci(int bci, bool &will_link, ciSignature* *declared_signature); 265 ciMethod* get_method_at_bci(int bci) { 266 bool ignored_will_link; 267 ciSignature* ignored_declared_signature; 268 return get_method_at_bci(bci, ignored_will_link, &ignored_declared_signature); 269 } 270 271 ciSignature* get_declared_signature_at_bci(int bci) { 272 bool ignored_will_link; 273 ciSignature* declared_signature; 274 get_method_at_bci(bci, ignored_will_link, &declared_signature); 275 assert(declared_signature != NULL, "cannot be null"); 276 return declared_signature; 277 } 278 279 // Given a certain calling environment, find the monomorphic target 280 // for the call. Return NULL if the call is not monomorphic in 281 // its calling environment. |