News for hackers. Stuff that matters.
Re:How JavaScript works: inside the V8 engine by pcwalton on Monday August 21, 2017 @01:49PM (#15066235)
The fundamental problem is that interprocedural optimizations break that model. Optimizations that inline e.g. jQuery code into callers are very important. You end up needing to do optimization on jQuery either way.

Additionally, the code that JavaScript JITs generate is not position independent, and it contains no linkage information (symbol tables, etc.). It contains raw addresses of various browser objects within it. You would need to introduce some sort of linker for that to work, which is a lot of complexity.

Re:How JavaScript works: inside the V8 engine by jbergens on Wednesday August 23, 2017 @01:42AM (#15078812)
The js landscape changes really fast, they could probably never keep up.
Re:How JavaScript works: inside the V8 engine by flamedoge on Monday August 21, 2017 @03:45PM (#15067228)
doesn't mean it can't be done
Re:How JavaScript works: inside the V8 engine by pcwalton on Monday August 21, 2017 @06:01PM (#15068170)
It could be done, yes, but you'd have to weigh the benefits of caching against the performance downsides of linking and IR serialization. I wouldn't be surprised if it ends up not being worth it in practice.