Skip to content

Add vm_interrupt checks in JIT after zend_observer_fcall_begin - #12141

Open
bwoebi wants to merge 1 commit into
php:PHP-8.1from
bwoebi:vm_interrupt_jit_observer_fcall_begin
Open

bwoebi wants to merge 1 commit into
php:PHP-8.1from
bwoebi:vm_interrupt_jit_observer_fcall_begin

Conversation

@bwoebi

@bwoebi bwoebi commented Sep 6, 2023

Copy link
Copy Markdown
Member

This ensures that it's possible to:
a) Sample inlined functions via vm_interrupt
b) Forcefully drop out of JIT in extraordinary circumstances, e.g. values of current stack frame changed, violating the assumptions the tracing jit does

The impact is minimal as we only do this when we have observing callbacks enabled.

This ensures that it's possible to:
a) Sample inlined functions via vm_interrupt
b) Forcefully drop out of JIT in extraordinary circumstances, e.g. values of current stack frame changed, violating the assumptions the tracing jit does

Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
@bwoebi
bwoebi requested a review from dstogov September 6, 2023 11:32
@dstogov

dstogov commented Sep 13, 2023

Copy link
Copy Markdown
Member

Hi @bwoebi, sorry for a long delay.
I saw this, and I had to think.

I don't like the fact that JIT has to support hacks in observer.
Observer that changes the execution flow is not an observer any more :(
I have no idea, why do you need this hack...

In general, you patch should work only while the exit to interrupt_handler don't need any de-optimization. All the values of PHP variables must be in memory. This can't be guaranteed and will limit JIT optimizations. It's possible to fix this creating an additional exit_point(s) (similar to zend_jit_check_timeout()).

Targeting this into PHP-8.1 also looks wrong. This is not a bug fix.

@joshtrichards

Copy link
Copy Markdown
Contributor

No longer seems applicable since #12079 and #21910.

At the very least the sampling/check portion is already present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants