Java bytecode to WebAssembly compiler

I'm developing my project called TeaVM which is capable of compiling JVM 
bytecode to JavaScript. Now I'm trying to emit proper WebAssembly 
output, and I have some results already. I use wasm command that I 
compiled from ml-proto to debug my compiler. Currently, my compiler 
produces both wast and binary formats. However, when I try to run binary 
file in browsers, they report errors. Here is my example: 
http://teavm.org/live-examples/wasm/

Google Chrome 53.0.2785.89 says: Uncaught (in promise) 
Wasm.instantiateModule(): Result = section "code" shorter (16199 bytes) 
than specified (17858 bytes) @+16878

Firefox nightly 51.0a1 (2016-09-02) says: TypeError: wasm error: compile 
error at offset 703: bad type

With no any further information to debug the problem. Moreover, when I 
compile http://teavm.org/live-examples/wasm/classes.wast with ml-proto, 
I get the same errors.

Can anyone help me to debug the problem?

Received on Saturday, 3 September 2016 15:50:18 UTC