RFR: JDK-8299229: Allow UseZGC with JVMCI and enable nmethod entry barrier support [v2]
Erik Österlund
eosterlund at openjdk.org
Tue Jan 17 21:50:46 UTC 2023
On Tue, 17 Jan 2023 19:27:31 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 incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains one additional commit since the last revision:
>
> Allow UseZGC with JVMCI and enable nmethod entry barrier support
Changes requested by eosterlund (Reviewer).
src/hotspot/cpu/riscv/gc/shared/barrierSetNMethod_riscv.cpp line 53:
> 51: case NMethodPatchingType::conc_data_patch:
> 52: return -4 * (5 + slow_path_size(nm));
> 53: case NMethodPatchingType::conc_instruction_and_data_patch:
Please re-instate these two lines.
src/hotspot/cpu/x86/gc/shared/barrierSetNMethod_x86.cpp line 189:
> 187: } else
> 188: #endif
> 189: barrier_address = nm->code_begin() + nm->frame_complete_offset() + entry_barrier_offset(nm);
This line looks like a ticking bomb. Can we have brackets or something?
src/hotspot/share/code/nmethod.cpp line 562:
> 560: nmethod* nm = NULL;
> 561: #if INCLUDE_JVMCI
> 562: int jvmci_data_size = compiler->is_jvmci() ? jvmci_data->size() : 0;
Weird indentation
src/hotspot/share/jvmci/jvmciCodeInstaller.cpp line 732:
> 730:
> 731: if (UseZGC && _nmethod_entry_patch_offset == -1) {
> 732: // ZGC requires the use of entry barriers for correctness
Note that G1 also requires nmethod entry barriers for correctness.
src/hotspot/share/jvmci/jvmciCodeInstaller.cpp line 774:
> 772: if (_nmethod_entry_patch_offset != -1) {
> 773: BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
> 774: if (bs_nm == nullptr) {
Should never be null. ARM32 was the last to enter the scene but now all platforms have these.
src/hotspot/share/jvmci/jvmciRuntime.hpp line 460:
> 458: FailedSpeculation** failed_speculations,
> 459: char* speculations,
> 460: int speculations_len,
Weird indentation
-------------
PR: https://git.openjdk.org/jdk/pull/11996
More information about the hotspot-dev
mailing list