diff options
Diffstat (limited to 'ext/opcache')
-rw-r--r-- | ext/opcache/README | 6 | ||||
-rw-r--r-- | ext/opcache/ZendAccelerator.c | 192 | ||||
-rw-r--r-- | ext/opcache/ZendAccelerator.h | 1 | ||||
-rw-r--r-- | ext/opcache/zend_accelerator_module.c | 2 |
4 files changed, 0 insertions, 201 deletions
diff --git a/ext/opcache/README b/ext/opcache/README index cf305ad9d1..6f07f7ee58 100644 --- a/ext/opcache/README +++ b/ext/opcache/README @@ -47,7 +47,6 @@ opcache.memory_consumption=128 opcache.interned_strings_buffer=8 opcache.max_accelerated_files=4000 opcache.revalidate_freq=60 -opcache.fast_shutdown=1 opcache.enable_cli=1 You also may add the following, but it may break some applications and @@ -137,11 +136,6 @@ opcache.save_comments (default "1") size of the optimized code. Disabling "Doc Comments" may break some existing applications and frameworks (e.g. Doctrine, ZF2, PHPUnit) -opcache.fast_shutdown (default "0") - If enabled, a fast shutdown sequence is used for the accelerated code - The fast shutdown sequence doesn't free each allocated block, but lets - the Zend Engine Memory Manager do the work. - opcache.enable_file_override (default "0") Allow file existence override (file_exists, etc.) performance feature. diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index e6dc4ce684..7e375e8289 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -2250,192 +2250,6 @@ static void accel_activate(void) } } -#if !ZEND_DEBUG - -/* Fast Request Shutdown - * ===================== - * Zend Memory Manager frees memory by its own. We don't have to free each - * allocated block separately, but we like to call all the destructors and - * callbacks in exactly the same order. - */ -static void accel_fast_hash_destroy(HashTable *ht); - -static void accel_fast_zval_dtor(zval *zvalue) -{ -tail_call: - switch (Z_TYPE_P(zvalue)) { - case IS_ARRAY: - GC_REMOVE_FROM_BUFFER(Z_ARR_P(zvalue)); - if (Z_ARR_P(zvalue) != &EG(symbol_table)) { - /* break possible cycles */ - ZVAL_NULL(zvalue); - accel_fast_hash_destroy(Z_ARRVAL_P(zvalue)); - } - break; - case IS_OBJECT: - OBJ_RELEASE(Z_OBJ_P(zvalue)); - break; - case IS_RESOURCE: - zend_list_delete(Z_RES_P(zvalue)); - break; - case IS_REFERENCE: { - zend_reference *ref = Z_REF_P(zvalue); - - if (--GC_REFCOUNT(ref) == 0) { - if (Z_REFCOUNTED(ref->val) && Z_DELREF(ref->val) == 0) { - zvalue = &ref->val; - goto tail_call; - } - } - } - break; - } -} - -static void accel_fast_hash_destroy(HashTable *ht) -{ - Bucket *p = ht->arData; - Bucket *end = p + ht->nNumUsed; - - while (p != end) { - if (Z_REFCOUNTED(p->val) && Z_DELREF(p->val) == 0) { - accel_fast_zval_dtor(&p->val); - } - p++; - } -} - -static inline void zend_accel_fast_del_bucket(HashTable *ht, uint32_t idx, Bucket *p) -{ - uint32_t nIndex = p->h | ht->nTableMask; - uint32_t i = HT_HASH(ht, nIndex); - - ht->nNumOfElements--; - if (idx != i) { - Bucket *prev = HT_HASH_TO_BUCKET(ht, i); - while (Z_NEXT(prev->val) != idx) { - i = Z_NEXT(prev->val); - prev = HT_HASH_TO_BUCKET(ht, i); - } - Z_NEXT(prev->val) = Z_NEXT(p->val); - } else { - HT_HASH(ht, p->h | ht->nTableMask) = Z_NEXT(p->val); - } -} - -static void zend_accel_fast_shutdown(void) -{ - if (EG(full_tables_cleanup)) { - return; - } - - if (EG(objects_store).top > 1 || zend_hash_num_elements(&EG(regular_list)) > 0) { - /* We don't have to destroy all zvals if they cannot call any destructors */ - zend_try { - ZEND_HASH_REVERSE_FOREACH(&EG(symbol_table), 0) { - if (Z_REFCOUNTED(_p->val) && Z_DELREF(_p->val) == 0) { - accel_fast_zval_dtor(&_p->val); - } - zend_accel_fast_del_bucket(&EG(symbol_table), HT_IDX_TO_HASH(_idx-1), _p); - } ZEND_HASH_FOREACH_END(); - } zend_end_try(); - zend_hash_init(&EG(symbol_table), 8, NULL, NULL, 0); - - ZEND_HASH_REVERSE_FOREACH(EG(function_table), 0) { - zend_function *func = Z_PTR(_p->val); - - if (func->type == ZEND_INTERNAL_FUNCTION) { - break; - } else { - if (func->op_array.static_variables) { - if (!(GC_FLAGS(func->op_array.static_variables) & IS_ARRAY_IMMUTABLE)) { - if (--GC_REFCOUNT(func->op_array.static_variables) == 0) { - accel_fast_hash_destroy(func->op_array.static_variables); - } - } - } - zend_accel_fast_del_bucket(EG(function_table), HT_IDX_TO_HASH(_idx-1), _p); - } - } ZEND_HASH_FOREACH_END(); - - ZEND_HASH_REVERSE_FOREACH(EG(class_table), 0) { - zend_class_entry *ce = Z_PTR(_p->val); - - if (ce->type == ZEND_INTERNAL_CLASS) { - break; - } else { - if (ce->ce_flags & ZEND_HAS_STATIC_IN_METHODS) { - zend_function *func; - - ZEND_HASH_FOREACH_PTR(&ce->function_table, func) { - if (func->type == ZEND_USER_FUNCTION) { - if (func->op_array.static_variables) { - if (!(GC_FLAGS(func->op_array.static_variables) & IS_ARRAY_IMMUTABLE)) { - if (--GC_REFCOUNT(func->op_array.static_variables) == 0) { - accel_fast_hash_destroy(func->op_array.static_variables); - } - } - func->op_array.static_variables = NULL; - } - } - } ZEND_HASH_FOREACH_END(); - } - if (ce->static_members_table) { - int i; - - for (i = 0; i < ce->default_static_members_count; i++) { - zval *zv = &ce->static_members_table[i]; - ZVAL_UNDEF(&ce->static_members_table[i]); - if (Z_REFCOUNTED_P(zv) && Z_DELREF_P(zv) == 0) { - accel_fast_zval_dtor(zv); - } - } - ce->static_members_table = NULL; - } - zend_accel_fast_del_bucket(EG(class_table), HT_IDX_TO_HASH(_idx-1), _p); - } - } ZEND_HASH_FOREACH_END(); - - } else { - - zend_hash_init(&EG(symbol_table), 8, NULL, NULL, 0); - - ZEND_HASH_REVERSE_FOREACH(EG(function_table), 0) { - zend_function *func = Z_PTR(_p->val); - - if (func->type == ZEND_INTERNAL_FUNCTION) { - break; - } else { - zend_accel_fast_del_bucket(EG(function_table), HT_IDX_TO_HASH(_idx-1), _p); - } - } ZEND_HASH_FOREACH_END(); - - ZEND_HASH_REVERSE_FOREACH(EG(class_table), 0) { - zend_class_entry *ce = Z_PTR(_p->val); - - if (ce->type == ZEND_INTERNAL_CLASS) { - break; - } else { - zend_accel_fast_del_bucket(EG(class_table), HT_IDX_TO_HASH(_idx-1), _p); - } - } ZEND_HASH_FOREACH_END(); - } - - ZEND_HASH_REVERSE_FOREACH(EG(zend_constants), 0) { - zend_constant *c = Z_PTR(_p->val); - - if (c->flags & CONST_PERSISTENT) { - break; - } else { - zend_accel_fast_del_bucket(EG(zend_constants), HT_IDX_TO_HASH(_idx-1), _p); - } - } ZEND_HASH_FOREACH_END(); - EG(function_table)->nNumUsed = EG(function_table)->nNumOfElements; - EG(class_table)->nNumUsed = EG(class_table)->nNumOfElements; - EG(zend_constants)->nNumUsed = EG(zend_constants)->nNumOfElements; -} -#endif - int accel_post_deactivate(void) { if (!ZCG(enabled) || !accel_startup_ok) { @@ -2464,12 +2278,6 @@ static void accel_deactivate(void) if (!ZCG(enabled) || !accel_startup_ok) { return; } - -#if !ZEND_DEBUG - if (ZCG(accel_directives).fast_shutdown && is_zend_mm()) { - zend_accel_fast_shutdown(); - } -#endif } static int accelerator_remove_cb(zend_extension *element1, zend_extension *element2) diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h index 6faa263db2..17b6f8da52 100644 --- a/ext/opcache/ZendAccelerator.h +++ b/ext/opcache/ZendAccelerator.h @@ -175,7 +175,6 @@ typedef struct _zend_accel_directives { zend_bool validate_timestamps; zend_bool revalidate_path; zend_bool save_comments; - zend_bool fast_shutdown; zend_bool protect_memory; zend_bool file_override_enabled; zend_bool inherited_hack; diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index 6f76851455..6c8efac7c7 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -299,7 +299,6 @@ ZEND_INI_BEGIN() STD_PHP_INI_ENTRY("opcache.protect_memory" , "0" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.protect_memory, zend_accel_globals, accel_globals) STD_PHP_INI_ENTRY("opcache.save_comments" , "1" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.save_comments, zend_accel_globals, accel_globals) - STD_PHP_INI_ENTRY("opcache.fast_shutdown" , "0" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.fast_shutdown, zend_accel_globals, accel_globals) STD_PHP_INI_ENTRY("opcache.optimization_level" , DEFAULT_OPTIMIZATION_LEVEL , PHP_INI_SYSTEM, OnUpdateLong, accel_directives.optimization_level, zend_accel_globals, accel_globals) STD_PHP_INI_ENTRY("opcache.opt_debug_level" , "0" , PHP_INI_SYSTEM, OnUpdateLong, accel_directives.opt_debug_level, zend_accel_globals, accel_globals) @@ -722,7 +721,6 @@ static ZEND_FUNCTION(opcache_get_configuration) add_assoc_bool(&directives, "opcache.protect_memory", ZCG(accel_directives).protect_memory); add_assoc_bool(&directives, "opcache.save_comments", ZCG(accel_directives).save_comments); - add_assoc_bool(&directives, "opcache.fast_shutdown", ZCG(accel_directives).fast_shutdown); add_assoc_bool(&directives, "opcache.enable_file_override", ZCG(accel_directives).file_override_enabled); add_assoc_long(&directives, "opcache.optimization_level", ZCG(accel_directives).optimization_level); |