Refactor: JVM implementation separation and JVMThread abstraction#435
Draft
zhengyu123 wants to merge 26 commits intomainfrom
Draft
Refactor: JVM implementation separation and JVMThread abstraction#435zhengyu123 wants to merge 26 commits intomainfrom
zhengyu123 wants to merge 26 commits intomainfrom
Conversation
CI Test ResultsRun: #23610765440 | Commit:
Status Overview
Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled Summary: Total: 32 | Passed: 32 | Failed: 0 Updated: 2026-03-26 18:28:35 UTC |
Scan-Build Report
Bug Summary
Reports
|
||||||||||||||||||||||||||||||||||||
rkennke
requested changes
Mar 26, 2026
Contributor
rkennke
left a comment
There was a problem hiding this comment.
Good refactoring. I have some comments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?:
Reorganizes JVM-specific C++ source into dedicated subdirectories and introduces a new JVMThread class as a JVM-agnostic thread bridge.
Why
Previously VMStructs::initThreadBridge() handled both HotSpot and J9 initialization paths in a single monolithic function. The TLS key, java thread ID field, and thread execution state logic were split across VMStructs, threadState.inline.h, and call sites. This made it difficult to conditionally compile or reason about JVM-specific behavior.
Key changes
Motivation:
This is part one of PROF-13889 that focuses on providing an abstraction on
Thread- to avoid PR growing to large. Followup PRs will address other areas, especially, in stack walking.In addition, this PR removes some of dead code and files that related to the platforms that we don't support.
Additional Notes:
How to test the change?:
For Datadog employees:
credentials of any kind, I've requested a review from
@DataDog/security-design-and-guidance.Unsure? Have a question? Request a review!