]> granicus.if.org Git - php/commitdiff
Inline zend_zval_ptr() in executor explicitely (only on hot paths)
authorDmitry Stogov <dmitry@zend.com>
Tue, 6 Aug 2019 13:28:42 +0000 (16:28 +0300)
committerDmitry Stogov <dmitry@zend.com>
Tue, 6 Aug 2019 13:28:42 +0000 (16:28 +0300)
Zend/zend_execute.c
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index a70144219642d2c6e69ffa3c7f29814c4a6e7005..556a8f8493a8ddba1dadc570d29171810ecf621c 100644 (file)
@@ -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)                                                                             \
index 930e1cc746e257779651798da3db300ec0a66c32..c10f9d6169c04f604582210e75c7acf42640038b 100644 (file)
@@ -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) {
index 6dfa6f2899a549d058245943e136383c68a15fe1..6ac1d09e8f5644e21648a02774abce418721261d 100644 (file)
@@ -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) {