com php-src: Don't skip RECV instuctions when function uses type hints: ext/opcache/jit/zend_jit.c
| From: | Dmitry Stogov | Date: | Fri, 01 Nov 2019 06:33:46 +0000 |
| Subject: | com php-src: Don't skip RECV instuctions when function uses type hints: ext/opcache/jit/zend_jit.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-109153@lists.php.net to get a copy of this message | ||
Commit: 61ebce1f06ea8e5c3726bbcc1f623a2ce7e05b7c
Author: Dmitry Stogov <dmitry@zend.com> Fri, 1 Nov 2019 09:33:46 +0300
Parents: 32d3dbf789abf433eabb2dd8062f2248269c20fc
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=61ebce1f06ea8e5c3726bbcc1f623a2ce7e05b7c
Log:
Don't skip RECV instuctions when function uses type hints
Changed paths:
M ext/opcache/jit/zend_jit.c
Diff:
diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c
index da50c6d61d2..de0569a88ae 100644
--- a/ext/opcache/jit/zend_jit.c
+++ b/ext/opcache/jit/zend_jit.c
@@ -2567,8 +2567,10 @@ static void ZEND_FASTCALL zend_runtime_jit(void)
zend_jit_unprotect();
/* restore original opcode handlers */
- while (opline->opcode == ZEND_RECV || opline->opcode == ZEND_RECV_INIT) {
- opline++;
+ if (!(op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) {
+ while (opline->opcode == ZEND_RECV || opline->opcode == ZEND_RECV_INIT) {
+ opline++;
+ }
}
opline->handler = ZEND_FUNC_INFO(op_array);
ZEND_SET_FUNC_INFO(op_array, NULL);
@@ -2597,8 +2599,10 @@ void zend_jit_check_funcs(HashTable *function_table, zend_bool is_method) {
}
op_array = &func->op_array;
opline = op_array->opcodes;
- while (opline->opcode == ZEND_RECV || opline->opcode == ZEND_RECV_INIT) {
- opline++;
+ if (!(op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) {
+ while (opline->opcode == ZEND_RECV || opline->opcode == ZEND_RECV_INIT) {
+ opline++;
+ }
}
if (opline->handler == zend_jit_profile_jit_handler) {
if (!RUN_TIME_CACHE(op_array)) {
@@ -2667,8 +2671,10 @@ static int zend_jit_setup_hot_counters(zend_op_array *op_array)
}
ZEND_SET_FUNC_INFO(op_array, (void*)jit_extension);
- while (opline->opcode == ZEND_RECV || opline->opcode == ZEND_RECV_INIT) {
- opline++;
+ if (!(op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) {
+ while (opline->opcode == ZEND_RECV || opline->opcode == ZEND_RECV_INIT) {
+ opline++;
+ }
}
opline->handler = (const void*)zend_jit_func_counter_handler;
@@ -2713,8 +2719,10 @@ ZEND_EXT_API int zend_jit_op_array(zend_op_array *op_array, zend_script
*script)
/* Set run-time JIT handler */
ZEND_ASSERT(zend_jit_runtime_jit_handler != NULL);
- while (opline->opcode == ZEND_RECV || opline->opcode == ZEND_RECV_INIT) {
- opline++;
+ if (!(op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) {
+ while (opline->opcode == ZEND_RECV || opline->opcode == ZEND_RECV_INIT) {
+ opline++;
+ }
}
ZEND_SET_FUNC_INFO(op_array, (void*)opline->handler);
opline->handler = (const void*)zend_jit_runtime_jit_handler;
@@ -2725,8 +2733,10 @@ ZEND_EXT_API int zend_jit_op_array(zend_op_array *op_array, zend_script
*script)
ZEND_ASSERT(zend_jit_profile_jit_handler != NULL);
if (op_array->function_name) {
- while (opline->opcode == ZEND_RECV || opline->opcode == ZEND_RECV_INIT) {
- opline++;
+ if (!(op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) {
+ while (opline->opcode == ZEND_RECV || opline->opcode == ZEND_RECV_INIT) {
+ opline++;
+ }
}
ZEND_SET_FUNC_INFO(op_array, (void*)opline->handler);
opline->handler = (const void*)zend_jit_profile_jit_handler;