Re: TracingPHP

From: Date: Tue, 02 Sep 2008 16:01:07 +0000
Subject: Re: TracingPHP
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-40214@lists.php.net to get a copy of this message
On Mon Aug 25 06:28 PM, steve wrote:
Has anyone had success compiling PHP with LLVM?
I haven't tried it, here is a good summary: http://llvm.org/devmtg/2008-08/Lopes_PHP-JIT-InTwoDays.pdf In short, it is 'slower' but that seems to be without any caching of the "bytecode"
So yes, we were able to make a JIT compiler for PHP, that is able to produce (and execute) binary code out of PHP scripts. It integrates nicely with the Zend VM and requires no modifications to it. The project is nowhere near completion, as caching of the code isn't implemented yet. Also, off-line compilation (i.e. producing standalone executables) is not working yet as well. There's also another project (completely unrelated and independent) that aims to compile PHP scripts to .NET bytecode (MSIL), but the approach is quite different.
That's from my research, maybe someone can correct me here. Isn't using something like Zend Guard (converts code into opcode) then caching the opcodes essentially JIT?
The products available out there do not produce machine code, so I wouldn't call them JIT compilers. Nuno

« previous php.internals (#40214) next »