Skip to content

Commit a1cac4f

Browse files
committed
Eliminate dead type store
1 parent 0ac810b commit a1cac4f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11758,7 +11758,11 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst,
1175811758
| ZVAL_COPY_VALUE_V res_addr, -1, val_addr, res_info, ZREG_R0, ZREG_R1
1175911759
if (Z_MODE(res_addr) == IS_MEM_ZVAL) {
1176011760
if (type < IS_STRING) {
11761-
| SET_ZVAL_TYPE_INFO res_addr, type
11761+
if (Z_REG(res_addr) != ZREG_FP ||
11762+
JIT_G(current_frame) == NULL ||
11763+
STACK_MEM_TYPE(JIT_G(current_frame)->stack, EX_VAR_TO_NUM(Z_OFFSET(res_addr))) != type) {
11764+
| SET_ZVAL_TYPE_INFO res_addr, type
11765+
}
1176211766
} else {
1176311767
| SET_ZVAL_TYPE_INFO res_addr, edx
1176411768
if (!result_avoid_refcounting) {
@@ -12825,7 +12829,11 @@ static int zend_jit_fetch_obj(dasm_State **Dst,
1282512829
| // ZVAL_COPY
1282612830
| ZVAL_COPY_VALUE_V res_addr, -1, val_addr, res_info, ZREG_R0, ZREG_R1
1282712831
if (type < IS_STRING) {
12828-
| SET_ZVAL_TYPE_INFO res_addr, type
12832+
if (Z_REG(res_addr) != ZREG_FP ||
12833+
JIT_G(current_frame) == NULL ||
12834+
STACK_MEM_TYPE(JIT_G(current_frame)->stack, EX_VAR_TO_NUM(Z_OFFSET(res_addr))) != type) {
12835+
| SET_ZVAL_TYPE_INFO res_addr, type
12836+
}
1282912837
} else {
1283012838
| SET_ZVAL_TYPE_INFO res_addr, edx
1283112839
if (!result_avoid_refcounting) {

0 commit comments

Comments
 (0)