From: Dmitry Stogov Date: Tue, 6 Aug 2019 13:28:42 +0000 (+0300) Subject: Inline zend_zval_ptr() in executor explicitely (only on hot paths) X-Git-Tag: php-7.4.0beta4~54 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d1fd4607d0df0e13f6fb2e278f9af108acc241b9;p=php Inline zend_zval_ptr() in executor explicitely (only on hot paths) --- diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index a701442196..556a8f8493 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -141,9 +141,6 @@ ZEND_API const zend_internal_function zend_pass_function = { {NULL,NULL,NULL,NULL} /* reserved */ }; -#undef zval_ptr_dtor -#define zval_ptr_dtor(zv) i_zval_ptr_dtor(zv) - #define FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(free_op, result) do { \ zval *__container_to_free = (free_op); \ if (UNEXPECTED(__container_to_free) \ diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 930e1cc746..c10f9d6169 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -4017,7 +4017,7 @@ ZEND_VM_HOT_HANDLER(129, ZEND_DO_ICALL, ANY, ANY, SPEC(RETVAL)) zend_vm_stack_free_call_frame(call); if (!RETURN_VALUE_USED(opline)) { - zval_ptr_dtor(ret); + i_zval_ptr_dtor(ret); } if (UNEXPECTED(EG(exception) != NULL)) { @@ -4116,7 +4116,7 @@ ZEND_VM_HOT_HANDLER(131, ZEND_DO_FCALL_BY_NAME, ANY, ANY, SPEC(RETVAL)) zend_vm_stack_free_call_frame(call); if (!RETURN_VALUE_USED(opline)) { - zval_ptr_dtor(ret); + i_zval_ptr_dtor(ret); } } @@ -4204,7 +4204,7 @@ ZEND_VM_HOT_HANDLER(60, ZEND_DO_FCALL, ANY, ANY, SPEC(RETVAL)) zend_vm_stack_free_args(call); if (!RETURN_VALUE_USED(opline)) { - zval_ptr_dtor(ret); + i_zval_ptr_dtor(ret); } } else { /* ZEND_OVERLOADED_FUNCTION */ @@ -6736,7 +6736,7 @@ ZEND_VM_C_LABEL(fe_fetch_w_exit): ref = Z_REF_P(value); GC_ADDREF(ref); - zval_ptr_dtor(variable_ptr); + i_zval_ptr_dtor(variable_ptr); ZVAL_REF(variable_ptr, ref); } } else { @@ -8366,7 +8366,7 @@ ZEND_VM_HANDLER(183, ZEND_BIND_STATIC, CV, UNUSED, REF) zval *variable_ptr; variable_ptr = GET_OP1_ZVAL_PTR_PTR_UNDEF(BP_VAR_W); - zval_ptr_dtor(variable_ptr); + i_zval_ptr_dtor(variable_ptr); ht = ZEND_MAP_PTR_GET(EX(func)->op_array.static_variables_ptr); if (!ht) { diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 6dfa6f2899..6ac1d09e8f 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -1287,7 +1287,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_ICALL_SPEC_RETV zend_vm_stack_free_call_frame(call); if (!0) { - zval_ptr_dtor(ret); + i_zval_ptr_dtor(ret); } if (UNEXPECTED(EG(exception) != NULL)) { @@ -1332,7 +1332,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_ICALL_SPEC_RETV zend_vm_stack_free_call_frame(call); if (!1) { - zval_ptr_dtor(ret); + i_zval_ptr_dtor(ret); } if (UNEXPECTED(EG(exception) != NULL)) { @@ -1454,7 +1454,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_S zend_vm_stack_free_call_frame(call); if (!0) { - zval_ptr_dtor(ret); + i_zval_ptr_dtor(ret); } } @@ -1530,7 +1530,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_S zend_vm_stack_free_call_frame(call); if (!1) { - zval_ptr_dtor(ret); + i_zval_ptr_dtor(ret); } } @@ -1618,7 +1618,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RETV zend_vm_stack_free_args(call); if (!0) { - zval_ptr_dtor(ret); + i_zval_ptr_dtor(ret); } } else { /* ZEND_OVERLOADED_FUNCTION */ @@ -1729,7 +1729,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RETV zend_vm_stack_free_args(call); if (!1) { - zval_ptr_dtor(ret); + i_zval_ptr_dtor(ret); } } else { /* ZEND_OVERLOADED_FUNCTION */ @@ -21632,7 +21632,7 @@ fe_fetch_w_exit: ref = Z_REF_P(value); GC_ADDREF(ref); - zval_ptr_dtor(variable_ptr); + i_zval_ptr_dtor(variable_ptr); ZVAL_REF(variable_ptr, ref); } } else { @@ -46525,7 +46525,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BIND_STATIC_SPEC_CV_UNUSED_HAN zval *variable_ptr; variable_ptr = EX_VAR(opline->op1.var); - zval_ptr_dtor(variable_ptr); + i_zval_ptr_dtor(variable_ptr); ht = ZEND_MAP_PTR_GET(EX(func)->op_array.static_variables_ptr); if (!ht) {