RFR: 8254562: ZGC: Remove ZMarkRootsTask [v3]
Stefan Karlsson
stefank at openjdk.java.net
Tue Oct 13 06:42:16 UTC 2020
On Mon, 12 Oct 2020 16:15:38 GMT, Per Liden <pliden at openjdk.org> wrote:
>> Stefan Karlsson has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Review 1
>
> src/hotspot/share/gc/z/zRelocate.cpp line 72:
>
>> 70: // During relocation we need to visit the JVMTI
>> 71: // export weak roots to rehash the JVMTI tag map
>> 72: ZRelocateRoots::oops_do(&_cl);
>
> I would have been more explicit here, something like this:
>
> class ZRelocateJVMTIWeakExportTask : public ZTask {
> public:
> ZRelocateJVMTIWeakExportTask() :
> ZTask("ZRelocateJVMTIWeakExportTask") {}
>
> virtual void work() {
> AlwaysTrueClosure always_alive;
> ZRelocateRootsIteratorClosure _cl;
> JvmtiExport::weak_oops_do(&always_alive, &cl);
> }
> };
>
> void ZRelocate::start() {
> // During relocation we need to visit the JVMTI
> // export weak roots to rehash the JVMTI tag map
> ZStatTimer timer(ZSubPhasePauseRelocateJVMTIWeakExport);
> ZRelocateJVMTIWeakExportTask task;
> _workers->run_serial(&task);
> }
>
> But this code will go away soon anyway, so you decide.
I agree, and I actually started that way, but hit some minor snags that ZSubPhasePauseRelocateJVMTIWeakExport wasn't
available to zRelocate.cpp, and I wasn't sure about moving a *PhasePause* instance out from the zRootsIterator.cpp.
-------------
PR: https://git.openjdk.java.net/jdk/pull/601
More information about the hotspot-gc-dev
mailing list