com php-src: Avoid repeatable zend_is_autogolobal() c alls: ext/opcache/ZendAccelerator.c ext/opcache/ZendAcc elerator.h
| From: | Dmitry Stogov | Date: | Mon, 09 Jun 2014 20:16:18 +0000 |
| Subject: | com php-src: Avoid repeatable zend_is_autogolobal() c alls: ext/opcache/ZendAccelerator.c ext/opcache/ZendAcc elerator.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-78784@lists.php.net to get a copy of this message | ||
Commit: 15ba03fc80d88481b68ad6aaa8d6b6070b26a1ba
Author: Dmitry Stogov <dmitry@zend.com> Tue, 10 Jun 2014 00:16:18 +0400
Parents: 7c045c61f03abe38c0f07aab88c6715e8db04550
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=15ba03fc80d88481b68ad6aaa8d6b6070b26a1ba
Log:
Avoid repeatable zend_is_autogolobal() calls
Changed paths:
M ext/opcache/ZendAccelerator.c
M ext/opcache/ZendAccelerator.h
Diff:
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 70dbc2c..37e0b3b 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -1281,7 +1281,8 @@ static void zend_accel_set_auto_globals(int mask TSRMLS_DC)
int n = 1;
for (i = 0; i < ag_size ; i++) {
- if (mask & n) {
+ if ((mask & n) && !(ZCG(auto_globals_mask) & n)) {
+ ZCG(auto_globals_mask) |= n;
zend_is_auto_global(jit_auto_globals_str[i] TSRMLS_CC);
}
n += n;
@@ -2110,6 +2111,7 @@ static void accel_activate(void)
SHM_UNPROTECT();
/* PHP-5.4 and above return "double", but we use 1 sec precision */
+ ZCG(auto_globals_mask) = 0;
ZCG(request_time) = (time_t)sapi_get_request_time(TSRMLS_C);
ZCG(cache_opline) = NULL;
ZCG(cache_persistent_script) = NULL;
diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h
index 46e97a4..bfa0386 100644
--- a/ext/opcache/ZendAccelerator.h
+++ b/ext/opcache/ZendAccelerator.h
@@ -261,6 +261,7 @@ typedef struct _zend_accel_globals {
char *include_path; /* current section of "include_path" directive
*/
int include_path_len; /* "include_path" string length */
int include_path_check;
+ int auto_globals_mask;
time_t request_time;
/* preallocated shared-memory block to save current script */
void *mem;