RFR: 8259668: Make SubTasksDone use-once

Albert Mingkun Yang ayang at openjdk.java.net
Wed Feb 3 16:31:58 UTC 2021


After JDK-8260574, a instance of `SubTasksDone` is never reused, so part of its APIs could be revised: `clear()` and the code calling it is removed.

With this patch, `all_tasks_completed` contains only assertion. Kim suggested moving this assertion logic to `~SubTasksDone`, but that could defer the assertion violation. For example, in the case of `G1FullGCMarkTask::work`, there is a significant amount of code running btw the instance when all subtasks are claimed (where `all_tasks_completed` is called in this PR) and `~SubTasksDone`. In the interest of having more precise location where bugs may lie, I have kept `all_tasks_completed` in the original place. More comments on this are welcome.

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

Commit messages:
 - once

Changes: https://git.openjdk.java.net/jdk/pull/2383/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2383&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8259668
  Stats: 95 lines in 4 files changed: 31 ins; 49 del; 15 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2383.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2383/head:pull/2383

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


More information about the hotspot-dev mailing list