hotspot/src/share/vm/oops/method.hpp
changeset 15601 df8faef6efaf
parent 15595 54a3423a504f
child 15744 fd58c7e770b3
equal deleted inserted replaced
15600:753e5733b5c9 15601:df8faef6efaf
    99 class CheckedExceptionElement;
    99 class CheckedExceptionElement;
   100 class LocalVariableTableElement;
   100 class LocalVariableTableElement;
   101 class AdapterHandlerEntry;
   101 class AdapterHandlerEntry;
   102 class MethodData;
   102 class MethodData;
   103 class ConstMethod;
   103 class ConstMethod;
       
   104 class InlineTableSizes;
   104 class KlassSizeStats;
   105 class KlassSizeStats;
   105 
   106 
   106 class Method : public Metadata {
   107 class Method : public Metadata {
   107  friend class VMStructs;
   108  friend class VMStructs;
   108  private:
   109  private:
   155  public:
   156  public:
   156 
   157 
   157   static Method* allocate(ClassLoaderData* loader_data,
   158   static Method* allocate(ClassLoaderData* loader_data,
   158                           int byte_code_size,
   159                           int byte_code_size,
   159                           AccessFlags access_flags,
   160                           AccessFlags access_flags,
   160                           int compressed_line_number_size,
   161                           InlineTableSizes* sizes,
   161                           int localvariable_table_length,
       
   162                           int exception_table_length,
       
   163                           int checked_exceptions_length,
       
   164                           int method_parameters_length,
       
   165                           u2 generic_signature_index,
       
   166                           ConstMethod::MethodType method_type,
   162                           ConstMethod::MethodType method_type,
   167                           TRAPS);
   163                           TRAPS);
   168 
   164 
   169   // CDS and vtbl checking can create an empty Method to get vtbl pointer.
   165   // CDS and vtbl checking can create an empty Method to get vtbl pointer.
   170   Method(){}
   166   Method(){}
   205   int generic_signature_index() const            { return constMethod()->generic_signature_index(); }
   201   int generic_signature_index() const            { return constMethod()->generic_signature_index(); }
   206   void set_generic_signature_index(int index)    { constMethod()->set_generic_signature_index(index); }
   202   void set_generic_signature_index(int index)    { constMethod()->set_generic_signature_index(index); }
   207 
   203 
   208   // annotations support
   204   // annotations support
   209   AnnotationArray* annotations() const           {
   205   AnnotationArray* annotations() const           {
   210     InstanceKlass* ik = method_holder();
   206     return constMethod()->method_annotations();
   211     if (ik->annotations() == NULL) {
       
   212       return NULL;
       
   213     }
       
   214     return ik->annotations()->get_method_annotations_of(method_idnum());
       
   215   }
   207   }
   216   AnnotationArray* parameter_annotations() const {
   208   AnnotationArray* parameter_annotations() const {
   217     InstanceKlass* ik = method_holder();
   209     return constMethod()->parameter_annotations();
   218     if (ik->annotations() == NULL) {
       
   219       return NULL;
       
   220     }
       
   221     return ik->annotations()->get_method_parameter_annotations_of(method_idnum());
       
   222   }
   210   }
   223   AnnotationArray* annotation_default() const    {
   211   AnnotationArray* annotation_default() const    {
   224     InstanceKlass* ik = method_holder();
   212     return constMethod()->default_annotations();
   225     if (ik->annotations() == NULL) {
   213   }
   226       return NULL;
   214   AnnotationArray* type_annotations() const      {
   227     }
   215     return constMethod()->type_annotations();
   228     return ik->annotations()->get_method_default_annotations_of(method_idnum());
   216   }
   229   }
       
   230   AnnotationArray* type_annotations() const {
       
   231   InstanceKlass* ik = method_holder();
       
   232   Annotations* type_annos = ik->type_annotations();
       
   233   if (type_annos == NULL)
       
   234     return NULL;
       
   235   return type_annos->get_method_annotations_of(method_idnum());
       
   236 }
       
   237 
   217 
   238 #ifdef CC_INTERP
   218 #ifdef CC_INTERP
   239   void set_result_index(BasicType type);
   219   void set_result_index(BasicType type);
   240   int  result_index()                            { return _result_index; }
   220   int  result_index()                            { return _result_index; }
   241 #endif
   221 #endif
   437 
   417 
   438   // interpreter entry
   418   // interpreter entry
   439   address interpreter_entry() const              { return _i2i_entry; }
   419   address interpreter_entry() const              { return _i2i_entry; }
   440   // Only used when first initialize so we can set _i2i_entry and _from_interpreted_entry
   420   // Only used when first initialize so we can set _i2i_entry and _from_interpreted_entry
   441   void set_interpreter_entry(address entry)      { _i2i_entry = entry;  _from_interpreted_entry = entry; }
   421   void set_interpreter_entry(address entry)      { _i2i_entry = entry;  _from_interpreted_entry = entry; }
   442   int  interpreter_kind(void) {
       
   443      return constMethod()->interpreter_kind();
       
   444   }
       
   445   void set_interpreter_kind();
       
   446   void set_interpreter_kind(int kind) {
       
   447     constMethod()->set_interpreter_kind(kind);
       
   448   }
       
   449 
   422 
   450   // native function (used for native methods only)
   423   // native function (used for native methods only)
   451   enum {
   424   enum {
   452     native_bind_event_is_interesting = true
   425     native_bind_event_is_interesting = true
   453   };
   426   };
   806 #else
   779 #else
   807   void print_name(outputStream* st = tty)        PRODUCT_RETURN; // prints as "virtual void foo(int)"
   780   void print_name(outputStream* st = tty)        PRODUCT_RETURN; // prints as "virtual void foo(int)"
   808 #endif
   781 #endif
   809 
   782 
   810   // Helper routine used for method sorting
   783   // Helper routine used for method sorting
   811   static void sort_methods(Array<Method*>* methods,
   784   static void sort_methods(Array<Method*>* methods, bool idempotent = false);
   812                            Array<AnnotationArray*>* methods_annotations,
       
   813                            Array<AnnotationArray*>* methods_parameter_annotations,
       
   814                            Array<AnnotationArray*>* methods_default_annotations,
       
   815                            Array<AnnotationArray*>* methods_type_annotations,
       
   816                            bool idempotent = false);
       
   817 
   785 
   818   // Deallocation function for redefine classes or if an error occurs
   786   // Deallocation function for redefine classes or if an error occurs
   819   void deallocate_contents(ClassLoaderData* loader_data);
   787   void deallocate_contents(ClassLoaderData* loader_data);
   820 
   788 
   821   // Printing
   789   // Printing