JDK-8268368 : Adopt cast notation for JavaThread conversions
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 18
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-06-08
  • Updated: 2021-11-09
  • Resolved: 2021-06-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 18
18 b03Fixed
Related Reports
Relates :  
Relates :  
Description
We currently define Thread::as_Java_thread() as an instance method to convert from a Thread* to a JavaThread*. Other Thread conversions have opted for a cast-style approach e.g.

static WorkerThread::cast(Thread* _this);
static CompilerThread::cast(Thread* _this);

we should look at doing JavaThread conversions in the same way for consistency.

This also helps remove Thread's knowledge of its subtypes from its API.
Comments
Changeset: cd678a38 Author: Guoxiong Li <gli@openjdk.org> Committer: David Holmes <dholmes@openjdk.org> Date: 2021-06-23 02:21:24 +0000 URL: https://git.openjdk.java.net/jdk/commit/cd678a383f7b23ea40132b207ddfc041394ba4c1
23-06-2021