Changeset 859


Ignore:
Timestamp:
2012-03-28T18:15:21+02:00 (3 years ago)
Author:
moo
Message:

expand_path for DIR FILE support

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/processor.m4

    r856 r859  
    10741074    PROCESS(zend_ulong, refcount) 
    10751075 
    1076     PROCESS(size_t, file_size) 
    10771076    PROCESS(zend_ulong, hits) 
    10781077    PROCESS(size_t, size) 
     
    11621161    IFSTORE(`dst->refcount = 0; DONE(refcount)', `PROCESS(long, refcount)') 
    11631162    PROCESS(time_t, file_mtime) 
     1163    PROCESS(size_t, file_size) 
    11641164#ifdef HAVE_INODE 
    11651165    PROCESS(int, file_device) 
  • trunk/xcache.c

    r858 r859  
    44#endif 
    55 
    6 #if 0 
     6#if 1 
    77#define SHOW_DPRINT 
    88#endif 
     
    337337                    xc_entry_php_t *p_php = (xc_entry_php_t *) p; 
    338338                    xc_entry_php_t *xce_php = (xc_entry_php_t *) xce; 
    339                     fresh = p_php->file_mtime == xce_php->file_mtime && p_php->php->file_size == xce_php->php->file_size; 
     339                    fresh = p_php->file_mtime == xce_php->file_mtime && p_php->file_size == xce_php->file_size; 
    340340                } 
    341341                break; 
     
    364364} 
    365365/* }}} */ 
    366 static void xc_entry_hold_php_dmz(xc_cache_t *cache, xc_entry_php_t *xce TSRMLS_DC) /* {{{ */ 
    367 { 
    368     TRACE("hold %s", xce->entry.name.str.val); 
    369     xce->refcount ++; 
    370     xc_stack_push(&XG(php_holds)[cache->cacheid], (void *)xce); 
     366static void xc_entry_hold_php_dmz(xc_cache_t *cache, xc_entry_php_t *entry TSRMLS_DC) /* {{{ */ 
     367{ 
     368    TRACE("hold %d:%s", entry->file_inode, entry->entry.name.str.val); 
     369    entry->refcount ++; 
     370    xc_stack_push(&XG(php_holds)[cache->cacheid], (void *)entry); 
    371371} 
    372372/* }}} */ 
     
    686686            add_assoc_long_ex(ei, ZEND_STRS("size"),          entry->size + php->size); 
    687687            add_assoc_long_ex(ei, ZEND_STRS("phprefcount"),   php->refcount); 
    688             add_assoc_long_ex(ei, ZEND_STRS("file_size"),     php->file_size); 
     688            add_assoc_long_ex(ei, ZEND_STRS("file_mtime"),    entry_php->file_mtime); 
     689            add_assoc_long_ex(ei, ZEND_STRS("file_size"),     entry_php->file_size); 
    689690#ifdef HAVE_INODE 
    690691            add_assoc_long_ex(ei, ZEND_STRS("file_device"),   entry_php->file_device); 
    691692            add_assoc_long_ex(ei, ZEND_STRS("file_inode"),    entry_php->file_inode); 
    692693#endif 
    693             add_assoc_long_ex(ei, ZEND_STRS("file_mtime"),    entry_php->file_mtime); 
    694694 
    695695#ifdef HAVE_XCACHE_CONSTANT 
     
    826826    xc_stack_t *s; 
    827827    xc_cache_t *cache; 
    828     xc_entry_t *xce; 
     828    xc_entry_php_t *xce; 
    829829 
    830830    for (i = 0; i < cachecount; i ++) { 
    831831        s = &holds[i]; 
    832         TRACE("holded %d", xc_stack_count(s)); 
     832        TRACE("holded %d items", xc_stack_count(s)); 
    833833        if (xc_stack_count(s)) { 
    834834            cache = caches[i]; 
    835835            ENTER_LOCK(cache) { 
    836836                while (xc_stack_count(s)) { 
    837                     xce = (xc_entry_t*) xc_stack_pop(s); 
    838                     TRACE("unhold %s", xce->name.str.val); 
    839                     ((xc_entry_php_t *) xce)->refcount ++; 
    840                     assert(((xc_entry_php_t *) xce)->refcount >= 0); 
     837                    xce = (xc_entry_php_t *) xc_stack_pop(s); 
     838                    TRACE("unhold %d:%s", xce->file_inode, xce->entry.name.str.val); 
     839                    xce->refcount ++; 
     840                    assert(xce->refcount >= 0); 
    841841                } 
    842842            } LEAVE_LOCK(cache); 
     
    905905} 
    906906/* }}} */ 
    907  
    908 #if 0 /* {{{ note about php hashing */ 
    909 the folling note is written in the form of "got = from" 
    910  
    911 TODO: open_basedir 
    912  
    913 opened_path = stat || zend_compile_file 
    914  
    915 phphashid = inode ? inode : hash(basename) 
    916 md5key = md5(relativepath) 
    917 md5hashid = hash(md5key) 
    918 cachehashid = multislot ? hash(basename) : hash(phphashid) 
    919  
    920 cached = phphashid -> md5key -> cachedmd5info -> cachedphp 
    921 cachedphp = [phphashid, fullpath] 
    922 restoredphp = [fullpath, phphashid] 
    923  
    924 #endif /* }}} */ 
    925907 
    926908#define HASH(i) (i) 
     
    974956/* }}} */ 
    975957#define xc_entry_hash_var xc_entry_hash_name 
    976 static inline xc_hash_value_t xc_entry_hash_php(xc_entry_php_t *xce TSRMLS_DC) /* {{{ */ 
    977 { 
    978     return 
    979 #ifdef HAVE_INODE 
    980         xce->file_inode ? HASH(xce->file_device + xce->file_inode) : 
    981 #endif 
    982         xc_entry_hash_php_basename(xce TSRMLS_CC); 
    983 } 
    984 /* }}} */ 
    985958static void xc_entry_free_key_php(xc_entry_php_t *xce TSRMLS_DC) /* {{{ */ 
    986959{ 
     
    1000973/* }}} */ 
    1001974 
    1002 static int xc_entry_init_key_php(xc_entry_hash_t *entry_hash, xc_entry_php_t *xce, const char *filename TSRMLS_DC) /* {{{ */ 
    1003 { 
    1004     char opened_path_buffer[MAXPATHLEN]; 
    1005  
    1006     if (!filename || !SG(request_info).path_translated) { 
     975static int xc_entry_init_key_php(xc_compiler_t *compiler TSRMLS_DC) /* {{{ */ 
     976{ 
     977    if (!compiler->filename || !SG(request_info).path_translated) { 
    1007978        return FAILURE; 
    1008979    } 
    1009980 
    1010     if (strstr(filename, "://") != NULL) { 
     981    if (strstr(compiler->filename, "://") != NULL) { 
    1011982        return FAILURE; 
    1012983    } 
     
    1015986        struct stat buf, *pbuf; 
    1016987 
    1017         if (strcmp(SG(request_info).path_translated, filename) == 0) { 
     988        if (strcmp(SG(request_info).path_translated, compiler->filename) == 0) { 
    1018989            /* sapi has already done this stat() for us */ 
    1019990            pbuf = sapi_get_stat(TSRMLS_C); 
     
    1025996        /* absolute path */ 
    1026997        pbuf = &buf; 
    1027         if (IS_ABSOLUTE_PATH(filename, strlen(filename))) { 
    1028             if (VCWD_STAT(filename, pbuf) != 0) { 
     998        if (IS_ABSOLUTE_PATH(compiler->filename, strlen(compiler->filename))) { 
     999            if (VCWD_STAT(compiler->filename, pbuf) != 0) { 
    10291000                return FAILURE; 
    10301001            } 
     
    10331004 
    10341005        /* relative path */ 
    1035         if (*filename == '.' && (IS_SLASH(filename[1]) || filename[1] == '.')) { 
    1036             const char *ptr = filename + 1; 
     1006        if (*compiler->filename == '.' && (IS_SLASH(compiler->filename[1]) || compiler->filename[1] == '.')) { 
     1007            const char *ptr = compiler->filename + 1; 
    10371008            if (*ptr == '.') { 
    10381009                while (*(++ptr) == '.'); 
     
    10421013            } 
    10431014 
    1044             if (VCWD_STAT(filename, pbuf) != 0) { 
     1015            if (VCWD_STAT(compiler->filename, pbuf) != 0) { 
    10451016                return FAILURE; 
    10461017            } 
     
    10501021 
    10511022        /* use include_path */ 
    1052         if (xc_stat(filename, PG(include_path), pbuf TSRMLS_CC) != SUCCESS) { 
     1023        if (xc_stat(compiler->filename, PG(include_path), pbuf TSRMLS_CC) != SUCCESS) { 
    10531024            return FAILURE; 
    10541025        } 
     
    10641035        } 
    10651036 
    1066         xce->file_mtime   = pbuf->st_mtime; 
     1037        compiler->new_entry.file_mtime   = pbuf->st_mtime; 
     1038        compiler->new_entry.file_size    = pbuf->st_size; 
    10671039#ifdef HAVE_INODE 
    1068         xce->file_device  = pbuf->st_dev; 
    1069         xce->file_inode   = pbuf->st_ino; 
    1070 #endif 
    1071         xce->php->file_size = pbuf->st_size; 
     1040        compiler->new_entry.file_device  = pbuf->st_dev; 
     1041        compiler->new_entry.file_inode   = pbuf->st_ino; 
     1042#endif 
    10721043    } 
    10731044    else { /* XG(inode) */ 
    1074         xce->file_mtime   = 0; 
     1045        compiler->new_entry.file_mtime   = 0; 
     1046        compiler->new_entry.file_size    = 0; 
    10751047#ifdef HAVE_INODE 
    1076         xce->file_device  = 0; 
    1077         xce->file_inode   = 0; 
    1078 #endif 
    1079         xce->php->file_size = 0; 
    1080     } 
    1081  
     1048        compiler->new_entry.file_device  = 0; 
     1049        compiler->new_entry.file_inode   = 0; 
     1050#endif 
     1051        compiler->opened_path = expand_filepath(compiler->filename, compiler->opened_path_buffer TSRMLS_CC); 
     1052    } 
     1053 
     1054    UNISW(NOTHING, compiler->new_entry.entry.name_type = IS_STRING;) 
     1055    compiler->new_entry.entry.name.str.val = (char *) (compiler->opened_path ? compiler->opened_path : compiler->filename); 
     1056    compiler->new_entry.entry.name.str.len = strlen(compiler->new_entry.entry.name.str.val); 
     1057 
     1058    { 
     1059        xc_hash_value_t basename_hash_value; 
     1060        if ( 
     1061            xc_php_hcache.size > 1 
    10821062#ifdef HAVE_INODE 
    1083     if (!xce->file_inode) 
    1084 #endif 
    1085     { 
    1086         /* hash on filename, let's expand it to real path */ 
    1087         /* FIXME */ 
    1088         filename = expand_filepath(filename, opened_path_buffer TSRMLS_CC); 
    1089         if (filename == NULL) { 
    1090             return FAILURE; 
    1091         } 
    1092     } 
    1093  
    1094     UNISW(NOTHING, xce->entry.name_type = IS_STRING;) 
    1095     xce->entry.name.str.val = (char *) filename; 
    1096     xce->entry.name.str.len = strlen(filename); 
    1097  
    1098     entry_hash->cacheslotid = xc_php_hcache.size > 1 ? xc_hash_fold(xc_entry_hash_php_basename(xce TSRMLS_CC), &xc_php_hcache) : 0; 
    1099     entry_hash->entryslotid = xc_hash_fold(xc_entry_hash_php(xce TSRMLS_CC), &xc_php_hentry); 
    1100     xce->filepath  = NULL; 
    1101     xce->dirpath   = NULL; 
     1063            || !compiler->new_entry.file_inode 
     1064#endif 
     1065            ) 
     1066        { 
     1067            basename_hash_value = xc_entry_hash_php_basename(&compiler->new_entry TSRMLS_CC); 
     1068        } 
     1069 
     1070        compiler->entry_hash.cacheid = xc_php_hcache.size > 1 ? xc_hash_fold(basename_hash_value, &xc_php_hcache) : 0; 
     1071        compiler->entry_hash.entryslotid = xc_hash_fold( 
     1072#ifdef HAVE_INODE 
     1073                compiler->new_entry.file_inode 
     1074                ? HASH(compiler->new_entry.file_device + compiler->new_entry.file_inode) 
     1075                : 
     1076#endif 
     1077                basename_hash_value 
     1078                , &xc_php_hentry); 
     1079    } 
     1080 
     1081    compiler->new_entry.filepath  = NULL; 
     1082    compiler->new_entry.dirpath   = NULL; 
    11021083#ifdef IS_UNICODE 
    1103     xce->ufilepath = NULL; 
    1104     xce->udirpath  = NULL; 
     1084    compiler->new_entry.ufilepath = NULL; 
     1085    compiler->new_entry.udirpath  = NULL; 
    11051086#endif 
    11061087 
     
    11131094} 
    11141095/* }}} */ 
    1115 static int xc_entry_init_key_php_md5(xc_cache_t *cache, xc_entry_data_php_t *php, xc_entry_php_t *xce TSRMLS_DC) /* {{{ */ 
     1096static int xc_entry_init_key_php_md5(xc_cache_t *cache, xc_compiler_t *compiler TSRMLS_DC) /* {{{ */ 
    11161097{ 
    11171098    unsigned char   buf[1024]; 
     
    11211102    ulong           old_rsid = EG(regular_list).nNextFreeElement; 
    11221103 
    1123     stream = php_stream_open_wrapper(xce->entry.name.str.val, "rb", USE_PATH | REPORT_ERRORS | ENFORCE_SAFE_MODE | STREAM_DISABLE_OPEN_BASEDIR, NULL); 
     1104    stream = php_stream_open_wrapper(compiler->new_entry.entry.name.str.val, "rb", USE_PATH | REPORT_ERRORS | ENFORCE_SAFE_MODE | STREAM_DISABLE_OPEN_BASEDIR, NULL); 
    11241105    if (!stream) { 
    11251106        return FAILURE; 
     
    11301111        PHP_MD5Update(&context, buf, n); 
    11311112    } 
    1132     PHP_MD5Final((unsigned char *) php->md5.digest, &context); 
     1113    PHP_MD5Final((unsigned char *) compiler->new_php.md5.digest, &context); 
    11331114 
    11341115    php_stream_close(stream); 
     
    11411122    } 
    11421123 
    1143     php->hvalue = (xc_php_hash_md5(php TSRMLS_CC) & cache->hphp->mask); 
     1124    compiler->new_php.hvalue = (xc_php_hash_md5(&compiler->new_php TSRMLS_CC) & cache->hphp->mask); 
    11441125#ifdef XCACHE_DEBUG 
    11451126    { 
    11461127        char md5str[33]; 
    1147         make_digest(md5str, (unsigned char *) php->md5.digest); 
     1128        make_digest(md5str, (unsigned char *) compiler->new_php.md5.digest); 
    11481129        TRACE("md5 %s", md5str); 
    11491130    } 
     
    11531134} 
    11541135/* }}} */ 
    1155 static void xc_entry_init_key_php_entry(xc_entry_php_t *xce, ZEND_24(const) char *filepath TSRMLS_DC) /* {{{*/ 
    1156 { 
    1157     xce->filepath     = filepath; 
    1158     xce->filepath_len = strlen(xce->filepath); 
    1159     xce->dirpath      = estrndup(xce->filepath, xce->filepath_len); 
    1160     xce->dirpath_len  = zend_dirname(xce->dirpath, xce->filepath_len); 
     1136static void xc_entry_init_key_php_entry(xc_entry_php_t *entry_php, ZEND_24(const) char *filepath TSRMLS_DC) /* {{{*/ 
     1137{ 
     1138    entry_php->filepath     = filepath; 
     1139    entry_php->filepath_len = strlen(entry_php->filepath); 
     1140    entry_php->dirpath      = estrndup(entry_php->filepath, entry_php->filepath_len); 
     1141    entry_php->dirpath_len  = zend_dirname(entry_php->dirpath, entry_php->filepath_len); 
    11611142#ifdef IS_UNICODE 
    1162     zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &xce->ufilepath, &xce->ufilepath_len, xce->filepath, xce->filepath_len TSRMLS_CC); 
    1163     zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &xce->udirpath,  &xce->udirpath_len,  xce->dirpath,  xce->dirpath_len TSRMLS_CC); 
     1143    zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &entry_php->ufilepath, &entry_php->ufilepath_len, entry_php->filepath, entry_php->filepath_len TSRMLS_CC); 
     1144    zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &entry_php->udirpath,  &entry_php->udirpath_len,  entry_php->dirpath,  entry_php->dirpath_len TSRMLS_CC); 
    11641145#endif 
    11651146} 
     
    12121193} xc_const_usage_t; 
    12131194/* }}} */ 
    1214 static void xc_collect_op_array_info(xc_entry_php_t *xce, xc_entry_data_php_t *php, xc_const_usage_t *usage, xc_op_array_info_t *op_array_info, zend_op_array *op_array TSRMLS_DC) /* {{{ */ 
     1195static void xc_collect_op_array_info(xc_compiler_t *compiler, xc_const_usage_t *usage, xc_op_array_info_t *op_array_info, zend_op_array *op_array TSRMLS_DC) /* {{{ */ 
    12151196{ 
    12161197    int i; 
     
    12201201 
    12211202#define XCACHE_ANALYZE_LITERAL(type) \ 
    1222     if (zend_binary_strcmp(Z_STRVAL(literal->constant), Z_STRLEN(literal->constant), xce->type##path, xce->type##path_len) == 0) { \ 
     1203    if (zend_binary_strcmp(Z_STRVAL(literal->constant), Z_STRLEN(literal->constant), compiler->new_entry.type##path, compiler->new_entry.type##path_len) == 0) { \ 
    12231204        usage->type##path_used = 1; \ 
    12241205        literalinfo |= xcache_##literal##_is_##type; \ 
     
    12261207 
    12271208#define XCACHE_U_ANALYZE_LITERAL(type) \ 
    1228     if (zend_u_##binary_strcmp(Z_USTRVAL(literal->constant), Z_USTRLEN(literal->constant), xce->u##type##path, xce->u##type##path_len) == 0) { \ 
     1209    if (zend_u_##binary_strcmp(Z_USTRVAL(literal->constant), Z_USTRLEN(literal->constant), compiler->new_entry.u##type##path, compiler->new_entry.u##type##path_len) == 0) { \ 
    12291210        usage->u##type##path_used = 1; \ 
    12301211        literalinfo |= xcache_##literal##_is_##type; \ 
     
    12321213 
    12331214#define XCACHE_ANALYZE_OP(type, op) \ 
    1234     if (zend_binary_strcmp(Z_STRVAL(Z_OP_CONSTANT(opline->op)), Z_STRLEN(Z_OP_CONSTANT(opline->op)), xce->type##path, xce->type##path_len) == 0) { \ 
     1215    if (zend_binary_strcmp(Z_STRVAL(Z_OP_CONSTANT(opline->op)), Z_STRLEN(Z_OP_CONSTANT(opline->op)), compiler->new_entry.type##path, compiler->new_entry.type##path_len) == 0) { \ 
    12351216        usage->type##path_used = 1; \ 
    12361217        oplineinfo |= xcache_##op##_is_##type; \ 
     
    12381219 
    12391220#define XCACHE_U_ANALYZE_OP(type, op) \ 
    1240     if (zend_u_##binary_strcmp(Z_USTRVAL(Z_OP_CONSTANT(opline->op)), Z_USTRLEN(Z_OP_CONSTANT(opline->op)), xce->u##type##path, xce->u##type##path_len) == 0) { \ 
     1221    if (zend_u_##binary_strcmp(Z_USTRVAL(Z_OP_CONSTANT(opline->op)), Z_USTRLEN(Z_OP_CONSTANT(opline->op)), compiler->new_entry.u##type##path, compiler->new_entry.u##type##path_len) == 0) { \ 
    12411222        usage->u##type##path_used = 1; \ 
    12421223        oplineinfo |= xcache_##op##_is_##type; \ 
     
    15021483} 
    15031484/* }}} */ 
    1504 static zend_op_array *xc_compile_php(xc_entry_php_t *xce, xc_entry_data_php_t *php, zend_file_handle *h, int type TSRMLS_DC) /* {{{ */ 
     1485static zend_op_array *xc_compile_php(xc_compiler_t *compiler, zend_file_handle *h, int type TSRMLS_DC) /* {{{ */ 
    15051486{ 
    15061487    zend_op_array *op_array; 
     
    15151496    old_constinfo_cnt = zend_hash_num_elements(EG(zend_constants)); 
    15161497 
    1517     php->op_array = NULL; 
     1498    compiler->new_php.op_array = NULL; 
    15181499    XG(initial_compile_file_called) = 0; 
    15191500    zend_try { 
     
    15381519    /* {{{ prepare */ 
    15391520    zend_restore_compiled_filename(h->opened_path ? h->opened_path : (char *) h->filename TSRMLS_CC); 
    1540     php->op_array      = op_array; 
     1521    compiler->new_php.op_array = op_array; 
    15411522 
    15421523#ifdef HAVE_XCACHE_CONSTANT 
    1543     php->constinfo_cnt  = zend_hash_num_elements(EG(zend_constants)) - old_constinfo_cnt; 
    1544 #endif 
    1545     php->funcinfo_cnt   = zend_hash_num_elements(CG(function_table)) - old_funcinfo_cnt; 
    1546     php->classinfo_cnt  = zend_hash_num_elements(CG(class_table))    - old_classinfo_cnt; 
     1524    compiler->new_php.constinfo_cnt  = zend_hash_num_elements(EG(zend_constants)) - old_constinfo_cnt; 
     1525#endif 
     1526    compiler->new_php.funcinfo_cnt   = zend_hash_num_elements(CG(function_table)) - old_funcinfo_cnt; 
     1527    compiler->new_php.classinfo_cnt  = zend_hash_num_elements(CG(class_table))    - old_classinfo_cnt; 
    15471528#ifdef ZEND_ENGINE_2_1 
    1548     /* {{{ count php->autoglobal_cnt */ { 
     1529    /* {{{ count new_php.autoglobal_cnt */ { 
    15491530        Bucket *b; 
    15501531 
    1551         php->autoglobal_cnt = 0; 
     1532        compiler->new_php.autoglobal_cnt = 0; 
    15521533        for (b = CG(auto_globals)->pListHead; b != NULL; b = b->pListNext) { 
    15531534            zend_auto_global *auto_global = (zend_auto_global *) b->pData; 
    15541535            /* check if actived */ 
    15551536            if (auto_global->auto_global_callback && !auto_global->armed) { 
    1556                 php->autoglobal_cnt ++; 
     1537                compiler->new_php.autoglobal_cnt ++; 
    15571538            } 
    15581539        } 
     
    15621543 
    15631544#define X_ALLOC_N(var, cnt) do {     \ 
    1564     if (php->cnt) {                  \ 
    1565         ECALLOC_N(php->var, php->cnt); \ 
    1566         if (!php->var) {             \ 
     1545    if (compiler->new_php.cnt) {                  \ 
     1546        ECALLOC_N(compiler->new_php.var, compiler->new_php.cnt); \ 
     1547        if (!compiler->new_php.var) {             \ 
    15671548            goto err_alloc;          \ 
    15681549        }                            \ 
    15691550    }                                \ 
    15701551    else {                           \ 
    1571         php->var = NULL;             \ 
     1552        compiler->new_php.var = NULL;             \ 
    15721553    }                                \ 
    15731554} while (0) 
     
    15911572#define COPY_H(vartype, var, cnt, name, datatype) do {        \ 
    15921573    for (i = 0, j = 0; b; i ++, b = b->pListNext) {           \ 
    1593         vartype *data = &php->var[j];                         \ 
     1574        vartype *data = &compiler->new_php.var[j];                         \ 
    15941575                                                              \ 
    15951576        if (i < old_##cnt) {                                  \ 
     
    15981579        j ++;                                                 \ 
    15991580                                                              \ 
    1600         assert(i < old_##cnt + php->cnt);                     \ 
     1581        assert(i < old_##cnt + compiler->new_php.cnt);                     \ 
    16011582        assert(b->pData);                                     \ 
    16021583        memcpy(&data->name, b->pData, sizeof(datatype));      \ 
     
    16301611            /* check if actived */ 
    16311612            if (auto_global->auto_global_callback && !auto_global->armed) { 
    1632                 xc_autoglobal_t *data = &php->autoglobals[i]; 
    1633  
    1634                 assert(i < php->autoglobal_cnt); 
     1613                xc_autoglobal_t *data = &compiler->new_php.autoglobals[i]; 
     1614 
     1615                assert(i < compiler->new_php.autoglobal_cnt); 
    16351616                i ++; 
    16361617                UNISW(NOTHING, data->type = b->key.type;) 
     
    16541635        unsigned int i; 
    16551636 
    1656         xc_entry_init_key_php_entry(xce, zend_get_compiled_filename(TSRMLS_C) TSRMLS_CC); 
     1637        xc_entry_init_key_php_entry(&compiler->new_entry, zend_get_compiled_filename(TSRMLS_C) TSRMLS_CC); 
    16571638        memset(&const_usage, 0, sizeof(const_usage)); 
    16581639 
    1659         for (i = 0; i < php->classinfo_cnt; i ++) { 
    1660             xc_classinfo_t *classinfo = &php->classinfos[i]; 
     1640        for (i = 0; i < compiler->new_php.classinfo_cnt; i ++) { 
     1641            xc_classinfo_t *classinfo = &compiler->new_php.classinfos[i]; 
    16611642            zend_class_entry *ce = CestToCePtr(classinfo->cest); 
    16621643            classinfo->methodinfo_cnt = ce->function_table.nTableSize; 
     
    16701651 
    16711652                for (j = 0, b = ce->function_table.pListHead; b; j ++, b = b->pListNext) { 
    1672                     xc_collect_op_array_info(xce, php, &const_usage, &classinfo->methodinfos[j], (zend_op_array *) b->pData TSRMLS_CC); 
     1653                    xc_collect_op_array_info(compiler, &const_usage, &classinfo->methodinfos[j], (zend_op_array *) b->pData TSRMLS_CC); 
    16731654                } 
    16741655            } 
     
    16781659        } 
    16791660 
    1680         for (i = 0; i < php->funcinfo_cnt; i ++) { 
    1681             xc_collect_op_array_info(xce, php, &const_usage, &php->funcinfos[i].op_array_info, (zend_op_array *) &php->funcinfos[i].func TSRMLS_CC); 
    1682         } 
    1683  
    1684         xc_collect_op_array_info(xce, php, &const_usage, &php->op_array_info, php->op_array TSRMLS_CC); 
     1661        for (i = 0; i < compiler->new_php.funcinfo_cnt; i ++) { 
     1662            xc_collect_op_array_info(compiler, &const_usage, &compiler->new_php.funcinfos[i].op_array_info, (zend_op_array *) &compiler->new_php.funcinfos[i].func TSRMLS_CC); 
     1663        } 
     1664 
     1665        xc_collect_op_array_info(compiler, &const_usage, &compiler->new_php.op_array_info, compiler->new_php.op_array TSRMLS_CC); 
    16851666 
    16861667        /* file/dir path free unused */ 
    16871668#define X_FREE_UNUSED(var) \ 
    16881669        if (!const_usage.var##path_used) { \ 
    1689             efree(xce->var##path); \ 
    1690             xce->var##path = NULL; \ 
    1691             xce->var##path_len = 0; \ 
     1670            efree(compiler->new_entry.var##path); \ 
     1671            compiler->new_entry.var##path = NULL; \ 
     1672            compiler->new_entry.var##path_len = 0; \ 
    16921673        } 
    16931674        /* filepath is required to restore op_array->filename, so no free filepath here */ 
     
    17011682    /* }}} */ 
    17021683#ifdef XCACHE_ERROR_CACHING 
    1703     php->compilererrors = ((xc_sandbox_t *) XG(sandbox))->compilererrors; 
    1704     php->compilererror_cnt = ((xc_sandbox_t *) XG(sandbox))->compilererror_cnt; 
     1684    compiler->new_php.compilererrors = ((xc_sandbox_t *) XG(sandbox))->compilererrors; 
     1685    compiler->new_php.compilererror_cnt = ((xc_sandbox_t *) XG(sandbox))->compilererror_cnt; 
    17051686#endif 
    17061687#ifndef ZEND_COMPILE_DELAYED_BINDING 
    17071688    /* {{{ find inherited classes that should be early-binding */ 
    1708     php->have_early_binding = 0; 
     1689    compiler->new_php.have_early_binding = 0; 
    17091690    { 
    17101691        int i; 
    1711         for (i = 0; i < php->classinfo_cnt; i ++) { 
    1712             php->classinfos[i].oplineno = -1; 
    1713         } 
    1714     } 
    1715  
    1716     xc_undo_pass_two(php->op_array TSRMLS_CC); 
    1717     xc_foreach_early_binding_class(php->op_array, xc_cache_early_binding_class_cb, (void *) php TSRMLS_CC); 
    1718     xc_redo_pass_two(php->op_array TSRMLS_CC); 
     1692        for (i = 0; i < compiler->new_php.classinfo_cnt; i ++) { 
     1693            compiler->new_php.classinfos[i].oplineno = -1; 
     1694        } 
     1695    } 
     1696 
     1697    xc_undo_pass_two(compiler->new_php.op_array TSRMLS_CC); 
     1698    xc_foreach_early_binding_class(compiler->new_php.op_array, xc_cache_early_binding_class_cb, (void *) compiler->new_php.SRMLS_CC); 
     1699    xc_redo_pass_two(compiler->new_php.op_array TSRMLS_CC); 
    17191700    /* }}} */ 
    17201701#endif 
     
    17231704 
    17241705err_alloc: 
    1725     xc_free_php(php TSRMLS_CC); 
     1706    xc_free_php(&compiler->new_php TSRMLS_CC); 
    17261707 
    17271708err_bailout: 
     
    17351716} 
    17361717/* }}} */ 
    1737 static zend_op_array *xc_compile_restore(xc_entry_php_t *stored_xce, zend_file_handle *h TSRMLS_DC) /* {{{ */ 
     1718static zend_op_array *xc_compile_restore(xc_entry_php_t *stored_entry, xc_entry_data_php_t *stored_php, zend_file_handle *h TSRMLS_DC) /* {{{ */ 
    17381719{ 
    17391720    zend_op_array *op_array; 
    1740     xc_entry_php_t xce; 
    1741     xc_entry_data_php_t php; 
     1721    xc_entry_php_t restored_entry; 
     1722    xc_entry_data_php_t restored_php; 
    17421723    zend_bool catched; 
    17431724 
    17441725    CG(in_compilation)    = 1; 
    1745     CG(compiled_filename) = stored_xce->entry.name.str.val; 
     1726    CG(compiled_filename) = stored_entry->entry.name.str.val; 
    17461727    CG(zend_lineno)       = 0; 
    1747     TRACE("restoring %s", stored_xce->entry.name.str.val); 
    1748     xc_processor_restore_xc_entry_php_t(&xce, stored_xce TSRMLS_CC); 
    1749     xc_processor_restore_xc_entry_data_php_t(stored_xce, &php, xce.php, xc_readonly_protection TSRMLS_CC); 
    1750     xce.php = &php; 
     1728    TRACE("restoring %d:%s", stored_entry->file_inode, stored_entry->entry.name.str.val); 
     1729    xc_processor_restore_xc_entry_php_t(&restored_entry, stored_entry TSRMLS_CC); 
     1730    xc_processor_restore_xc_entry_data_php_t(stored_entry, &restored_php, stored_php, xc_readonly_protection TSRMLS_CC); 
     1731    restored_entry.php = &restored_php; 
    17511732#ifdef SHOW_DPRINT 
    1752     xc_dprint(&xce, 0 TSRMLS_CC); 
     1733    xc_dprint(&restored_entry, 0 TSRMLS_CC); 
    17531734#endif 
    17541735 
    17551736    catched = 0; 
    17561737    zend_try { 
    1757         op_array = xc_entry_install(&xce, h TSRMLS_CC); 
     1738        op_array = xc_entry_install(&restored_entry, h TSRMLS_CC); 
    17581739    } zend_catch { 
    17591740        catched = 1; 
     
    17611742 
    17621743#ifdef HAVE_XCACHE_CONSTANT 
    1763     if (php.constinfos) { 
    1764         efree(php.constinfos); 
    1765     } 
    1766 #endif 
    1767     if (php.funcinfos) { 
    1768         efree(php.funcinfos); 
    1769     } 
    1770     if (php.classinfos) { 
    1771         efree(php.classinfos); 
     1744    if (restored_php.constinfos) { 
     1745        efree(restored_php.constinfos); 
     1746    } 
     1747#endif 
     1748    if (restored_php.funcinfos) { 
     1749        efree(restored_php.funcinfos); 
     1750    } 
     1751    if (restored_php.classinfos) { 
     1752        efree(restored_php.classinfos); 
    17721753    } 
    17731754 
     
    17771758    CG(in_compilation)    = 0; 
    17781759    CG(compiled_filename) = NULL; 
    1779     TRACE("restored  %s", stored_xce->entry.name.str.val); 
     1760    TRACE("restored %d:%s", stored_entry->file_inode, stored_entry->entry.name.str.val); 
    17801761    return op_array; 
    17811762} 
     
    17871768} 
    17881769/* }}} */ 
    1789 static zend_op_array *xc_compile_file_ex(xc_entry_hash_t *entry_hash, xc_entry_php_t *xce, zend_file_handle *h, int type TSRMLS_DC) /* {{{ */ 
    1790 { 
     1770static zend_op_array *xc_compile_file_ex(xc_compiler_t *compiler, zend_file_handle *h, int type TSRMLS_DC) /* {{{ */ 
     1771{ 
     1772    /* 
     1773    if (clog) { 
     1774        return old; 
     1775    } 
     1776 
     1777    if (cached_entry = getby entry_hash) { 
     1778        php = cached_entry.php; 
     1779        php = restore(php); 
     1780        return php; 
     1781    } 
     1782    else { 
     1783        if (!(php = getby md5)) { 
     1784            if (clog) { 
     1785                return old; 
     1786            } 
     1787            php = compile(); 
     1788            entry = create entries[entry]; 
     1789        } 
     1790 
     1791        entry.php = php; 
     1792        return php; 
     1793    } 
     1794    */ 
     1795 
    17911796    zend_op_array *op_array; 
    1792     xc_entry_php_t *stored_xce; 
     1797    xc_entry_php_t *stored_entry; 
    17931798    xc_entry_data_php_t *stored_php; 
    17941799    zend_bool gaveup = 0; 
    17951800    zend_bool catched = 0; 
    1796     zend_bool newlycompiled; 
    17971801    xc_sandbox_t sandbox; 
    1798     xc_cache_t *cache = xc_php_caches[entry_hash->cacheslotid]; 
     1802    xc_cache_t *cache = xc_php_caches[compiler->entry_hash.cacheid]; 
    17991803 
    18001804    /* stale clogs precheck */ 
     
    18031807        return old_compile_file(h, type TSRMLS_CC); 
    18041808    } 
     1809 
    18051810    /* {{{ entry_lookup/hit/md5_init/php_lookup */ 
    1806     stored_xce = NULL; 
     1811    stored_entry = NULL; 
    18071812    stored_php = NULL; 
    18081813    ENTER_LOCK_EX(cache) { 
    1809         stored_xce = (xc_entry_php_t *) xc_entry_find_dmz(XC_TYPE_PHP, cache, entry_hash->entryslotid, (xc_entry_t *) xce TSRMLS_CC); 
    1810         if (stored_xce) { 
     1814        stored_entry = (xc_entry_php_t *) xc_entry_find_dmz(XC_TYPE_PHP, cache, compiler->entry_hash.entryslotid, (xc_entry_t *) &compiler->new_entry TSRMLS_CC); 
     1815        if (stored_entry) { 
    18111816            xc_cache_hit_dmz(cache TSRMLS_CC); 
    18121817 
    1813             TRACE("hit %s, holding", stored_xce->entry.name.str.val); 
    1814             xc_entry_hold_php_dmz(cache, stored_xce TSRMLS_CC); 
    1815         } 
    1816         else { 
    1817             cache->misses ++; 
    1818             TRACE("miss %s", xce->entry.name.str.val); 
    1819  
    1820             if (xc_entry_init_key_php_md5(cache, xce->php, xce TSRMLS_CC) != SUCCESS) { 
    1821                 gaveup = 1; 
    1822                 break; 
    1823             } 
    1824  
    1825             stored_php = xc_php_find_dmz(cache, xce->php TSRMLS_CC); 
    1826  
    1827             /* miss but compiling */ 
    1828             if (!stored_php) { 
    1829                 if (XG(request_time) - cache->compiling < 30) { 
    1830                     TRACE("%s", "miss but compiling"); 
    1831                     cache->clogs ++; 
    1832                     gaveup = 1; 
    1833                     break; 
    1834                 } 
    1835                 TRACE("%s", "php_lookup miss"); 
    1836             } 
    1837             else { 
    1838                 TRACE("%s", "php_lookup hit"); 
    1839             } 
    1840  
    1841             cache->compiling = XG(request_time); 
    1842         } 
     1818            TRACE(" hit %d:%s, holding", compiler->new_entry.file_inode, stored_entry->entry.name.str.val); 
     1819            xc_entry_hold_php_dmz(cache, stored_entry TSRMLS_CC); 
     1820            stored_php = stored_entry->php; 
     1821            break; 
     1822        } 
     1823 
     1824        cache->misses ++; 
     1825        TRACE("miss entry %d:%s", compiler->new_entry.file_inode, compiler->new_entry.entry.name.str.val); 
     1826 
     1827        if (xc_entry_init_key_php_md5(cache, compiler TSRMLS_CC) != SUCCESS) { 
     1828            gaveup = 1; 
     1829            break; 
     1830        } 
     1831 
     1832        stored_php = xc_php_find_dmz(cache, &compiler->new_php TSRMLS_CC); 
     1833 
     1834        /* miss but compiling */ 
     1835        if (stored_php) { 
     1836            compiler->new_entry.php = stored_php; 
     1837            xc_php_addref_dmz(stored_php); 
     1838            if (!compiler->opened_path) { 
     1839                compiler->opened_path = expand_filepath(compiler->filename, compiler->opened_path_buffer TSRMLS_CC); 
     1840            } 
     1841            xc_entry_init_key_php_entry(&compiler->new_entry, compiler->opened_path TSRMLS_CC); 
     1842            stored_entry = xc_entry_php_store_dmz(cache, compiler->entry_hash.entryslotid, &compiler->new_entry TSRMLS_CC); 
     1843            TRACE(" cached %d:%s, holding", compiler->new_entry.file_inode, stored_entry->entry.name.str.val); 
     1844            xc_entry_hold_php_dmz(cache, stored_entry TSRMLS_CC); 
     1845            break; 
     1846        } 
     1847 
     1848        if (XG(request_time) - cache->compiling < 30) { 
     1849            TRACE("%s", "miss php, but compiling"); 
     1850            cache->clogs ++; 
     1851            gaveup = 1; 
     1852            break; 
     1853        } 
     1854 
     1855        TRACE("%s", "miss php, going to compile"); 
     1856        cache->compiling = XG(request_time); 
    18431857    } LEAVE_LOCK_EX(cache); 
    18441858 
     
    18481862    } 
    18491863 
    1850     /* hit */ 
    1851     if (stored_xce) { 
    1852         return xc_compile_restore(stored_xce, h TSRMLS_CC); 
     1864    /* found entry */ 
     1865    if (stored_entry) { 
     1866        return xc_compile_restore(stored_entry, stored_php, h TSRMLS_CC); 
    18531867    } 
    18541868 
     
    18581872    } 
    18591873    /* }}} */ 
     1874 
    18601875    op_array = NULL; 
    18611876    /* {{{ compile */ 
    1862     if (stored_php) { 
    1863         newlycompiled = 0; 
    1864         xc_entry_init_key_php_entry(xce, h->opened_path ? h->opened_path : h->filename TSRMLS_CC); 
    1865         xce->php = stored_php; 
    1866     } 
    1867     else { 
    1868         newlycompiled = 1; 
    1869  
    1870         /* make compile inside sandbox */ 
    1871         xc_sandbox_init(&sandbox, h->opened_path ? h->opened_path : h->filename TSRMLS_CC); 
     1877    /* make compile inside sandbox */ 
     1878    xc_sandbox_init(&sandbox, h->opened_path ? h->opened_path : h->filename TSRMLS_CC); 
    18721879 
    18731880#ifdef HAVE_XCACHE_CONSTANT 
    1874         xce->php->constinfos  = NULL; 
    1875 #endif 
    1876         xce->php->funcinfos   = NULL; 
    1877         xce->php->classinfos  = NULL; 
     1881    compiler->new_php.constinfos  = NULL; 
     1882#endif 
     1883    compiler->new_php.funcinfos   = NULL; 
     1884    compiler->new_php.classinfos  = NULL; 
    18781885#ifdef ZEND_ENGINE_2_1 
    1879         xce->php->autoglobals = NULL; 
    1880 #endif 
    1881  
    1882         memset(&xce->php->op_array_info, 0, sizeof(xce->php->op_array_info)); 
    1883  
    1884         zend_try { 
    1885             op_array = xc_compile_php(xce, xce->php, h, type TSRMLS_CC); 
    1886         } zend_catch { 
    1887             catched = 1; 
    1888         } zend_end_try(); 
    1889  
    1890         if (catched || !op_array) { 
    1891             goto err_aftersandbox; 
    1892         } 
    1893  
    1894         /* not cachable */ 
    1895         if (!xce->php->op_array) { 
    1896             cache->compiling = 0; 
    1897             /* it's not cachable, but don't scare the users with high misses */ 
    1898             cache->misses --; 
    1899             xc_sandbox_free(&sandbox, XC_InstallNoBinding TSRMLS_CC); 
    1900             return op_array; 
    1901         } 
     1886    compiler->new_php.autoglobals = NULL; 
     1887#endif 
     1888    memset(&compiler->new_php.op_array_info, 0, sizeof(compiler->new_php.op_array_info)); 
     1889 
     1890    zend_try { 
     1891        op_array = xc_compile_php(compiler, h, type TSRMLS_CC); 
     1892    } zend_catch { 
     1893        catched = 1; 
     1894    } zend_end_try(); 
     1895 
     1896    if (catched || !op_array) { 
     1897        goto err_aftersandbox; 
     1898    } 
     1899 
     1900    /* not cachable */ 
     1901    if (!compiler->new_php.op_array) { 
     1902        cache->compiling = 0; 
     1903        /* it's not cachable, but don't scare the users with high misses */ 
     1904        cache->misses --; 
     1905        xc_sandbox_free(&sandbox, XC_InstallNoBinding TSRMLS_CC); 
     1906        return op_array; 
    19021907    } 
    19031908    /* }}} */ 
    1904 #ifdef HAVE_INODE 
    1905     /* {{{ path name fix 
    1906      * inode enabled entry hash/compare on name 
    1907      * do not update to its name to real pathname 
    1908      * WARNING: this code is required to be after compile 
    1909      */ 
    1910     if (xce->file_inode) { 
    1911         const char *filename = h->opened_path ? h->opened_path : h->filename; 
    1912         if (xce->entry.name.str.val != filename) { 
    1913             xce->entry.name.str.val = (char *) filename; 
    1914             xce->entry.name.str.len = strlen(filename); 
    1915         } 
    1916     } 
    1917     /* }}} */ 
    1918 #endif 
    19191909#ifdef SHOW_DPRINT 
    1920     xc_dprint(xce, 0 TSRMLS_CC); 
    1921 #endif 
    1922     stored_xce = NULL; 
     1910    compiler->new_entry.php = &compiler->new_php; 
     1911    xc_dprint(&compiler->new_entry, 0 TSRMLS_CC); 
     1912#endif 
    19231913    ENTER_LOCK_EX(cache) { /* {{{ php_store/entry_store */ 
    19241914        /* php_store */ 
    1925         if (newlycompiled) { 
    1926             stored_php = xc_php_store_dmz(cache, xce->php TSRMLS_CC); 
    1927             if (!stored_php) { 
    1928                 /* error */ 
    1929                 break; 
    1930             } 
     1915        stored_php = xc_php_store_dmz(cache, &compiler->new_php TSRMLS_CC); 
     1916        if (!stored_php) { 
     1917            /* error */ 
     1918            break; 
    19311919        } 
    19321920        /* entry_store */ 
     1921        compiler->new_entry.php = stored_php; 
    19331922        xc_php_addref_dmz(stored_php); 
    1934         stored_xce = xc_entry_php_store_dmz(cache, entry_hash->entryslotid, xce TSRMLS_CC); 
    1935         if (stored_xce) { 
    1936             stored_xce->php = stored_php; 
    1937         } 
    1938         else { 
    1939             /* error */ 
     1923        stored_entry = xc_entry_php_store_dmz(cache, compiler->entry_hash.entryslotid, &compiler->new_entry TSRMLS_CC); 
     1924        if (!stored_entry) { 
    19401925            xc_php_release_dmz(cache, stored_php); 
    19411926        } 
    19421927    } LEAVE_LOCK_EX(cache); 
    19431928    /* }}} */ 
    1944     TRACE("%s", stored_xce ? "stored" : "store failed"); 
     1929    TRACE("%s", stored_entry ? "stored" : "store failed"); 
    19451930 
    19461931    cache->compiling = 0; 
     
    19491934    } 
    19501935 
    1951     if (newlycompiled) { 
    1952         xc_free_php(xce->php TSRMLS_CC); 
    1953     } 
    1954  
    1955     if (stored_xce) { 
     1936    xc_free_php(&compiler->new_php TSRMLS_CC); 
     1937 
     1938    if (stored_entry) { 
    19561939        if (op_array) { 
    19571940#ifdef ZEND_ENGINE_2 
     
    19631946            h = NULL; 
    19641947        } 
    1965         if (newlycompiled) { 
    1966             xc_sandbox_free(&sandbox, XC_NoInstall TSRMLS_CC); 
    1967         } 
    1968         return xc_compile_restore(stored_xce, h TSRMLS_CC); 
     1948        xc_sandbox_free(&sandbox, XC_NoInstall TSRMLS_CC); 
     1949        return xc_compile_restore(stored_entry, stored_php, h TSRMLS_CC); 
    19691950    } 
    19701951    else { 
    1971         if (newlycompiled) { 
    1972             zend_op_array *old_active_op_array = CG(active_op_array); 
    1973             /* install it */ 
    1974             CG(active_op_array) = op_array; 
    1975             xc_sandbox_free(&sandbox, XC_Install TSRMLS_CC); 
    1976             CG(active_op_array) = old_active_op_array; 
    1977         } 
     1952        zend_op_array *old_active_op_array = CG(active_op_array); 
     1953        /* install it */ 
     1954        CG(active_op_array) = op_array; 
     1955        xc_sandbox_free(&sandbox, XC_Install TSRMLS_CC); 
     1956        CG(active_op_array) = old_active_op_array; 
    19781957    } 
    19791958    return op_array; 
    19801959 
    19811960err_aftersandbox: 
    1982     if (newlycompiled) { 
    1983         xc_free_php(xce->php TSRMLS_CC); 
    1984         xc_sandbox_free(&sandbox, XC_NoInstall TSRMLS_CC); 
    1985     } 
     1961    xc_free_php(&compiler->new_php TSRMLS_CC); 
     1962    xc_sandbox_free(&sandbox, XC_NoInstall TSRMLS_CC); 
    19861963 
    19871964    if (catched) { 
     
    19951972static zend_op_array *xc_compile_file(zend_file_handle *h, int type TSRMLS_DC) /* {{{ */ 
    19961973{ 
     1974    xc_compiler_t compiler; 
    19971975    zend_op_array *op_array; 
    1998     xc_entry_php_t xce; 
    1999     xc_entry_hash_t entry_hash; 
    2000     xc_entry_data_php_t php; 
    2001     const char *filename; 
    20021976 
    20031977    assert(xc_initized); 
    20041978 
    2005     TRACE("type = %d\n", h->type); 
     1979    TRACE("xc_compile_file: type=%d name=%s", h->type, h->filename ? h->filename : "NULL"); 
    20061980    if (!XG(cacher)) { 
    20071981        op_array = old_compile_file(h, type TSRMLS_CC); 
     1982        TRACE("%s", "cacher not enabled"); 
    20081983        return op_array; 
    20091984    } 
    20101985 
    20111986    /* {{{ entry_init_key */ 
    2012     filename = h->opened_path ? h->opened_path : h->filename; 
    2013     xce.php = &php; 
    2014     if (xc_entry_init_key_php(&entry_hash, &xce, filename TSRMLS_CC) != SUCCESS) { 
    2015         TRACE("failed to init key for %s", filename); 
     1987    compiler.opened_path = h->opened_path; 
     1988    compiler.filename = compiler.opened_path ? compiler.opened_path : h->filename; 
     1989    if (xc_entry_init_key_php(&compiler TSRMLS_CC) != SUCCESS) { 
     1990        TRACE("failed to init key for %s", compiler.filename); 
    20161991        return old_compile_file(h, type TSRMLS_CC); 
    20171992    } 
    20181993    /* }}} */ 
    20191994 
    2020     op_array = xc_compile_file_ex(&entry_hash, &xce, h, type TSRMLS_CC); 
    2021  
    2022     xc_entry_free_key_php(&xce TSRMLS_CC); 
     1995    op_array = xc_compile_file_ex(&compiler, h, type TSRMLS_CC); 
     1996 
     1997    xc_entry_free_key_php(&compiler.new_entry TSRMLS_CC); 
    20231998 
    20241999    return op_array; 
     
    26762651    hv = xc_entry_hash_var((xc_entry_t *) xce TSRMLS_CC); 
    26772652 
    2678     entry_hash->cacheslotid = (hv & xc_var_hcache.mask); 
     2653    entry_hash->cacheid = (hv & xc_var_hcache.mask); 
    26792654    hv >>= xc_var_hcache.bits; 
    26802655    entry_hash->entryslotid = (hv & xc_var_hentry.mask); 
     
    27002675    } 
    27012676    xc_entry_init_key_var(&entry_hash, &xce, name TSRMLS_CC); 
    2702     cache = xc_var_caches[entry_hash.cacheslotid]; 
     2677    cache = xc_var_caches[entry_hash.cacheid]; 
    27032678 
    27042679    ENTER_LOCK(cache) { 
     
    27422717 
    27432718    xc_entry_init_key_var(&entry_hash, &xce, name TSRMLS_CC); 
    2744     cache = xc_var_caches[entry_hash.cacheslotid]; 
     2719    cache = xc_var_caches[entry_hash.cacheid]; 
    27452720 
    27462721    ENTER_LOCK(cache) { 
     
    27722747    } 
    27732748    xc_entry_init_key_var(&entry_hash, &xce, name TSRMLS_CC); 
    2774     cache = xc_var_caches[entry_hash.cacheslotid]; 
     2749    cache = xc_var_caches[entry_hash.cacheid]; 
    27752750 
    27762751    ENTER_LOCK(cache) { 
     
    28062781    } 
    28072782    xc_entry_init_key_var(&entry_hash, &xce, name TSRMLS_CC); 
    2808     cache = xc_var_caches[entry_hash.cacheslotid]; 
     2783    cache = xc_var_caches[entry_hash.cacheid]; 
    28092784 
    28102785    ENTER_LOCK(cache) { 
     
    28792854 
    28802855    xc_entry_init_key_var(&entry_hash, &xce, name TSRMLS_CC); 
    2881     cache = xc_var_caches[entry_hash.cacheslotid]; 
     2856    cache = xc_var_caches[entry_hash.cacheid]; 
    28822857 
    28832858    ENTER_LOCK(cache) { 
     
    29182893            xce.entry.ctime = stored_xce->entry.ctime; 
    29192894            xce.entry.hits  = stored_xce->entry.hits; 
    2920             xc_entry_remove_dmz(XC_TYPE_VAR, cache, entry_hash.cacheslotid, (xc_entry_t *) stored_xce TSRMLS_CC); 
    2921         } 
    2922         xc_entry_var_store_dmz(cache, entry_hash.cacheslotid, &xce TSRMLS_CC); 
     2895            xc_entry_remove_dmz(XC_TYPE_VAR, cache, entry_hash.entryslotid, (xc_entry_t *) stored_xce TSRMLS_CC); 
     2896        } 
     2897        xc_entry_var_store_dmz(cache, entry_hash.entryslotid, &xce TSRMLS_CC); 
    29232898 
    29242899    } LEAVE_LOCK(cache); 
  • trunk/xcache.h

    r855 r859  
    374374    zend_ulong  refcount;   /* count of entries referencing to this data */ 
    375375 
    376     size_t     file_size; 
    377376    zend_ulong hits;        /* hits of this php */ 
    378377    size_t     size; 
     
    432431    zend_ulong refcount;    /* count of php instances holding this entry */ 
    433432    time_t file_mtime; 
     433    size_t file_size; 
    434434#ifdef HAVE_INODE 
    435435    int file_device; 
     
    456456/* }}} */ 
    457457typedef struct xc_entry_hash_t { /* {{{ */ 
    458     xc_hash_value_t cacheslotid; 
     458    xc_hash_value_t cacheid; 
    459459    xc_hash_value_t entryslotid; 
    460460} xc_entry_hash_t; 
     461/* }}} */ 
     462typedef struct xc_compiler_t { /* {{{ */ 
     463    const char *filename; 
     464    const char *opened_path; 
     465    char opened_path_buffer[MAXPATHLEN]; 
     466 
     467    xc_entry_hash_t entry_hash; 
     468    xc_entry_php_t new_entry; 
     469    xc_entry_data_php_t new_php; 
     470} xc_compiler_t; 
    461471/* }}} */ 
    462472 
Note: See TracChangeset for help on using the changeset viewer.