A web assembly 1.0 interpreter implementation in pure java. This interpreter intended to provide a smart contract runtime for block chain.
We use off-heap memory to avoid frequently garbage collection (See UnsafeMemory.java, UnsafeStackAllocator.java and InstructionPool.java). The UnsafeMemory and UnsafeStackAllocator should be closed explicitly.
- How to Use?
See src/test/org.tdf.lotusvm.Bench.java
Not support:
- sign-extension operators
- return multi-value
- floating number operations, i.e. f32.const, f32_nearest, f64_round (undefined behavior in some platform and error-prone)
TODO:
- module validation
- dynamically compile .wasm to java byte code