php-src/Zend/zend_vm_execute.skl
Dmitry Stogov 49cf7c5d12 Don't propogate "fake" EX(called_scope) and EX(This) into each internal function.
They need quite seldom and it's cheaper to get them from corresponfing upper stack frame.
2015-04-23 12:16:37 +03:00

49 lines
1.1 KiB
Plaintext

{%DEFINES%}
ZEND_API void {%EXECUTOR_NAME%}_ex(zend_execute_data *ex)
{
DCL_OPLINE
{%HELPER_VARS%}
{%INTERNAL_LABELS%}
LOAD_OPLINE();
while (1) {
{%ZEND_VM_CONTINUE_LABEL%}
{%ZEND_VM_DISPATCH%} {
{%INTERNAL_EXECUTOR%}
}
}
zend_error_noreturn(E_CORE_ERROR, "Arrived at end of main loop which shouldn't happen");
}
ZEND_API void zend_{%EXECUTOR_NAME%}(zend_op_array *op_array, zval *return_value)
{
zend_execute_data *execute_data;
if (EG(exception) != NULL) {
return;
}
execute_data = zend_vm_stack_push_call_frame(ZEND_CALL_TOP_CODE,
(zend_function*)op_array, 0, zend_get_called_scope(EG(current_execute_data)), zend_get_this_object(EG(current_execute_data)));
if (EG(current_execute_data)) {
execute_data->symbol_table = zend_rebuild_symbol_table();
} else {
execute_data->symbol_table = &EG(symbol_table);
}
EX(prev_execute_data) = EG(current_execute_data);
i_init_execute_data(execute_data, op_array, return_value);
zend_{%EXECUTOR_NAME%}_ex(execute_data);
}
{%EXTERNAL_EXECUTOR%}
void {%INITIALIZER_NAME%}(void)
{
{%EXTERNAL_LABELS%}
}