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

- Thread: https://externals.io/message/27531
- Original archive: https://news-web.php.net/php.internals/27531
- Started by Sara Golemon on 2007-01-19T02:12:59+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #27531 — Sara Golemon — 2007-01-19T02:12:59+00:00

URL: https://externals.io/message/27531#27531

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

---

## #27532 — Ilia Alshanetsky — 2007-01-19T02:32:30+00:00

URL: https://externals.io/message/27531#27532 · In reply to: #27531

> 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
