The whole idea is great, but it'll work without problems only if
switch-tables are constructed at compile (or optimization) time.

The idea also won't work with variables and unresolved constants as
"case" labels (I saw your extension already carries about this limitation).

I think the proper way to implement the idea is introducing a new opcode
ZEND_SWITCH which has switch table as IS_CONSTANT_ARRAY operand.

Thanks. Dmitry.

Stefan Esser wrote:
> Hi Dmitry,
> 
>> As you set the extended_value in shared memory to point into process
>> memory the other process will read it and look into it's own memory, and
>> of course it won't find proper switch-table there.
> 
> In case the opcode cache directly uses op_array mapped in shared memory
> the extension should result in a slow down because every . However it
> SHOULD detect that the extended_value points to an invalid memory
> address, because it checks if it points into the memory allocated. The
> heap should be random enough to catch this most of the time.
> 
> But yeah I know that there are some (potential) problems ;) That is why
> it is experimental. The bigger question is however if the whole idea
> fails with some switch() constructs.
> 
> Stefan Esser

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to