RFR: JDK-8267916: Make as_CompilerThread consistent with other as_*_thread methods [v2]

Kim Barrett kbarrett at openjdk.java.net
Wed Jun 2 14:53:30 UTC 2021


On Wed, 2 Jun 2021 14:26:07 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

> I encountered some circular dependencies after moving the definition to `thread.inline.hpp`, so I replaced it with a static `cast` method, as Kim instructed from an offline discussion. Note now there's a discrepancy: `CompilerThread::cast(t)` vs `t->as_Worker_thread()` (or `t->as_Java_thread()`). I can do the same for other `as_*_thread` methods as well (in this PR or another one) if people feel like this approach.

as_Worker_thread => WorkerThread::cast could pretty easily be added to this change.  There's only one call.

There are lots of as_Java_thread calls.  Maybe check with runtime team how they feel about the inconsistency vs code churn.

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

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


More information about the hotspot-dev mailing list