2 ms·
Yeah, V8 has a lot of stuff under the hood that you can access for profiling and what not, but nothing more than that. V8 has two JIT compilers. One that's quic
by TheHydroImpulse 13y ago
Yeah, V8 has a lot of stuff under the hood that you can access for profiling and what not, but nothing more than that. V8 has two JIT compilers. One that's quick at starting up, but doesn't produce very good cpu instructions, and an optimizing JIT-compiler that takes a lot longer to spin up, but the code is heavily optimized.
You can ask V8 to give you IR dumps and other meta information about the runtime of your program.
But, unfortunately, that's all you can get. You can't use V8 to implement a new language, or compile your language down, unless you transpile it to JavaScript, which isn't as fun.
Yeah, LLVM is pretty awesome of compilers. I know it used to be somewhat bad for JIT compilers, but I haven't tried or benchmarked it since then. There's also LibJit that's written in C, and it's only goal is to JIT compile (http://eli.thegreenplace.net/2013/10/17/getting-started-with-libjit-part-1/ http://eli.thegreenplace.net/2013/10/17/getting-started-with...). A downside to LibJit is the lack of IR. It just emits x86(-64?) instructions. LLVM offers it's super awesome IR which makes debugging a ton easier.
Julia is another smaller VM that makes use of LLVM as a JIT compiler. I don't know if it has a bytecode you can compile to, or not.
Then you can always go towards an interpreted virtual machine, written in C or even Rust; if the current VMs don't work out.