On Tue, 3 Mar 2026 20:21:14 GMT, John Hendrikx <[email protected]> wrote:

> `instanceof int` wow, what does bytecode look like? do you know if any 
> boxing/unboxing is involved?

The `instanceof` bytecode is not used for primitive pattern matching. It's just 
a method call to 
`java.lang.runtime.ExactConversionsSupport.isLongToIntExact(long)`, and that 
method just consists of one line:

return n == (long)(int)n;

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

PR Comment: https://git.openjdk.org/jfx/pull/2093#issuecomment-3993379196

Reply via email to