23

I've been searching for a while now, but I could not find any engine that emits LLVM bytecode. But somehow I cannot belief there is no such engine :)

tshepang
  • 12,111
  • 21
  • 91
  • 136
manuels
  • 1,511
  • 3
  • 14
  • 26
  • IIRC mozilla investigated the possibility of using LLVM as a backend for their JIT but ruled it out, saying it would be too slow or something like that – CAFxX Dec 11 '11 at 21:11
  • @CAFxX: Do you have any reference about that? – Albert Mar 04 '14 at 14:24
  • 3
    @Albert sure: https://hacks.mozilla.org/2009/07/tracemonkey-overview/comment-page-2/#comment-67629 – CAFxX Mar 05 '14 at 16:59
  • 2
    [LLV8](https://github.com/ispras/llv8) is an experimental top-tier compiler for V8 JavaScript Engine. LLV8 leverages the power of LLVM MCJIT to produce highly optimized code. last commit was on Sep 8, 2016. – Wis Jan 15 '18 at 20:35

4 Answers4

9

JXcore will be your best bet going forward IMHO - when they convert from V8 to LLVM, which is an objective of theirs when they reach version 2 (according to their roadmap), it will then compile your javascript sources into native code.

You can get more info on JXcore here.

This part of the answer is in a response to Albert's answer:

According to ktrzeciaknubisa's post they will publish the source as soon as they are out of the beta stages and have clean code...this might take some time.

Laurens Holst
  • 20,156
  • 2
  • 29
  • 33
WitHeld
  • 305
  • 3
  • 8
3

It appears Webkit now includes this functionality as of May 2014:

... the WebKit project has unified its existing JavaScript compilation infrastructure with the state-of-the-art LLVM optimizer.

https://webkit.org/blog/3362/introducing-the-webkit-ftl-jit/

The code for this seems to be here:

http://www.opensource.apple.com/source/JavaScriptCore/JavaScriptCore-7600.1.4.17.5/ftl/FTLLowerDFGToLLVM.cpp

Johann
  • 4,107
  • 3
  • 40
  • 39
  • 1
    They've since replaced LLVM with the Bare Bones Backend. https://webkit.org/blog/5852/introducing-the-b3-jit-compiler/ – David Braun Jan 10 '17 at 19:34
3

There doesn't seem to be any.

In the list of projects build with LLVM there is nothing about Javascript.

Guffa
  • 687,336
  • 108
  • 737
  • 1,005
1

JXCore (a fork of Nodejs) claims to have implemented that. Since Feb 2015, it is open source, the code is here on GitHub.

koppor
  • 19,079
  • 15
  • 119
  • 161
Albert
  • 65,406
  • 61
  • 242
  • 386
  • Where is it stated, that JXcore is a commercial fork? In the contrary - it is an open source project https://github.com/jxcore/jxcore (starting from mid of Feb 2015, but was never commercial though) – infografnet Mar 23 '15 at 16:39
  • But they moved that to "somewhere down the road" and use V8 and SpiderMonkey now – Josef Mar 25 '15 at 16:59