Commit 642ac3e
committed
Provide script to TSSA build in tracing JIT
For the following script:
```php
final class Foo {
public $prop = 0;
}
function test(Foo $obj) {
$obj->prop=1;
}
$foo = new Foo;
for ($i=0;$i<3;$i++) {
test($foo);
}
```
When comparing the TSSA (via opcache.jit_debug) vs the opcache SSA
(via opcache.opt_debug_level=0x400000) we note that in TSSA, the RECV op
for `test` does not infer the type of the argument to be class `Foo`.
This is because the optimizer uses the `script` pointer to figure out
known classes but TSSA always sets `script` to NULL. This in turn
generates suboptimal assembly because `zend_may_throw` returns 1 due to
the unknown CE in the TSSA, resulting in an extra exception check in the
assembly code.1 parent 8376904 commit 642ac3e
1 file changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4117 | 4117 | | |
4118 | 4118 | | |
4119 | 4119 | | |
| 4120 | + | |
| 4121 | + | |
| 4122 | + | |
| 4123 | + | |
| 4124 | + | |
| 4125 | + | |
| 4126 | + | |
4120 | 4127 | | |
4121 | 4128 | | |
4122 | 4129 | | |
| |||
0 commit comments