Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow JIT for passing arguments to trampolines and "bad" functions #16365

Merged
merged 10 commits into from
Oct 15, 2024

Conversation

dstogov
Copy link
Member

@dstogov dstogov commented Oct 11, 2024

No description provided.

@dstogov dstogov marked this pull request as draft October 11, 2024 11:09
@dstogov dstogov marked this pull request as ready for review October 14, 2024 10:18
zend_jit_op_array_trace_extension *jit_extension;

if (EX(call)->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we need similar changes in zend_jit_trace_record_fake_init_call_ex(), otherwise this code is mis-compiled when ++$arg triggers a side trace:

class Test {
    public mixed $prop;
    function foo($args) {
        foreach ($args as $arg) {
            $this->bar(++$arg);
        }
    }
    function __call($name, $args) {
    }
}

$test = new Test;
$test->foo([1, 1.5, 1.5]);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching! I'll fix this.

@dstogov dstogov merged commit 097edc8 into php:master Oct 15, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants