dmitry Fri May 19 06:11:02 2006 UTC Modified files: /ZendEngine2 zend.c zend.h zend_extensions.h zend_globals.h /php-src/ext/standard basic_functions.c /php-src/main main.c Log: Optimized zend_try/zend_catch macroses (eliminated memcpy()) http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend.c?r1=1.355&r2=1.356&diff_format=u Index: ZendEngine2/zend.c diff -u ZendEngine2/zend.c:1.355 ZendEngine2/zend.c:1.356 --- ZendEngine2/zend.c:1.355 Wed May 17 13:28:20 2006 +++ ZendEngine2/zend.c Fri May 19 06:11:02 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend.c,v 1.355 2006/05/17 13:28:20 iliaa Exp $ */ +/* $Id: zend.c,v 1.356 2006/05/19 06:11:02 dmitry Exp $ */ #include "zend.h" #include "zend_extensions.h" @@ -1192,14 +1192,14 @@ { TSRMLS_FETCH(); - if (!EG(bailout_set)) { + if (!EG(bailout)) { zend_output_debug_string(1, "%s(%d) : Bailed out without a bailout address!", filename, lineno); exit(-1); } CG(unclean_shutdown) = 1; CG(in_compilation) = EG(in_execution) = 0; EG(current_execute_data) = NULL; - longjmp(EG(bailout), FAILURE); + longjmp(*EG(bailout), FAILURE); } END_EXTERN_C() http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend.h?r1=1.321&r2=1.322&diff_format=u Index: ZendEngine2/zend.h diff -u ZendEngine2/zend.h:1.321 ZendEngine2/zend.h:1.322 --- ZendEngine2/zend.h:1.321 Tue May 9 21:30:11 2006 +++ ZendEngine2/zend.h Fri May 19 06:11:02 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend.h,v 1.321 2006/05/09 21:30:11 helly Exp $ */ +/* $Id: zend.h,v 1.322 2006/05/19 06:11:02 dmitry Exp $ */ #ifndef ZEND_H #define ZEND_H @@ -489,19 +489,19 @@ #define zend_try \ { \ - jmp_buf orig_bailout; \ - zend_bool orig_bailout_set=EG(bailout_set); \ + jmp_buf *orig_bailout = EG(bailout); \ + jmp_buf bailout; \ \ - EG(bailout_set) = 1; \ - memcpy(&orig_bailout, &EG(bailout), sizeof(jmp_buf)); \ - if (setjmp(EG(bailout))==0) + EG(bailout) = &bailout; \ + if (setjmp(bailout)==0) { #define zend_catch \ - else + } else { \ + EG(bailout) = orig_bailout; #define zend_end_try() \ - memcpy(&EG(bailout), &orig_bailout, sizeof(jmp_buf)); \ - EG(bailout_set) = orig_bailout_set; \ + } \ + EG(bailout) = orig_bailout; \ } -#define zend_first_try EG(bailout_set)=0; zend_try +#define zend_first_try EG(bailout)=NULL; zend_try BEGIN_EXTERN_C() ZEND_API char *get_zend_version(void); http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_extensions.h?r1=1.72&r2=1.73&diff_format=u Index: ZendEngine2/zend_extensions.h diff -u ZendEngine2/zend_extensions.h:1.72 ZendEngine2/zend_extensions.h:1.73 --- ZendEngine2/zend_extensions.h:1.72 Tue Feb 21 08:00:39 2006 +++ ZendEngine2/zend_extensions.h Fri May 19 06:11:02 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_extensions.h,v 1.72 2006/02/21 08:00:39 dmitry Exp $ */ +/* $Id: zend_extensions.h,v 1.73 2006/05/19 06:11:02 dmitry Exp $ */ #ifndef ZEND_EXTENSIONS_H #define ZEND_EXTENSIONS_H @@ -27,7 +27,7 @@ /* The first number is the engine version and the rest is the date. * This way engine 2/3 API no. is always greater than engine 1 API no.. */ -#define ZEND_EXTENSION_API_NO 320051025 +#define ZEND_EXTENSION_API_NO 320060519 typedef struct _zend_extension_version_info { int zend_extension_api_no; http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_globals.h?r1=1.158&r2=1.159&diff_format=u Index: ZendEngine2/zend_globals.h diff -u ZendEngine2/zend_globals.h:1.158 ZendEngine2/zend_globals.h:1.159 --- ZendEngine2/zend_globals.h:1.158 Mon May 15 14:53:47 2006 +++ ZendEngine2/zend_globals.h Fri May 19 06:11:02 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_globals.h,v 1.158 2006/05/15 14:53:47 dmitry Exp $ */ +/* $Id: zend_globals.h,v 1.159 2006/05/19 06:11:02 dmitry Exp $ */ #ifndef ZEND_GLOBALS_H #define ZEND_GLOBALS_H @@ -169,7 +169,7 @@ HashTable included_files; /* files already included */ - jmp_buf bailout; + jmp_buf *bailout; int error_reporting; int orig_error_reporting; @@ -192,7 +192,6 @@ zend_bool in_execution; HashTable *in_autoload; zend_function *autoload_func; - zend_bool bailout_set; zend_bool full_tables_cleanup; /* for extended information support */ http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/basic_functions.c?r1=1.771&r2=1.772&diff_format=u Index: php-src/ext/standard/basic_functions.c diff -u php-src/ext/standard/basic_functions.c:1.771 php-src/ext/standard/basic_functions.c:1.772 --- php-src/ext/standard/basic_functions.c:1.771 Sat May 13 17:53:01 2006 +++ php-src/ext/standard/basic_functions.c Fri May 19 06:11:02 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.771 2006/05/13 17:53:01 helly Exp $ */ +/* $Id: basic_functions.c,v 1.772 2006/05/19 06:11:02 dmitry Exp $ */ #include "php.h" #include "php_streams.h" @@ -2316,13 +2316,13 @@ void php_call_shutdown_functions(TSRMLS_D) { - if (BG(user_shutdown_function_names)) + if (BG(user_shutdown_function_names)) { zend_try { zend_hash_apply(BG(user_shutdown_function_names), (apply_func_t) user_shutdown_function_call TSRMLS_CC); - memcpy(&EG(bailout), &orig_bailout, sizeof(jmp_buf)); - php_free_shutdown_functions(TSRMLS_C); } zend_end_try(); + php_free_shutdown_functions(TSRMLS_C); + } } void php_free_shutdown_functions(TSRMLS_D) http://cvs.php.net/viewcvs.cgi/php-src/main/main.c?r1=1.689&r2=1.690&diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.689 php-src/main/main.c:1.690 --- php-src/main/main.c:1.689 Tue May 16 00:40:36 2006 +++ php-src/main/main.c Fri May 19 06:11:02 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.689 2006/05/16 00:40:36 iliaa Exp $ */ +/* $Id: main.c,v 1.690 2006/05/19 06:11:02 dmitry Exp $ */ /* {{{ includes */ @@ -1540,7 +1540,7 @@ ts_allocate_id(&core_globals_id, sizeof(php_core_globals), (ts_allocate_ctor) core_globals_ctor, NULL); core_globals = ts_resource(core_globals_id); #endif - EG(bailout_set) = 0; + EG(bailout) = NULL; EG(error_reporting) = E_ALL & ~E_NOTICE; PG(header_is_being_sent) = 0;
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php