[php-src] PR #23304: Defer SAVE_OPLINE() on the INSTANCEOF fast path
| From: | staabm | Date: | Sun, 16 Aug 2026 06:52:10 +0000 |
| Subject: | [php-src] PR #23304: Defer SAVE_OPLINE() on the INSTANCEOF fast path | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-37909@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/23304
Author: staabm
disclaimer: this change was generated by claude opus. I have little experience with php-src
development
----
The object paths (inline cache and instanceof walk) run no user code and cannot throw; only
releasing a TMP operand (destructor), fetching a late-bound class (op2 UNUSED) and the
undefined-variable warning need the opline saved, and now save it explicitly.
----
after PR
```
➜ php-src git:(defer-save-opline) ✗ sapi/cli/php -n -d opcache.enable_cli=0
instanceof_fast_path_repro.php
PHP 8.6.0-dev
iterations=30000000 rounds=7
case best(s) avg(s) sink
----------------------------------------------------
baseline 0.101673 0.102430 0
class-hit 0.139364 0.140235 0
interface-hit 0.146674 0.148583 0
instanceof / baseline ratios (best time, lower is better):
class-hit 1.3707x
interface-hit 1.4426x
```
before PR
```
➜ php-src git:(defer-save-opline) ✗ sapi/cli/php_old -n -d opcache.enable_cli=0
instanceof_fast_path_repro.php
PHP 8.6.0-dev
iterations=30000000 rounds=7
case best(s) avg(s) sink
----------------------------------------------------
baseline 0.101893 0.102754 0
class-hit 0.134350 0.135289 0
interface-hit 0.143015 0.144332 0
instanceof / baseline ratios (best time, lower is better):
class-hit 1.3185x
interface-hit 1.4036x
```
using
[instanceof_fast_path_repro.php](https://gist.github.com/staabm/7154c8b38df6c740f5f9ab58052b0fec)