hotspot/src/share/vm/classfile/classFileParser.cpp
changeset 19681 1b35da7b1d85
parent 19326 14cb6cf26a96
child 19770 7cb9f982ea81
child 19954 1642109d1a2c
equal deleted inserted replaced
19545:409c50cf1e5d 19681:1b35da7b1d85
    26 #include "classfile/classFileParser.hpp"
    26 #include "classfile/classFileParser.hpp"
    27 #include "classfile/classLoader.hpp"
    27 #include "classfile/classLoader.hpp"
    28 #include "classfile/classLoaderData.hpp"
    28 #include "classfile/classLoaderData.hpp"
    29 #include "classfile/classLoaderData.inline.hpp"
    29 #include "classfile/classLoaderData.inline.hpp"
    30 #include "classfile/defaultMethods.hpp"
    30 #include "classfile/defaultMethods.hpp"
    31 #include "classfile/genericSignatures.hpp"
       
    32 #include "classfile/javaClasses.hpp"
    31 #include "classfile/javaClasses.hpp"
    33 #include "classfile/symbolTable.hpp"
    32 #include "classfile/symbolTable.hpp"
    34 #include "classfile/systemDictionary.hpp"
    33 #include "classfile/systemDictionary.hpp"
    35 #include "classfile/verificationType.hpp"
    34 #include "classfile/verificationType.hpp"
    36 #include "classfile/verifier.hpp"
    35 #include "classfile/verifier.hpp"
  3037     }
  3036     }
  3038   }
  3037   }
  3039   return annotations;
  3038   return annotations;
  3040 }
  3039 }
  3041 
  3040 
  3042 
       
  3043 #ifdef ASSERT
       
  3044 static void parseAndPrintGenericSignatures(
       
  3045     instanceKlassHandle this_klass, TRAPS) {
       
  3046   assert(ParseAllGenericSignatures == true, "Shouldn't call otherwise");
       
  3047   ResourceMark rm;
       
  3048 
       
  3049   if (this_klass->generic_signature() != NULL) {
       
  3050     using namespace generic;
       
  3051     ClassDescriptor* spec = ClassDescriptor::parse_generic_signature(this_klass(), CHECK);
       
  3052 
       
  3053     tty->print_cr("Parsing %s", this_klass->generic_signature()->as_C_string());
       
  3054     spec->print_on(tty);
       
  3055 
       
  3056     for (int i = 0; i < this_klass->methods()->length(); ++i) {
       
  3057       Method* m = this_klass->methods()->at(i);
       
  3058       MethodDescriptor* method_spec = MethodDescriptor::parse_generic_signature(m, spec);
       
  3059       Symbol* sig = m->generic_signature();
       
  3060       if (sig == NULL) {
       
  3061         sig = m->signature();
       
  3062       }
       
  3063       tty->print_cr("Parsing %s", sig->as_C_string());
       
  3064       method_spec->print_on(tty);
       
  3065     }
       
  3066   }
       
  3067 }
       
  3068 #endif // def ASSERT
       
  3069 
       
  3070 
       
  3071 instanceKlassHandle ClassFileParser::parse_super_class(int super_class_index,
  3041 instanceKlassHandle ClassFileParser::parse_super_class(int super_class_index,
  3072                                                        TRAPS) {
  3042                                                        TRAPS) {
  3073   instanceKlassHandle super_klass;
  3043   instanceKlassHandle super_klass;
  3074   if (super_class_index == 0) {
  3044   if (super_class_index == 0) {
  3075     check_property(_class_name == vmSymbols::java_lang_Object(),
  3045     check_property(_class_name == vmSymbols::java_lang_Object(),
  4058 
  4028 
  4059     // Allocate mirror and initialize static fields
  4029     // Allocate mirror and initialize static fields
  4060     java_lang_Class::create_mirror(this_klass, protection_domain, CHECK_(nullHandle));
  4030     java_lang_Class::create_mirror(this_klass, protection_domain, CHECK_(nullHandle));
  4061 
  4031 
  4062 
  4032 
  4063 #ifdef ASSERT
       
  4064     if (ParseAllGenericSignatures) {
       
  4065       parseAndPrintGenericSignatures(this_klass, CHECK_(nullHandle));
       
  4066     }
       
  4067 #endif
       
  4068 
       
  4069     // Generate any default methods - default methods are interface methods
  4033     // Generate any default methods - default methods are interface methods
  4070     // that have a default implementation.  This is new with Lambda project.
  4034     // that have a default implementation.  This is new with Lambda project.
  4071     if (has_default_methods && !access_flags.is_interface() &&
  4035     if (has_default_methods && !access_flags.is_interface() &&
  4072         local_interfaces->length() > 0) {
  4036         local_interfaces->length() > 0) {
  4073       DefaultMethods::generate_default_methods(
  4037       DefaultMethods::generate_default_methods(