Re: Method call improvements
| From: | Dmitry Stogov | Date: | Tue, 12 May 2009 06:25:47 +0000 |
| Subject: | Re: Method call improvements | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-43893@lists.php.net to get a copy of this message | ||
Hi Paul,
Paul Biggar wrote:
On Mon, May 11, 2009 at 7:47 PM, Guilherme Blanco <guilhermeblanco@gmail.com> wrote:I know PHP limitations, and I meant additional lookup caches for one or few results connected directly to ZEND_INIT_METHOD_CALL (and family) opcodes.What's the status on this one?!I think it died from neglect. But it was a really good idea. One question that was raised was:On Thu, Jan 22, 2009 at 10:20 AM, Dmitry Stogov <dmitry@zend.com> wrote:You can't actually use PICs or even ICs with the Zend engine, because you can't insert code into the callee method's header (you would need a JIT). You also wouldn't want to, since PHP can't use the recompilation techniques that Self had. You can use lookup caches, which is exactly what the original patch was.However we can introduce some indirect table associated with op_array, which can be used to implement inline caches without direct opcode modification (in the same way as IS_CV variables work). There are a lot of papers about polymorphic inline caches (e.g. http://research.sun.com/self/papers/pics.html) which we probably should use to not to invite bicycle.
FWIW, since PHP has a static inheritence chain, the best approach seems to be to build a virtual dispatch table, instead of a hashtable for functions. However, there might be some esoteric extensions which make this difficult.The real things is even worse as during compilation of a class it's parent class doesn't have to be known. So construction of VMTs becomes a bit problematic. BTW we could think in this way... Thanks. Dmitry.
Paul