src/share/vm/oops/constMethod.hpp

changeset 4398
ade95d680b42
parent 4338
fd74228fd5ca
child 4431
f9eb431c3efe
     1.1 --- a/src/share/vm/oops/constMethod.hpp	Mon Jan 07 15:32:51 2013 -0500
     1.2 +++ b/src/share/vm/oops/constMethod.hpp	Tue Jan 08 14:01:36 2013 -0500
     1.3 @@ -77,9 +77,18 @@
     1.4  // |  (access flags bit tells whether table is present)   |
     1.5  // |  (indexed from end of ConstMethod*)                  |
     1.6  // |------------------------------------------------------|
     1.7 +// | method parameters elements + length (length last)    |
     1.8 +// |  (length is u2, elements are u2, u4 structures)      |
     1.9 +// |  (see class MethodParametersElement)                 |
    1.10 +// |  (access flags bit tells whether table is present)   |
    1.11 +// |  (indexed from end of ConstMethod*)                  |
    1.12 +// |------------------------------------------------------|
    1.13  // | generic signature index (u2)                         |
    1.14  // |  (indexed from start of constMethodOop)              |
    1.15  // |------------------------------------------------------|
    1.16 +//
    1.17 +// IMPORTANT: If anything gets added here, there need to be changes to
    1.18 +// ensure that ServicabilityAgent doesn't get broken as a result!
    1.19  
    1.20  
    1.21  // Utitily class decribing elements in checked exceptions table inlined in Method*.
    1.22 @@ -109,6 +118,13 @@
    1.23    u2 catch_type_index;
    1.24  };
    1.25  
    1.26 +// Utility class describing elements in method parameters
    1.27 +class MethodParametersElement VALUE_OBJ_CLASS_SPEC {
    1.28 + public:
    1.29 +  u2 name_cp_index;
    1.30 +  u4 flags;
    1.31 +};
    1.32 +
    1.33  
    1.34  class ConstMethod : public MetaspaceObj {
    1.35    friend class VMStructs;
    1.36 @@ -123,7 +139,8 @@
    1.37      _has_localvariable_table = 4,
    1.38      _has_exception_table = 8,
    1.39      _has_generic_signature = 16,
    1.40 -    _is_overpass = 32
    1.41 +    _has_method_parameters = 32,
    1.42 +    _is_overpass = 64
    1.43    };
    1.44  
    1.45    // Bit vector of signature
    1.46 @@ -160,6 +177,7 @@
    1.47                int localvariable_table_length,
    1.48                int exception_table_length,
    1.49                int checked_exceptions_length,
    1.50 +              int method_parameters_length,
    1.51                u2  generic_signature_index,
    1.52                MethodType is_overpass,
    1.53                int size);
    1.54 @@ -171,6 +189,7 @@
    1.55                                 int localvariable_table_length,
    1.56                                 int exception_table_length,
    1.57                                 int checked_exceptions_length,
    1.58 +                               int method_parameters_length,
    1.59                                 u2  generic_signature_index,
    1.60                                 MethodType mt,
    1.61                                 TRAPS);
    1.62 @@ -182,7 +201,8 @@
    1.63                                   int checked_exceptions_len,
    1.64                                   int compressed_line_number_size,
    1.65                                   int localvariable_table_len,
    1.66 -                                 int exception_table_len);
    1.67 +                                 int exception_table_len,
    1.68 +                                 int method_parameters_length);
    1.69  
    1.70    bool has_generic_signature() const
    1.71      { return (_flags & _has_generic_signature) != 0; }
    1.72 @@ -199,6 +219,9 @@
    1.73    bool has_exception_handler() const
    1.74      { return (_flags & _has_exception_table) != 0; }
    1.75  
    1.76 +  bool has_method_parameters() const
    1.77 +    { return (_flags & _has_method_parameters) != 0; }
    1.78 +
    1.79    MethodType method_type() const {
    1.80      return ((_flags & _is_overpass) == 0) ? NORMAL : OVERPASS;
    1.81    }
    1.82 @@ -284,10 +307,11 @@
    1.83  
    1.84    // Size needed
    1.85    static int size(int code_size, int compressed_line_number_size,
    1.86 -                         int local_variable_table_length,
    1.87 -                         int exception_table_length,
    1.88 -                         int checked_exceptions_length,
    1.89 -                         u2  generic_signature_index);
    1.90 +                  int local_variable_table_length,
    1.91 +                  int exception_table_length,
    1.92 +                  int checked_exceptions_length,
    1.93 +                  int method_parameters_length,
    1.94 +                  u2  generic_signature_index);
    1.95  
    1.96    int size() const                    { return _constMethod_size;}
    1.97    void set_constMethod_size(int size)     { _constMethod_size = size; }
    1.98 @@ -308,6 +332,7 @@
    1.99    u2* checked_exceptions_length_addr() const;
   1.100    u2* localvariable_table_length_addr() const;
   1.101    u2* exception_table_length_addr() const;
   1.102 +  u2* method_parameters_length_addr() const;
   1.103  
   1.104    // checked exceptions
   1.105    int checked_exceptions_length() const;
   1.106 @@ -321,6 +346,10 @@
   1.107    int exception_table_length() const;
   1.108    ExceptionTableElement* exception_table_start() const;
   1.109  
   1.110 +  // method parameters table
   1.111 +  int method_parameters_length() const;
   1.112 +  MethodParametersElement* method_parameters_start() const;
   1.113 +
   1.114    // byte codes
   1.115    void    set_code(address code) {
   1.116      if (code_size() > 0) {

mercurial