< prev index next >

src/share/vm/oops/method.hpp

Print this page




  55 class AdapterHandlerEntry;
  56 class MethodData;
  57 class MethodCounters;
  58 class ConstMethod;
  59 class InlineTableSizes;
  60 class KlassSizeStats;
  61 
  62 class Method : public Metadata {
  63  friend class VMStructs;
  64  private:
  65   ConstMethod*      _constMethod;                // Method read-only data.
  66   MethodData*       _method_data;
  67   MethodCounters*   _method_counters;
  68   AccessFlags       _access_flags;               // Access flags
  69   int               _vtable_index;               // vtable index of this method (see VtableIndexFlag)
  70                                                  // note: can have vtables with >2**16 elements (because of inheritance)
  71 #ifdef CC_INTERP
  72   int               _result_index;               // C++ interpreter needs for converting results to/from stack
  73 #endif
  74   u2                _intrinsic_id;               // vmSymbols::intrinsic_id (0 == _none)

  75 
  76   // Flags
  77   enum Flags {
  78     _jfr_towrite          = 1 << 0,
  79     _caller_sensitive     = 1 << 1,
  80     _force_inline         = 1 << 2,
  81     _dont_inline          = 1 << 3,
  82     _hidden               = 1 << 4,
  83     _has_injected_profile = 1 << 5,
  84     _running_emcp         = 1 << 6,
  85     _intrinsic_candidate  = 1 << 7
  86   };
  87   u1 _flags;
  88 
  89 #ifndef PRODUCT
  90   int               _compiled_invocation_count;  // Number of nmethod invocations so far (for perf. debugging)
  91 #endif
  92   // Entry point for calling both from and to the interpreter.
  93   address _i2i_entry;           // All-args-on-stack calling convention
  94   // Adapter blob (i2c/c2i) for this Method*. Set once when method is linked.


 758   static bool is_method_id(jmethodID mid);
 759 
 760   // Clear methods
 761   static void clear_jmethod_ids(ClassLoaderData* loader_data);
 762   static void print_jmethod_ids(ClassLoaderData* loader_data, outputStream* out) PRODUCT_RETURN;
 763 
 764   // Get this method's jmethodID -- allocate if it doesn't exist
 765   jmethodID jmethod_id()                            { methodHandle this_h(this);
 766                                                       return InstanceKlass::get_jmethod_id(method_holder(), this_h); }
 767 
 768   // Lookup the jmethodID for this method.  Return NULL if not found.
 769   // NOTE that this function can be called from a signal handler
 770   // (see AsyncGetCallTrace support for Forte Analyzer) and this
 771   // needs to be async-safe. No allocation should be done and
 772   // so handles are not used to avoid deadlock.
 773   jmethodID find_jmethod_id_or_null()               { return method_holder()->jmethod_id_or_null(this); }
 774 
 775   // Support for inlining of intrinsic methods
 776   vmIntrinsics::ID intrinsic_id() const          { return (vmIntrinsics::ID) _intrinsic_id;           }
 777   void     set_intrinsic_id(vmIntrinsics::ID id) {                           _intrinsic_id = (u2) id; }




 778 
 779   // Helper routines for intrinsic_id() and vmIntrinsics::method().
 780   void init_intrinsic_id();     // updates from _none if a match
 781   static vmSymbols::SID klass_id_for_intrinsics(Klass* holder);
 782 
 783   bool jfr_towrite() {
 784     return (_flags & _jfr_towrite) != 0;
 785   }
 786   void set_jfr_towrite(bool x) {
 787     _flags = x ? (_flags | _jfr_towrite) : (_flags & ~_jfr_towrite);
 788   }
 789 
 790   bool caller_sensitive() {
 791     return (_flags & _caller_sensitive) != 0;
 792   }
 793   void set_caller_sensitive(bool x) {
 794     _flags = x ? (_flags | _caller_sensitive) : (_flags & ~_caller_sensitive);
 795   }
 796 
 797   bool force_inline() {




  55 class AdapterHandlerEntry;
  56 class MethodData;
  57 class MethodCounters;
  58 class ConstMethod;
  59 class InlineTableSizes;
  60 class KlassSizeStats;
  61 
  62 class Method : public Metadata {
  63  friend class VMStructs;
  64  private:
  65   ConstMethod*      _constMethod;                // Method read-only data.
  66   MethodData*       _method_data;
  67   MethodCounters*   _method_counters;
  68   AccessFlags       _access_flags;               // Access flags
  69   int               _vtable_index;               // vtable index of this method (see VtableIndexFlag)
  70                                                  // note: can have vtables with >2**16 elements (because of inheritance)
  71 #ifdef CC_INTERP
  72   int               _result_index;               // C++ interpreter needs for converting results to/from stack
  73 #endif
  74   u2                _intrinsic_id;               // vmSymbols::intrinsic_id (0 == _none)
  75   u2                _accessor_field_name;
  76 
  77   // Flags
  78   enum Flags {
  79     _jfr_towrite          = 1 << 0,
  80     _caller_sensitive     = 1 << 1,
  81     _force_inline         = 1 << 2,
  82     _dont_inline          = 1 << 3,
  83     _hidden               = 1 << 4,
  84     _has_injected_profile = 1 << 5,
  85     _running_emcp         = 1 << 6,
  86     _intrinsic_candidate  = 1 << 7
  87   };
  88   u1 _flags;
  89 
  90 #ifndef PRODUCT
  91   int               _compiled_invocation_count;  // Number of nmethod invocations so far (for perf. debugging)
  92 #endif
  93   // Entry point for calling both from and to the interpreter.
  94   address _i2i_entry;           // All-args-on-stack calling convention
  95   // Adapter blob (i2c/c2i) for this Method*. Set once when method is linked.


 759   static bool is_method_id(jmethodID mid);
 760 
 761   // Clear methods
 762   static void clear_jmethod_ids(ClassLoaderData* loader_data);
 763   static void print_jmethod_ids(ClassLoaderData* loader_data, outputStream* out) PRODUCT_RETURN;
 764 
 765   // Get this method's jmethodID -- allocate if it doesn't exist
 766   jmethodID jmethod_id()                            { methodHandle this_h(this);
 767                                                       return InstanceKlass::get_jmethod_id(method_holder(), this_h); }
 768 
 769   // Lookup the jmethodID for this method.  Return NULL if not found.
 770   // NOTE that this function can be called from a signal handler
 771   // (see AsyncGetCallTrace support for Forte Analyzer) and this
 772   // needs to be async-safe. No allocation should be done and
 773   // so handles are not used to avoid deadlock.
 774   jmethodID find_jmethod_id_or_null()               { return method_holder()->jmethod_id_or_null(this); }
 775 
 776   // Support for inlining of intrinsic methods
 777   vmIntrinsics::ID intrinsic_id() const          { return (vmIntrinsics::ID) _intrinsic_id;           }
 778   void     set_intrinsic_id(vmIntrinsics::ID id) {                           _intrinsic_id = (u2) id; }
 779   
 780   // Accessor-Method
 781   u2 accessor_field_name()                    { return _accessor_field_name;              }
 782   void set_accessor_field_name(u2 field_name) {        _accessor_field_name = field_name; }
 783 
 784   // Helper routines for intrinsic_id() and vmIntrinsics::method().
 785   void init_intrinsic_id();     // updates from _none if a match
 786   static vmSymbols::SID klass_id_for_intrinsics(Klass* holder);
 787 
 788   bool jfr_towrite() {
 789     return (_flags & _jfr_towrite) != 0;
 790   }
 791   void set_jfr_towrite(bool x) {
 792     _flags = x ? (_flags | _jfr_towrite) : (_flags & ~_jfr_towrite);
 793   }
 794 
 795   bool caller_sensitive() {
 796     return (_flags & _caller_sensitive) != 0;
 797   }
 798   void set_caller_sensitive(bool x) {
 799     _flags = x ? (_flags | _caller_sensitive) : (_flags & ~_caller_sensitive);
 800   }
 801 
 802   bool force_inline() {


< prev index next >