From f0c8366a9e8acd832b6d433035d162218f8db1ec Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 8 Jul 2010 14:05:11 +0000 Subject: - use interned strings for auto globals - $GLOBALS became a JIT autoglobal, so it's initialized only if used (this may affect opcode caches) --- main/php_variables.c | 184 +++++++++++++++++++++++++++------------------------ 1 file changed, 96 insertions(+), 88 deletions(-) (limited to 'main/php_variables.c') diff --git a/main/php_variables.c b/main/php_variables.c index a37349ac1d..e45598f603 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -643,98 +643,106 @@ static zend_bool php_auto_globals_create_request(char *name, uint name_len TSRML */ int php_hash_environment(TSRMLS_D) { - char *p; - unsigned char _gpc_flags[5] = {0, 0, 0, 0, 0}; - struct auto_global_record { - char *name; - uint name_len; - zend_bool jit_initialization; - } auto_global_records[] = { - { "_POST", sizeof("_POST"), 0 }, - { "_GET", sizeof("_GET"), 0 }, - { "_COOKIE", sizeof("_COOKIE"), 0 }, - { "_SERVER", sizeof("_SERVER"), 1 }, - { "_ENV", sizeof("_ENV"), 1 }, - { "_FILES", sizeof("_FILES"), 0 }, - }; - size_t num_track_vars = sizeof(auto_global_records)/sizeof(struct auto_global_record); - size_t i; - - /* jit_initialization = 0; */ - for (i=0; i