RFR: 8258192: Obsolete the CriticalJNINatives flag

Aleksey Shipilev shade at openjdk.java.net
Thu Nov 11 07:27:39 UTC 2021


On Wed, 10 Nov 2021 22:06:05 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

> This change removes the disabled CriticalJNINatives code, and the flag now gives an obsolete message.
> Tested with tier1 on cpus x64, aarch64, and builds on linux-x86-open,linux-s390x-open,linux-arm32-debug,linux-ppc64le-debug.

src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp line 1746:

> 1744:   // NW     [ABI_REG_ARGS]             <-- 1) R1_SP
> 1745:   //        [outgoing arguments]       <-- 2) R1_SP + out_arg_slot_offset
> 1746:   //        [oopHandle area]           <-- 3) R1_SP + oop_handle_offset (save area for critical natives) ?

`?`. The comment `(save area for critical natives)` must be redundant now.

src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp line 1551:

> 1549:   int total_c_args = total_in_args+1;
> 1550:   if (method->is_static()) {
> 1551:     total_c_args++;

In this patch, sometimes we keep the if structure, like here, but in other places, we replace this with:

  int total_c_args = total_in_args + (method->is_static() ? 2 : 1)

Should probably stick with a single style.

src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp line 1793:

> 1791:     int c_arg = arg_order.at(ai + 1);
> 1792:     __ block_comment(err_msg("move %d -> %d", i, c_arg));
> 1793:     assert (c_arg != -1, "wrong direction");

`assert (c_arg != -1 && i != -1, "wrong direction");`?

src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp line 1905:

> 1903:   } else {
> 1904:     // Compute a valid move order, using tmp_vmreg to break any cycles
> 1905:     ComputeMoveOrder cmo(total_in_args, in_regs, total_c_args, out_regs, in_sig_bt, arg_order, tmp_vmreg);

`ComputeMoveOrder` is still used somewhere, or?

src/hotspot/share/runtime/sharedRuntime.cpp line 3019:

> 3017:   if (CriticalJNINatives && !method->is_method_handle_intrinsic()) {
> 3018:     // We perform the I/O with transition to native before acquiring AdapterHandlerLibrary_lock.
> 3019:     critical_entry = NativeLookup::lookup_critical_entry(method);

`critical_entry` variable is now redundant?

-------------

PR: https://git.openjdk.java.net/jdk/pull/6343


More information about the hotspot-dev mailing list