A fast V8 bytecode decompiler written in Rust. Parses the text output of --print-bytecode and reconstructs a pseudo-JavaScript representation of each function.
The original View8 Python tool works well but struggles with large V8 dump files. For a file with ~308K bytecode lines:
| Tool | Peak RAM |
|---|---|
| Python view8 | ~900 GB (GC + dicts + string copies) |
| view8-rs | ~30 MB (flat structs, no GC) |
cargo install --path view8-rsOr build manually:
git clone https://github.com/awasthi21/view8-rs
cd view8-rs/view8-rs
cargo build --release
# binary at: target/release/view8_rsFirst, generate a V8 bytecode dump:
node --print-bytecode your_script.js > bytecode.txt 2>&1Then decompile it:
view8_rs bytecode.txt output.jsfunction func_start_0x7f1a2b3c(a0, a1) {
ACCU = a0
r0 = ACCU
ACCU = r0["length"]
if (!ACCU) goto +12
ACCU = r0.call(r1, ...)
return ACCU
}- Parse — reads the entire dump into memory line-by-line, resolving
FixedArrayandSharedFunctionInfoblocks - Translate — maps each V8 opcode to a readable pseudo-JS expression (accumulator model)
- Resolve — replaces
ConstPool[N]references with their actual string/value from the constant pool - Export — writes one function block per
SharedFunctionInfoto the output file
regex— bytecode line parsinglazy_static— compiled regex poolmemmap2— fast file I/O
MIT