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

Replace InstanceKlass::allocate_instance_handle with JavaCalls::construct_new_instance

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 11
    • None
    • hotspot
    • None
    • b15

        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.

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

                Created:
                Updated:
                Resolved: