andreasgal/j2me.js — pull request #405 by marco-c (2014-10-07 02:43:04+00:00)
Title: Implement a basic JIT

This is still a WIP, many of the changes are actually unneeded and will be stripped out when I'll submit the actual pull request.
The function that "compiles" a Java function into a JS function is *VM.compile*. It's performing the compilation for each method, we may want to do it only for a subset of methods (for example, methods that are called > *n* times, method that have loops, etc.).
I'm not very happy with how function calls work, I'd like some feedback on this point (basically now I'm storing the function state every time another function is called).

There are many optimizations possible (for example in the invoke* case we may want to precompute more things if the operation is not invokeinterface or invokevirtual, because we have more info).