summaryrefslogtreecommitdiff
path: root/ext/opcache/zend_persist.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/opcache/zend_persist.c')
-rw-r--r--ext/opcache/zend_persist.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c
index efadcb91fb..9bdba91639 100644
--- a/ext/opcache/zend_persist.c
+++ b/ext/opcache/zend_persist.c
@@ -285,11 +285,11 @@ static HashTable *zend_persist_attributes(HashTable *attributes)
return ptr;
}
-static void zend_persist_type(zend_type *type) {
+static void zend_persist_type(zend_type *type, bool use_arena) {
if (ZEND_TYPE_HAS_LIST(*type)) {
zend_type_list *list = ZEND_TYPE_LIST(*type);
if (ZEND_TYPE_USES_ARENA(*type)) {
- if (!ZCG(is_immutable_class)) {
+ if (!ZCG(is_immutable_class) && use_arena) {
list = zend_shared_memdup_arena_put(list, ZEND_TYPE_LIST_SIZE(list->num_types));
} else {
/* Moved from arena to SHM because type list was fully resolved. */
@@ -575,7 +575,7 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc
if (arg_info[i].name) {
zend_accel_store_interned_string(arg_info[i].name);
}
- zend_persist_type(&arg_info[i].type);
+ zend_persist_type(&arg_info[i].type, 0);
}
if (op_array->fn_flags & ZEND_ACC_HAS_RETURN_TYPE) {
arg_info++;
@@ -738,7 +738,7 @@ static zend_property_info *zend_persist_property_info(zend_property_info *prop)
if (prop->attributes) {
prop->attributes = zend_persist_attributes(prop->attributes);
}
- zend_persist_type(&prop->type);
+ zend_persist_type(&prop->type, 1);
return prop;
}
@@ -806,6 +806,7 @@ static void zend_persist_class_entry(zval *zv)
ZCG(is_immutable_class) = 0;
ce = Z_PTR_P(zv) = zend_shared_memdup_arena_put(ce, sizeof(zend_class_entry));
}
+ ce->ce_flags |= ZEND_ACC_CACHED;
zend_accel_store_interned_string(ce->name);
if (ce->parent_name && !(ce->ce_flags & ZEND_ACC_LINKED)) {
zend_accel_store_interned_string(ce->parent_name);