Then one day someone called Yevano took interest. He wanted to boost the speed of JVML by turning it into a JIT, which compiles the Java bytecode into Lua bytecode for better performance. ds84182 had been basically absent from JVML since his initial work, so we decided to work on this exclusively in Yevano's repo. Since then, it has undergone some amazing work that has turned it into a very capable tool. I'm proud to announce JVML-JIT.
Install: pastebin run NzNwtBQy
Or: grin-get install Team-CC-Corp/JVML-JIT
Github: Team-CC-Corp/JVML-JIT
Usage
If you didn't use grin-get for installation, make sure you add jvml/bin/ to your shell's path at startup.
jvml MyMainClass
jvml -jar MyExecutableJarFile
JVML-JIT uses the notion of the classpath. By default, the cc_rt.jar file is included, and the current directory the shell is at is included. The -cp argument can be used to add to this.
Building for JVML-JIT
Although in many cases, it will work out to just compile your java code normally and run those class files, it runs some risks. Our runtime library is incomplete and the compiler might use methods and classes we don't have implemented. To be safe about this and avoid that problem, use the bootclasspath compiler option.
javac -bootclasspath jvml/CCLib/jar/cc_rt.jar MySource.java
How it Works
JVML-JIT works by loading class files, and compiling their methods into Lua. In an attempt to be more efficient, no method is compiled until the first time it's called. These compiled methods are now just ordinary Lua functions.
FAQ
- Can I run Minecraft in Minecraft? Sorry, but probably not. Minecraft makes use of extensive APIs that would take years to implement. That's just not going to happen.
- Can I run ______ in Minecraft? Sure, if you can get all the classes and natives it depends on ported over. Any additions to the runtime library would be appreciated in a pull request! =)
- Why is it so slow? I thought the JIT was supposed to speed it up! JVML-JIT will appear slow for small projects or projects that do many different things one time each. This is because compiling the methods to Lua is a bit of a slow process. Compiling roughly 60k lines of Lua assembly (which is a lot) takes the JIT about 15 seconds. Once a method is compiled, it's very, very quick. But if your program isn't using the same methods multiple times, you'll notice that you spend a lot of time compiling the variety of methods you use. Point is, JVML-JIT is better suited for larger projects that are meant to do long running, repetitive tasks. Perfect for a server!
- How can I contribute to help advance the runtime library? If there's any classes or methods you'd like to see implemented in the runtime, anyone is free to fork the repo, add the features in, and send us a pull request. As long as your change works, we'll probably take all the help we can get.
- Where do I report bugs and issues? Please direct any and all bugs and issues to JVML-JIT's issues page.