src/share/vm/classfile/classFileParser.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 6642881_8u40_hotspot Sdiff src/share/vm/classfile

src/share/vm/classfile/classFileParser.cpp

Print this page
rev 6604 : 6642881: Improve performance of Class.getClassLoader()
Summary: Add classLoader to java/lang/Class instance for fast access
Reviewed-by: alanb, lfoltan, rriggs, vlivanov, twisti, jfranck


4121     this_klass->set_modifier_flags(computed_modifiers);
4122 
4123     // check if this class can access its super class
4124     check_super_class_access(this_klass, CHECK_(nullHandle));
4125 
4126     // check if this class can access its superinterfaces
4127     check_super_interface_access(this_klass, CHECK_(nullHandle));
4128 
4129     // check if this class overrides any final method
4130     check_final_method_override(this_klass, CHECK_(nullHandle));
4131 
4132     // check that if this class is an interface then it doesn't have static methods
4133     if (this_klass->is_interface()) {
4134       /* An interface in a JAVA 8 classfile can be static */
4135       if (_major_version < JAVA_8_VERSION) {
4136         check_illegal_static_method(this_klass, CHECK_(nullHandle));
4137       }
4138     }
4139 
4140     // Allocate mirror and initialize static fields
4141     java_lang_Class::create_mirror(this_klass, protection_domain, CHECK_(nullHandle));
4142 
4143 
4144     // Generate any default methods - default methods are interface methods
4145     // that have a default implementation.  This is new with Lambda project.
4146     if (has_default_methods ) {
4147       DefaultMethods::generate_default_methods(
4148           this_klass(), &all_mirandas, CHECK_(nullHandle));
4149     }
4150 
4151     // Update the loader_data graph.
4152     record_defined_class_dependencies(this_klass, CHECK_NULL);
4153 
4154     ClassLoadingService::notify_class_loaded(InstanceKlass::cast(this_klass()),
4155                                              false /* not shared class */);
4156 
4157     if (TraceClassLoading) {
4158       ResourceMark rm;
4159       // print in a single call to reduce interleaving of output
4160       if (cfs->source() != NULL) {
4161         tty->print("[Loaded %s from %s]\n", this_klass->external_name(),
4162                    cfs->source());




4121     this_klass->set_modifier_flags(computed_modifiers);
4122 
4123     // check if this class can access its super class
4124     check_super_class_access(this_klass, CHECK_(nullHandle));
4125 
4126     // check if this class can access its superinterfaces
4127     check_super_interface_access(this_klass, CHECK_(nullHandle));
4128 
4129     // check if this class overrides any final method
4130     check_final_method_override(this_klass, CHECK_(nullHandle));
4131 
4132     // check that if this class is an interface then it doesn't have static methods
4133     if (this_klass->is_interface()) {
4134       /* An interface in a JAVA 8 classfile can be static */
4135       if (_major_version < JAVA_8_VERSION) {
4136         check_illegal_static_method(this_klass, CHECK_(nullHandle));
4137       }
4138     }
4139 
4140     // Allocate mirror and initialize static fields
4141     java_lang_Class::create_mirror(this_klass, class_loader, protection_domain,
4142                                    CHECK_(nullHandle));
4143 
4144     // Generate any default methods - default methods are interface methods
4145     // that have a default implementation.  This is new with Lambda project.
4146     if (has_default_methods ) {
4147       DefaultMethods::generate_default_methods(
4148           this_klass(), &all_mirandas, CHECK_(nullHandle));
4149     }
4150 
4151     // Update the loader_data graph.
4152     record_defined_class_dependencies(this_klass, CHECK_NULL);
4153 
4154     ClassLoadingService::notify_class_loaded(InstanceKlass::cast(this_klass()),
4155                                              false /* not shared class */);
4156 
4157     if (TraceClassLoading) {
4158       ResourceMark rm;
4159       // print in a single call to reduce interleaving of output
4160       if (cfs->source() != NULL) {
4161         tty->print("[Loaded %s from %s]\n", this_klass->external_name(),
4162                    cfs->source());


src/share/vm/classfile/classFileParser.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File