]> granicus.if.org Git - php/commitdiff
Minimal JIT support for JMP_NULL
authorDmitry Stogov <dmitry@zend.com>
Wed, 2 Sep 2020 08:49:42 +0000 (11:49 +0300)
committerDmitry Stogov <dmitry@zend.com>
Wed, 2 Sep 2020 08:49:42 +0000 (11:49 +0300)
ext/opcache/jit/zend_jit.c
ext/opcache/jit/zend_jit_trace.c
ext/opcache/jit/zend_jit_x86.dasc

index a89b21f875afadf8a71e6eb8fd1d16fd92c4ac4a..7997110c82ffce23cee1706cea62fed12dceb2e9 100644 (file)
@@ -2972,8 +2972,6 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
                                                        goto jit_failure;
                                                }
                                                goto done;
-                                       case ZEND_JMP_NULL:
-                                               goto jit_failure;
                                        default:
                                                break;
                                }
@@ -3062,6 +3060,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
                                case ZEND_JMPNZ_EX:
                                case ZEND_JMP_SET:
                                case ZEND_COALESCE:
+                               case ZEND_JMP_NULL:
                                case ZEND_FE_RESET_R:
                                case ZEND_FE_RESET_RW:
                                case ZEND_ASSERT_CHECK:
@@ -3112,8 +3111,6 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
                                                }
                                        }
                                        break;
-                               case ZEND_JMP_NULL:
-                                       goto jit_failure;
                                default:
                                        if (!zend_jit_handler(&dasm_state, opline,
                                                        zend_may_throw(opline, ssa_op, op_array, ssa))) {
index 4b88a9d03ea90f25fdff65bc7e7f8dbfd4adf61f..3203339d028fac8dfe1f0003aa918ad616906a6c 100644 (file)
@@ -280,6 +280,7 @@ static int zend_jit_trace_may_exit(const zend_op_array *op_array, const zend_op
                case ZEND_JMPNZ_EX:
                case ZEND_JMP_SET:
                case ZEND_COALESCE:
+               case ZEND_JMP_NULL:
                case ZEND_FE_RESET_R:
                case ZEND_FE_RESET_RW:
                case ZEND_ASSERT_CHECK:
@@ -4638,6 +4639,7 @@ done:
                                         || opline->opcode == ZEND_QM_ASSIGN
                                         || opline->opcode == ZEND_JMP_SET
                                         || opline->opcode == ZEND_COALESCE
+                                        || opline->opcode == ZEND_JMP_NULL
                                         || opline->opcode == ZEND_FE_RESET_R) {
                                                /* keep old value */
                                                type = STACK_VAR_TYPE(opline->op1.var);
index 39a8942a844c3d06dac51878aa6ec01522723cf2..39fd42e263f6cee5c46a56b77dccafdacdea8ba6 100644 (file)
@@ -3329,6 +3329,7 @@ static int zend_jit_trace_handler(dasm_State **Dst, const zend_op_array *op_arra
                                        case ZEND_JMPNZ_EX:
                                        case ZEND_JMP_SET:
                                        case ZEND_COALESCE:
+                                       case ZEND_JMP_NULL:
                                        case ZEND_FE_RESET_R:
                                        case ZEND_FE_RESET_RW:
                                                exit_opline = (trace->opline == opline + 1) ?
@@ -8335,6 +8336,7 @@ static int zend_jit_needs_call_chain(zend_call_info *call_info, uint32_t b, cons
                                        case ZEND_FE_RESET_RW:
                                        case ZEND_JMP_SET:
                                        case ZEND_COALESCE:
+                                       case ZEND_JMP_NULL:
                                        case ZEND_ASSERT_CHECK:
                                        case ZEND_CATCH:
                                        case ZEND_DECLARE_ANON_CLASS:
@@ -8416,6 +8418,7 @@ static int zend_jit_needs_call_chain(zend_call_info *call_info, uint32_t b, cons
                                case ZEND_FE_RESET_RW:
                                case ZEND_JMP_SET:
                                case ZEND_COALESCE:
+                               case ZEND_JMP_NULL:
                                case ZEND_ASSERT_CHECK:
                                case ZEND_CATCH:
                                case ZEND_DECLARE_ANON_CLASS: