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

JvmtiEnv::SetBreakpoint and JvmtiEnv::ClearBreakpoint might not work with anonymous classes

    XMLWordPrintable

    Details

    • Subcomponent:
      svc
    • Resolved In Build:
      b58

      Backports

        Description

        The methods JvmtiEnv::SetBreakpoint and JvmtiEnv::ClearBreakpoint take a Method* (pointer to Method) as parameter. Both methods are currently using an oop to the class loader to keep the Method's class alive. However, for anonymous classes, keeping an oop to the class loader is not sufficient to keep the class alive. For anonymous classes, one must keep an oop the Java mirror of the class.

        Coleen suggested using the following method:

           // oop that keeps the metadata for this class from being unloaded
           // in places where the metadata is stored in other places, like nmethods
           oop klass_holder() const {
             return is_anonymous() ? java_mirror() : class_loader();
           }

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                coleenp Coleen Phillimore
                Reporter:
                ehelin Erik Helin
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: