]> granicus.if.org Git - php/commitdiff
Remove restriction on method call inlining
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 29 Jun 2020 07:54:31 +0000 (09:54 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 29 Jun 2020 07:54:31 +0000 (09:54 +0200)
In PHP 8, we are guaranteed that $this exists, so we no longer have
to forbid this case.

ext/opcache/Optimizer/optimize_func_calls.c

index 28a3c534895d6ae8d5dde11e7a15c41577235f94..c1ac58d0de7de12e30d2cc50d7877876146928da 100644 (file)
@@ -113,13 +113,6 @@ static void zend_try_inline_call(zend_op_array *op_array, zend_op *fcall, zend_o
                                return;
                        }
 
-                       if (fcall->opcode == ZEND_INIT_METHOD_CALL && fcall->op1_type == IS_UNUSED) {
-                               /* TODO: we can't inlne methods, because $this may be used
-                                *       not in object context ???
-                                */
-                               return;
-                       }
-
                        for (i = 0; i < num_args; i++) {
                                /* Don't inline functions with by-reference arguments. This would require
                                 * correct handling of INDIRECT arguments. */