ZVAL_PTR(&q->val, ARENA_REALLOC(Z_PTR(p->val)));
new_entry = (zend_op_array*)Z_PTR(q->val);
- /* Copy constructor */
- /* we use refcount to show that op_array is referenced from several places */
- if (new_entry->refcount != NULL) {
- accel_xlat_set(Z_PTR(p->val), new_entry);
- new_entry->refcount = NULL;
- }
-
- if (old_ce == new_entry->scope) {
- new_entry->scope = ce;
- } else {
- if ((new_ce = accel_xlat_get(new_entry->scope)) != NULL) {
- new_entry->scope = new_ce;
- } else {
- zend_error(E_ERROR, ACCELERATOR_PRODUCT_NAME " class loading error, class %s, function %s", ce->name->val, new_entry->function_name->val);
- }
- }
+ new_entry->scope = ARENA_REALLOC(new_entry->scope);
/* update prototype */
if (new_entry->prototype) {
- if ((new_prototype = accel_xlat_get(new_entry->prototype)) != NULL) {
- new_entry->prototype = new_prototype;
- } else {
- zend_error(E_ERROR, ACCELERATOR_PRODUCT_NAME " class loading error, class %s, function %s", ce->name->val, new_entry->function_name->val);
- }
+ new_entry->prototype = ARENA_REALLOC(new_entry->prototype);
}
}
}
prop_info->doc_comment = NULL;
}
}
- if (prop_info->ce == old_ce) {
- prop_info->ce = ce;
- } else if ((new_ce = accel_xlat_get(prop_info->ce)) != NULL) {
- prop_info->ce = new_ce;
- } else {
- zend_error(E_ERROR, ACCELERATOR_PRODUCT_NAME" class loading error, class %s, property %s", ce->name->val, prop_info->name->val);
- }
+ prop_info->ce = ARENA_REALLOC(prop_info->ce);
}
}
#define zend_update_inherited_handler(handler) \
{ \
if (ce->handler != NULL) { \
- if ((new_func = accel_xlat_get(ce->handler)) != NULL) { \
- ce->handler = new_func; \
- } else { \
- zend_error(E_ERROR, ACCELERATOR_PRODUCT_NAME " class loading error, class %s", ce->name->val); \
- } \
+ ce->handler = ARENA_REALLOC(ce->handler); \
} \
}
*pce = ce = ARENA_REALLOC(old_ce);
ce->refcount = 1;
- if (old_ce->refcount != 1) {
- /* this class is not used as a parent for any other classes */
- accel_xlat_set(old_ce, ce);
- }
-
if (old_ce->default_properties_table) {
int i;
}
if (ce->parent) {
- if ((new_ce = accel_xlat_get(ce->parent)) != NULL) {
- ce->parent = new_ce;
- } else {
- zend_error(E_ERROR, ACCELERATOR_PRODUCT_NAME" class loading error, class %s", ce->name->val);
- }
+ ce->parent = ARENA_REALLOC(ce->parent);
}
zend_update_inherited_handler(constructor);
if (op_array->scope && op_array->prototype) {
if ((persist_ptr = zend_shared_alloc_get_xlat_entry(op_array->prototype))) {
op_array->prototype = (union _zend_function*)persist_ptr;
- /* we use refcount to show that op_array is referenced from several places */
- op_array->prototype->op_array.refcount++;
}
} else {
op_array->prototype = NULL;
if (ce->parent) {
ce->parent = zend_shared_alloc_get_xlat_entry(ce->parent);
- /* We use refcount to show if the class is used as a parent */
- ce->parent->refcount++;
}
/* update methods */
if (ce->constructor) {
ce->constructor = zend_shared_alloc_get_xlat_entry(ce->constructor);
- /* we use refcount to show that op_array is referenced from several places */
- ce->constructor->op_array.refcount++;
}
if (ce->destructor) {
ce->destructor = zend_shared_alloc_get_xlat_entry(ce->destructor);
- ce->destructor->op_array.refcount++;
}
if (ce->clone) {
ce->clone = zend_shared_alloc_get_xlat_entry(ce->clone);
- ce->clone->op_array.refcount++;
}
if (ce->__get) {
ce->__get = zend_shared_alloc_get_xlat_entry(ce->__get);
- ce->__get->op_array.refcount++;
}
if (ce->__set) {
ce->__set = zend_shared_alloc_get_xlat_entry(ce->__set);
- ce->__set->op_array.refcount++;
}
if (ce->__call) {
ce->__call = zend_shared_alloc_get_xlat_entry(ce->__call);
- ce->__call->op_array.refcount++;
}
if (ce->serialize_func) {
ce->serialize_func = zend_shared_alloc_get_xlat_entry(ce->serialize_func);
- ce->serialize_func->op_array.refcount++;
}
if (ce->unserialize_func) {
ce->unserialize_func = zend_shared_alloc_get_xlat_entry(ce->unserialize_func);
- ce->unserialize_func->op_array.refcount++;
}
if (ce->__isset) {
ce->__isset = zend_shared_alloc_get_xlat_entry(ce->__isset);
- ce->__isset->op_array.refcount++;
}
if (ce->__unset) {
ce->__unset = zend_shared_alloc_get_xlat_entry(ce->__unset);
- ce->__unset->op_array.refcount++;
}
if (ce->__tostring) {
ce->__tostring = zend_shared_alloc_get_xlat_entry(ce->__tostring);
- ce->__tostring->op_array.refcount++;
}
if (ce->__callstatic) {
ce->__callstatic = zend_shared_alloc_get_xlat_entry(ce->__callstatic);
- ce->__callstatic->op_array.refcount++;
}
if (ce->__debugInfo) {
ce->__debugInfo = zend_shared_alloc_get_xlat_entry(ce->__debugInfo);
- ce->__debugInfo->op_array.refcount++;
}
zend_hash_apply(&ce->properties_info, (apply_func_t) zend_update_property_info_ce);
return 0;