com php-src: Remove zend_get_class_entry function: Zend/zend_API.c Zend/zend_API.h Zend/zend_builtin _functions.c Zend/zend_types.h Zend/zend_vm_def
.h Zend/zend_vm_execute.h ext/pdo/pdo_stmt.c ext/soap/soap.c ext/spl/spl_iterators.c ext/standard/ var.c

From: Date: Thu, 09 Oct 2014 12:17:30 +0000
Subject: com php-src: Remove zend_get_class_entry function: Zend/zend_API.c Zend/zend_API.h Zend/zend_builtin _functions.c Zend/zend_types.h Zend/zend_vm_def
.h Zend/zend_vm_execute.h ext/pdo/pdo_stmt.c ext/soap/soap.c ext/spl/spl_iterators.c ext/standard/ var.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-82211@lists.php.net to get a copy of this message
Commit: e5e9d8346f50d406f4e8ed8431b7c917663a32c3 Author: Nikita Popov <nikic@php.net> Thu, 9 Oct 2014 14:17:30 +0200 Parents: b3a779de68efcf2cff265cae30e45f1ada834064 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e5e9d8346f50d406f4e8ed8431b7c917663a32c3 Log: Remove zend_get_class_entry function Changed paths: M Zend/zend_API.c M Zend/zend_API.h M Zend/zend_builtin_functions.c M Zend/zend_types.h M Zend/zend_vm_def.h M Zend/zend_vm_execute.h M ext/pdo/pdo_stmt.c M ext/soap/soap.c M ext/spl/spl_iterators.c M ext/standard/var.c

diff --git a/Zend/zend_API.c b/Zend/zend_API.c index b9e6cc1..cf4ac5e 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -196,12 +196,6 @@ ZEND_API char *zend_zval_type_name(const zval *arg) /* {{{ */ } /* }}} */ -ZEND_API zend_class_entry *zend_get_class_entry(const zend_object *zobject TSRMLS_DC) /* {{{ */ -{ - return zobject->ce; -} -/* }}} */ - /* returns 1 if you need to copy result, 0 if it's already a copy */ ZEND_API zend_string *zend_get_object_classname(const zend_object *object TSRMLS_DC) /* {{{ */ { @@ -213,7 +207,7 @@ ZEND_API zend_string *zend_get_object_classname(const zend_object *object TSRMLS return ret; } } - return zend_get_class_entry(object TSRMLS_CC)->name; + return object->ce->name; } /* }}} */ @@ -2895,7 +2889,7 @@ static int zend_is_callable_check_class(zend_string *name, zend_fcall_info_cache fcc->object = Z_OBJ(EG(current_execute_data)->This); fcc->called_scope = Z_OBJCE(EG(current_execute_data)->This); } else { - fcc->called_scope = fcc->object ? zend_get_class_entry(fcc->object TSRMLS_CC) : fcc->calling_scope; + fcc->called_scope = fcc->object ? fcc->object->ce : fcc->calling_scope; } *strict_class = 1; ret = 1; @@ -3038,7 +3032,7 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca ((fcc->object && fcc->calling_scope->__call) || (!fcc->object && fcc->calling_scope->__callstatic)))) { if (fcc->function_handler->op_array.fn_flags & ZEND_ACC_PRIVATE) { - if (!zend_check_private(fcc->function_handler, fcc->object ? zend_get_class_entry(fcc->object TSRMLS_CC) : EG(scope), lmname TSRMLS_CC)) { + if (!zend_check_private(fcc->function_handler, fcc->object ? fcc->object->ce : EG(scope), lmname TSRMLS_CC)) { retval = 0; fcc->function_handler = NULL; goto get_function_via_handler; @@ -3148,7 +3142,7 @@ get_function_via_handler: } if (retval && (check_flags & IS_CALLABLE_CHECK_NO_ACCESS) == 0) { if (fcc->function_handler->op_array.fn_flags & ZEND_ACC_PRIVATE) { - if (!zend_check_private(fcc->function_handler, fcc->object ? zend_get_class_entry(fcc->object TSRMLS_CC) : EG(scope), lmname TSRMLS_CC)) { + if (!zend_check_private(fcc->function_handler, fcc->object ? fcc->object->ce : EG(scope), lmname TSRMLS_CC)) { if (error) { if (*error) { efree(*error); @@ -3181,7 +3175,7 @@ get_function_via_handler: zend_string_release(mname); if (fcc->object) { - fcc->called_scope = zend_get_class_entry(fcc->object TSRMLS_CC); + fcc->called_scope = fcc->object->ce; } if (retval) { fcc->initialized = 1; @@ -3222,7 +3216,7 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zend_object *object, uint case IS_STRING: if (object) { fcc->object = object; - fcc->calling_scope = zend_get_class_entry(object TSRMLS_CC); + fcc->calling_scope = object->ce; if (callable_name) { char *ptr; diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 730e1b9..9082c03 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -339,7 +339,6 @@ ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, const c ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, int name_length, zend_bool silent TSRMLS_DC); -ZEND_API zend_class_entry *zend_get_class_entry(const zend_object *object TSRMLS_DC); ZEND_API zend_string *zend_get_object_classname(const zend_object *object TSRMLS_DC); ZEND_API char *zend_get_type_by_const(int type); diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 614cfff..fb85a2d 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -858,7 +858,7 @@ ZEND_FUNCTION(get_parent_class) && (name = Z_OBJ_HT_P(arg)->get_class_name(Z_OBJ_P(arg), 1 TSRMLS_CC)) != NULL) { RETURN_STR(name); } else { - ce = zend_get_class_entry(Z_OBJ_P(arg) TSRMLS_CC); + ce = Z_OBJ_P(arg)->ce; } } else if (Z_TYPE_P(arg) == IS_STRING) { ce = zend_lookup_class(Z_STR_P(arg) TSRMLS_CC); @@ -2181,9 +2181,7 @@ ZEND_FUNCTION(debug_print_backtrace) function_name = (func->common.scope && func->common.scope->trait_aliases) ? zend_resolve_method_name( - (object ? - zend_get_class_entry(object TSRMLS_CC) : - func->common.scope), func)->val : + (object ? object->ce : func->common.scope), func)->val : (func->common.function_name ? func->common.function_name->val : NULL); } else { @@ -2403,9 +2401,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int function_name = (func->common.scope && func->common.scope->trait_aliases) ? zend_resolve_method_name( - (object ? - zend_get_class_entry(object TSRMLS_CC) : - func->common.scope), func)->val : + (object ? object->ce : func->common.scope), func)->val : (func->common.function_name ? func->common.function_name->val : NULL); } else { diff --git a/Zend/zend_types.h b/Zend/zend_types.h index 811133a..e3818dd 100644 --- a/Zend/zend_types.h +++ b/Zend/zend_types.h @@ -438,7 +438,7 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) { #define Z_OBJ_HANDLE(zval) (Z_OBJ((zval)))->handle #define Z_OBJ_HANDLE_P(zval_p) Z_OBJ_HANDLE(*(zval_p)) -#define Z_OBJCE(zval) zend_get_class_entry(Z_OBJ(zval) TSRMLS_CC) +#define Z_OBJCE(zval) (Z_OBJ(zval)->ce) #define Z_OBJCE_P(zval_p) Z_OBJCE(*(zval_p)) #define Z_OBJPROP(zval) Z_OBJ_HT((zval))->get_properties(&(zval) TSRMLS_CC) diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 9530020..1d9b00a 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -2185,7 +2185,7 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, TMP|VAR|UNUSED|CV, CONST|TMP|VAR|CV) } obj = Z_OBJ_P(object); - called_scope = zend_get_class_entry(obj TSRMLS_CC); + called_scope = obj->ce; if (OP2_TYPE != IS_CONST || (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) { @@ -2297,7 +2297,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS if (UNEXPECTED(ce->constructor == NULL)) { zend_error_noreturn(E_ERROR, "Cannot call constructor"); } - if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + if (Z_OBJ(EX(This)) && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val); } fbc = ce->constructor; @@ -2310,7 +2310,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS GC_REFCOUNT(object)++; } if (!object || - !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { + !instanceof_function(object->ce, ce TSRMLS_CC)) { /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { @@ -2941,7 +2941,7 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV) CACHE_PTR(Z_CACHE_SLOT_P(opline->op1.zv), catch_ce); } - ce = zend_get_class_entry(EG(exception) TSRMLS_CC); + ce = EG(exception)->ce; #ifdef HAVE_DTRACE if (DTRACE_EXCEPTION_CAUGHT_ENABLED()) { diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index eaf5963..d3b40c1 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -4158,7 +4158,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER( if (UNEXPECTED(ce->constructor == NULL)) { zend_error_noreturn(E_ERROR, "Cannot call constructor"); } - if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + if (Z_OBJ(EX(This)) && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val); } fbc = ce->constructor; @@ -4171,7 +4171,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER( GC_REFCOUNT(object)++; } if (!object || - !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { + !instanceof_function(object->ce, ce TSRMLS_CC)) { /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { @@ -5480,7 +5480,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE if (UNEXPECTED(ce->constructor == NULL)) { zend_error_noreturn(E_ERROR, "Cannot call constructor"); } - if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + if (Z_OBJ(EX(This)) && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val); } fbc = ce->constructor; @@ -5493,7 +5493,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE GC_REFCOUNT(object)++; } if (!object || - !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { + !instanceof_function(object->ce, ce TSRMLS_CC)) { /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { @@ -6674,7 +6674,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE if (UNEXPECTED(ce->constructor == NULL)) { zend_error_noreturn(E_ERROR, "Cannot call constructor"); } - if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + if (Z_OBJ(EX(This)) && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val); } fbc = ce->constructor; @@ -6687,7 +6687,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE GC_REFCOUNT(object)++; } if (!object || - !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { + !instanceof_function(object->ce, ce TSRMLS_CC)) { /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { @@ -7619,7 +7619,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER if (UNEXPECTED(ce->constructor == NULL)) { zend_error_noreturn(E_ERROR, "Cannot call constructor"); } - if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + if (Z_OBJ(EX(This)) && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val); } fbc = ce->constructor; @@ -7632,7 +7632,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER GC_REFCOUNT(object)++; } if (!object || - !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { + !instanceof_function(object->ce, ce TSRMLS_CC)) { /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { @@ -8607,7 +8607,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN if (UNEXPECTED(ce->constructor == NULL)) { zend_error_noreturn(E_ERROR, "Cannot call constructor"); } - if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + if (Z_OBJ(EX(This)) && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val); } fbc = ce->constructor; @@ -8620,7 +8620,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN GC_REFCOUNT(object)++; } if (!object || - !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { + !instanceof_function(object->ce, ce TSRMLS_CC)) { /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { @@ -8731,7 +8731,7 @@ static int ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A CACHE_PTR(Z_CACHE_SLOT_P(opline->op1.zv), catch_ce); } - ce = zend_get_class_entry(EG(exception) TSRMLS_CC); + ce = EG(exception)->ce; #ifdef HAVE_DTRACE if (DTRACE_EXCEPTION_CAUGHT_ENABLED()) { @@ -11028,7 +11028,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CONST_HANDLER(ZEND_OPCO } obj = Z_OBJ_P(object); - called_scope = zend_get_class_entry(obj TSRMLS_CC); + called_scope = obj->ce; if (IS_CONST != IS_CONST || (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) { @@ -12194,7 +12194,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE } obj = Z_OBJ_P(object); - called_scope = zend_get_class_entry(obj TSRMLS_CC); + called_scope = obj->ce; if (IS_TMP_VAR != IS_CONST || (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) { @@ -13361,7 +13361,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE } obj = Z_OBJ_P(object); - called_scope = zend_get_class_entry(obj TSRMLS_CC); + called_scope = obj->ce; if (IS_VAR != IS_CONST || (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) { @@ -15117,7 +15117,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_ } obj = Z_OBJ_P(object); - called_scope = zend_get_class_entry(obj TSRMLS_CC); + called_scope = obj->ce; if (IS_CV != IS_CONST || (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) { @@ -18727,7 +18727,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZEND_OPCO } obj = Z_OBJ_P(object); - called_scope = zend_get_class_entry(obj TSRMLS_CC); + called_scope = obj->ce; if (IS_CONST != IS_CONST || (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) { @@ -18838,7 +18838,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE if (UNEXPECTED(ce->constructor == NULL)) { zend_error_noreturn(E_ERROR, "Cannot call constructor"); } - if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + if (Z_OBJ(EX(This)) && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val); } fbc = ce->constructor; @@ -18851,7 +18851,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE GC_REFCOUNT(object)++; } if (!object || - !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { + !instanceof_function(object->ce, ce TSRMLS_CC)) { /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { @@ -20984,7 +20984,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE } obj = Z_OBJ_P(object); - called_scope = zend_get_class_entry(obj TSRMLS_CC); + called_scope = obj->ce; if (IS_TMP_VAR != IS_CONST || (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) { @@ -21096,7 +21096,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND if (UNEXPECTED(ce->constructor == NULL)) { zend_error_noreturn(E_ERROR, "Cannot call constructor"); } - if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + if (Z_OBJ(EX(This)) && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val); } fbc = ce->constructor; @@ -21109,7 +21109,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND GC_REFCOUNT(object)++; } if (!object || - !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { + !instanceof_function(object->ce, ce TSRMLS_CC)) { /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { @@ -23210,7 +23210,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE } obj = Z_OBJ_P(object); - called_scope = zend_get_class_entry(obj TSRMLS_CC); + called_scope = obj->ce; if (IS_VAR != IS_CONST || (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) { @@ -23322,7 +23322,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND if (UNEXPECTED(ce->constructor == NULL)) { zend_error_noreturn(E_ERROR, "Cannot call constructor"); } - if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + if (Z_OBJ(EX(This)) && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val); } fbc = ce->constructor; @@ -23335,7 +23335,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND GC_REFCOUNT(object)++; } if (!object || - !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { + !instanceof_function(object->ce, ce TSRMLS_CC)) { /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { @@ -24796,7 +24796,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z if (UNEXPECTED(ce->constructor == NULL)) { zend_error_noreturn(E_ERROR, "Cannot call constructor"); } - if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + if (Z_OBJ(EX(This)) && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val); } fbc = ce->constructor; @@ -24809,7 +24809,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z GC_REFCOUNT(object)++; } if (!object || - !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { + !instanceof_function(object->ce, ce TSRMLS_CC)) { /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { @@ -26628,7 +26628,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_ } obj = Z_OBJ_P(object); - called_scope = zend_get_class_entry(obj TSRMLS_CC); + called_scope = obj->ce; if (IS_CV != IS_CONST || (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) { @@ -26739,7 +26739,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_ if (UNEXPECTED(ce->constructor == NULL)) { zend_error_noreturn(E_ERROR, "Cannot call constructor"); } - if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { + if (Z_OBJ(EX(This)) && Z_OBJ(EX(This))->ce != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val); } fbc = ce->constructor; @@ -26752,7 +26752,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_ GC_REFCOUNT(object)++; } if (!object || - !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) { + !instanceof_function(object->ce, ce TSRMLS_CC)) { /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { @@ -28245,7 +28245,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER(ZEND_O } obj = Z_OBJ_P(object); - called_scope = zend_get_class_entry(obj TSRMLS_CC); + called_scope = obj->ce; if (IS_CONST != IS_CONST || (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) { @@ -29645,7 +29645,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPC } obj = Z_OBJ_P(object); - called_scope = zend_get_class_entry(obj TSRMLS_CC); + called_scope = obj->ce; if (IS_TMP_VAR != IS_CONST || (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) { @@ -30952,7 +30952,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPC } obj = Z_OBJ_P(object); - called_scope = zend_get_class_entry(obj TSRMLS_CC); + called_scope = obj->ce; if (IS_VAR != IS_CONST || (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) { @@ -32770,7 +32770,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCO } obj = Z_OBJ_P(object); - called_scope = zend_get_class_entry(obj TSRMLS_CC); + called_scope = obj->ce; if (IS_CV != IS_CONST || (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) { @@ -36117,7 +36117,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER(ZEND_OPCOD } obj = Z_OBJ_P(object); - called_scope = zend_get_class_entry(obj TSRMLS_CC); + called_scope = obj->ce; if (IS_CONST != IS_CONST || (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) { @@ -38207,7 +38207,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_ } obj = Z_OBJ_P(object); - called_scope = zend_get_class_entry(obj TSRMLS_CC); + called_scope = obj->ce; if (IS_TMP_VAR != IS_CONST || (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) { @@ -40304,7 +40304,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_ } obj = Z_OBJ_P(object); - called_scope = zend_get_class_entry(obj TSRMLS_CC); + called_scope = obj->ce; if (IS_VAR != IS_CONST || (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) { @@ -43449,7 +43449,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_H } obj = Z_OBJ_P(object); - called_scope = zend_get_class_entry(obj TSRMLS_CC); + called_scope = obj->ce; if (IS_CV != IS_CONST || (fbc = CACHED_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(function_name), called_scope)) == NULL) { diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 5781de7..72c69c2 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -978,7 +978,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_ ZVAL_COPY(return_value, &stmt->fetch.into); - if (zend_get_class_entry(Z_OBJ_P(return_value) TSRMLS_CC) == ZEND_STANDARD_CLASS_DEF_PTR) { + if (Z_OBJ_P(return_value)->ce == ZEND_STANDARD_CLASS_DEF_PTR) { how = PDO_FETCH_OBJ; } break; diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 51c62f5..7b3cee8 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -105,7 +105,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const CG(in_compilation) = _old_in_compilation; \ EG(current_execute_data) = _old_current_execute_data; \ if (EG(exception) == NULL || \ - !instanceof_function(zend_get_class_entry(EG(exception) TSRMLS_CC), soap_fault_class_entry TSRMLS_CC)) {\ + !instanceof_function(EG(exception)->ce, soap_fault_class_entry TSRMLS_CC)) {\ _bailout = 1;\ }\ if (_old_stack_top != EG(argument_stack)->top) { \ diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index dddc8c5..f47093b 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -883,7 +883,7 @@ static union _zend_function *spl_recursive_it_get_method(zend_object **zobject, zval *zobj; if (!object->iterators) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "The %s instance wasn't initialized properly", zend_get_class_entry(*zobject TSRMLS_CC)->name->val); + php_error_docref(NULL TSRMLS_CC, E_ERROR, "The %s instance wasn't initialized properly", (*zobject)->ce->name->val); } zobj = &object->iterators[level].zobject; diff --git a/ext/standard/var.c b/ext/standard/var.c index 6fea4b0..f7ac706 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -727,8 +727,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt php_var_serialize_string(buf, Z_STRVAL_P(name), Z_STRLEN_P(name)); php_var_serialize_intern(buf, d, var_hash TSRMLS_CC); } else { - zend_class_entry *ce; - ce = zend_get_class_entry(Z_OBJ_P(struc) TSRMLS_CC); + zend_class_entry *ce = Z_OBJ_P(struc)->ce; if (ce) { zend_string *prot_name, *priv_name;
« previous php.cvs (#82211) next »