ispras/llv8

Could LLV8 be rebased on upstream V8 changes?

CrazyPython opened this issue · 3 comments

I see LLV8 has modified Crankshaft. Upstream, V8 has removed Crankshaft.

How feasible (how much time) would it be to rebase V8 on upstream changes? Does LLV8 depend on CrankShaft?

Furthermore, for a CPU-intensive JavaScript application, how much better could LLV8 do over TurboFan?

Hi, thank you for your interest in this project.

First of all, you should know that LLV8 was a research project, and it hasn't been updated in a long time. This would make comparisons difficult, because a) not all operations are supported in LLV8 and b) I am not sure if it even builds, because the build system used for upstream V8 (used to be GYP) has changed since then, and the old one might not be available anymore.

Still, it was fun to hack on, and some important work has been done (supporting safepoints, OSR, and whatnot), so the project is kept here as a reference.

LLV8 surely does depend on Crankshaft: it uses the Hydrogen representation as an input, and lowers that into LLVM IR. Hydrogen was part of Crankshaft, so I assume it is now gone. There also used to be a baseline JIT compiler (Full CodeGen) rather than an interpreter, so deoptimization support might also need revamping.

So I expect porting LLV8 to new V8 to be about as difficult as writing from scratch, except perhaps the old implementation would serve as a reference (interaction of the compiled code with the VM is probably done largely in the same way). I haven't had a close look into Ignition and Turbofan, so I can't offer any estimation on how much benefit could there be had from using LLVM in terms of throughput. And also there's a design decision to make for such a hypothetical project as to what IR to use as an input for translation into LLVM IR. There's the bytecode (probably a good choice), then there's the Turbofan's IR (soup of nodes?), and also there's an option of just writing another backend for Turbofan that would use LLVM for codegen. There are different trade-offs associated with each solution.

How much information is lost by the lowering of JavaScript to Hydrogen?

I understand that Turbofan has an SSA-like sea of nodes representation. I also understand that LLVM is an SSA.

Did LLV8 have IPC support?