From: Dmitry Stogov Date: Mon, 1 Jun 2015 14:22:04 +0000 (+0300) Subject: Reorder conditions to check for fast paths first. X-Git-Tag: php-7.0.0alpha1~54 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ce862a25d52850d93e16f784c1953f9a4c50fadc;p=php Reorder conditions to check for fast paths first. --- diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index da91b40106..17b7ddd594 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1448,8 +1448,8 @@ static zend_always_inline void zend_fetch_dimension_address(zval *result, zval * { zval *retval; -try_again: if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +try_array: SEPARATE_ARRAY(container); fetch_from_array: if (dim == NULL) { @@ -1462,7 +1462,14 @@ fetch_from_array: retval = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, dim_type, type); } ZVAL_INDIRECT(result, retval); - } else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { + return; + } else if (EXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto try_array; + } + } + if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { if (type != BP_VAR_UNSET && UNEXPECTED(Z_STRLEN_P(container) == 0)) { zval_ptr_dtor_nogc(container); convert_to_array: @@ -1524,9 +1531,6 @@ convert_to_array: /* for read-mode only */ ZVAL_NULL(result); } - } else if (EXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) { - container = Z_REFVAL_P(container); - goto try_again; } else { if (type == BP_VAR_UNSET) { zend_error(E_WARNING, "Cannot unset offset in a non-array variable"); @@ -1557,11 +1561,18 @@ static zend_always_inline void zend_fetch_dimension_address_read(zval *result, z { zval *retval; -try_again: if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { +try_array: retval = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, dim_type, type); ZVAL_COPY(result, retval); - } else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { + return; + } else if (EXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto try_array; + } + } + if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { zend_long offset; try_string_offset: @@ -1627,9 +1638,6 @@ try_string_offset: ZVAL_NULL(result); } } - } else if (EXPECTED(Z_TYPE_P(container) == IS_REFERENCE)) { - container = Z_REFVAL_P(container); - goto try_again; } else { ZVAL_NULL(result); } diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index c71fbc9734..0ecf1c10ba 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -6501,12 +6501,13 @@ ZEND_VM_HANDLER(115, ZEND_ISSET_ISEMPTY_DIM_OBJ, CONST|TMPVAR|UNUSED|CV, CONST|T offset = GET_OP2_ZVAL_PTR(BP_VAR_R); -ZEND_VM_C_LABEL(isset_dim_obj_again): if (OP1_TYPE != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { - HashTable *ht = Z_ARRVAL_P(container); + HashTable *ht; zval *value; zend_string *str; +ZEND_VM_C_LABEL(isset_dim_obj_array): + ht = Z_ARRVAL_P(container); ZEND_VM_C_LABEL(isset_again): if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { str = Z_STR_P(offset); @@ -6555,7 +6556,14 @@ ZEND_VM_C_LABEL(num_index_prop): } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { result = (value == NULL || !i_zend_is_true(value)); } - } else if (OP1_TYPE == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + ZEND_VM_C_GOTO(isset_dim_obj_exit); + } else if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + ZEND_VM_C_GOTO(isset_dim_obj_array); + } + } + if (OP1_TYPE == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0); } else { @@ -6592,13 +6600,11 @@ ZEND_VM_C_LABEL(num_index_prop): if ((opline->extended_value & ZEND_ISSET) == 0) { result = !result; } - } else if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { - container = Z_REFVAL_P(container); - ZEND_VM_C_GOTO(isset_dim_obj_again); } else { result = ((opline->extended_value & ZEND_ISSET) == 0); } +ZEND_VM_C_LABEL(isset_dim_obj_exit): FREE_OP2(); FREE_OP1(); ZEND_VM_SMART_BRANCH(result, 1); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index a38d7db860..4b101e0b70 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -6351,12 +6351,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CON offset = EX_CONSTANT(opline->op2); -isset_dim_obj_again: if (IS_CONST != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { - HashTable *ht = Z_ARRVAL_P(container); + HashTable *ht; zval *value; zend_string *str; +isset_dim_obj_array: + ht = Z_ARRVAL_P(container); isset_again: if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { str = Z_STR_P(offset); @@ -6405,7 +6406,14 @@ num_index_prop: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { result = (value == NULL || !i_zend_is_true(value)); } - } else if (IS_CONST == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + goto isset_dim_obj_exit; + } else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto isset_dim_obj_array; + } + } + if (IS_CONST == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0); } else { @@ -6442,13 +6450,12 @@ num_index_prop: if ((opline->extended_value & ZEND_ISSET) == 0) { result = !result; } - } else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { - container = Z_REFVAL_P(container); - goto isset_dim_obj_again; } else { result = ((opline->extended_value & ZEND_ISSET) == 0); } +isset_dim_obj_exit: + ZEND_VM_SMART_BRANCH(result, 1); ZVAL_BOOL(EX_VAR(opline->result.var), result); @@ -9763,12 +9770,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CON offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); -isset_dim_obj_again: if (IS_CONST != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { - HashTable *ht = Z_ARRVAL_P(container); + HashTable *ht; zval *value; zend_string *str; +isset_dim_obj_array: + ht = Z_ARRVAL_P(container); isset_again: if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { str = Z_STR_P(offset); @@ -9817,7 +9825,14 @@ num_index_prop: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { result = (value == NULL || !i_zend_is_true(value)); } - } else if (IS_CONST == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + goto isset_dim_obj_exit; + } else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto isset_dim_obj_array; + } + } + if (IS_CONST == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0); } else { @@ -9854,13 +9869,12 @@ num_index_prop: if ((opline->extended_value & ZEND_ISSET) == 0) { result = !result; } - } else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { - container = Z_REFVAL_P(container); - goto isset_dim_obj_again; } else { result = ((opline->extended_value & ZEND_ISSET) == 0); } +isset_dim_obj_exit: + ZEND_VM_SMART_BRANCH(result, 1); ZVAL_BOOL(EX_VAR(opline->result.var), result); @@ -11440,12 +11454,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CON offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); -isset_dim_obj_again: if (IS_CONST != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { - HashTable *ht = Z_ARRVAL_P(container); + HashTable *ht; zval *value; zend_string *str; +isset_dim_obj_array: + ht = Z_ARRVAL_P(container); isset_again: if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { str = Z_STR_P(offset); @@ -11494,7 +11509,14 @@ num_index_prop: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { result = (value == NULL || !i_zend_is_true(value)); } - } else if (IS_CONST == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + goto isset_dim_obj_exit; + } else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto isset_dim_obj_array; + } + } + if (IS_CONST == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0); } else { @@ -11531,13 +11553,11 @@ num_index_prop: if ((opline->extended_value & ZEND_ISSET) == 0) { result = !result; } - } else if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { - container = Z_REFVAL_P(container); - goto isset_dim_obj_again; } else { result = ((opline->extended_value & ZEND_ISSET) == 0); } +isset_dim_obj_exit: zval_ptr_dtor_nogc(free_op2); ZEND_VM_SMART_BRANCH(result, 1); @@ -24251,12 +24271,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNU offset = EX_CONSTANT(opline->op2); -isset_dim_obj_again: if (IS_UNUSED != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { - HashTable *ht = Z_ARRVAL_P(container); + HashTable *ht; zval *value; zend_string *str; +isset_dim_obj_array: + ht = Z_ARRVAL_P(container); isset_again: if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { str = Z_STR_P(offset); @@ -24305,7 +24326,14 @@ num_index_prop: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { result = (value == NULL || !i_zend_is_true(value)); } - } else if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + goto isset_dim_obj_exit; + } else if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto isset_dim_obj_array; + } + } + if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0); } else { @@ -24342,13 +24370,12 @@ num_index_prop: if ((opline->extended_value & ZEND_ISSET) == 0) { result = !result; } - } else if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { - container = Z_REFVAL_P(container); - goto isset_dim_obj_again; } else { result = ((opline->extended_value & ZEND_ISSET) == 0); } +isset_dim_obj_exit: + ZEND_VM_SMART_BRANCH(result, 1); ZVAL_BOOL(EX_VAR(opline->result.var), result); @@ -26572,12 +26599,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNU offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); -isset_dim_obj_again: if (IS_UNUSED != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { - HashTable *ht = Z_ARRVAL_P(container); + HashTable *ht; zval *value; zend_string *str; +isset_dim_obj_array: + ht = Z_ARRVAL_P(container); isset_again: if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { str = Z_STR_P(offset); @@ -26626,7 +26654,14 @@ num_index_prop: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { result = (value == NULL || !i_zend_is_true(value)); } - } else if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + goto isset_dim_obj_exit; + } else if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto isset_dim_obj_array; + } + } + if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0); } else { @@ -26663,13 +26698,12 @@ num_index_prop: if ((opline->extended_value & ZEND_ISSET) == 0) { result = !result; } - } else if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { - container = Z_REFVAL_P(container); - goto isset_dim_obj_again; } else { result = ((opline->extended_value & ZEND_ISSET) == 0); } +isset_dim_obj_exit: + ZEND_VM_SMART_BRANCH(result, 1); ZVAL_BOOL(EX_VAR(opline->result.var), result); @@ -28110,12 +28144,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNU offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); -isset_dim_obj_again: if (IS_UNUSED != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { - HashTable *ht = Z_ARRVAL_P(container); + HashTable *ht; zval *value; zend_string *str; +isset_dim_obj_array: + ht = Z_ARRVAL_P(container); isset_again: if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { str = Z_STR_P(offset); @@ -28164,7 +28199,14 @@ num_index_prop: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { result = (value == NULL || !i_zend_is_true(value)); } - } else if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + goto isset_dim_obj_exit; + } else if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto isset_dim_obj_array; + } + } + if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0); } else { @@ -28201,13 +28243,11 @@ num_index_prop: if ((opline->extended_value & ZEND_ISSET) == 0) { result = !result; } - } else if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { - container = Z_REFVAL_P(container); - goto isset_dim_obj_again; } else { result = ((opline->extended_value & ZEND_ISSET) == 0); } +isset_dim_obj_exit: zval_ptr_dtor_nogc(free_op2); ZEND_VM_SMART_BRANCH(result, 1); @@ -32762,12 +32802,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_ offset = EX_CONSTANT(opline->op2); -isset_dim_obj_again: if (IS_CV != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { - HashTable *ht = Z_ARRVAL_P(container); + HashTable *ht; zval *value; zend_string *str; +isset_dim_obj_array: + ht = Z_ARRVAL_P(container); isset_again: if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { str = Z_STR_P(offset); @@ -32816,7 +32857,14 @@ num_index_prop: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { result = (value == NULL || !i_zend_is_true(value)); } - } else if (IS_CV == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + goto isset_dim_obj_exit; + } else if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto isset_dim_obj_array; + } + } + if (IS_CV == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0); } else { @@ -32853,13 +32901,12 @@ num_index_prop: if ((opline->extended_value & ZEND_ISSET) == 0) { result = !result; } - } else if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { - container = Z_REFVAL_P(container); - goto isset_dim_obj_again; } else { result = ((opline->extended_value & ZEND_ISSET) == 0); } +isset_dim_obj_exit: + ZEND_VM_SMART_BRANCH(result, 1); ZVAL_BOOL(EX_VAR(opline->result.var), result); @@ -37664,12 +37711,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_ offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); -isset_dim_obj_again: if (IS_CV != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { - HashTable *ht = Z_ARRVAL_P(container); + HashTable *ht; zval *value; zend_string *str; +isset_dim_obj_array: + ht = Z_ARRVAL_P(container); isset_again: if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { str = Z_STR_P(offset); @@ -37718,7 +37766,14 @@ num_index_prop: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { result = (value == NULL || !i_zend_is_true(value)); } - } else if (IS_CV == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + goto isset_dim_obj_exit; + } else if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto isset_dim_obj_array; + } + } + if (IS_CV == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0); } else { @@ -37755,13 +37810,12 @@ num_index_prop: if ((opline->extended_value & ZEND_ISSET) == 0) { result = !result; } - } else if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { - container = Z_REFVAL_P(container); - goto isset_dim_obj_again; } else { result = ((opline->extended_value & ZEND_ISSET) == 0); } +isset_dim_obj_exit: + ZEND_VM_SMART_BRANCH(result, 1); ZVAL_BOOL(EX_VAR(opline->result.var), result); @@ -40247,12 +40301,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_ offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); -isset_dim_obj_again: if (IS_CV != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { - HashTable *ht = Z_ARRVAL_P(container); + HashTable *ht; zval *value; zend_string *str; +isset_dim_obj_array: + ht = Z_ARRVAL_P(container); isset_again: if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { str = Z_STR_P(offset); @@ -40301,7 +40356,14 @@ num_index_prop: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { result = (value == NULL || !i_zend_is_true(value)); } - } else if (IS_CV == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + goto isset_dim_obj_exit; + } else if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto isset_dim_obj_array; + } + } + if (IS_CV == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0); } else { @@ -40338,13 +40400,11 @@ num_index_prop: if ((opline->extended_value & ZEND_ISSET) == 0) { result = !result; } - } else if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { - container = Z_REFVAL_P(container); - goto isset_dim_obj_again; } else { result = ((opline->extended_value & ZEND_ISSET) == 0); } +isset_dim_obj_exit: zval_ptr_dtor_nogc(free_op2); ZEND_VM_SMART_BRANCH(result, 1); @@ -42315,12 +42375,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMP offset = EX_CONSTANT(opline->op2); -isset_dim_obj_again: if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { - HashTable *ht = Z_ARRVAL_P(container); + HashTable *ht; zval *value; zend_string *str; +isset_dim_obj_array: + ht = Z_ARRVAL_P(container); isset_again: if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { str = Z_STR_P(offset); @@ -42369,7 +42430,14 @@ num_index_prop: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { result = (value == NULL || !i_zend_is_true(value)); } - } else if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + goto isset_dim_obj_exit; + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto isset_dim_obj_array; + } + } + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0); } else { @@ -42406,13 +42474,12 @@ num_index_prop: if ((opline->extended_value & ZEND_ISSET) == 0) { result = !result; } - } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { - container = Z_REFVAL_P(container); - goto isset_dim_obj_again; } else { result = ((opline->extended_value & ZEND_ISSET) == 0); } +isset_dim_obj_exit: + zval_ptr_dtor_nogc(free_op1); ZEND_VM_SMART_BRANCH(result, 1); ZVAL_BOOL(EX_VAR(opline->result.var), result); @@ -44200,12 +44267,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMP offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); -isset_dim_obj_again: if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { - HashTable *ht = Z_ARRVAL_P(container); + HashTable *ht; zval *value; zend_string *str; +isset_dim_obj_array: + ht = Z_ARRVAL_P(container); isset_again: if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { str = Z_STR_P(offset); @@ -44254,7 +44322,14 @@ num_index_prop: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { result = (value == NULL || !i_zend_is_true(value)); } - } else if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + goto isset_dim_obj_exit; + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto isset_dim_obj_array; + } + } + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0); } else { @@ -44291,13 +44366,12 @@ num_index_prop: if ((opline->extended_value & ZEND_ISSET) == 0) { result = !result; } - } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { - container = Z_REFVAL_P(container); - goto isset_dim_obj_again; } else { result = ((opline->extended_value & ZEND_ISSET) == 0); } +isset_dim_obj_exit: + zval_ptr_dtor_nogc(free_op1); ZEND_VM_SMART_BRANCH(result, 1); ZVAL_BOOL(EX_VAR(opline->result.var), result); @@ -45259,12 +45333,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMP offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); -isset_dim_obj_again: if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { - HashTable *ht = Z_ARRVAL_P(container); + HashTable *ht; zval *value; zend_string *str; +isset_dim_obj_array: + ht = Z_ARRVAL_P(container); isset_again: if (EXPECTED(Z_TYPE_P(offset) == IS_STRING)) { str = Z_STR_P(offset); @@ -45313,7 +45388,14 @@ num_index_prop: } else /* if (opline->extended_value & ZEND_ISEMPTY) */ { result = (value == NULL || !i_zend_is_true(value)); } - } else if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { + goto isset_dim_obj_exit; + } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { + container = Z_REFVAL_P(container); + if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { + goto isset_dim_obj_array; + } + } + if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0); } else { @@ -45350,13 +45432,11 @@ num_index_prop: if ((opline->extended_value & ZEND_ISSET) == 0) { result = !result; } - } else if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { - container = Z_REFVAL_P(container); - goto isset_dim_obj_again; } else { result = ((opline->extended_value & ZEND_ISSET) == 0); } +isset_dim_obj_exit: zval_ptr_dtor_nogc(free_op2); zval_ptr_dtor_nogc(free_op1); ZEND_VM_SMART_BRANCH(result, 1);