diff options
author | Dmitry Stogov <dmitry@zend.com> | 2020-07-23 15:18:28 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2020-07-23 15:18:28 +0300 |
commit | 96a1b409df21db178a37ba09ae2ed27714443565 (patch) | |
tree | 852e54c787ef7c5e9f5fef69111454855b8d2322 | |
parent | 93594862f4530af39bcecc7bda0a2b8cdf543be5 (diff) | |
download | php-git-96a1b409df21db178a37ba09ae2ed27714443565.tar.gz |
Don't record "fake" closures
-rw-r--r-- | ext/opcache/jit/zend_jit_vm_helpers.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/opcache/jit/zend_jit_vm_helpers.c b/ext/opcache/jit/zend_jit_vm_helpers.c index 0703d9e805..836629eb52 100644 --- a/ext/opcache/jit/zend_jit_vm_helpers.c +++ b/ext/opcache/jit/zend_jit_vm_helpers.c @@ -481,6 +481,10 @@ static int zend_jit_trace_record_fake_init_call_ex(zend_execute_data *call, zend /* TODO: Can we continue recording ??? */ return -1; } + if (func->type == ZEND_INTERNAL_FUNCTION + && (func->op_array.fn_flags & (ZEND_ACC_CLOSURE|ZEND_ACC_FAKE_CLOSURE))) { + return -1; + } if (func->type == ZEND_USER_FUNCTION && (func->op_array.fn_flags & ZEND_ACC_CLOSURE)) { jit_extension = @@ -724,6 +728,10 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex, break; } if (EX(call)->func->type == ZEND_INTERNAL_FUNCTION) { + if (EX(call)->func->op_array.fn_flags & (ZEND_ACC_CLOSURE|ZEND_ACC_FAKE_CLOSURE)) { + stop = ZEND_JIT_TRACE_STOP_BAD_FUNC; + break; + } TRACE_RECORD(ZEND_JIT_TRACE_DO_ICALL, 0, EX(call)->func); } } else if (opline->opcode == ZEND_INCLUDE_OR_EVAL) { @@ -879,6 +887,11 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex, break; } func = EX(call)->func; + if (func->type == ZEND_INTERNAL_FUNCTION + && (func->op_array.fn_flags & (ZEND_ACC_CLOSURE|ZEND_ACC_FAKE_CLOSURE))) { + stop = ZEND_JIT_TRACE_STOP_BAD_FUNC; + break; + } if (func->type == ZEND_USER_FUNCTION && (func->op_array.fn_flags & ZEND_ACC_CLOSURE)) { jit_extension = |