Skip to content

birbe/jvm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Experimental JVM on WASM

This repo is my experiment in making a pure-Rust JVM that supports running both on native platforms and WebAssembly.

On WebAssembly, it takes advantage of the GC extension to the WASM spec, meaning in theory the Java objects get garbage-collected by the browser's garbage collector instead of one written within WASM.

At the moment it's just a toy and is non-functional.

Things I've worked on so far, include but are not limited to (and in no particular order or amount of success):

  • Java classfile parsing
  • Extremely basic non-garbage collected heap for native
  • Dynamic linking of the WASM modules generated at runtime
  • Basic interop between Rust and WASM objects
  • Implemented part of the interpreter
  • Java bytecode control flow to WASM (using the stackifier algorithm)

Things that are notably missing:

  • A lot of instructions
  • Most of the important instructions like for dynamic dispatch (they're either partially (incorrectly) implemented or entirely unimplemented)
  • Garbage collection (on native platforms)

Originally it only ran on native, but now it only runs on WASM as that's where I'm doing most of my testing. Eventually I'll properly refactor it's internal APIs to support conditionally compiling with the proper parts enabled for each specific platform.

About

Take two! Pure-Rust implementation of the 20th JVM spec

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages