On Fri, 13 Mar 2026 18:50:36 GMT, Remi Forax <[email protected]> wrote:

> You can use that as a cheap way to compute code coverage :)
> Especially if you combine it with a StackWalker to find the bci of the caller 
> of the BSM.

That would require a unique constant per code coverage location, since all 
occurrences of `ldc` share their constant, it’s `invokedynamic`’s bootstrap 
method that gets invoked once for every bci, even with a shared 
`CONSTANT_InvokeDynamic`.
(it can simply return a shared 
`ConstantCallSite[target=MethodHandles.zero(void.class)]` after doing the 
`StackWalker`‑based code coverage computation)

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

PR Comment: https://git.openjdk.org/jdk/pull/30125#issuecomment-4102923087

Reply via email to