Replace InstanceKlass::allocate_instance_handle with JavaCalls::construct_new_instance

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 11
    • Affects Version/s: None
    • Component/s: 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.

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

                Created:
                Updated:
                Resolved: