Re: com php-src: Fix class constant fetching: Zend/tests/class_constant_to_reference_cached.phpt Zend/zend_execute.c Zend/zend_vm_def.h
Zend/zend_vm_execute.h
| From: | Nikita Popov | Date: | Thu, 29 May 2014 22:27:53 +0000 |
| Subject: | Re: com php-src: Fix class constant fetching: Zend/tests/class_constant_to_reference_cached.phpt Zend/zend_execute.c Zend/zend_vm_def.h Zend/zend_vm_execute.h |
||
| References: | 1 2 3 4 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-78644@lists.php.net to get a copy of this message | ||
On Thu, May 29, 2014 at 11:34 AM, Dmitry Stogov <dmitry@zend.com> wrote:
> Thanks. I saw the patch, but didn't check it yet.
>
> BTW: I have one big improvement idea, that might correlate with the work
> you made.
>
> Currently, when we pass an argument to user php function, it's always
> copied twice.
> Once by SEND instruction, and then by RECV.
> It means that we not only do the double work, but also keep two copies of
> the same zval on VM stack.
> I started thinking (in background yet) how it might be improved.
> It's not going to be easy and may require significant redesign, but it
> must make significant gain.
> what do you think?
>
I think this is a good idea in principle (and iirc this is what LuaJIT
does), but I'm not sure whether this is really feasible for PHP. If we
share the storage for args pushed on the stack and the CVs used to refer to
them in functions, this means that any change to the CV will also change
the passed argument. That usually doesn't matter, but for example
func_get_arg(s) should always return the original argument(s), which
wouldn't work anymore with such an approach. Same applies to backtraces for
exceptions etc.
Nikita