It's worth noting that this is ASM code, not Spring code. However, since we effectively include our own fork of ASM there, we can apply optimizations.
As for the actual optimization, that's a good catch. However, it seems even more attractive to change that code to autoboxing (i.e. just pass in the primitive values) since the JVM will then internally use valueOf itself.