RFR: 8254562: ZGC: Remove ZMarkRootsTask [v3]

Per Liden pliden at openjdk.java.net
Mon Oct 12 16:19:14 UTC 2020


On Mon, 12 Oct 2020 14:04:20 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

>> After introducing concurrent stack scanning, we don't need to mark through any roots during the mark start pause.
>> Remove the code.
>> Note that the old code passed in `false` to `_roots(false /* visit_jvmti_weak_export */)`. This has the effect that no
>> roots are visited by the iterator: void ZRootsIterator::oops_do(ZRootsIteratorClosure* cl) {
>>   ZStatTimer timer(ZSubPhasePauseRoots);
>>   if (_visit_jvmti_weak_export) {
>>     _jvmti_weak_export.oops_do(cl);
>>   }
>> }
>
> 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.

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

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



More information about the hotspot-gc-dev mailing list