Inhibit inlining of subroutines (jsr/ret) in the preverifier
I'm working on a project, Cibyl, where I've recently experimented
with generating a lot of code in subroutines. I have a couple of test
cases which has quite large methods, and when adding the subroutine
code, I was surprised to see that these would not pass the
preverification phase anymore. It was surprising since the same classes
worked fine when executing in a non-J2ME Java environment (Midpath).
So I downloaded the preverifier code (thanks!) and started looking at
what could cause this. The reason it fails is that the preverifier
inlines the subroutines, which I suppose is fine in most cases - but I
have hundreds of subroutine calls so this means my method sizes will go
throgh the roof.
In particular, preverification now fails on a "short" goto, where the
offset becomes too large because of the inlined subroutine. I'd say
this is a general bug in the preverifier, since even a single
subroutine can cause this problem if placed wrongly.
To the questions then: I found the -Xni option which should turn this
off, but I see from the code that this is not yet implemented. Has this
been implemented before/working and is there source code left from
that?. I've tried to quickly implement this myself, but so far been
unable to get working classes out of it. Are there any pointers on
where to look for this?