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

Replace InstanceKlass::allocate_instance_handle with JavaCalls::construct_new_instance

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 11
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b15

      Backports

        Description

        There's a lot of boilerplate code, e.g.;
        http://hg.openjdk.java.net/jdk/jdk/file/bd3e4517dfa3/src/hotspot/share/services/attachListener.cpp#l418

        instanceHandle thread_oop = klass->allocate_instance_handle(THREAD);
        ....
          JavaValue result(T_VOID);
          JavaCalls::call_special(&result, thread_oop,
                               klass,
                               vmSymbols::object_initializer_name(),
                               vmSymbols::threadgroup_string_void_signature(),
                               thread_group,
                               string,
                               THREAD);

        It's better to replace this code with new JavaCalls::construct_new_instance API introduced in JDK-8189140.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                iklam Ioi Lam
                Reporter:
                iklam Ioi Lam
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: