JDK-8059595 : Verifier::verify is wasting time before is_eligible_for_verification check
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 8u20,9
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-10-02
  • Updated: 2015-06-03
  • Resolved: 2014-10-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b36Fixed
Related Reports
Relates :  
Description
On Unsafe.defineAnonymousClass-intensive benchmarks, you can see this branch in profiler:

  5.794   (12%)    InstanceKlass::link_class(Thread*)
    1.141   (2%)    Verifier::verify(instanceKlassHandle,Verifier::Mode,bool,Thread*)
      0.841   (2%)    Klass::external_name()const

Anonymous classes are not verified, but we do useless work before checking for that with is_eligible_for_verification:

 101   Symbol* exception_name = NULL;
 102   const size_t message_buffer_len = klass->name()->utf8_length() + 1024;
 103   char* message_buffer = NEW_RESOURCE_ARRAY(char, message_buffer_len);
 104   char* exception_message = message_buffer;
 105 
 106   const char* klassName = klass->external_name();
 107   bool can_failover = FailOverToOldVerifier &&
 108       klass->major_version() < NOFAILOVER_MAJOR_VERSION;
 109 
 110   // If the class should be verified, first see if we can use the split
 111   // verifier.  If not, or if verification fails and FailOverToOldVerifier
 112   // is set, then call the inference verifier.
 113   if (is_eligible_for_verification(klass, should_verify_class)) {
Comments
Suggested change: http://cr.openjdk.java.net/~shade/8059595/webrev.00/ Makes the entire Verify::verify branch to almost disappear from profiles.
02-10-2014