-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Deprecate autovivification on false #7131
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will also need adjustments in zend_jit_helpers.c (grep for the error message).
I have tried using this code in the test, but it doesn't even compile.
I get the error:
|
cbd0f93
to
393aa51
Compare
@dstogov Could you please take a look at my JIT implementation? I assumed it would be best to move handling of false to the slow path entirely, rather than generating JIT code to emit the deprecation. Does this make sense to you? |
The arm64 build fails in zend_vm_execute.h, but I don't understand the error at all. There are no interesting changes to zend_vm_def.h and nothing that is ARM specific. |
@shqking Do you have an idea where the ARM build failure on Travis is coming from? It's failing to build zend_execute.c, which doesn't have ARM specific code, so I'm a bit stumped. |
Hi @nikic as commented in this file zend_jit_arm64.dasc, I think one ')' is removed by accident. In my local machine, the building succeeds if we fix this typo. |
@shqking Thanks! Unfortunately, the build still fails after fixing the typo: https://app.travis-ci.com/github/php/php-src/jobs/524706767#L1960 |
It seems like one compiler warning. However, in my local machine Ubuntu20+gcc10 (Ubuntu18+gcc7 is used in travis-ci)), using the same configure options as travis-ci, I didn't get this compiler warning. Let me try more times...
|
Okay, I suspect this is some kind of race condition in our build system, where we try to regenerate zend_vm_execute.h while building zend_execute.c. Probably the only relation this has to ARM is that the ARM builder on Travis has high parallelism. I'm not sure what exactly is wrong, but looking at the order in the log it seems plausible. |
I still cannot reproduce this failure in my environment. Yes. Your conjecture sounds reasonable. |
The building on arm64 machine can pass now, but JIT/arm64 failed for the new test case, i.e. The error might be related to the opcode sequence Let me dig it deeper. |
The patch below can fix this test failure.
In JIT/x86, the return register, i.e. It seems that the return register is updated by one callee inside function [1] https://github.com/php/php-src/blob/master/ext/opcache/jit/zend_jit_x86.dasc#L11883 IMHO, the workaround can fix the test failure, but I don't think it's a good fix... Besides, with this workaround, I tested all the |
Co-authored-by: Tyson Andre <tysonandre775@hotmail.com>
Move handling of false to the slow path.
We now may_throw for MAY_BE_FALSE. Also don't set indirect_feference in this case, as we now go through the slow path and the container isn't guaranteed to be in r0/REG0 anymore.
I believe the build system race condition should be fixed by 3025126. I've tried to address the problem you mention in 8c2c5d9, by not setting the indirect_reference flag for MAY_BE_FALSE containers. That is, if we go through the slow path of fetch_dim, also bypass this optimization. Does that seem like a reasonable solution? |
LGTM. Thanks. |
I checked only the JIT part and the general approach looks fine. |
RFC: https://wiki.php.net/rfc/autovivification_false
Based on implementation TysonAndre#17