31#define ADD_DUP_SIZE(m,s) ZCG(current_persistent_script)->size += zend_shared_memdup_size((void*)m, s)
32#define ADD_SIZE(m) ZCG(current_persistent_script)->size += ZEND_ALIGNED_SIZE(m)
34# define ADD_STRING(str) ADD_DUP_SIZE((str), _ZSTR_STRUCT_SIZE(ZSTR_LEN(str)))
36# define ADD_INTERNED_STRING(str) do { \
37 if (ZCG(current_persistent_script)->corrupted) { \
39 } else if (!IS_ACCEL_INTERNED(str)) { \
40 zend_string *tmp = accel_new_interned_string(str); \
49static void zend_persist_zval_calc(
zval *z);
50static void zend_persist_op_array_calc(
zval *
zv);
60 }
else if (
ht->nNumUsed >
HT_MIN_SIZE &&
ht->nNumUsed < (uint32_t)(-(int32_t)
ht->nTableMask) / 4) {
64 hash_size = (uint32_t)(-(int32_t)
ht->nTableMask);
65 while (hash_size >> 2 >
ht->nNumUsed) {
74static void zend_persist_ast_calc(
zend_ast *ast)
81 }
else if (zend_ast_is_list(ast)) {
84 for (i = 0; i < list->
children; i++) {
86 zend_persist_ast_calc(list->
child[i]);
90 uint32_t children = zend_ast_get_num_children(ast);
92 for (i = 0; i < children; i++) {
94 zend_persist_ast_calc(ast->
child[i]);
100static void zend_persist_zval_calc(
zval *z)
112 if (!
ZCG(current_persistent_script)->corrupted
121 zend_hash_persist_calc(
ht);
126 zend_persist_zval_calc(
zv);
135 zend_persist_zval_calc(&
p->val);
141 if (
ZCG(current_persistent_script)->corrupted
156static void zend_persist_attributes_calc(
HashTable *attributes)
159 && (
ZCG(current_persistent_script)->corrupted
166 zend_hash_persist_calc(attributes);
173 for (i = 0; i <
attr->argc; i++) {
174 if (
attr->args[i].name) {
177 zend_persist_zval_calc(&
attr->args[i].value);
192 zend_persist_type_calc(single_type);
203static void zend_persist_op_array_calc_ex(
zend_op_array *op_array)
215 if (op_array->
scope) {
239 zend_persist_zval_calc(&
p->val);
249 zend_persist_zval_calc(
p);
275 if (arg_info[i].
name) {
278 zend_persist_type_calc(&arg_info[i].
type);
286 if (
ZCG(accel_directives).save_comments && op_array->
doc_comment) {
291 zend_persist_attributes_calc(op_array->
attributes);
298 if (op_array->
vars) {
302 for (i = 0; i < op_array->
last_var; i++) {
312 zend_persist_op_array_calc(&tmp);
319static void zend_persist_op_array_calc(
zval *
zv)
326 zend_persist_op_array_calc_ex(op_array);
332static void zend_persist_class_method_calc(
zend_op_array *op_array)
349 && !
ZCG(current_persistent_script)->corrupted
358 zend_persist_op_array_calc_ex(op_array);
365 if (old_function_name) {
375 zend_persist_type_calc(&prop->
type);
380 zend_persist_attributes_calc(prop->
attributes);
385 if (prop->
hooks[i]) {
392static void zend_persist_class_constant_calc(
zval *
zv)
402 if (!
ZCG(current_persistent_script)->corrupted
408 zend_persist_zval_calc(&c->
value);
415 zend_persist_type_calc(&c->
type);
443 zend_persist_class_method_calc(
Z_PTR(
p->val));
467 zend_persist_class_constant_calc(&
p->val);
475 if (prop->
ce == ce) {
476 zend_persist_property_info_calc(prop);
571static void zend_accel_persist_class_table_calc(
HashTable *class_table)
575 zend_hash_persist_calc(class_table);
585 for (uint32_t i = 0; i < num_warnings; i++) {
592static void zend_persist_early_bindings_calc(
596 for (uint32_t i = 0; i < num_early_bindings; i++) {
608 new_persistent_script->
mem =
NULL;
609 new_persistent_script->
size = 0;
610 new_persistent_script->
corrupted =
false;
611 ZCG(current_persistent_script) = new_persistent_script;
621#if defined(__AVX__) || defined(__SSE2__)
623 new_persistent_script->
size = (new_persistent_script->
size + 63) & ~63;
637 zend_persist_op_array_calc(&
p->val);
642 zend_persist_early_bindings_calc(
645 new_persistent_script->
corrupted =
false;
647 ZCG(current_persistent_script) =
NULL;
649 return new_persistent_script->
size;
struct _zend_persistent_script zend_persistent_script
struct _zend_early_binding zend_early_binding
unsigned const char * end
zend_string * doc_comment
HashTable constants_table
zend_class_iterator_funcs * iterator_funcs_ptr
zval * default_static_members_table
struct _zend_class_entry::@126215362204241324314155352336150042254204116267::@166057154351252324007362117353350250255142166322 user
HashTable properties_info
zend_trait_precedence ** trait_precedences
zend_class_name * trait_names
zend_class_name * interface_names
union _zend_class_entry::@126215362204241324314155352336150042254204116267 info
zend_class_arrayaccess_funcs * arrayaccess_funcs_ptr
zend_string * parent_name
int default_properties_count
zend_trait_alias ** trait_aliases
int default_static_members_count
struct _zend_property_info ** properties_info_table
zend_string * doc_comment
zval * default_properties_table
zend_string * lc_parent_name
HashTable * static_variables
zend_op_array ** dynamic_func_defs
zend_string * doc_comment
zend_try_catch_element * try_catch_array
zend_live_range * live_range
zend_string * function_name
uint32_t num_dynamic_func_defs
uint32_t num_early_bindings
zend_early_binding * early_bindings
zend_error_info ** warnings
zend_string * doc_comment
zend_op_array main_op_array
zend_trait_method_reference trait_method
zend_string * method_name
zend_trait_method_reference trait_method
zend_string * exclude_class_names[1]
struct _zend_class_name zend_class_name
struct _zend_trait_precedence zend_trait_precedence
struct _zend_error_info zend_error_info
struct _zend_trait_alias zend_trait_alias
struct _zend_ast_zval zend_ast_zval
struct _zend_ast_list zend_ast_list
#define ZEND_ATTRIBUTE_SIZE(argc)
struct _zend_attribute zend_attribute
zend_string_release_ex(func->internal_function.function_name, 0)
#define ZEND_PROPERTY_HOOK_COUNT
#define ZEND_ACC_IMMUTABLE
#define ZEND_INTERNAL_FUNCTION
#define ZEND_USER_FUNCTION
struct _zend_op_array zend_op_array
#define ZEND_PROPERTY_HOOK_STRUCT_SIZE
struct _zend_class_constant zend_class_constant
struct _zend_property_info zend_property_info
#define ZEND_ACC_HAS_RETURN_TYPE
struct _zend_arg_info zend_arg_info
#define ZEND_ACC_ARENA_ALLOCATED
#define ZEND_ACC_VARIADIC
struct _zend_try_catch_element zend_try_catch_element
struct _zend_live_range zend_live_range
#define ZEND_INTERNAL_CLASS
struct _zend_internal_function zend_internal_function
ZEND_API size_t zend_extensions_op_array_persist_calc(zend_op_array *op_array)
ZEND_API void ZEND_FASTCALL zend_hash_rehash(HashTable *ht)
#define ZEND_HASH_MAP_FOREACH_BUCKET(ht, _bucket)
#define ZEND_HASH_PACKED_FOREACH_PTR(ht, _ptr)
#define HASH_FLAG_UNINITIALIZED
#define ZEND_HASH_PACKED_FOREACH_VAL(ht, _val)
#define ZEND_HASH_FOREACH_END()
struct _zend_class_arrayaccess_funcs zend_class_arrayaccess_funcs
struct _zend_class_iterator_funcs zend_class_iterator_funcs
struct _zend_string zend_string
void zend_persist_warnings_calc(uint32_t num_warnings, zend_error_info **warnings)
void zend_persist_class_entry_calc(zend_class_entry *ce)
uint32_t zend_accel_script_persist_calc(zend_persistent_script *new_persistent_script, int for_shm)
#define ADD_INTERNED_STRING(str)
struct _zend_array zend_array
struct _zend_class_entry zend_class_entry
bool zend_accel_in_shm(void *ptr)
void * zend_shared_alloc_get_xlat_entry(const void *key_pointer)
int zend_shared_memdup_size(void *source, size_t size)
void zend_shared_alloc_register_xlat_entry(const void *key_pointer, const void *value)
#define ZEND_ALIGNED_SIZE(size)
#define ZSTR_IS_INTERNED(s)
struct _zend_ast_ref zend_ast_ref
#define ZEND_TYPE_NAME(t)
#define Z_CONSTANT_FLAGS(zval)
#define Z_ARRVAL_P(zval_p)
struct _zend_array HashTable
#define ZEND_TYPE_LIST_SIZE(num_types)
#define ZEND_TYPE_HAS_NAME(t)
#define ZEND_TYPE_FOREACH(type, type_ptr)
#define ZEND_TYPE_HAS_LIST(t)
#define ZEND_TYPE_FOREACH_END()
#define Z_TYPE_FLAGS_P(zval_p)
#define ZEND_TYPE_SET_PTR(t, _ptr)
#define ZEND_TYPE_LIST(t)
struct _zend_ast zend_ast
#define HT_PACKED_USED_SIZE(ht)
#define Z_ASTVAL_P(zval_p)