[ARCHIVED] PluotSorbet is a J2ME-compatible virtual machine written in JavaScript.
Перейти к файлу
Andreas Gal af6e510174 catch Java exceptions in native code in the interpreter 2014-07-17 18:42:11 -07:00
classfile fix long constants 2014-07-17 00:42:20 -07:00
java more fixes 2014-07-09 22:23:17 -07:00
tests Merge branch 'master' of github.com:andreasgal/j2me.js 2014-07-17 14:34:56 -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 start adding micro tests 2014-07-16 20:07:00 -07:00
README.md changes 2014-07-15 00:29:17 -07:00
arraytypes.js hook up array types 2014-07-13 17:36:47 -07:00
classes.js cleanup invoke and move to VM 2014-07-17 17:39:25 -07:00
classinfo.js put tests into the right package 2014-07-15 16:49:00 -07:00
frame.js cleanup invoke and move to VM 2014-07-17 17:39:25 -07:00
index.html send output to a div 2014-07-17 01:41:50 -07:00
jvm.js cleanup invoke and move to VM 2014-07-17 17:39:25 -07:00
long.js fix Long export 2014-07-16 19:11:59 -07:00
main.js inline invoke into the vm 2014-07-17 11:13:16 -07:00
native.js catch Java exceptions in native code in the interpreter 2014-07-17 18:42:11 -07:00
opcodes.js cleanup opcode table 2014-07-12 11:48:05 -07:00
scheduler.js rewrite bytecodes 2014-07-11 20:20:41 -07:00
signature.js count slots used in parsed signature 2014-07-13 19:32:37 -07:00
thread.js remove frame reference in thread for now 2014-07-17 14:35:40 -07:00
threads.js add scheduling code 2014-07-17 17:58:07 -07:00
util.js more tests 2014-07-16 20:53:54 -07:00
vm.js catch Java exceptions in native code in the interpreter 2014-07-17 18:42:11 -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 Java, re-using as much of the CDLC infrastructure 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.