src/share/vm/classfile/classFileParser.cpp

changeset 4398
ade95d680b42
parent 4393
35431a769282
child 4422
adc176e95bf2
child 4454
ff0a7943fd29
     1.1 --- a/src/share/vm/classfile/classFileParser.cpp	Mon Jan 07 15:32:51 2013 -0500
     1.2 +++ b/src/share/vm/classfile/classFileParser.cpp	Tue Jan 08 14:01:36 2013 -0500
     1.3 @@ -1935,6 +1935,8 @@
     1.4    u2** localvariable_table_start;
     1.5    u2* localvariable_type_table_length;
     1.6    u2** localvariable_type_table_start;
     1.7 +  u2 method_parameters_length = 0;
     1.8 +  u1* method_parameters_data = NULL;
     1.9    bool parsed_code_attribute = false;
    1.10    bool parsed_checked_exceptions_attribute = false;
    1.11    bool parsed_stackmap_attribute = false;
    1.12 @@ -2144,6 +2146,14 @@
    1.13              parse_checked_exceptions(&checked_exceptions_length,
    1.14                                       method_attribute_length,
    1.15                                       cp, CHECK_(nullHandle));
    1.16 +    } else if (method_attribute_name == vmSymbols::tag_method_parameters()) {
    1.17 +      method_parameters_length = cfs->get_u1_fast();
    1.18 +      method_parameters_data = cfs->get_u1_buffer();
    1.19 +      cfs->skip_u2_fast(method_parameters_length);
    1.20 +      cfs->skip_u4_fast(method_parameters_length);
    1.21 +      // ignore this attribute if it cannot be reflected
    1.22 +      if (!SystemDictionary::Parameter_klass_loaded())
    1.23 +        method_parameters_length = 0;
    1.24      } else if (method_attribute_name == vmSymbols::tag_synthetic()) {
    1.25        if (method_attribute_length != 0) {
    1.26          classfile_parse_error(
    1.27 @@ -2231,7 +2241,8 @@
    1.28    Method* m = Method::allocate(
    1.29        loader_data, code_length, access_flags, linenumber_table_length,
    1.30        total_lvt_length, exception_table_length, checked_exceptions_length,
    1.31 -      generic_signature_index, ConstMethod::NORMAL, CHECK_(nullHandle));
    1.32 +      method_parameters_length, generic_signature_index,
    1.33 +      ConstMethod::NORMAL, CHECK_(nullHandle));
    1.34  
    1.35    ClassLoadingService::add_class_method_size(m->size()*HeapWordSize);
    1.36  
    1.37 @@ -2279,6 +2290,18 @@
    1.38                               exception_table_start, size);
    1.39    }
    1.40  
    1.41 +  // Copy method parameters
    1.42 +  if (method_parameters_length > 0) {
    1.43 +    MethodParametersElement* elem = m->constMethod()->method_parameters_start();
    1.44 +    for(int i = 0; i < method_parameters_length; i++) {
    1.45 +      elem[i].name_cp_index =
    1.46 +        Bytes::get_Java_u2(method_parameters_data);
    1.47 +      method_parameters_data += 2;
    1.48 +      elem[i].flags = Bytes::get_Java_u4(method_parameters_data);
    1.49 +      method_parameters_data += 4;
    1.50 +    }
    1.51 +  }
    1.52 +
    1.53    // Copy checked exceptions
    1.54    if (checked_exceptions_length > 0) {
    1.55      int size = checked_exceptions_length * sizeof(CheckedExceptionElement) / sizeof(u2);
    1.56 @@ -3042,6 +3065,7 @@
    1.57                                                      TempNewSymbol& parsed_name,
    1.58                                                      bool verify,
    1.59                                                      TRAPS) {
    1.60 +
    1.61    // When a retransformable agent is attached, JVMTI caches the
    1.62    // class bytes that existed before the first retransformation.
    1.63    // If RedefineClasses() was used before the retransformable

mercurial