konsoletyper / teavm

Compiles Java bytecode to JavaScript, WebAssembly and C
https://teavm.org
Apache License 2.0
2.55k stars 262 forks source link

Add hprof file generator for WebAssembly heap #806

Open konsoletyper opened 8 months ago

konsoletyper commented 8 months ago

Note that this generator would require additional external file that describes heap layout. Rationale: having this encoded in wasm file will increase its side and add security risks. Thus, only some intermediate heap dump can be generated by JS runtime. All user data, like contents of non-object arrays and non-object fields, should be removed, for security. Then, additional tool should be used, that takes this intermediate dump and heap layout descriptor and produces hprof file. This is how things work for C backend.