Skip to content

Conversation

@iluuu1994
Copy link
Member

No description provided.

@iluuu1994 iluuu1994 marked this pull request as ready for review December 22, 2025 01:54
@iluuu1994 iluuu1994 requested a review from dstogov as a code owner December 22, 2025 01:54
#include "zend_vm_opcodes.h"

#include "jit/zend_jit.h"
#include "jit/ir/ir.h"
Copy link
Member

Choose a reason for hiding this comment

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

IR related dependencies should be encapsulated in zend_jit_ir.h.
I know, this is not completely true now, but I wouldn't spread dependency even more.

Copy link
Member

@dstogov dstogov left a comment

Choose a reason for hiding this comment

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

I didn't understand the reason for this permutation.
This doesn't make sources better at all, but would complicate merging between major branches.

I would understand making a better decomposition of JIT to separately compiled C files with minimized cross-dependencies. This is a bit bigger task, but it would beneficial for humans and not only for clangd.

@iluuu1994
Copy link
Member Author

My assumption was that the C files are included directly for better cross-file optimizations. I'm happy to try to split them comletely, though that won't exactly result in a smaller change or help with merge conflicts. It will add a huge header file for helpers with a silent conflict (no merge conflict, but if the signature of a helper changes, it will need to be updated in the header file in the master branch).

Clangd is pretty essential for me to work in a codebase, especially one I don't know by heart. I don't care if it's this approach or if we can find something else, but it would be great to fix somehow.

@arnaud-lb
Copy link
Member

I also use clangd, and it does help a lot for code nagivation (more than ctags), finding usages of a function, real time checking/linting, etc.

This change would reduce friction when contribution to the JIT, which is a good thing.

making a better decomposition of JIT to separately compiled C files with minimized cross-dependencies.

This would be great, but as @iluuu1994 noted there is likely some performance impact. Some of which could be mitigated by moving some function definitions to headers.

The proposed change wouldn't preclude doing this ultimately. If we split the new header file into zend_jit_helpers.h, zend_jit_ir.h, etc, we would end up with similar headers. We could then iterate towards separate compilation.

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.

3 participants