Hacker News new | ask | show | jobs
by samus 1031 days ago
A non-obvious difficulty is that on the bytecode level constructor invocation are "special", i.e., a separate bytecode command has to be used to call it. Therefore, introducing separate instructions for value types would have required recompilation (or rewriting at startup) of user code that calls constructors of value classes. This would have been an ongoing migration issue and a potential source of bugs, not just because of Java Core legacy like the primitive wrapper types. Fortunately, it turns out that the JVM can be adapted to smoothly hide the difference behind the scenes.