How large a chunk of assembly is needed to balance out the JNI overhead? And are you keeping an eye on Panama so you can do this insane thing faster? :-)
I'm not sure yet and I'm very interested in this problem, although it may be JVM-specific. I have not read much on Panama, but will definitely check it out.
Yep! It's in the works and not pushed yet, but depending on the architecture you're running on, you should be able to execute different blocks of assembly (or fall back to a Java-implemented method if nothing matches your architecture).
An entire block is passed to the JNI bridge at one time; specifically, when invoke() is called. It essentially is a function (and must follow the calling conventions of the platform).
http://www.squeaksource.com/@us0cp9R3z2kMAiPd/FB3wRHMZ