cvs: ZendEngine2 / zend_execute_API.c zend_globals.h

From: Date: Mon, 23 Aug 2004 20:57:40 +0000
Subject: cvs: ZendEngine2 / zend_execute_API.c zend_globals.h
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-2891@lists.php.net to get a copy of this message
helly Mon Aug 23 16:57:40 2004 EDT Modified files: /ZendEngine2 zend_execute_API.c zend_globals.h Log: - Boost up __autoload() calls by caching the lookup http://cvs.php.net/diff.php/ZendEngine2/zend_execute_API.c?r1=1.292&r2=1.293&ty=u Index: ZendEngine2/zend_execute_API.c diff -u ZendEngine2/zend_execute_API.c:1.292 ZendEngine2/zend_execute_API.c:1.293 --- ZendEngine2/zend_execute_API.c:1.292 Thu Aug 19 16:29:04 2004 +++ ZendEngine2/zend_execute_API.c Mon Aug 23 16:57:40 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute_API.c,v 1.292 2004/08/19 20:29:04 andi Exp $ */ +/* $Id: zend_execute_API.c,v 1.293 2004/08/23 20:57:40 helly Exp $ */ #include <stdio.h> #include <signal.h> @@ -138,6 +138,7 @@ EG(in_execution) = 0; EG(in_autoload) = NULL; + EG(autoload_func) = NULL; zend_ptr_stack_init(&EG(argument_stack)); zend_ptr_stack_push(&EG(argument_stack), (void *) NULL); @@ -878,6 +879,8 @@ char *lc_name; zval *exception; char dummy = 1; + zend_fcall_info fcall_info; + zend_fcall_info_cache fcall_cache; lc_name = do_alloca(name_length + 1); zend_str_tolower_copy(lc_name, name, name_length); @@ -911,10 +914,26 @@ ZVAL_STRINGL(class_name_ptr, name, name_length, 0); args[0] = &class_name_ptr; + + fcall_info.size = sizeof(fcall_info); + fcall_info.function_table = EG(function_table); + fcall_info.function_name = &autoload_function; + fcall_info.symbol_table = NULL; + fcall_info.retval_ptr_ptr = &retval_ptr; + fcall_info.param_count = 1; + fcall_info.params = args; + fcall_info.object_pp = NULL; + fcall_info.no_separation = 1; + + fcall_cache.initialized = EG(autoload_func) ? 1 : 0; + fcall_cache.function_handler = EG(autoload_func); + fcall_cache.calling_scope = NULL; + fcall_cache.object_pp = NULL; exception = EG(exception); EG(exception) = NULL; - retval = call_user_function_ex(EG(function_table), NULL, &autoload_function, &retval_ptr, 1, args, 0, NULL TSRMLS_CC); + retval = zend_call_function(&fcall_info, &fcall_cache TSRMLS_CC); + EG(autoload_func) = fcall_cache.function_handler; zend_hash_del(EG(in_autoload), lc_name, name_length+1); http://cvs.php.net/diff.php/ZendEngine2/zend_globals.h?r1=1.136&r2=1.137&ty=u Index: ZendEngine2/zend_globals.h diff -u ZendEngine2/zend_globals.h:1.136 ZendEngine2/zend_globals.h:1.137 --- ZendEngine2/zend_globals.h:1.136 Thu Aug 19 16:29:04 2004 +++ ZendEngine2/zend_globals.h Mon Aug 23 16:57:40 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_globals.h,v 1.136 2004/08/19 20:29:04 andi Exp $ */ +/* $Id: zend_globals.h,v 1.137 2004/08/23 20:57:40 helly Exp $ */ #ifndef ZEND_GLOBALS_H #define ZEND_GLOBALS_H @@ -192,6 +192,7 @@ zend_bool in_execution; HashTable *in_autoload; + zend_function *autoload_func; zend_bool bailout_set; zend_bool full_tables_cleanup; zend_bool ze1_compatibility_mode;

« previous php.zend-engine.cvs (#2891) next »