Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8059595

Verifier::verify is wasting time before is_eligible_for_verification check

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8u20, 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b36
    • Verification:
      Not verified

      Backports

        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)) {

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  shade Aleksey Shipilev
                  Reporter:
                  shade Aleksey Shipilev
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: