New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8255046: [lworld] JIT should make use of array layout encoding in markWord #256
Conversation
|
@TobiHartmann This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been no new commits pushed to the
|
Webrevs
|
Cool. As for aastore operation - performance unchanged. aastore operation has the same cost in valhalla and in legacy world long before that. The reason of that is either hotspot has precise type information (and doesn't generate checks) or ArrayStoreException check is generated (ArrayStoreException check dominates aastore performance). Note: I considered benchmarks when ArrayFlattened check can't be hoisted out loop (ref to array is loaded on every loop iteration). |
/integrate |
@TobiHartmann Pushed as commit 1b1aefa. |
This patch re-implements the flat array check in C1 and C2 by using the mark word bits instead of the layout helper from the array Klass (see JDK-8247299). Unfortunately, this turned out to be far from trivial to implement in C2.
I've introduced a new FlatArrayCheck macro node to wrap the logic of the new check and to make it easier for the loop unswitching optimization to detect and hoist the check. One major problem is that we can't use immutable memory anymore because we are loading the mark word which is mutable (
AliasType::_is_rewritable
istrue
). Although the bits we are interested in are in fact immutable (we check formarkWord::unlocked_value
), we need to use raw memory to not break anti dependency analysis. As a result, flat array checks are not hoisted out of loops anymore and loop unswitching fails.PhaseIdealLoop::move_flat_array_check_out_of_loop
will attempt to still move flat array checks out of loops by walking up the memory edge to before the loop and re-wiring the check accordingly.This patch also fixes an existing issue in Escape Analysis that was only triggered now that we are able to fold the flat array check in more cases due to the
::Ideal
/::Value
transformations.@kuksenko, could you please evaluate performance of this change? Disabling the
UseArrayMarkWordCheck
flag allows to switch back to the old check using the layout helper.Thanks,
Tobias
Progress
Testing
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/valhalla pull/256/head:pull/256
$ git checkout pull/256