Re: Giving Globals the CV treatment [WAS: Runtime JIT Proposals]

php.internals

Sara Golemon

19 years ago
ilia@prohost.org wrote:
> The optimizer already does most of those things, so I think things like > that are best left there rather then being done in the core. >
How exactly does the (by "the" I presume you mean "your") optimizer manage to turn $_POST['foo'] into a single CV based DIM fetch? The current get_ptr_ptr_cv semantics only pull from EG(active_symbol_table)... Or do you mean that they turn: ZEND_FETCH_R $0 'GLOBALS' (global) ZEND_FETCH_DIM_R $1 $0 'foo' Into: ZEND_FETCH_R $1 'foo' (global) And: ZEND_BEGIN_SILENCE ZEND_FETCH_R $0 'foo' (local) ZEND_FETCH_DIM_R $1 $0 'bar' ZEND_END_SILENCE Into: ZEND_BEGIN_SILENCE ZEND_FETCH_DIM_R $1 !0 'bar' ZEND_END_SILENCE With !0 being a newly generated CV pointing at $foo -Sara

Ilia A.

19 years ago
On 18-Jan-07, at 9:12 PM, Sara Golemon wrote:
> Or do you mean that they turn: > ZEND_FETCH_R $0 'GLOBALS' (global) > ZEND_FETCH_DIM_R $1 $0 'foo' > > Into: > ZEND_FETCH_R $1 'foo' (global)
Yup.
> And: > ZEND_BEGIN_SILENCE > ZEND_FETCH_R $0 'foo' (local) > ZEND_FETCH_DIM_R $1 $0 'bar' > ZEND_END_SILENCE > > Into: > ZEND_BEGIN_SILENCE > ZEND_FETCH_DIM_R $1 !0 'bar' > ZEND_END_SILENCE
I haven't implemented this yet, but it shouldn't be too hard to add. Ilia Alshanetsky