Re:Resources for Amateur Compiler Writers
by chrisseaton on Monday July 25, 2016 @07:09PM
(#12162259)
But that's my point - the person emitting the bytecode needs to be the one doing the work to re-use local variable indices. And the algorithm for doing that is register allocation. So even if you target the JVM you may still need to know how to do register allocation, and it isn't some historical piece of trivia.
For every local variable index, the JVM needs to keep the value live for the duration of the method because that's what the debugger will show.
And yes we have seen the 64k limit blown by real programs in the wild that aren't designed to be awkward (I'm in the VM research group at Oracle).
But if you're really running into the 64k limit on max_locals even with index reuse, then you're out of luck.