On Sun, 1 Nov 2026 20:50:32 GMT, jonghoonpark <[email protected]> wrote:

> 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).

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/Location.java line 124:

> 122:     /** NarrowOop (please GC me!) */
> 123:     public static final Type NARROWOOP    = new Type("narrowoop");
> 124:     /** Long held in one register */

Looks like a typo, but I left it as is since it’s out of scope for this change.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33665#discussion_r4438038488

Reply via email to