Skip to content

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

Merged
dstogov merged 10 commits intophp:masterfrom
dstogov:jit_trampoline
Oct 15, 2024
Merged

Allow JIT for passing arguments to trampolines and "bad" functions #16365
dstogov merged 10 commits intophp:masterfrom
dstogov:jit_trampoline

Conversation

@dstogov
Copy link
Copy Markdown
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
uint32_t info = 0;
zend_jit_op_array_trace_extension *jit_extension;

if (EX(call)->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
Copy link
Copy Markdown
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
Copy Markdown
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
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