7902944: JMH: Avoid weak references in Blackhole.consume(Object) #153
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.
See the bug for rationale. This avoids
WeakReference
-s completely through the aliased box trick. Not only this solves the original problem with inline types, it also allows for prompt reclamation of the objects, without relying on the specifics of VM reference processing.I looked at
jmh-core-benchmarks
results, and they suggest this still works reliably without compiler blackholes. Compiler blackholes make all of this irrelevant.Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jmh.git pull/153/head:pull/153
$ git checkout pull/153
Update a local copy of the PR:
$ git checkout pull/153
$ git pull https://git.openjdk.org/jmh.git pull/153/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 153
View PR using the GUI difftool:
$ git pr show -t 153
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jmh/pull/153.diff
Using Webrev
Link to Webrev Comment