When C2 scalar-replaces a Vector API object, its payload is recorded in debug 
info as a `Location::vector`. SA's `Location.getType()` does not recognize this 
type and throws "should not reach here" when it decodes such a location.

The cause is that `vmStructs` does not export HotSpot's `Location::vector`, and 
SA's `Location` has no corresponding type.

## Changes
- `vmStructs.cpp`: export `Location::vector`
- SA `Location.java`: add `Type.VECTOR` and handle it in `getType()`, 
`Type.getValue()` and `printOn()`
- `HTMLGenerator.java`: handle `VECTOR` in `locationAsString()`

## Testing
- New test `serviceability/sa/TestVectorDebugInfoDecode.java`: runs a 
`LingeredApp` that waits with a C2-compiled frame on its stack, holding a live 
`IntVector` across a call. The test attaches SA and checks that a `Location` of 
type `vector` is decoded from that frame's scope objects.
  - Without the fix, the test fails:
    - With none of the changes, it does not compile because 
`Location.Type.VECTOR` does not exist.
    - With only the `getType()` branch removed, it fails with the same "should 
not reach here" as in the bug report.
- `tier1` tests pass.

---------
- [x] I confirm that I make this contribution in accordance with the [OpenJDK 
Interim AI Policy](https://openjdk.org/legal/ai).

-------------

Commit messages:
 - JDK-8394577: Serviceability agent is missing type support for 
Location::vector

Changes: https://git.openjdk.org/jdk/pull/33665/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=33665&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8394577
  Stats: 225 lines in 5 files changed: 223 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/33665.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/33665/head:pull/33665

PR: https://git.openjdk.org/jdk/pull/33665

Reply via email to