hotspot/src/share/vm/oops/constMethod.cpp
changeset 14385 959bbcc16725
parent 13728 882756847a04
child 14391 df0a1573d5bd
equal deleted inserted replaced
14289:aec758622b4b 14385:959bbcc16725
    32 // Static initialization
    32 // Static initialization
    33 const u2 ConstMethod::MAX_IDNUM   = 0xFFFE;
    33 const u2 ConstMethod::MAX_IDNUM   = 0xFFFE;
    34 const u2 ConstMethod::UNSET_IDNUM = 0xFFFF;
    34 const u2 ConstMethod::UNSET_IDNUM = 0xFFFF;
    35 
    35 
    36 ConstMethod* ConstMethod::allocate(ClassLoaderData* loader_data,
    36 ConstMethod* ConstMethod::allocate(ClassLoaderData* loader_data,
    37                                             int byte_code_size,
    37                                    int byte_code_size,
    38                                             int compressed_line_number_size,
    38                                    int compressed_line_number_size,
    39                                             int localvariable_table_length,
    39                                    int localvariable_table_length,
    40                                             int exception_table_length,
    40                                    int exception_table_length,
    41                                             int checked_exceptions_length,
    41                                    int checked_exceptions_length,
    42                                             TRAPS) {
    42                                    MethodType method_type,
       
    43                                    TRAPS) {
    43   int size = ConstMethod::size(byte_code_size,
    44   int size = ConstMethod::size(byte_code_size,
    44                                       compressed_line_number_size,
    45                                       compressed_line_number_size,
    45                                       localvariable_table_length,
    46                                       localvariable_table_length,
    46                                       exception_table_length,
    47                                       exception_table_length,
    47                                       checked_exceptions_length);
    48                                       checked_exceptions_length);
    48   return new (loader_data, size, true, THREAD) ConstMethod(
    49   return new (loader_data, size, true, THREAD) ConstMethod(
    49                        byte_code_size, compressed_line_number_size,
    50       byte_code_size, compressed_line_number_size, localvariable_table_length,
    50                        localvariable_table_length, exception_table_length,
    51       exception_table_length, checked_exceptions_length, method_type, size);
    51                        checked_exceptions_length, size);
       
    52 }
    52 }
    53 
    53 
    54 ConstMethod::ConstMethod(int byte_code_size,
    54 ConstMethod::ConstMethod(int byte_code_size,
    55                                        int compressed_line_number_size,
    55                          int compressed_line_number_size,
    56                                        int localvariable_table_length,
    56                          int localvariable_table_length,
    57                                        int exception_table_length,
    57                          int exception_table_length,
    58                                        int checked_exceptions_length,
    58                          int checked_exceptions_length,
    59                                        int size) {
    59                          MethodType method_type,
       
    60                          int size) {
    60 
    61 
    61   No_Safepoint_Verifier no_safepoint;
    62   No_Safepoint_Verifier no_safepoint;
    62   set_interpreter_kind(Interpreter::invalid);
    63   set_interpreter_kind(Interpreter::invalid);
    63   init_fingerprint();
    64   init_fingerprint();
    64   set_constants(NULL);
    65   set_constants(NULL);
    67   set_constMethod_size(size);
    68   set_constMethod_size(size);
    68   set_inlined_tables_length(checked_exceptions_length,
    69   set_inlined_tables_length(checked_exceptions_length,
    69                             compressed_line_number_size,
    70                             compressed_line_number_size,
    70                             localvariable_table_length,
    71                             localvariable_table_length,
    71                             exception_table_length);
    72                             exception_table_length);
       
    73   set_method_type(method_type);
    72   assert(this->size() == size, "wrong size for object");
    74   assert(this->size() == size, "wrong size for object");
    73 }
    75 }
    74 
    76 
    75 
    77 
    76 // Deallocate metadata fields associated with ConstMethod*
    78 // Deallocate metadata fields associated with ConstMethod*