PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LCOV - code coverage report
Current view: top level - ext/opcache - zend_persist.c (source / functions) Hit Total Coverage
Test: PHP Code Coverage Lines: 237 455 52.1 %
Date: 2015-08-25 Functions: 11 14 78.6 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :    +----------------------------------------------------------------------+
       3             :    | Zend OPcache                                                         |
       4             :    +----------------------------------------------------------------------+
       5             :    | Copyright (c) 1998-2015 The PHP Group                                |
       6             :    +----------------------------------------------------------------------+
       7             :    | This source file is subject to version 3.01 of the PHP license,      |
       8             :    | that is bundled with this package in the file LICENSE, and is        |
       9             :    | available through the world-wide-web at the following url:           |
      10             :    | http://www.php.net/license/3_01.txt                                  |
      11             :    | If you did not receive a copy of the PHP license and are unable to   |
      12             :    | obtain it through the world-wide-web, please send a note to          |
      13             :    | license@php.net so we can mail you a copy immediately.               |
      14             :    +----------------------------------------------------------------------+
      15             :    | Authors: Andi Gutmans <andi@zend.com>                                |
      16             :    |          Zeev Suraski <zeev@zend.com>                                |
      17             :    |          Stanislav Malyshev <stas@zend.com>                          |
      18             :    |          Dmitry Stogov <dmitry@zend.com>                             |
      19             :    +----------------------------------------------------------------------+
      20             : */
      21             : 
      22             : #include "zend.h"
      23             : #include "ZendAccelerator.h"
      24             : #include "zend_persist.h"
      25             : #include "zend_extensions.h"
      26             : #include "zend_shared_alloc.h"
      27             : #include "zend_vm.h"
      28             : #include "zend_constants.h"
      29             : #include "zend_operators.h"
      30             : 
      31             : #define zend_accel_store(p, size) \
      32             :             (p = _zend_shared_memdup((void*)p, size, 1))
      33             : #define zend_accel_memdup(p, size) \
      34             :             _zend_shared_memdup((void*)p, size, 0)
      35             : 
      36             : #define zend_accel_store_string(str) do { \
      37             :                 zend_string *new_str = zend_shared_alloc_get_xlat_entry(str); \
      38             :                 if (new_str) { \
      39             :                         zend_string_release(str); \
      40             :                         str = new_str; \
      41             :                 } else { \
      42             :                 new_str = zend_accel_memdup((void*)str, _ZSTR_STRUCT_SIZE(ZSTR_LEN(str))); \
      43             :                         zend_string_release(str); \
      44             :                 str = new_str; \
      45             :                 zend_string_hash_val(str); \
      46             :                 GC_FLAGS(str) = IS_STR_INTERNED | IS_STR_PERMANENT; \
      47             :                 } \
      48             :     } while (0)
      49             : #define zend_accel_memdup_string(str) do { \
      50             :                 str = zend_accel_memdup(str, _ZSTR_STRUCT_SIZE(ZSTR_LEN(str))); \
      51             :         zend_string_hash_val(str); \
      52             :                 GC_FLAGS(str) = IS_STR_INTERNED | IS_STR_PERMANENT; \
      53             :         } while (0)
      54             : #define zend_accel_store_interned_string(str) do { \
      55             :                 if (!IS_ACCEL_INTERNED(str)) { \
      56             :                         zend_accel_store_string(str); \
      57             :                 } \
      58             :         } while (0)
      59             : #define zend_accel_memdup_interned_string(str) do { \
      60             :                 if (!IS_ACCEL_INTERNED(str)) { \
      61             :                         zend_accel_memdup_string(str); \
      62             :                 } \
      63             :         } while (0)
      64             : 
      65             : typedef void (*zend_persist_func_t)(zval*);
      66             : 
      67             : static void zend_persist_zval(zval *z);
      68             : static void zend_persist_zval_const(zval *z);
      69             : 
      70             : static const uint32_t uninitialized_bucket[-HT_MIN_MASK] =
      71             :         {HT_INVALID_IDX, HT_INVALID_IDX};
      72             : 
      73         962 : static void zend_hash_persist(HashTable *ht, zend_persist_func_t pPersistElement)
      74             : {
      75             :         uint32_t idx, nIndex;
      76             :         Bucket *p;
      77             : 
      78         962 :         if (!(ht->u.flags & HASH_FLAG_INITIALIZED)) {
      79         466 :                 HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
      80         466 :                 return;
      81             :         }
      82         496 :         if (ht->u.flags & HASH_FLAG_PACKED) {
      83          12 :                 void *data = HT_GET_DATA_ADDR(ht);
      84          12 :                 zend_accel_store(data, HT_USED_SIZE(ht));
      85          12 :                 HT_SET_DATA_ADDR(ht, data);
      86         484 :         } else if (ht->nNumUsed < -(int32_t)ht->nTableMask / 2) {
      87             :                 /* compact table */
      88         480 :                 void *old_data = HT_GET_DATA_ADDR(ht);
      89         480 :                 Bucket *old_buckets = ht->arData;
      90         480 :                 int32_t hash_size = -(int32_t)ht->nTableMask;
      91             : 
      92        6160 :                 while (hash_size >> 1 > ht->nNumUsed) {
      93        5200 :                         hash_size >>= 1;
      94             :                 }
      95         480 :                 ht->nTableMask = -hash_size;
      96         480 :                 HT_SET_DATA_ADDR(ht, ZCG(mem));
      97         480 :                 ZCG(mem) = (void*)((char*)ZCG(mem) + ZEND_ALIGNED_SIZE((hash_size * sizeof(uint32_t)) + (ht->nNumUsed * sizeof(Bucket))));
      98         480 :                 HT_HASH_RESET(ht);
      99         480 :                 memcpy(ht->arData, old_buckets, ht->nNumUsed * sizeof(Bucket));
     100         480 :                 efree(old_data);
     101             : 
     102         570 :                 for (idx = 0; idx < ht->nNumUsed; idx++) {
     103          90 :                         p = ht->arData + idx;
     104         180 :                         if (Z_TYPE(p->val) == IS_UNDEF) continue;
     105             : 
     106             :                         /* persist bucket and key */
     107          83 :                         if (p->key) {
     108          83 :                                 zend_accel_store_interned_string(p->key);
     109             :                         }
     110             : 
     111             :                         /* persist the data itself */
     112          83 :                         pPersistElement(&p->val);
     113             : 
     114          83 :                         nIndex = p->h | ht->nTableMask;
     115          83 :                         Z_NEXT(p->val) = HT_HASH(ht, nIndex);
     116          83 :                         HT_HASH(ht, nIndex) = HT_IDX_TO_HASH(idx);
     117             :                 }
     118         480 :                 return;
     119             :         } else {
     120           4 :                 void *data = ZCG(mem);
     121           4 :                 void *old_data = HT_GET_DATA_ADDR(ht);
     122             : 
     123           4 :                 ZCG(mem) = (void*)((char*)data + HT_USED_SIZE(ht));
     124           4 :                 memcpy(data, old_data, HT_USED_SIZE(ht));
     125           4 :                 efree(old_data);
     126           4 :                 HT_SET_DATA_ADDR(ht, data);
     127             :         }
     128             : 
     129         111 :         for (idx = 0; idx < ht->nNumUsed; idx++) {
     130          95 :                 p = ht->arData + idx;
     131         190 :                 if (Z_TYPE(p->val) == IS_UNDEF) continue;
     132             : 
     133             :                 /* persist bucket and key */
     134          95 :                 if (p->key) {
     135          58 :                         zend_accel_store_interned_string(p->key);
     136             :                 }
     137             : 
     138             :                 /* persist the data itself */
     139          95 :                 pPersistElement(&p->val);
     140             :         }
     141             : }
     142             : 
     143           0 : static void zend_hash_persist_immutable(HashTable *ht)
     144             : {
     145             :         uint32_t idx, nIndex;
     146             :         Bucket *p;
     147             : 
     148           0 :         if (!(ht->u.flags & HASH_FLAG_INITIALIZED)) {
     149           0 :                 HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
     150           0 :                 return;
     151             :         }
     152           0 :         if (ht->u.flags & HASH_FLAG_PACKED) {
     153           0 :                 HT_SET_DATA_ADDR(ht, zend_accel_memdup(HT_GET_DATA_ADDR(ht), HT_USED_SIZE(ht)));
     154           0 :         } else if (ht->nNumUsed < -(int32_t)ht->nTableMask / 2) {
     155             :                 /* compact table */
     156           0 :                 void *old_data = HT_GET_DATA_ADDR(ht);
     157           0 :                 Bucket *old_buckets = ht->arData;
     158           0 :                 int32_t hash_size = -(int32_t)ht->nTableMask;
     159             : 
     160           0 :                 while (hash_size >> 1 > ht->nNumUsed) {
     161           0 :                         hash_size >>= 1;
     162             :                 }
     163           0 :                 ht->nTableMask = -hash_size;
     164           0 :                 HT_SET_DATA_ADDR(ht, ZCG(mem));
     165           0 :                 ZCG(mem) = (void*)((char*)ZCG(mem) + (hash_size * sizeof(uint32_t)) + (ht->nNumUsed * sizeof(Bucket)));
     166           0 :                 HT_HASH_RESET(ht);
     167           0 :                 memcpy(ht->arData, old_buckets, ht->nNumUsed * sizeof(Bucket));
     168           0 :                 efree(old_data);
     169             : 
     170           0 :                 for (idx = 0; idx < ht->nNumUsed; idx++) {
     171           0 :                         p = ht->arData + idx;
     172           0 :                         if (Z_TYPE(p->val) == IS_UNDEF) continue;
     173             : 
     174             :                         /* persist bucket and key */
     175           0 :                         if (p->key) {
     176           0 :                                 zend_accel_memdup_interned_string(p->key);
     177             :                         }
     178             : 
     179             :                         /* persist the data itself */
     180           0 :                         zend_persist_zval_const(&p->val);
     181             : 
     182           0 :                         nIndex = p->h | ht->nTableMask;
     183           0 :                         Z_NEXT(p->val) = HT_HASH(ht, nIndex);
     184           0 :                         HT_HASH(ht, nIndex) = HT_IDX_TO_HASH(idx);
     185             :                 }
     186           0 :                 return;
     187             :         } else {
     188           0 :                 void *data = ZCG(mem);
     189             : 
     190           0 :                 ZCG(mem) = (void*)((char*)data + HT_USED_SIZE(ht));
     191           0 :                 memcpy(data, HT_GET_DATA_ADDR(ht), HT_USED_SIZE(ht));
     192           0 :                 HT_SET_DATA_ADDR(ht, data);
     193             :         }
     194           0 :         for (idx = 0; idx < ht->nNumUsed; idx++) {
     195           0 :                 p = ht->arData + idx;
     196           0 :                 if (Z_TYPE(p->val) == IS_UNDEF) continue;
     197             : 
     198             :                 /* persist bucket and key */
     199           0 :                 if (p->key) {
     200           0 :                         zend_accel_memdup_interned_string(p->key);
     201             :                 }
     202             : 
     203             :                 /* persist the data itself */
     204           0 :                 zend_persist_zval_const(&p->val);
     205             :         }
     206             : }
     207             : 
     208           0 : static zend_ast *zend_persist_ast(zend_ast *ast)
     209             : {
     210             :         uint32_t i;
     211             :         zend_ast *node;
     212             : 
     213           0 :         if (ast->kind == ZEND_AST_ZVAL) {
     214           0 :                 zend_ast_zval *copy = zend_accel_memdup(ast, sizeof(zend_ast_zval));
     215           0 :                 zend_persist_zval(&copy->val);
     216           0 :                 node = (zend_ast *) copy;
     217             :         } else if (zend_ast_is_list(ast)) {
     218           0 :                 zend_ast_list *list = zend_ast_get_list(ast);
     219           0 :                 zend_ast_list *copy = zend_accel_memdup(ast,
     220             :                         sizeof(zend_ast_list) - sizeof(zend_ast *) + sizeof(zend_ast *) * list->children);
     221           0 :                 for (i = 0; i < list->children; i++) {
     222           0 :                         if (copy->child[i]) {
     223           0 :                                 copy->child[i] = zend_persist_ast(copy->child[i]);
     224             :                         }
     225             :                 }
     226           0 :                 node = (zend_ast *) copy;
     227             :         } else {
     228           0 :                 uint32_t children = zend_ast_get_num_children(ast);
     229           0 :                 node = zend_accel_memdup(ast, sizeof(zend_ast) - sizeof(zend_ast *) + sizeof(zend_ast *) * children);
     230           0 :                 for (i = 0; i < children; i++) {
     231           0 :                         if (node->child[i]) {
     232           0 :                                 node->child[i] = zend_persist_ast(node->child[i]);
     233             :                         }
     234             :                 }
     235             :         }
     236             : 
     237           0 :         efree(ast);
     238           0 :         return node;
     239             : }
     240             : 
     241        3126 : static void zend_persist_zval(zval *z)
     242             : {
     243             :         zend_uchar flags;
     244             :         void *new_ptr;
     245             : 
     246        3126 :         switch (Z_TYPE_P(z)) {
     247             :                 case IS_STRING:
     248             :                 case IS_CONSTANT:
     249        2424 :                         flags = Z_GC_FLAGS_P(z) & ~ (IS_STR_PERSISTENT | IS_STR_INTERNED | IS_STR_PERMANENT);
     250        2424 :                         zend_accel_store_interned_string(Z_STR_P(z));
     251        2424 :                         Z_GC_FLAGS_P(z) |= flags;
     252        2424 :                         Z_TYPE_FLAGS_P(z) &= ~(IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
     253        2424 :                         break;
     254             :                 case IS_ARRAY:
     255          62 :                         new_ptr = zend_shared_alloc_get_xlat_entry(Z_ARR_P(z));
     256          62 :                         if (new_ptr) {
     257           0 :                                 Z_ARR_P(z) = new_ptr;
     258           0 :                                 Z_TYPE_FLAGS_P(z) = IS_TYPE_IMMUTABLE;
     259             :                         } else {
     260          62 :                                 if (Z_IMMUTABLE_P(z)) {
     261           0 :                                         Z_ARR_P(z) = zend_accel_memdup(Z_ARR_P(z), sizeof(zend_array));
     262           0 :                                         zend_hash_persist_immutable(Z_ARRVAL_P(z));
     263             :                                 } else {
     264          62 :                                         GC_REMOVE_FROM_BUFFER(Z_ARR_P(z));
     265          62 :                                         zend_accel_store(Z_ARR_P(z), sizeof(zend_array));
     266          62 :                                         zend_hash_persist(Z_ARRVAL_P(z), zend_persist_zval);
     267             :                                         /* make immutable array */
     268          62 :                                         Z_TYPE_FLAGS_P(z) = IS_TYPE_IMMUTABLE;
     269          62 :                                         GC_REFCOUNT(Z_COUNTED_P(z)) = 2;
     270          62 :                                         GC_FLAGS(Z_COUNTED_P(z)) |= IS_ARRAY_IMMUTABLE;
     271          62 :                                         Z_ARRVAL_P(z)->u.flags |= HASH_FLAG_STATIC_KEYS;
     272          62 :                                         Z_ARRVAL_P(z)->u.flags &= ~HASH_FLAG_APPLY_PROTECTION;
     273             :                                 }
     274             :                         }
     275          62 :                         break;
     276             :                 case IS_REFERENCE:
     277           0 :                         new_ptr = zend_shared_alloc_get_xlat_entry(Z_REF_P(z));
     278           0 :                         if (new_ptr) {
     279           0 :                                 Z_REF_P(z) = new_ptr;
     280             :                         } else {
     281           0 :                                 zend_accel_store(Z_REF_P(z), sizeof(zend_reference));
     282           0 :                                 zend_persist_zval(Z_REFVAL_P(z));
     283             :                         }
     284           0 :                         break;
     285             :                 case IS_CONSTANT_AST:
     286           0 :                         new_ptr = zend_shared_alloc_get_xlat_entry(Z_AST_P(z));
     287           0 :                         if (new_ptr) {
     288           0 :                                 Z_AST_P(z) = new_ptr;
     289             :                         } else {
     290           0 :                                 zend_accel_store(Z_AST_P(z), sizeof(zend_ast_ref));
     291           0 :                                 Z_ASTVAL_P(z) = zend_persist_ast(Z_ASTVAL_P(z));
     292             :                         }
     293             :                         break;
     294             :         }
     295        3126 : }
     296             : 
     297          13 : static void zend_persist_zval_static(zval *z)
     298             : {
     299             :         zend_uchar flags;
     300             :         void *new_ptr;
     301             : 
     302          13 :         switch (Z_TYPE_P(z)) {
     303             :                 case IS_STRING:
     304             :                 case IS_CONSTANT:
     305           0 :                         flags = Z_GC_FLAGS_P(z) & ~ (IS_STR_PERSISTENT | IS_STR_INTERNED | IS_STR_PERMANENT);
     306           0 :                         zend_accel_store_interned_string(Z_STR_P(z));
     307           0 :                         Z_GC_FLAGS_P(z) |= flags;
     308           0 :                         Z_TYPE_FLAGS_P(z) &= ~(IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
     309           0 :                         break;
     310             :                 case IS_ARRAY:
     311          12 :                         new_ptr = zend_shared_alloc_get_xlat_entry(Z_ARR_P(z));
     312          12 :                         if (new_ptr) {
     313           0 :                                 Z_ARR_P(z) = new_ptr;
     314           0 :                                 Z_TYPE_FLAGS_P(z) = IS_TYPE_IMMUTABLE;
     315             :                         } else {
     316          12 :                                 if (Z_IMMUTABLE_P(z)) {
     317           0 :                                         Z_ARR_P(z) = zend_accel_memdup(Z_ARR_P(z), sizeof(zend_array));
     318           0 :                                         zend_hash_persist_immutable(Z_ARRVAL_P(z));
     319             :                                 } else {
     320          12 :                                         GC_REMOVE_FROM_BUFFER(Z_ARR_P(z));
     321          12 :                                         zend_accel_store(Z_ARR_P(z), sizeof(zend_array));
     322          12 :                                         zend_hash_persist(Z_ARRVAL_P(z), zend_persist_zval);
     323             :                                         /* make immutable array */
     324          12 :                                         Z_TYPE_FLAGS_P(z) = IS_TYPE_IMMUTABLE;
     325          12 :                                         GC_REFCOUNT(Z_COUNTED_P(z)) = 2;
     326          12 :                                         GC_FLAGS(Z_COUNTED_P(z)) |= IS_ARRAY_IMMUTABLE;
     327          12 :                                         Z_ARRVAL_P(z)->u.flags |= HASH_FLAG_STATIC_KEYS;
     328          12 :                                         Z_ARRVAL_P(z)->u.flags &= ~HASH_FLAG_APPLY_PROTECTION;
     329             :                                 }
     330             :                         }
     331          12 :                         break;
     332             :                 case IS_REFERENCE:
     333           0 :                         new_ptr = zend_shared_alloc_get_xlat_entry(Z_REF_P(z));
     334           0 :                         if (new_ptr) {
     335           0 :                                 Z_REF_P(z) = new_ptr;
     336             :                         } else {
     337           0 :                                 zend_accel_store(Z_REF_P(z), sizeof(zend_reference));
     338           0 :                                 zend_persist_zval(Z_REFVAL_P(z));
     339             :                         }
     340           0 :                         break;
     341             :                 case IS_CONSTANT_AST:
     342           0 :                         new_ptr = zend_shared_alloc_get_xlat_entry(Z_AST_P(z));
     343           0 :                         if (new_ptr) {
     344           0 :                                 Z_AST_P(z) = new_ptr;
     345           0 :                                 Z_TYPE_FLAGS_P(z) = IS_TYPE_CONSTANT | IS_TYPE_IMMUTABLE;
     346             :                         } else {
     347           0 :                                 zend_accel_store(Z_AST_P(z), sizeof(zend_ast_ref));
     348           0 :                                 Z_ASTVAL_P(z) = zend_persist_ast(Z_ASTVAL_P(z));
     349           0 :                                 Z_TYPE_FLAGS_P(z) = IS_TYPE_CONSTANT | IS_TYPE_IMMUTABLE;
     350           0 :                                 GC_REFCOUNT(Z_COUNTED_P(z)) = 2;
     351             :                         }
     352             :                         break;
     353             :         }
     354          13 : }
     355             : 
     356           0 : static void zend_persist_zval_const(zval *z)
     357             : {
     358             :         zend_uchar flags;
     359             :         void *new_ptr;
     360             : 
     361           0 :         switch (Z_TYPE_P(z)) {
     362             :                 case IS_STRING:
     363             :                 case IS_CONSTANT:
     364           0 :                         flags = Z_GC_FLAGS_P(z) & ~ (IS_STR_PERSISTENT | IS_STR_INTERNED | IS_STR_PERMANENT);
     365           0 :                         zend_accel_memdup_interned_string(Z_STR_P(z));
     366           0 :                         Z_GC_FLAGS_P(z) |= flags;
     367           0 :                         Z_TYPE_FLAGS_P(z) &= ~(IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
     368           0 :                         break;
     369             :                 case IS_ARRAY:
     370           0 :                         new_ptr = zend_shared_alloc_get_xlat_entry(Z_ARR_P(z));
     371           0 :                         if (new_ptr) {
     372           0 :                                 Z_ARR_P(z) = new_ptr;
     373           0 :                                 Z_TYPE_FLAGS_P(z) = IS_TYPE_IMMUTABLE;
     374             :                         } else {
     375           0 :                                 if (Z_IMMUTABLE_P(z)) {
     376           0 :                                         Z_ARR_P(z) = zend_accel_memdup(Z_ARR_P(z), sizeof(zend_array));
     377           0 :                                         zend_hash_persist_immutable(Z_ARRVAL_P(z));
     378             :                                 } else {
     379           0 :                                         GC_REMOVE_FROM_BUFFER(Z_ARR_P(z));
     380           0 :                                         zend_accel_store(Z_ARR_P(z), sizeof(zend_array));
     381           0 :                                         zend_hash_persist(Z_ARRVAL_P(z), zend_persist_zval);
     382             :                                         /* make immutable array */
     383           0 :                                         Z_TYPE_FLAGS_P(z) = IS_TYPE_IMMUTABLE;
     384           0 :                                         GC_REFCOUNT(Z_COUNTED_P(z)) = 2;
     385           0 :                                         GC_FLAGS(Z_COUNTED_P(z)) |= IS_ARRAY_IMMUTABLE;
     386           0 :                                         Z_ARRVAL_P(z)->u.flags |= HASH_FLAG_STATIC_KEYS;
     387           0 :                                         Z_ARRVAL_P(z)->u.flags &= ~HASH_FLAG_APPLY_PROTECTION;
     388             :                                 }
     389             :                         }
     390           0 :                         break;
     391             :                 case IS_REFERENCE:
     392           0 :                         new_ptr = zend_shared_alloc_get_xlat_entry(Z_REF_P(z));
     393           0 :                         if (new_ptr) {
     394           0 :                                 Z_REF_P(z) = new_ptr;
     395             :                         } else {
     396           0 :                                 zend_accel_store(Z_REF_P(z), sizeof(zend_reference));
     397           0 :                                 zend_persist_zval(Z_REFVAL_P(z));
     398             :                         }
     399           0 :                         break;
     400             :                 case IS_CONSTANT_AST:
     401           0 :                         new_ptr = zend_shared_alloc_get_xlat_entry(Z_AST_P(z));
     402           0 :                         if (new_ptr) {
     403           0 :                                 Z_AST_P(z) = new_ptr;
     404             :                         } else {
     405           0 :                                 zend_accel_store(Z_AST_P(z), sizeof(zend_ast_ref));
     406           0 :                                 Z_ASTVAL_P(z) = zend_persist_ast(Z_ASTVAL_P(z));
     407             :                         }
     408             :                         break;
     409             :         }
     410           0 : }
     411             : 
     412         460 : static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_script* main_persistent_script)
     413             : {
     414         460 :         int already_stored = 0;
     415             :         zend_op *persist_ptr;
     416         460 :         zval *orig_literals = NULL;
     417             : 
     418         460 :         if (op_array->type != ZEND_USER_FUNCTION) {
     419           0 :                 return;
     420             :         }
     421             : 
     422         460 :         if (op_array->refcount && --(*op_array->refcount) == 0) {
     423         460 :                 efree(op_array->refcount);
     424             :         }
     425         460 :         op_array->refcount = NULL;
     426             : 
     427         460 :         if (main_persistent_script) {
     428         427 :                 zend_execute_data *orig_execute_data = EG(current_execute_data);
     429             :                 zend_execute_data fake_execute_data;
     430             :                 zval *offset;
     431             : 
     432         427 :                 memset(&fake_execute_data, 0, sizeof(fake_execute_data));
     433         427 :                 fake_execute_data.func = (zend_function*)op_array;
     434         427 :                 EG(current_execute_data) = &fake_execute_data;
     435         427 :                 if ((offset = zend_get_constant_str("__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__") - 1)) != NULL) {
     436          95 :                         main_persistent_script->compiler_halt_offset = Z_LVAL_P(offset);
     437             :                 }
     438         427 :                 EG(current_execute_data) = orig_execute_data;
     439             :         }
     440             : 
     441         460 :         if (op_array->static_variables) {
     442          13 :                 HashTable *stored = zend_shared_alloc_get_xlat_entry(op_array->static_variables);
     443             : 
     444          13 :                 if (stored) {
     445           0 :                         op_array->static_variables = stored;
     446             :                 } else {
     447          13 :                         zend_hash_persist(op_array->static_variables, zend_persist_zval_static);
     448          13 :                         zend_accel_store(op_array->static_variables, sizeof(HashTable));
     449             :                         /* make immutable array */
     450          13 :                         GC_REFCOUNT(op_array->static_variables) = 2;
     451          13 :                         GC_TYPE_INFO(op_array->static_variables) = IS_ARRAY | (IS_ARRAY_IMMUTABLE << 8);
     452          13 :                         op_array->static_variables->u.flags |= HASH_FLAG_STATIC_KEYS;
     453          13 :                         op_array->static_variables->u.flags &= ~HASH_FLAG_APPLY_PROTECTION;
     454             :                 }
     455             :         }
     456             : 
     457         460 :         if (zend_shared_alloc_get_xlat_entry(op_array->opcodes)) {
     458           0 :                 already_stored = 1;
     459             :         }
     460             : 
     461         460 :         if (op_array->literals) {
     462         460 :                 if (already_stored) {
     463           0 :                         orig_literals = zend_shared_alloc_get_xlat_entry(op_array->literals);
     464             :                         ZEND_ASSERT(orig_literals != NULL);
     465           0 :                         op_array->literals = orig_literals;
     466             :                 } else {
     467         460 :                         zval *p = zend_accel_memdup(op_array->literals, sizeof(zval) * op_array->last_literal);
     468         460 :                         zval *end = p + op_array->last_literal;
     469         460 :                         orig_literals = op_array->literals;
     470         460 :                         op_array->literals = p;
     471        3921 :                         while (p < end) {
     472        3001 :                                 zend_persist_zval(p);
     473        3001 :                                 p++;
     474             :                         }
     475         460 :                         efree(orig_literals);
     476             :                 }
     477             :         }
     478             : 
     479         460 :         if (already_stored) {
     480           0 :                 persist_ptr = zend_shared_alloc_get_xlat_entry(op_array->opcodes);
     481             :                 ZEND_ASSERT(persist_ptr != NULL);
     482           0 :                 op_array->opcodes = persist_ptr;
     483             :         } else {
     484         460 :                 zend_op *new_opcodes = zend_accel_memdup(op_array->opcodes, sizeof(zend_op) * op_array->last);
     485             : #if ZEND_USE_ABS_CONST_ADDR || ZEND_USE_ABS_JMP_ADDR
     486             :                 zend_op *opline = new_opcodes;
     487             :                 zend_op *end = new_opcodes + op_array->last;
     488             :                 int offset = 0;
     489             : 
     490             :                 for (; opline < end ; opline++, offset++) {
     491             : # if ZEND_USE_ABS_CONST_ADDR
     492             :                         if (ZEND_OP1_TYPE(opline) == IS_CONST) {
     493             :                                 opline->op1.zv = (zval*)((char*)opline->op1.zv + ((char*)op_array->literals - (char*)orig_literals));
     494             :                         }
     495             :                         if (ZEND_OP2_TYPE(opline) == IS_CONST) {
     496             :                                 opline->op2.zv = (zval*)((char*)opline->op2.zv + ((char*)op_array->literals - (char*)orig_literals));
     497             :                         }
     498             : # endif
     499             : # if ZEND_USE_ABS_JMP_ADDR
     500             :                         if (ZEND_DONE_PASS_TWO(op_array)) {
     501             :                                 /* fix jumps to point to new array */
     502             :                                 switch (opline->opcode) {
     503             :                                         case ZEND_JMP:
     504             :                                         case ZEND_FAST_CALL:
     505             :                                         case ZEND_DECLARE_ANON_CLASS:
     506             :                                         case ZEND_DECLARE_ANON_INHERITED_CLASS:
     507             :                                                 ZEND_OP1(opline).jmp_addr = &new_opcodes[ZEND_OP1(opline).jmp_addr - op_array->opcodes];
     508             :                                                 break;
     509             :                                         case ZEND_JMPZNZ:
     510             :                                                 /* relative extended_value don't have to be changed */
     511             :                                                 /* break omitted intentionally */
     512             :                                         case ZEND_JMPZ:
     513             :                                         case ZEND_JMPNZ:
     514             :                                         case ZEND_JMPZ_EX:
     515             :                                         case ZEND_JMPNZ_EX:
     516             :                                         case ZEND_JMP_SET:
     517             :                                         case ZEND_COALESCE:
     518             :                                         case ZEND_NEW:
     519             :                                         case ZEND_FE_RESET_R:
     520             :                                         case ZEND_FE_RESET_RW:
     521             :                                         case ZEND_ASSERT_CHECK:
     522             :                                                 ZEND_OP2(opline).jmp_addr = &new_opcodes[ZEND_OP2(opline).jmp_addr - op_array->opcodes];
     523             :                                                 break;
     524             :                                         case ZEND_FE_FETCH_R:
     525             :                                         case ZEND_FE_FETCH_RW:
     526             :                                                 /* relative extended_value don't have to be changed */
     527             :                                                 break;
     528             :                                 }
     529             :                         }
     530             : # endif
     531             :                 }
     532             : #endif
     533             : 
     534         460 :                 efree(op_array->opcodes);
     535         460 :                 op_array->opcodes = new_opcodes;
     536             : 
     537         460 :                 if (op_array->run_time_cache) {
     538           0 :                         efree(op_array->run_time_cache);
     539           0 :                         op_array->run_time_cache = NULL;
     540             :                 }
     541             :         }
     542             : 
     543         460 :         if (op_array->function_name && !IS_ACCEL_INTERNED(op_array->function_name)) {
     544             :                 zend_string *new_name;
     545           0 :                 if (already_stored) {
     546           0 :                         new_name = zend_shared_alloc_get_xlat_entry(op_array->function_name);
     547             :                         ZEND_ASSERT(new_name != NULL);
     548           0 :                         op_array->function_name = new_name;
     549             :                 } else {
     550           0 :                         zend_accel_store_string(op_array->function_name);
     551             :                 }
     552             :         }
     553             : 
     554         460 :         if (op_array->filename) {
     555             :                 /* do not free! PHP has centralized filename storage, compiler will free it */
     556         920 :                 zend_accel_memdup_string(op_array->filename);
     557             :         }
     558             : 
     559         460 :         if (op_array->arg_info) {
     560          29 :                 zend_arg_info *arg_info = op_array->arg_info;
     561          29 :                 uint32_t num_args = op_array->num_args;
     562             : 
     563          29 :                 if (op_array->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) {
     564           4 :                         arg_info--;
     565           4 :                         num_args++;
     566             :                 }
     567          29 :                 if (already_stored) {
     568           0 :                         arg_info = zend_shared_alloc_get_xlat_entry(arg_info);
     569             :                         ZEND_ASSERT(arg_info != NULL);
     570             :                 } else {
     571             :                         uint32_t i;
     572             : 
     573          29 :                         if (op_array->fn_flags & ZEND_ACC_VARIADIC) {
     574           0 :                                 num_args++;
     575             :                         }
     576          29 :                         zend_accel_store(arg_info, sizeof(zend_arg_info) * num_args);
     577          63 :                         for (i = 0; i < num_args; i++) {
     578          34 :                                 if (arg_info[i].name) {
     579          30 :                                         zend_accel_store_interned_string(arg_info[i].name);
     580             :                                 }
     581          34 :                                 if (arg_info[i].class_name) {
     582           4 :                                         zend_accel_store_interned_string(arg_info[i].class_name);
     583             :                                 }
     584             :                         }
     585             :                 }
     586          29 :                 if (op_array->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) {
     587           4 :                         arg_info++;
     588             :                 }
     589          29 :                 op_array->arg_info = arg_info;
     590             :         }
     591             : 
     592         460 :         if (op_array->brk_cont_array) {
     593          21 :                 zend_accel_store(op_array->brk_cont_array, sizeof(zend_brk_cont_element) * op_array->last_brk_cont);
     594             :         }
     595             : 
     596         460 :         if (op_array->scope) {
     597           9 :                 op_array->scope = zend_shared_alloc_get_xlat_entry(op_array->scope);
     598             :         }
     599             : 
     600         460 :         if (op_array->doc_comment) {
     601           0 :                 if (ZCG(accel_directives).save_comments) {
     602           0 :                         if (already_stored) {
     603           0 :                                 op_array->doc_comment = zend_shared_alloc_get_xlat_entry(op_array->doc_comment);
     604             :                                 ZEND_ASSERT(op_array->doc_comment != NULL);
     605             :                         } else {
     606           0 :                                 zend_accel_store_string(op_array->doc_comment);
     607             :                         }
     608             :                 } else {
     609           0 :                         if (!already_stored) {
     610           0 :                                 zend_string_release(op_array->doc_comment);
     611             :                         }
     612           0 :                         op_array->doc_comment = NULL;
     613             :                 }
     614             :         }
     615             : 
     616         460 :         if (op_array->try_catch_array) {
     617           8 :                 zend_accel_store(op_array->try_catch_array, sizeof(zend_try_catch_element) * op_array->last_try_catch);
     618             :         }
     619             : 
     620         460 :         if (op_array->vars) {
     621          72 :                 if (already_stored) {
     622           0 :                         persist_ptr = zend_shared_alloc_get_xlat_entry(op_array->vars);
     623             :                         ZEND_ASSERT(persist_ptr != NULL);
     624           0 :                         op_array->vars = (zend_string**)persist_ptr;
     625             :                 } else {
     626             :                         int i;
     627          72 :                         zend_accel_store(op_array->vars, sizeof(zend_string*) * op_array->last_var);
     628         241 :                         for (i = 0; i < op_array->last_var; i++) {
     629         169 :                                 zend_accel_store_interned_string(op_array->vars[i]);
     630             :                         }
     631             :                 }
     632             :         }
     633             : 
     634             :         /* "prototype" may be undefined if "scope" isn't set */
     635         462 :         if (op_array->scope && op_array->prototype) {
     636           2 :                 if ((persist_ptr = zend_shared_alloc_get_xlat_entry(op_array->prototype))) {
     637           2 :                         op_array->prototype = (union _zend_function*)persist_ptr;
     638             :                 }
     639             :         } else {
     640         458 :                 op_array->prototype = NULL;
     641             :         }
     642             : }
     643             : 
     644          33 : static void zend_persist_op_array(zval *zv)
     645             : {
     646          33 :         zend_op_array *op_array = Z_PTR_P(zv);
     647          33 :         zend_op_array *old_op_array = zend_shared_alloc_get_xlat_entry(op_array);
     648          33 :         if (old_op_array) {
     649           0 :                 Z_PTR_P(zv) = old_op_array;
     650           0 :                 if (op_array->refcount && --(*op_array->refcount) == 0) {
     651           0 :                         efree(op_array->refcount);
     652             :                 }
     653           0 :                 return;
     654             :         }
     655          33 :         memcpy(ZCG(arena_mem), Z_PTR_P(zv), sizeof(zend_op_array));
     656          33 :         zend_shared_alloc_register_xlat_entry(Z_PTR_P(zv), ZCG(arena_mem));
     657          33 :         Z_PTR_P(zv) = ZCG(arena_mem);
     658          33 :         ZCG(arena_mem) = (void*)((char*)ZCG(arena_mem) + ZEND_ALIGNED_SIZE(sizeof(zend_op_array)));
     659          33 :         zend_persist_op_array_ex(Z_PTR_P(zv), NULL);
     660             : }
     661             : 
     662           2 : static void zend_persist_property_info(zval *zv)
     663             : {
     664           2 :         zend_property_info *prop = zend_shared_alloc_get_xlat_entry(Z_PTR_P(zv));
     665             : 
     666           2 :         if (prop) {
     667           0 :                 Z_PTR_P(zv) = prop;
     668           0 :                 return;
     669             :         }
     670           2 :         memcpy(ZCG(arena_mem), Z_PTR_P(zv), sizeof(zend_property_info));
     671           2 :         zend_shared_alloc_register_xlat_entry(Z_PTR_P(zv), ZCG(arena_mem));
     672           2 :         prop = Z_PTR_P(zv) = ZCG(arena_mem);
     673           2 :         ZCG(arena_mem) = (void*)((char*)ZCG(arena_mem) + ZEND_ALIGNED_SIZE(sizeof(zend_property_info)));
     674           2 :         prop->ce = zend_shared_alloc_get_xlat_entry(prop->ce);
     675           2 :         zend_accel_store_interned_string(prop->name);
     676           2 :         if (prop->doc_comment) {
     677           0 :                 if (ZCG(accel_directives).save_comments) {
     678           0 :                         zend_accel_store_string(prop->doc_comment);
     679             :                 } else {
     680           0 :                         if (!zend_shared_alloc_get_xlat_entry(prop->doc_comment)) {
     681           0 :                                 zend_shared_alloc_register_xlat_entry(prop->doc_comment, prop->doc_comment);
     682             :                         }
     683           0 :                         zend_string_release(prop->doc_comment);
     684           0 :                         prop->doc_comment = NULL;
     685             :                 }
     686             :         }
     687             : }
     688             : 
     689           7 : static void zend_persist_class_entry(zval *zv)
     690             : {
     691           7 :         zend_class_entry *ce = Z_PTR_P(zv);
     692             : 
     693           7 :         if (ce->type == ZEND_USER_CLASS) {
     694           7 :                 memcpy(ZCG(arena_mem), Z_PTR_P(zv), sizeof(zend_class_entry));
     695           7 :                 zend_shared_alloc_register_xlat_entry(Z_PTR_P(zv), ZCG(arena_mem));
     696           7 :                 ce = Z_PTR_P(zv) = ZCG(arena_mem);
     697           7 :                 ZCG(arena_mem) = (void*)((char*)ZCG(arena_mem) + ZEND_ALIGNED_SIZE(sizeof(zend_class_entry)));
     698           7 :                 zend_accel_store_interned_string(ce->name);
     699           7 :                 zend_hash_persist(&ce->function_table, zend_persist_op_array);
     700           7 :                 if (ce->default_properties_table) {
     701             :                     int i;
     702             : 
     703           0 :                         zend_accel_store(ce->default_properties_table, sizeof(zval) * ce->default_properties_count);
     704           0 :                         for (i = 0; i < ce->default_properties_count; i++) {
     705           0 :                                 zend_persist_zval(&ce->default_properties_table[i]);
     706             :                         }
     707             :                 }
     708           7 :                 if (ce->default_static_members_table) {
     709             :                     int i;
     710             : 
     711           1 :                         zend_accel_store(ce->default_static_members_table, sizeof(zval) * ce->default_static_members_count);
     712           3 :                         for (i = 0; i < ce->default_static_members_count; i++) {
     713           2 :                                 zend_persist_zval(&ce->default_static_members_table[i]);
     714             :                         }
     715             :                 }
     716           7 :                 ce->static_members_table = NULL;
     717             : 
     718           7 :                 zend_hash_persist(&ce->constants_table, zend_persist_zval);
     719             : 
     720           7 :                 if (ZEND_CE_FILENAME(ce)) {
     721             :                         /* do not free! PHP has centralized filename storage, compiler will free it */
     722          14 :                         zend_accel_memdup_string(ZEND_CE_FILENAME(ce));
     723             :                 }
     724           7 :                 if (ZEND_CE_DOC_COMMENT(ce)) {
     725           0 :                         if (ZCG(accel_directives).save_comments) {
     726           0 :                                 zend_accel_store_string(ZEND_CE_DOC_COMMENT(ce));
     727             :                         } else {
     728           0 :                                 if (!zend_shared_alloc_get_xlat_entry(ZEND_CE_DOC_COMMENT(ce))) {
     729           0 :                                         zend_shared_alloc_register_xlat_entry(ZEND_CE_DOC_COMMENT(ce), ZEND_CE_DOC_COMMENT(ce));
     730           0 :                                         zend_string_release(ZEND_CE_DOC_COMMENT(ce));
     731             :                                 }
     732           0 :                                 ZEND_CE_DOC_COMMENT(ce) = NULL;
     733             :                         }
     734             :                 }
     735           7 :                 zend_hash_persist(&ce->properties_info, zend_persist_property_info);
     736           7 :                 if (ce->num_interfaces && ce->interfaces) {
     737           0 :                         efree(ce->interfaces);
     738             :                 }
     739           7 :                 ce->interfaces = NULL; /* will be filled in on fetch */
     740             : 
     741           7 :                 if (ce->num_traits && ce->traits) {
     742           0 :                         efree(ce->traits);
     743             :                 }
     744           7 :                 ce->traits = NULL;
     745             : 
     746           7 :                 if (ce->trait_aliases) {
     747           0 :                         int i = 0;
     748           0 :                         while (ce->trait_aliases[i]) {
     749           0 :                                 if (ce->trait_aliases[i]->trait_method) {
     750           0 :                                         if (ce->trait_aliases[i]->trait_method->method_name) {
     751           0 :                                                 zend_accel_store_interned_string(ce->trait_aliases[i]->trait_method->method_name);
     752             :                                         }
     753           0 :                                         if (ce->trait_aliases[i]->trait_method->class_name) {
     754           0 :                                                 zend_accel_store_interned_string(ce->trait_aliases[i]->trait_method->class_name);
     755             :                                         }
     756           0 :                                         ce->trait_aliases[i]->trait_method->ce = NULL;
     757           0 :                                         zend_accel_store(ce->trait_aliases[i]->trait_method,
     758             :                                                 sizeof(zend_trait_method_reference));
     759             :                                 }
     760             : 
     761           0 :                                 if (ce->trait_aliases[i]->alias) {
     762           0 :                                         zend_accel_store_interned_string(ce->trait_aliases[i]->alias);
     763             :                                 }
     764             : 
     765           0 :                                 zend_accel_store(ce->trait_aliases[i], sizeof(zend_trait_alias));
     766           0 :                                 i++;
     767             :                         }
     768             : 
     769           0 :                         zend_accel_store(ce->trait_aliases, sizeof(zend_trait_alias*) * (i + 1));
     770             :                 }
     771             : 
     772           7 :                 if (ce->trait_precedences) {
     773           0 :                         int i = 0;
     774             : 
     775           0 :                         while (ce->trait_precedences[i]) {
     776           0 :                                 zend_accel_store_interned_string(ce->trait_precedences[i]->trait_method->method_name);
     777           0 :                                 zend_accel_store_interned_string(ce->trait_precedences[i]->trait_method->class_name);
     778           0 :                                 ce->trait_precedences[i]->trait_method->ce = NULL;
     779           0 :                                 zend_accel_store(ce->trait_precedences[i]->trait_method,
     780             :                                         sizeof(zend_trait_method_reference));
     781             : 
     782           0 :                                 if (ce->trait_precedences[i]->exclude_from_classes) {
     783           0 :                                         int j = 0;
     784             : 
     785           0 :                                         while (ce->trait_precedences[i]->exclude_from_classes[j].class_name) {
     786           0 :                                                 zend_accel_store_interned_string(ce->trait_precedences[i]->exclude_from_classes[j].class_name);
     787           0 :                                                 j++;
     788             :                                         }
     789           0 :                                         zend_accel_store(ce->trait_precedences[i]->exclude_from_classes,
     790             :                                                 sizeof(zend_class_entry*) * (j + 1));
     791             :                                 }
     792             : 
     793           0 :                                 zend_accel_store(ce->trait_precedences[i], sizeof(zend_trait_precedence));
     794           0 :                                 i++;
     795             :                         }
     796           0 :                         zend_accel_store(
     797             :                                 ce->trait_precedences, sizeof(zend_trait_precedence*) * (i + 1));
     798             :                 }
     799             :         }
     800           7 : }
     801             : 
     802             : //static int zend_update_property_info_ce(zval *zv)
     803             : //{
     804             : //      zend_property_info *prop = Z_PTR_P(zv);
     805             : //
     806             : //      prop->ce = zend_shared_alloc_get_xlat_entry(prop->ce);
     807             : //      return 0;
     808             : //}
     809             : 
     810           7 : static int zend_update_parent_ce(zval *zv)
     811             : {
     812           7 :         zend_class_entry *ce = Z_PTR_P(zv);
     813             : 
     814           7 :         if (ce->parent) {
     815           3 :                 ce->parent = zend_shared_alloc_get_xlat_entry(ce->parent);
     816             :         }
     817             : 
     818             :         /* update methods */
     819           7 :         if (ce->constructor) {
     820           0 :                 ce->constructor = zend_shared_alloc_get_xlat_entry(ce->constructor);
     821             :         }
     822           7 :         if (ce->destructor) {
     823           0 :                 ce->destructor = zend_shared_alloc_get_xlat_entry(ce->destructor);
     824             :         }
     825           7 :         if (ce->clone) {
     826           0 :                 ce->clone = zend_shared_alloc_get_xlat_entry(ce->clone);
     827             :         }
     828           7 :         if (ce->__get) {
     829           0 :                 ce->__get = zend_shared_alloc_get_xlat_entry(ce->__get);
     830             :         }
     831           7 :         if (ce->__set) {
     832           0 :                 ce->__set = zend_shared_alloc_get_xlat_entry(ce->__set);
     833             :         }
     834           7 :         if (ce->__call) {
     835           0 :                 ce->__call = zend_shared_alloc_get_xlat_entry(ce->__call);
     836             :         }
     837           7 :         if (ce->serialize_func) {
     838           0 :                 ce->serialize_func = zend_shared_alloc_get_xlat_entry(ce->serialize_func);
     839             :         }
     840           7 :         if (ce->unserialize_func) {
     841           0 :                 ce->unserialize_func = zend_shared_alloc_get_xlat_entry(ce->unserialize_func);
     842             :         }
     843           7 :         if (ce->__isset) {
     844           0 :                 ce->__isset = zend_shared_alloc_get_xlat_entry(ce->__isset);
     845             :         }
     846           7 :         if (ce->__unset) {
     847           0 :                 ce->__unset = zend_shared_alloc_get_xlat_entry(ce->__unset);
     848             :         }
     849           7 :         if (ce->__tostring) {
     850           0 :                 ce->__tostring = zend_shared_alloc_get_xlat_entry(ce->__tostring);
     851             :         }
     852           7 :         if (ce->__callstatic) {
     853           0 :                 ce->__callstatic = zend_shared_alloc_get_xlat_entry(ce->__callstatic);
     854             :         }
     855           7 :         if (ce->__debugInfo) {
     856           0 :                 ce->__debugInfo = zend_shared_alloc_get_xlat_entry(ce->__debugInfo);
     857             :         }
     858             : //      zend_hash_apply(&ce->properties_info, (apply_func_t) zend_update_property_info_ce);
     859           7 :         return 0;
     860             : }
     861             : 
     862         427 : static void zend_accel_persist_class_table(HashTable *class_table)
     863             : {
     864         427 :     zend_hash_persist(class_table, zend_persist_class_entry);
     865         427 :         zend_hash_apply(class_table, (apply_func_t) zend_update_parent_ce);
     866         427 : }
     867             : 
     868         427 : zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, unsigned int key_length)
     869             : {
     870         427 :         script->mem = ZCG(mem);
     871             : 
     872         427 :         zend_shared_alloc_clear_xlat_table();
     873             : 
     874         427 :         zend_accel_store(script, sizeof(zend_persistent_script));
     875         427 :         if (key && *key) {
     876         427 :                 *key = zend_accel_memdup(*key, key_length + 1);
     877             :         }
     878        1281 :         zend_accel_store_string(script->full_path);
     879             : 
     880             : #ifdef __SSE2__
     881             :         /* Align to 64-byte boundary */
     882         427 :         ZCG(mem) = (void*)(((zend_uintptr_t)ZCG(mem) + 63L) & ~63L);
     883             : #endif
     884             : 
     885         427 :         script->arena_mem = ZCG(arena_mem) = ZCG(mem);
     886         427 :         ZCG(mem) = (void*)((char*)ZCG(mem) + script->arena_size);
     887             : 
     888         427 :         zend_accel_persist_class_table(&script->class_table);
     889         427 :         zend_hash_persist(&script->function_table, zend_persist_op_array);
     890         427 :         zend_persist_op_array_ex(&script->main_op_array, script);
     891             : 
     892         427 :         return script;
     893             : }
     894             : 
     895         427 : int zend_accel_script_persistable(zend_persistent_script *script)
     896             : {
     897         427 :         return 1;
     898             : }

Generated by: LCOV version 1.10

Generated at Tue, 25 Aug 2015 07:24:22 +0000 (3 days ago)

Copyright © 2005-2015 The PHP Group
All rights reserved.