summaryrefslogtreecommitdiff
path: root/Zend/zend_execute_API.c
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2000-08-09 19:22:35 +0000
committerZeev Suraski <zeev@php.net>2000-08-09 19:22:35 +0000
commitc06692e9ec92bdbe22e7a4149b5365635c4ad950 (patch)
treefb3e7ccb8c5187dd8d39aacd97d2707739982769 /Zend/zend_execute_API.c
parent609577d8826e5a23565eb8fdf5033d60ed505c4e (diff)
downloadphp-git-c06692e9ec92bdbe22e7a4149b5365635c4ad950.tar.gz
The patch we promised - redesigned the compilation/execution API:
Advantages: - Smaller memory footprint for the op arrays - Slightly faster compilation times (due to saved erealloc() calls and faster zend_op initialization) - include_once() & require_once() share the same file list - Consistency between include() and require() - this mostly means that return() works inside require()'d files just as it does in include() files (it used to be meaningless in require()'d files, most of the time (see below)) - Made require() consistent with itself. Before, if the argument was not a constant string, require() took the include() behavior (with return()). - Removed lots of duplicate code. Bottom line - require() and include() are very similar now; require() is simply an include() which isn't allowed to fail. Due to the erealloc() calls for large op arrays, require() didn't end up being any faster than include() in the Zend engine.
Diffstat (limited to 'Zend/zend_execute_API.c')
-rw-r--r--Zend/zend_execute_API.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 16853bcadb..8a3f147bfb 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -115,8 +115,7 @@ void init_executor(CLS_D ELS_DC)
original_sigsegv_handler = signal(SIGSEGV, zend_handle_sigsegv);
#endif
EG(return_value_ptr_ptr) = &EG(global_return_value_ptr);
- EG(global_return_value_ptr) = &EG(global_return_value);
- INIT_ZVAL(EG(global_return_value));
+ EG(global_return_value_ptr) = NULL;
EG(symtable_cache_ptr) = EG(symtable_cache)-1;
EG(symtable_cache_limit)=EG(symtable_cache)+SYMTABLE_CACHE_SIZE-1;
@@ -129,7 +128,6 @@ void init_executor(CLS_D ELS_DC)
zend_ptr_stack_init(&EG(argument_stack));
- EG(main_op_array) = NULL;
zend_hash_init(&EG(symbol_table), 50, NULL, ZVAL_PTR_DTOR, 0);
EG(active_symbol_table) = &EG(symbol_table);
@@ -155,11 +153,6 @@ void init_executor(CLS_D ELS_DC)
void shutdown_executor(ELS_D)
{
- if (EG(global_return_value_ptr) == &EG(global_return_value)) {
- zval_dtor(&EG(global_return_value));
- } else {
- zval_ptr_dtor(EG(return_value_ptr_ptr));
- }
zend_ptr_stack_destroy(&EG(arg_types_stack));
while (EG(symtable_cache_ptr)>=EG(symtable_cache)) {
@@ -180,10 +173,6 @@ void shutdown_executor(ELS_D)
zend_ptr_stack_destroy(&EG(argument_stack));
/* Destroy all op arrays */
- if (EG(main_op_array)) {
- destroy_op_array(EG(main_op_array));
- efree(EG(main_op_array));
- }
zend_hash_apply(EG(function_table), (int (*)(void *)) is_not_internal_function);
zend_hash_apply(EG(class_table), (int (*)(void *)) is_not_internal_class);
@@ -236,8 +225,8 @@ ZEND_API char *get_active_function_name()
ZEND_API char *zend_get_executed_filename(ELS_D)
{
- if (EG(opline_ptr)) {
- return active_opline->filename;
+ if (EG(active_op_array)) {
+ return EG(active_op_array)->filename;
} else {
return "[no active file]";
}