[ARCHIVED] PluotSorbet is a J2ME-compatible virtual machine written in JavaScript.
Перейти к файлу
Andreas Gal 2a08d3b8ea add ClassTest.java and hashCode() 2014-07-26 18:47:38 -07:00
classfile properly parse and resolve interfaces 2014-07-17 23:26:34 -07:00
java initialize main thread during startup 2014-07-20 00:35:00 -07:00
tests add and fix vm for ClassTest.java 2014-07-26 18:20:54 -07:00
.gitignore Add a .gitignore 2014-07-17 12:48:31 -04:00
LICENSE remove task.js 2014-07-10 23:45:28 -07:00
Makefile add dependency to makefile 2014-07-18 21:04:17 -07:00
README.md Update README.md 2014-07-22 20:41:09 -07:00
arrays.js fix a couple array handling bugs 2014-07-18 01:20:06 -07:00
classes.js make all tests pass again 2014-07-25 15:06:21 -07:00
classinfo.js add and fix vm for ClassTest.java 2014-07-26 18:20:54 -07:00
context.js better locking for class intialization 2014-07-26 11:42:02 -07:00
frame.js big refactoring to eliminate nested interpreter loops 2014-07-25 13:06:48 -07:00
index.html remove promise.hs 2014-07-25 21:46:28 -07:00
jvm.js better locking for class intialization 2014-07-26 11:42:02 -07:00
long.js fix Long export 2014-07-16 19:11:59 -07:00
main.js fix array copy with object element type 2014-07-26 17:39:49 -07:00
native.js add ClassTest.java and hashCode() 2014-07-26 18:47:38 -07:00
opcodes.js cleanup opcode table 2014-07-12 11:48:05 -07:00
signature.js count slots used in parsed signature 2014-07-13 19:32:37 -07:00
timer.js add zero timer 2014-07-17 21:18:53 -07:00
util.js use fround to truncate to floats 2014-07-19 19:10:15 -07:00
vm.js add support for Mauve-style testlets, and fix interface cast check and assigning null to an array 2014-07-26 14:18:44 -07:00
zipfile.js fix exception handling, inject trailing 0 in zipfile.js 2014-07-06 18:16:15 -07:00

README.md

j2me.js

j2me.js is a small J2ME virtual machine in JavaScript.

A few similar projects exist. My primary objective is to keep this very simple and small and to leverage the CDLC JDK. In particular I am trying to implement as little as possible in JavaScript, re-using as much of the CDLC infrastructure and existing Java code as I can.

The VM core itself is based on node-jvm, which has a very nice classfile parser but is quite buggy and incomplete.

A few other projects like js2me.js exist, but they tend to implement the class library in JavaScript which is a bad idea because its a lot of work, and really hard to get right from a compatibility perspective (Java has a lot of quirks and poorly documented edge cases).

The VM is able to execute a "Hello World" Java program, which if you know anything about the Java bootstrap sequence, is quite complex.

To try this at home run the Makefile in java/ to generate the the class library jar (which is decompressed on the fly in JavaScript, using zip.js) and then load index.html in the browser (full disclosure: I only tried this in Firefox).

I will likely add some test automation in node.js next.