RE: [PHP-DEV] Giving Globals the CV treatment [WAS: Runtime JIT Proposals]
| From: | Dmitry Stogov | Date: | Tue, 23 Jan 2007 18:01:45 +0000 |
| Subject: | RE: [PHP-DEV] Giving Globals the CV treatment [WAS: Runtime JIT Proposals] | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-27613@lists.php.net to get a copy of this message | ||
OK. Now your patch will work, but I would like to think about more elegant
solution.
The problem that I am busy with other work.
Could you please wait a week and then commit it if I won't return (on the
next Tuesday).
Thanks. Dmitry.
> -----Original Message-----
> From: Sara Golemon [mailto:pollita@php.net]
> Sent: Tuesday, January 23, 2007 12:34 PM
> To: Dmitry Stogov
> Cc: internals@lists.php.net; 'Andrei Zmievski'; 'Andi Gutmans'
> Subject: Re: [PHP-DEV] Giving Globals the CV treatment [WAS:
> Runtime JIT Proposals]
>
>
> > At first I don't understand why you are trying to
> deallocate variable.
> >
> > + if (CG(active_op_array)->T == (parent->u.var - 1)) {
> > + CG(active_op_array)->T--;
> > + }
> >
> > Isn't the same variable reused as result of ZEND_FETCH_DIM?
> >
> Yeah, I hastily recanted that about three minutes after my post... It
> was accidentally left in from a prior attempt. You're
> absolutely right
> that it doesn't belong there. Just my sloppiness in
> preparing the patch
> for posting.
>
> > The rest of patch seems proper, but I am not sure about
> place. Why we
> > optimize @$a['b'] but not @$a->b and @$a->b()?
> >
> > I would prefer to find more general solution.
> >
> Well, we could do it in the end_variable_parse, but at that point we
> actually *do* have to erase an op and a temp var. Doing it at this
> stage prevents the extra op/tempvar from being allocated at all.
>
> Looking at do_fetch_property, I notice that we're already doing this
> (after a fashion) for turning $this->prop into an immediate FETCH_OBJ
> (setting op1 to UNUSED to indicate $this). This approach really just
> builds on that existing solution.
>
> I've updated the patch (adding FETCH_OBJ support and applying some
> concepts from do_fetch_property's implementation for $this
> optimization
> to the FETCH_DIM/OBJ CV implementations).
>
> I suppose the one alternate approach we could take would be to make a
> macro/inline func out of this rewriting step so that the
> DIM/OBJ parsers
> can use the same code-base. I might even suggest we look at
> supporting
> op1->IS_UNUSED for $this when used with array access on objects (but
> that would require an update so that the opcode handler
> supports it as
> well).
>
> -Sara
>