8358696: Assert with extreme values for -XX:BciProfileWidth #26139
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.
Issue
Extreme values for BciProfileWidth flag such as
java -XX:BciProfileWidth=-1 -version
andjava -XX:BciProfileWidth=100000 -version
results in assert failureassert(allocates2(pc)) failed: not in CodeBuffer memory: 0x0000772b63a7a3a0 <= 0x0000772b63b75159 <= 0x0000772b63b75158
Analysis
The flag BciProfileWidth is used to specify the number of return BCI's to be recorded in the ret profile. On debugging the issue, I found that increasing the size of the interpreter using the
InterpreterCodeSize
insrc/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp
file prevented the above mentioned assert from failing for large values of BciProfileWidth. Additionally, a value below zero for BciProfileWidth implies that no return BCI's are to be recorded in the ret profile. This makes it equivalent to specifying the value zero.Proposal
Considering the fact that larger BciProfileWidth results in slower profiling, I have proposed a range to restrict the value for BciProfileWidth that works for the current
InterpreterCodeSize
. The value ofInterpreterCodeSize
is platform dependent. Hence, the upper bound of the range results from considering the lowestInterpreterCodeSize
that does not result in a failure. However, I have only tested this on a x86 machine.Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26139/head:pull/26139
$ git checkout pull/26139
Update a local copy of the PR:
$ git checkout pull/26139
$ git pull https://git.openjdk.org/jdk.git pull/26139/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 26139
View PR using the GUI difftool:
$ git pr show -t 26139
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26139.diff