hotspot/src/share/vm/oops/method.hpp
changeset 33209 43d7a2139756
parent 32820 ec181adbf3b1
child 33230 23bb11a5cf4e
equal deleted inserted replaced
33206:da8c3575c076 33209:43d7a2139756
    69   int               _vtable_index;               // vtable index of this method (see VtableIndexFlag)
    69   int               _vtable_index;               // vtable index of this method (see VtableIndexFlag)
    70                                                  // note: can have vtables with >2**16 elements (because of inheritance)
    70                                                  // note: can have vtables with >2**16 elements (because of inheritance)
    71 #ifdef CC_INTERP
    71 #ifdef CC_INTERP
    72   int               _result_index;               // C++ interpreter needs for converting results to/from stack
    72   int               _result_index;               // C++ interpreter needs for converting results to/from stack
    73 #endif
    73 #endif
    74   u2                _method_size;                // size of this object
       
    75   u2                _intrinsic_id;               // vmSymbols::intrinsic_id (0 == _none)
    74   u2                _intrinsic_id;               // vmSymbols::intrinsic_id (0 == _none)
    76 
    75 
    77   // Flags
    76   // Flags
    78   enum Flags {
    77   enum Flags {
    79     _jfr_towrite          = 1 << 0,
    78     _jfr_towrite          = 1 << 0,
   104   // NULL only at safepoints (because of a de-opt).
   103   // NULL only at safepoints (because of a de-opt).
   105   nmethod* volatile _code;                       // Points to the corresponding piece of native code
   104   nmethod* volatile _code;                       // Points to the corresponding piece of native code
   106   volatile address           _from_interpreted_entry; // Cache of _code ? _adapter->i2c_entry() : _i2i_entry
   105   volatile address           _from_interpreted_entry; // Cache of _code ? _adapter->i2c_entry() : _i2i_entry
   107 
   106 
   108   // Constructor
   107   // Constructor
   109   Method(ConstMethod* xconst, AccessFlags access_flags, int size);
   108   Method(ConstMethod* xconst, AccessFlags access_flags);
   110  public:
   109  public:
   111 
   110 
   112   static Method* allocate(ClassLoaderData* loader_data,
   111   static Method* allocate(ClassLoaderData* loader_data,
   113                           int byte_code_size,
   112                           int byte_code_size,
   114                           AccessFlags access_flags,
   113                           AccessFlags access_flags,
   239   void set_orig_method_idnum(u2 idnum)   { constMethod()->set_orig_method_idnum(idnum); }
   238   void set_orig_method_idnum(u2 idnum)   { constMethod()->set_orig_method_idnum(idnum); }
   240 
   239 
   241   // code size
   240   // code size
   242   int code_size() const                  { return constMethod()->code_size(); }
   241   int code_size() const                  { return constMethod()->code_size(); }
   243 
   242 
   244   // method size
   243   // method size in words
   245   int method_size() const                        { return _method_size; }
   244   int method_size() const                { return sizeof(Method)/wordSize + is_native() ? 2 : 0; }
   246   void set_method_size(int size) {
       
   247     assert(0 <= size && size < (1 << 16), "invalid method size");
       
   248     _method_size = size;
       
   249   }
       
   250 
   245 
   251   // constant pool for Klass* holding this method
   246   // constant pool for Klass* holding this method
   252   ConstantPool* constants() const              { return constMethod()->constants(); }
   247   ConstantPool* constants() const              { return constMethod()->constants(); }
   253   void set_constants(ConstantPool* c)          { constMethod()->set_constants(c); }
   248   void set_constants(ConstantPool* c)          { constMethod()->set_constants(c); }
   254 
   249