com php-src: We check result type guard in FETCH_DIM_R/IS only if index is long or string.: ext/opca che/jit/zend_jit_x86.dasc

From: Date: Thu, 30 Jul 2020 16:19:10 +0000
Subject: com php-src: We check result type guard in FETCH_DIM_R/IS only if index is long or string.: ext/opca che/jit/zend_jit_x86.dasc
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-112464@lists.php.net to get a copy of this message
Commit: 8ea9e1ae4cc2fb0fda44bc2b15f648874ccac2e3 Author: Dmitry Stogov <dmitry@zend.com> Thu, 30 Jul 2020 19:19:10 +0300 Parents: 9dacc8525170664790c72967329dbc4d22a4e6f0 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8ea9e1ae4cc2fb0fda44bc2b15f648874ccac2e3 Log: We check result type guard in FETCH_DIM_R/IS only if index is long or string. Changed paths: M ext/opcache/jit/zend_jit_x86.dasc Diff: diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc index 840d54a607..8dd771c302 100644 --- a/ext/opcache/jit/zend_jit_x86.dasc +++ b/ext/opcache/jit/zend_jit_x86.dasc @@ -10449,6 +10449,21 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst, const zend_op *opline, cons if (!res_exit_addr) { return 0; } + + if (!(op2_info & ((MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_REF) - (MAY_BE_STRING|MAY_BE_LONG)))) { + old_info = STACK_INFO(stack, EX_VAR_TO_NUM(opline->result.var)); + SET_STACK_TYPE(stack, EX_VAR_TO_NUM(opline->result.var), IS_UNKNOWN); + SET_STACK_REG(stack, EX_VAR_TO_NUM(opline->result.var), ZREG_ZVAL_COPY_R0); + exit_point = zend_jit_trace_get_exit_point(opline, opline+1, NULL, flags); + SET_STACK_INFO(stack, EX_VAR_TO_NUM(opline->result.var), old_info); + res_exit_addr = zend_jit_trace_get_exit_addr(exit_point); + if (!res_exit_addr) { + return 0; + } + res_info &= ~MAY_BE_GUARD; + ssa->var_info[ssa_op->result_def].type &= ~MAY_BE_GUARD; + } + if (opline->opcode == ZEND_FETCH_DIM_IS && !(res_info & MAY_BE_NULL)) { old_info = STACK_INFO(stack, EX_VAR_TO_NUM(opline->result.var)); @@ -10461,8 +10476,6 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst, const zend_op *opline, cons return 0; } } - res_info &= ~MAY_BE_GUARD; - ssa->var_info[ssa_op->result_def].type &= ~MAY_BE_GUARD; } if (op1_info & MAY_BE_REF) {

« previous php.cvs (#112464) next »