RFR: JDK-8299229: Allow UseZGC with JVMCI and enable nmethod entry barrier support [v4]

Andrei Pangin apangin at openjdk.org
Tue Jan 31 02:30:59 UTC 2023


On Mon, 23 Jan 2023 20:34:00 GMT, Tom Rodriguez <never at openjdk.org> wrote:

>> This exposes the required ZGC values to JVMCI and adds support for nmethod entry barriers.  The ZGC support is straightforward but the nmethod entry barrier required some reworking to fit better into JVMCI usage.  I also removed the epoch based barrier since it was no longer used with simplified the assumptions on the JVMCI side.  There is also a minor loom related fix to support post call nops included.  I could move that into a separate PR if that would be preferred.
>
> Tom Rodriguez has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains seven commits:
> 
>  - Handle concurrent unloading
>  - Merge branch 'master' into tkr-zgc
>  - Add missing declaration
>  - Replace NULL with nullptr in new code
>  - Merge branch 'master' into tkr-zgc
>  - Review fixes
>  - Allow UseZGC with JVMCI and enable nmethod entry barrier support

src/hotspot/share/gc/shared/barrierSetNMethod.cpp line 70:

> 68:   if (nm->is_native_method() || nm->is_compiled_by_c2() || nm->is_compiled_by_c1()) {
> 69:     return true;
> 70:   }

I wonder why `is_native_method` automatically implies `supports_entry_barrier == true`.
Apparently JVMCI is not supposed to compile native methods (without entry barrier), however, this seems too restrictive to me.

Should not we swap the order of the checks? E.g.

  if (nm->is_compiled_by_jvmci()) {
    return nm->jvmci_nmethod_data()->has_entry_barrier();
  }

  if (nm->is_native_method() || nm->is_compiled_by_c2() || nm->is_compiled_by_c1()) {
    return true;
  }

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

PR: https://git.openjdk.org/jdk/pull/11996


More information about the hotspot-dev mailing list