< prev index next >

src/hotspot/share/classfile/verifier.cpp

Print this page




 113   // print in a single call to reduce interleaving between threads
 114   if (source_file != NULL) {
 115     log_debug(class, resolve)("%s %s %s (verification)", verify, resolve, source_file);
 116   } else {
 117     log_debug(class, resolve)("%s %s (verification)", verify, resolve);
 118   }
 119 }
 120 
 121 // Prints the end-verification message to the appropriate output.
 122 void Verifier::log_end_verification(outputStream* st, const char* klassName, Symbol* exception_name, TRAPS) {
 123   if (HAS_PENDING_EXCEPTION) {
 124     st->print("Verification for %s has", klassName);
 125     st->print_cr(" exception pending %s ",
 126                  PENDING_EXCEPTION->klass()->external_name());
 127   } else if (exception_name != NULL) {
 128     st->print_cr("Verification for %s failed", klassName);
 129   }
 130   st->print_cr("End class verification for: %s", klassName);
 131 }
 132 
 133 bool Verifier::verify(InstanceKlass* klass, Verifier::Mode mode, bool should_verify_class, TRAPS) {
 134   HandleMark hm(THREAD);
 135   ResourceMark rm(THREAD);
 136 
 137   // Eagerly allocate the identity hash code for a klass. This is a fallout
 138   // from 6320749 and 8059924: hash code generator is not supposed to be called
 139   // during the safepoint, but it allows to sneak the hashcode in during
 140   // verification. Without this eager hashcode generation, we may end up
 141   // installing the hashcode during some other operation, which may be at
 142   // safepoint -- blowing up the checks. It was previously done as the side
 143   // effect (sic!) for external_name(), but instead of doing that, we opt to
 144   // explicitly push the hashcode in here. This is signify the following block
 145   // is IMPORTANT:
 146   if (klass->java_mirror() != NULL) {
 147     klass->java_mirror()->identity_hash();
 148   }
 149 
 150   if (!is_eligible_for_verification(klass, should_verify_class)) {
 151     return true;
 152   }
 153 




 113   // print in a single call to reduce interleaving between threads
 114   if (source_file != NULL) {
 115     log_debug(class, resolve)("%s %s %s (verification)", verify, resolve, source_file);
 116   } else {
 117     log_debug(class, resolve)("%s %s (verification)", verify, resolve);
 118   }
 119 }
 120 
 121 // Prints the end-verification message to the appropriate output.
 122 void Verifier::log_end_verification(outputStream* st, const char* klassName, Symbol* exception_name, TRAPS) {
 123   if (HAS_PENDING_EXCEPTION) {
 124     st->print("Verification for %s has", klassName);
 125     st->print_cr(" exception pending %s ",
 126                  PENDING_EXCEPTION->klass()->external_name());
 127   } else if (exception_name != NULL) {
 128     st->print_cr("Verification for %s failed", klassName);
 129   }
 130   st->print_cr("End class verification for: %s", klassName);
 131 }
 132 
 133 bool Verifier::verify(InstanceKlass* klass, bool should_verify_class, TRAPS) {
 134   HandleMark hm(THREAD);
 135   ResourceMark rm(THREAD);
 136 
 137   // Eagerly allocate the identity hash code for a klass. This is a fallout
 138   // from 6320749 and 8059924: hash code generator is not supposed to be called
 139   // during the safepoint, but it allows to sneak the hashcode in during
 140   // verification. Without this eager hashcode generation, we may end up
 141   // installing the hashcode during some other operation, which may be at
 142   // safepoint -- blowing up the checks. It was previously done as the side
 143   // effect (sic!) for external_name(), but instead of doing that, we opt to
 144   // explicitly push the hashcode in here. This is signify the following block
 145   // is IMPORTANT:
 146   if (klass->java_mirror() != NULL) {
 147     klass->java_mirror()->identity_hash();
 148   }
 149 
 150   if (!is_eligible_for_verification(klass, should_verify_class)) {
 151     return true;
 152   }
 153 


< prev index next >