diff options
Diffstat (limited to 'ext/opcache/zend_persist_calc.c')
| -rw-r--r-- | ext/opcache/zend_persist_calc.c | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/ext/opcache/zend_persist_calc.c b/ext/opcache/zend_persist_calc.c index 25ba69bee8..22e74d6b36 100644 --- a/ext/opcache/zend_persist_calc.c +++ b/ext/opcache/zend_persist_calc.c @@ -236,8 +236,8 @@ static void zend_persist_op_array_calc_ex(zend_op_array *op_array) } } - if (op_array->brk_cont_array) { - ADD_DUP_SIZE(op_array->brk_cont_array, sizeof(zend_brk_cont_element) * op_array->last_brk_cont); + if (op_array->live_range) { + ADD_DUP_SIZE(op_array->live_range, sizeof(zend_live_range) * op_array->last_live_range); } if (ZCG(accel_directives).save_comments && op_array->doc_comment) { @@ -294,6 +294,21 @@ static void zend_persist_property_info_calc(zval *zv) } } +static void zend_persist_class_constant_calc(zval *zv) +{ + zend_class_constant *c = Z_PTR_P(zv); + + if (!zend_shared_alloc_get_xlat_entry(c)) { + zend_shared_alloc_register_xlat_entry(c, c); + ADD_ARENA_SIZE(sizeof(zend_class_constant)); + zend_persist_zval_calc(&c->value); + if (ZCG(accel_directives).save_comments && c->doc_comment) { + ADD_STRING(c->doc_comment); + } + } +} + + static void zend_persist_class_entry_calc(zval *zv) { zend_class_entry *ce = Z_PTR_P(zv); @@ -318,13 +333,13 @@ static void zend_persist_class_entry_calc(zval *zv) zend_persist_zval_calc(&ce->default_static_members_table[i]); } } - zend_hash_persist_calc(&ce->constants_table, zend_persist_zval_calc); + zend_hash_persist_calc(&ce->constants_table, zend_persist_class_constant_calc); - if (ZEND_CE_FILENAME(ce)) { - ADD_STRING(ZEND_CE_FILENAME(ce)); + if (ce->info.user.filename) { + ADD_STRING(ce->info.user.filename); } - if (ZCG(accel_directives).save_comments && ZEND_CE_DOC_COMMENT(ce)) { - ADD_STRING(ZEND_CE_DOC_COMMENT(ce)); + if (ZCG(accel_directives).save_comments && ce->info.user.doc_comment) { + ADD_STRING(ce->info.user.doc_comment); } zend_hash_persist_calc(&ce->properties_info, zend_persist_property_info_calc); @@ -397,16 +412,16 @@ uint zend_accel_script_persist_calc(zend_persistent_script *new_persistent_scrip /* script is not going to be saved in SHM */ new_persistent_script->corrupted = 1; } - ADD_STRING(new_persistent_script->full_path); + ADD_STRING(new_persistent_script->script.filename); #ifdef __SSE2__ /* Align size to 64-byte boundary */ new_persistent_script->size = (new_persistent_script->size + 63) & ~63; #endif - zend_accel_persist_class_table_calc(&new_persistent_script->class_table); - zend_hash_persist_calc(&new_persistent_script->function_table, zend_persist_op_array_calc); - zend_persist_op_array_calc_ex(&new_persistent_script->main_op_array); + zend_accel_persist_class_table_calc(&new_persistent_script->script.class_table); + zend_hash_persist_calc(&new_persistent_script->script.function_table, zend_persist_op_array_calc); + zend_persist_op_array_calc_ex(&new_persistent_script->script.main_op_array); #ifdef __SSE2__ /* Align size to 64-byte boundary */ |
