Repository navigation
Conversation
This reduces confusion between opcode handlers used by the VM, and opcode handler functions used for tracing. Depending on the VM, zend_vm_opcode_handler_t may not be a real function. For instance in the HYBRID VM this is a label pointer.
bdaf126 to
ed49acd
Compare
dstogov
left a comment
There was a problem hiding this comment.
The patch seems simple, but I don't see all the possible consequences.
I don't object against it, but please check the comments.
| $str .= "#else\n"; | ||
| $str .= "typedef const void* zend_vm_opcode_handler_t;\n"; | ||
| $str .= "typedef const void* zend_vm_opcode_handler_func_t;\n"; |
There was a problem hiding this comment.
I suppose #else means GOTO and SWITCH VM.
Most probably GOTO uses only zend_vm_opcode_handler_t and SWITCH doesn't use both (or zend_vm_opcode_handler_t is just int).
| $str .= "typedef const void* zend_vm_opcode_handler_t;\n"; | ||
| $str .= "typedef void (ZEND_FASTCALL *zend_vm_opcode_handler_func_t)(void);\n"; |
There was a problem hiding this comment.
Some comments that explain the conceptual difference for all VM types would be helpful.
There was a problem hiding this comment.
I agree. I will add comments after the tail call PR is merged.
| ZVAL_NULL(result); | ||
| } | ||
|
|
||
| #if ZEND_VM_KIND != ZEND_VM_KIND_HYBRID |
There was a problem hiding this comment.
Previously opcache and JIT didn't have compile-time dependencies on VM type. The same opcache build was able to work with HYBRID and CALL VM.
It's not necessary to keep this, but if we decide to remove this possibility we also may remove zend_jit_vm_kind run-time checks.
There was a problem hiding this comment.
I guessed this was the intent, but I think this has been broken since a long time. For instance, we have a lot of #ifdef HAVE_GCC_GLOBAL_REGS.
I will remove zend_jit_vm_kind as a follow-up.
This reduces the chances of confusion between opcode handlers used by the VM, and opcode handler functions used for tracing or debugging. Depending on the VM, zend_vm_opcode_handler_t may not be a function. For instance in the HYBRID VM this is a label pointer.
Extracted from #18720.