8214972: Uses of klass_holder() except GC need to apply GC barriers #3059 #393
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.
Description
I've been working on a backport to fix JDK-8339725. The fix in openjdk/jdk#20907 is not enough to fix the problem on jdk11.
The missing backport is JDK-8214972, which I apply in this PR. JDK-8210321 is also needed for
ClassLoaderData::holder_no_keepalive
.Related issues
async-profiler/async-profiler#974
Motivation and context
JDK-8339725 affects users of Async-Profiler, and the backports in this PR are a prerequisite for the fix to be fully effective. I'm going to open a new PR to complete the fix if this one is accepted.
I proposed this PR in openjdk/jdk11u-dev#3059, but it was rejected.
How has this been tested?
tier1 and tier2 tests completed successfully.
Platform information
Tested on Amazon Linux 2.
Additional context
n/a