Unwind checksum and digest intrinsics on ARM64 #1400
Merged
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
Unwind certain ARM64 intrinsics.
Related issues
#1385
Motivation and context
HotSpot JVM has hand-coded assembly implementation for some CPU intensive checksum and digest computation algorithms suchs as CRC32, MD5, SHA256, etc. These compiler intrinsic functions are generated at runtime and they do not follow commonly used frame layout, especially on ARM64. That's why async-profiler (as well as JDK Flight Recorder and other profilers) cannot unwind Java stack trace during execution of these functions.
I divided stub routines for these intrinsics into 4 categories:
x30
register.stp
instruction that decrement stack pointer by this fixed amount. To unwind these stubs, I find frame size directly from the instruction stream and incrementsp
back by this amount.fp
(x29
) register to find the previous frame.sp
in the middle). These cases are rare, and I do not attempt to unwind such frames.How has this been tested?
Added new test
CodingIntrinsics.java
that executes the following intrinsics:By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.