]> granicus.if.org Git - php/commitdiff
Fixed JIT for ext/opcache/tests/bool_not_cv.phpt with opcache.jit=1202
authorDmitry Stogov <dmitry@zend.com>
Wed, 27 May 2020 07:57:33 +0000 (10:57 +0300)
committerDmitry Stogov <dmitry@zend.com>
Wed, 27 May 2020 07:57:33 +0000 (10:57 +0300)
ext/opcache/jit/zend_jit_x86.dasc

index e7b17b0b8e0badc3ea79eabb723bc422c8357240..abee45b95cec6e4649bda729db64a0ac26c08847 100644 (file)
@@ -7224,6 +7224,7 @@ static int zend_jit_bool_jmpznz(dasm_State **Dst, const zend_op *opline, const z
        uint32_t false_label = -1;
        zend_bool set_bool = 0;
        zend_bool set_bool_not = 0;
+       zend_bool set_delayed = 0;
        zend_bool jmp_done = 0;
 
        if (branch_opcode == ZEND_BOOL) {
@@ -7393,7 +7394,11 @@ static int zend_jit_bool_jmpznz(dasm_State **Dst, const zend_op *opline, const z
                                                } else {
                                                        |       add eax, 2
                                                }
-                                               |       SET_ZVAL_TYPE_INFO res_addr, eax
+                                               if ((op1_info & MAY_BE_UNDEF) && (op1_info & MAY_BE_ANY)) {
+                                                       set_delayed = 1;
+                                               } else {
+                                                       |       SET_ZVAL_TYPE_INFO res_addr, eax
+                                               }
                                        }
                                }
                        }
@@ -7401,7 +7406,13 @@ static int zend_jit_bool_jmpznz(dasm_State **Dst, const zend_op *opline, const z
                        /* It's FALSE, but may be UNDEF */
                        if (op1_info & MAY_BE_UNDEF) {
                                if (op1_info & MAY_BE_ANY) {
-                                       |       IF_ZVAL_TYPE op1_addr, IS_UNDEF, >1
+                                       if (set_delayed) {
+                                               |       CMP_ZVAL_TYPE op1_addr, IS_UNDEF
+                                               |       SET_ZVAL_TYPE_INFO res_addr, eax
+                                               |       jz >1
+                                       } else {
+                                               |       IF_ZVAL_TYPE op1_addr, IS_UNDEF, >1
+                                       }
                                        |.cold_code
                                        |1:
                                }