8309777: [lworld+vector] Fix re-materialize crash for vector objects with un-vectorized multi-fields during deoptimization #863
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.
Some vector API jtreg tests crash when running on hardwares that do
not support the relative vector species.
Here is the log:
The root cause is
VectorSupport::allocate_vector_payload
assumes theScopeValue
which denotes the field value generated by C2 compileris a vector or an oop. But after the vector's payload is changed to be
the
MultiField
annotated field, the non-static fields of the vectorclass is changed to be a series of fields with the same primitive type.
In C2 compiler, operations for such multi-fields can be vectorized only
if the running hardware supports the vector operations for the specified
vector size. For such cases, the field value generated by C2 is a vector.
Otherwise, the fields are the scalarized primitive type values. Hence
the re-materizalization for such vector objects should be handled just
like other normal objects.
To make things right when re-materializing vector objects whose fields
are not vectorized, two parts need to be modified:
In c2 compiler, pass the un-vectorized multi-fields on safepoint when
scalaring an
InlineTypeNode
. To try to vectorize the multi-fields incompiler, only the multi-field base is added to the klass's non-static
field list. And the other multi-fields are saved in a secondary field list
of their multi-field base. So if the multi-fields are not vectorized, all
the field members should be found out and passed to the safepoint.
During deoptimization, re-materialize the vector objects with different
routines based on the
ScopeValue
types. That is, go to theVectorSupport
routine to re-allocate the objects from a vector value, while go to the
normal objects re-allocation path if the field value is not a vector.
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/863/head:pull/863
$ git checkout pull/863
Update a local copy of the PR:
$ git checkout pull/863
$ git pull https://git.openjdk.org/valhalla.git pull/863/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 863
View PR using the GUI difftool:
$ git pr show -t 863
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/863.diff
Webrev
Link to Webrev Comment