On Mon, 27 Apr 2026 08:08:42 GMT, Markus Grönlund <[email protected]> wrote:

> > Attempting to add an injected field did not work because you cannot reflect 
> > an injected field, not even using Unsafe. So I cannot read the value of an 
> > injected field from Java. Either we go with the encoding in the slot field, 
> > or I will add a separate non-final field "jfrEpoch" to 
> > java.lang.reflect.Field. Thoughts?
> 
> I assume an injected field would be feasible if all the access were via JVM 
> funtions rather than reflect/Unsafe but that would add complexity as it might 
> end up needing instrinics. In that case, an explicit field would be better so 
> the slot field is not overridden.

Yes, we can do an intrinsic too, if we really want to tuck this away. I can 
look into that alternative as well, since I already built similar intrinsics to 
read the jfrEpoch, which are currently in use for virtual threads.

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

PR Comment: https://git.openjdk.org/jdk/pull/30922#issuecomment-4325364313

Reply via email to