All Projects → raydac → J J Jvm

raydac / J J Jvm

Licence: apache-2.0
JVM bytecode interpreter written in Java

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to J J Jvm

Korge
KorGE Game Engine. Multiplatform Kotlin Game Engine
Stars: ✭ 780 (+1850%)
Mutual labels:  engine, jvm
Friceengine
🎮 JVM game engine based on Swing/JavaFX.
Stars: ✭ 330 (+725%)
Mutual labels:  engine, jvm
Spartanengine
Game engine with an emphasis on architectual quality and performance
Stars: ✭ 869 (+2072.5%)
Mutual labels:  engine
Javabrainmap
Java 体系涉及到的各方面知识点脑图总结,万物皆脑图。The knowledge of all aspects of the Java system is summarized in the brain map.
Stars: ✭ 33 (-17.5%)
Mutual labels:  jvm
E
A zero-dependency micro library to deal with errors
Stars: ✭ 21 (-47.5%)
Mutual labels:  jvm
Amethyst
Data-oriented and data-driven game engine written in Rust
Stars: ✭ 7,682 (+19105%)
Mutual labels:  engine
Javacore
☕️ JavaCore 是对 Java 核心技术的经验总结。
Stars: ✭ 909 (+2172.5%)
Mutual labels:  jvm
Culverinengine Project3
We are a group of 35 students from CITM. UPC. and we made a dungeon crawler game with a theme of Game of Thrones. Web:
Stars: ✭ 11 (-72.5%)
Mutual labels:  engine
Ineter
Fast Java library for working with IP addresses, ranges, and subnets
Stars: ✭ 39 (-2.5%)
Mutual labels:  jvm
Fake Jni
An implementation of the JNI and JVMTI with support for direct interaction between natively registered classes and JVM objects.
Stars: ✭ 20 (-50%)
Mutual labels:  jvm
Blog
本仓库存放个人博客的 markdown 源文件
Stars: ✭ 951 (+2277.5%)
Mutual labels:  jvm
Pulsar
Fibers, Channels and Actors for Clojure
Stars: ✭ 885 (+2112.5%)
Mutual labels:  jvm
Bugz
🐛 Composable User Agent Detection using Ramda
Stars: ✭ 15 (-62.5%)
Mutual labels:  engine
Yeti
⛄️ A general-purpose data-driven game engine with tools. Attribution based licensing.
Stars: ✭ 21 (-47.5%)
Mutual labels:  engine
Mbassador
Powerful event-bus optimized for high throughput in multi-threaded applications. Features: Sync and Async event publication, weak/strong references, event filtering, annotation driven
Stars: ✭ 877 (+2092.5%)
Mutual labels:  jvm
Cockburst
一个高性能,可靠,异步的本地持久化队列实现;重启JVM、重启服务器、或者强制KILL进程时,队列里的数据不丢失;
Stars: ✭ 33 (-17.5%)
Mutual labels:  jvm
Javaok
必看!java后端,亮剑诛仙。java发展路线技术要点。
Stars: ✭ 867 (+2067.5%)
Mutual labels:  jvm
Glumpy
Python+Numpy+OpenGL: fast, scalable and beautiful scientific visualization
Stars: ✭ 882 (+2105%)
Mutual labels:  engine
Docker Discovery Registrator Consul
Service discovery library for JVM based applications running in Docker containers that use the Registrator service registry bridge with Consul as a backend
Stars: ✭ 21 (-47.5%)
Mutual labels:  jvm
Flatjson
A fast JSON parser (and builder)
Stars: ✭ 39 (-2.5%)
Mutual labels:  jvm

Java 5.0+ License Apache 2.0 PayPal donation Yandex.Money donation

History

In 2009 I had some free time during weekend and decided to try to develop small JVM interpreter in pure Java which could be used in J2ME CLDC 1.0 platform because the platform didn't have any ClassLoader support but it was very useful to load compiled class files through network and execute them. The Development of the "proof of concept" took about 3 days and worked with good speed even on Nokia 6100. The project was published as OSS project on my home page (titled as "M-JVM") and I even detected some interest from mobile software developers.

In 2015 I decided to rework my home page and removed the old project from there, but because it still can be useful for someone, I made refactored it and moved sources to GitHub under title J-J-JVM project. I made some improvements in the project, added support of inner classes, double and long values, added dozens of tests. The Library is tests for compatibility with Android API 2.0r1+.

The JVM interpreter doesn't contain any "Poka-yoke" (mistake-proofing) mechanism and verification of byte-code, it doesn't make any stack map verification and any requests or communication with Java security manager!

Hello world

For instance we have some class which prints "Hello world!" to the console.

package com.igormaznitsa.testjjjvm;

public class HelloWorld {
  public static void main(final String ... args){
    System.out.println("Hello world!");
  }
}

And we want to execute the main method within JJJVM. To Load the class body we use Javassist. But lets not just print the message but will catch it and make some processing.

JJJVMProvider provider = new JSEProviderImpl(){
  @Override
  public Object invoke(JJJVMClass caller, Object instance, String jvmFormattedClassName, String methodName, String methodSignature, Object[] arguments) throws Throwable {
    if (jvmFormattedClassName.equals("java/io/PrintStream") && methodName.equals("println") && methodSignature.equals("(Ljava/lang/String;)V")){
      System.out.println("<<"+arguments[0]+">>");
      return null;
    }
    return super.invoke(caller, instance, jvmFormattedClassName, methodName, methodSignature, arguments); //To change body of generated methods, choose Tools | Templates.
  }
};
JJJVMClassImpl jjjvmClass = new JJJVMClassImpl(new ByteArrayInputStream(javassist.ClassPool.getDefault().get("com.igormaznitsa.testjjjvm.HelloWorld").toBytecode()), provider);
jjjvmClass.findMethod("main", "([Ljava/lang/String;)V").invoke(null, null);

And the code above will print

<<Hello world!>>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].