< prev index next >

src/hotspot/share/classfile/classFileParser.cpp

Print this page




 645         verify_legal_class_name(class_name, CHECK);
 646         break;
 647       }
 648       case JVM_CONSTANT_NameAndType: {
 649         if (_need_verify) {
 650           const int sig_index = cp->signature_ref_index_at(index);
 651           const int name_index = cp->name_ref_index_at(index);
 652           const Symbol* const name = cp->symbol_at(name_index);
 653           const Symbol* const sig = cp->symbol_at(sig_index);
 654           guarantee_property(sig->utf8_length() != 0,
 655             "Illegal zero length constant pool entry at %d in class %s",
 656             sig_index, CHECK);
 657           guarantee_property(name->utf8_length() != 0,
 658             "Illegal zero length constant pool entry at %d in class %s",
 659             name_index, CHECK);
 660 
 661           if (sig->char_at(0) == JVM_SIGNATURE_FUNC) {
 662             // Format check method name and signature
 663             verify_legal_method_name(name, CHECK);
 664             verify_legal_method_signature(name, sig, CHECK);

 665           } else {
 666             // Format check field name and signature
 667             verify_legal_field_name(name, CHECK);
 668             verify_legal_field_signature(name, sig, CHECK);
 669           }
 670         }
 671         break;
 672       }
 673       case JVM_CONSTANT_Dynamic: {
 674         const int name_and_type_ref_index =
 675           cp->name_and_type_ref_index_at(index);
 676         // already verified to be utf8
 677         const int name_ref_index =
 678           cp->name_ref_index_at(name_and_type_ref_index);
 679         // already verified to be utf8
 680         const int signature_ref_index =
 681           cp->signature_ref_index_at(name_and_type_ref_index);
 682         const Symbol* const name = cp->symbol_at(name_ref_index);
 683         const Symbol* const signature = cp->symbol_at(signature_ref_index);
 684         if (_need_verify) {


5651       // print out the superclass.
5652       const char * from = ik->external_name();
5653       if (ik->java_super() != NULL) {
5654         log_debug(class, resolve)("%s %s (super)",
5655                    from,
5656                    ik->java_super()->external_name());
5657       }
5658       // print out each of the interface classes referred to by this class.
5659       const Array<InstanceKlass*>* const local_interfaces = ik->local_interfaces();
5660       if (local_interfaces != NULL) {
5661         const int length = local_interfaces->length();
5662         for (int i = 0; i < length; i++) {
5663           const InstanceKlass* const k = local_interfaces->at(i);
5664           const char * to = k->external_name();
5665           log_debug(class, resolve)("%s %s (interface)", from, to);
5666         }
5667       }
5668     }
5669   }
5670 


5671   JFR_ONLY(INIT_ID(ik);)
5672 
5673   // If we reach here, all is well.
5674   // Now remove the InstanceKlass* from the _klass_to_deallocate field
5675   // in order for it to not be destroyed in the ClassFileParser destructor.
5676   set_klass_to_deallocate(NULL);
5677 
5678   // it's official
5679   set_klass(ik);
5680 
5681   debug_only(ik->verify();)
5682 }
5683 
5684 void ClassFileParser::update_class_name(Symbol* new_class_name) {
5685   // Decrement the refcount in the old name, since we're clobbering it.
5686   _class_name->decrement_refcount();
5687 
5688   _class_name = new_class_name;
5689   // Increment the refcount of the new name.
5690   // Now the ClassFileParser owns this name and will decrement in


5780   _inner_classes(NULL),
5781   _nest_members(NULL),
5782   _nest_host(0),
5783   _local_interfaces(NULL),
5784   _transitive_interfaces(NULL),
5785   _combined_annotations(NULL),
5786   _annotations(NULL),
5787   _type_annotations(NULL),
5788   _fields_annotations(NULL),
5789   _fields_type_annotations(NULL),
5790   _klass(NULL),
5791   _klass_to_deallocate(NULL),
5792   _parsed_annotations(NULL),
5793   _fac(NULL),
5794   _field_info(NULL),
5795   _method_ordering(NULL),
5796   _all_mirandas(NULL),
5797   _vtable_size(0),
5798   _itable_size(0),
5799   _num_miranda_methods(0),

5800   _rt(REF_NONE),
5801   _protection_domain(protection_domain),
5802   _access_flags(),
5803   _pub_level(pub_level),
5804   _bad_constant_seen(0),
5805   _synthetic_flag(false),
5806   _sde_length(false),
5807   _sde_buffer(NULL),
5808   _sourcefile_index(0),
5809   _generic_signature_index(0),
5810   _major_version(0),
5811   _minor_version(0),
5812   _this_class_index(0),
5813   _super_class_index(0),
5814   _itfs_len(0),
5815   _java_fields_count(0),
5816   _need_verify(false),
5817   _relax_verify(false),
5818   _has_nonstatic_concrete_methods(false),
5819   _declares_nonstatic_concrete_methods(false),




 645         verify_legal_class_name(class_name, CHECK);
 646         break;
 647       }
 648       case JVM_CONSTANT_NameAndType: {
 649         if (_need_verify) {
 650           const int sig_index = cp->signature_ref_index_at(index);
 651           const int name_index = cp->name_ref_index_at(index);
 652           const Symbol* const name = cp->symbol_at(name_index);
 653           const Symbol* const sig = cp->symbol_at(sig_index);
 654           guarantee_property(sig->utf8_length() != 0,
 655             "Illegal zero length constant pool entry at %d in class %s",
 656             sig_index, CHECK);
 657           guarantee_property(name->utf8_length() != 0,
 658             "Illegal zero length constant pool entry at %d in class %s",
 659             name_index, CHECK);
 660 
 661           if (sig->char_at(0) == JVM_SIGNATURE_FUNC) {
 662             // Format check method name and signature
 663             verify_legal_method_name(name, CHECK);
 664             verify_legal_method_signature(name, sig, CHECK);
 665             _method_sig_count++;
 666           } else {
 667             // Format check field name and signature
 668             verify_legal_field_name(name, CHECK);
 669             verify_legal_field_signature(name, sig, CHECK);
 670           }
 671         }
 672         break;
 673       }
 674       case JVM_CONSTANT_Dynamic: {
 675         const int name_and_type_ref_index =
 676           cp->name_and_type_ref_index_at(index);
 677         // already verified to be utf8
 678         const int name_ref_index =
 679           cp->name_ref_index_at(name_and_type_ref_index);
 680         // already verified to be utf8
 681         const int signature_ref_index =
 682           cp->signature_ref_index_at(name_and_type_ref_index);
 683         const Symbol* const name = cp->symbol_at(name_ref_index);
 684         const Symbol* const signature = cp->symbol_at(signature_ref_index);
 685         if (_need_verify) {


5652       // print out the superclass.
5653       const char * from = ik->external_name();
5654       if (ik->java_super() != NULL) {
5655         log_debug(class, resolve)("%s %s (super)",
5656                    from,
5657                    ik->java_super()->external_name());
5658       }
5659       // print out each of the interface classes referred to by this class.
5660       const Array<InstanceKlass*>* const local_interfaces = ik->local_interfaces();
5661       if (local_interfaces != NULL) {
5662         const int length = local_interfaces->length();
5663         for (int i = 0; i < length; i++) {
5664           const InstanceKlass* const k = local_interfaces->at(i);
5665           const char * to = k->external_name();
5666           log_debug(class, resolve)("%s %s (interface)", from, to);
5667         }
5668       }
5669     }
5670   }
5671 
5672   ik->set_method_sig_count(_method_sig_count);
5673 
5674   JFR_ONLY(INIT_ID(ik);)
5675 
5676   // If we reach here, all is well.
5677   // Now remove the InstanceKlass* from the _klass_to_deallocate field
5678   // in order for it to not be destroyed in the ClassFileParser destructor.
5679   set_klass_to_deallocate(NULL);
5680 
5681   // it's official
5682   set_klass(ik);
5683 
5684   debug_only(ik->verify();)
5685 }
5686 
5687 void ClassFileParser::update_class_name(Symbol* new_class_name) {
5688   // Decrement the refcount in the old name, since we're clobbering it.
5689   _class_name->decrement_refcount();
5690 
5691   _class_name = new_class_name;
5692   // Increment the refcount of the new name.
5693   // Now the ClassFileParser owns this name and will decrement in


5783   _inner_classes(NULL),
5784   _nest_members(NULL),
5785   _nest_host(0),
5786   _local_interfaces(NULL),
5787   _transitive_interfaces(NULL),
5788   _combined_annotations(NULL),
5789   _annotations(NULL),
5790   _type_annotations(NULL),
5791   _fields_annotations(NULL),
5792   _fields_type_annotations(NULL),
5793   _klass(NULL),
5794   _klass_to_deallocate(NULL),
5795   _parsed_annotations(NULL),
5796   _fac(NULL),
5797   _field_info(NULL),
5798   _method_ordering(NULL),
5799   _all_mirandas(NULL),
5800   _vtable_size(0),
5801   _itable_size(0),
5802   _num_miranda_methods(0),
5803   _method_sig_count(0),
5804   _rt(REF_NONE),
5805   _protection_domain(protection_domain),
5806   _access_flags(),
5807   _pub_level(pub_level),
5808   _bad_constant_seen(0),
5809   _synthetic_flag(false),
5810   _sde_length(false),
5811   _sde_buffer(NULL),
5812   _sourcefile_index(0),
5813   _generic_signature_index(0),
5814   _major_version(0),
5815   _minor_version(0),
5816   _this_class_index(0),
5817   _super_class_index(0),
5818   _itfs_len(0),
5819   _java_fields_count(0),
5820   _need_verify(false),
5821   _relax_verify(false),
5822   _has_nonstatic_concrete_methods(false),
5823   _declares_nonstatic_concrete_methods(false),


< prev index next >