@@ -1898,8 +1898,8 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
1898
1898
case ZEND_VM_KIND_CALL :
1899
1899
out ($ f ,"\n" );
1900
1900
out ($ f ,"#ifdef ZEND_VM_FP_GLOBAL_REG \n" );
1901
+ out ($ f ,"# define ZEND_OPCODE_HANDLER_ARGS void \n" );
1901
1902
out ($ f ,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU \n" );
1902
- out ($ f ,"# define ZEND_OPCODE_HANDLER_ARGS \n" );
1903
1903
out ($ f ,"# define ZEND_OPCODE_HANDLER_ARGS_EX \n" );
1904
1904
out ($ f ,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX \n" );
1905
1905
out ($ f ,"#else \n" );
@@ -1950,14 +1950,12 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
1950
1950
out ($ f , " ZEND_VM_DISPATCH(t.handler); \\\n" );
1951
1951
out ($ f , " } while (0) \\\n" );
1952
1952
out ($ f , "\n" );
1953
- out ($ f ,"# define ZEND_VM_DISPATCH_TO_HANDLER(handler) ZEND_VM_DISPATCH(handler) \n" );
1954
- out ($ f ,"# define ZEND_VM_DISPATCH_TO_HELPER(helper) ZEND_VM_DISPATCH(helper) \n" );
1955
- out ($ f ,"# define ZEND_VM_DISPATCH_TO_HELPER_EX(helper, ...) ZEND_VM_DISPATCH_EX(helper, __VA_ARGS__) \n" );
1956
1953
if ($ kind == ZEND_VM_KIND_HYBRID ) {
1957
1954
out ($ f ,"# define ZEND_VM_HOT \n" );
1958
1955
}
1959
1956
out ($ f ,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE \n" );
1960
1957
out ($ f ,"#else \n" );
1958
+ out ($ f ,"# define ZEND_OPCODE_HANDLER_RET const zend_op * \n" );
1961
1959
out ($ f ,"# define ZEND_OPCODE_HANDLER_RET_EX const zend_op * \n" );
1962
1960
out ($ f ,"# define ZEND_VM_TAIL_CALL(call) return call \n" );
1963
1961
out ($ f ,"# define ZEND_VM_CONTINUE() return opline \n" );
@@ -1972,6 +1970,9 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
1972
1970
}
1973
1971
out ($ f ,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE \n" );
1974
1972
out ($ f ,"#endif \n" );
1973
+ out ($ f ,"#define ZEND_VM_DISPATCH_TO_HANDLER(handler) ZEND_VM_DISPATCH(handler) \n" );
1974
+ out ($ f ,"#define ZEND_VM_DISPATCH_TO_HELPER(helper) ZEND_VM_DISPATCH(helper) \n" );
1975
+ out ($ f ,"#define ZEND_VM_DISPATCH_TO_HELPER_EX(helper, ...) ZEND_VM_DISPATCH_EX(helper, __VA_ARGS__) \n" );
1975
1976
out ($ f ,"\n" );
1976
1977
out ($ f ,"#if ZEND_VM_TAIL_CALL_DISPATCH \n" );
1977
1978
out ($ f ,"typedef struct _zend_vm_trampoline { \n" );
@@ -2504,7 +2505,7 @@ function gen_vm_opcodes_header(
2504
2505
$ str .= "#endif \n" ;
2505
2506
$ str .= "\n" ;
2506
2507
$ str .= "#if ZEND_VM_KIND == ZEND_VM_KIND_HYBRID \n" ;
2507
- $ str .= "typedef const void* zend_vm_opcode_handler_t; \n" ;
2508
+ $ str .= "typedef void (ZEND_FASTCALL * zend_vm_opcode_handler_t)(void) ; \n" ;
2508
2509
$ str .= "typedef void (ZEND_FASTCALL *zend_vm_opcode_handler_func_t)(void); \n" ;
2509
2510
$ str .= "#elif ZEND_VM_KIND == ZEND_VM_KIND_CALL \n" ;
2510
2511
$ str .= "typedef const struct _zend_op *(ZEND_OPCODE_HANDLER_CCONV *zend_vm_opcode_handler_t)(struct _zend_execute_data *execute_data, const struct _zend_op *opline); \n" ;
@@ -2995,7 +2996,7 @@ function gen_vm($def, $skel) {
2995
2996
}
2996
2997
out ($ f , "} \n\n" );
2997
2998
out ($ f , "#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID && !ZEND_VM_TAIL_CALL_DISPATCH) || !ZEND_VM_SPEC \n" );
2998
- out ($ f , "static const void * zend_vm_get_opcode_handler(uint8_t opcode, const zend_op* op) \n" );
2999
+ out ($ f , "static zend_vm_opcode_handler_t zend_vm_get_opcode_handler(uint8_t opcode, const zend_op* op) \n" );
2999
3000
out ($ f , "{ \n" );
3000
3001
if (!ZEND_VM_SPEC ) {
3001
3002
out ($ f , "\treturn zend_opcode_handlers[zend_vm_get_opcode_handler_idx(opcode, op)]; \n" );
@@ -3121,7 +3122,7 @@ function gen_vm($def, $skel) {
3121
3122
out ($ f , "{ \n" );
3122
3123
if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID ) {
3123
3124
out ($ f ,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) \n" );
3124
- out ($ f , "\t opcode_handler_t handler; \n" );
3125
+ out ($ f , "\t zend_vm_opcode_handler_func_t handler; \n" );
3125
3126
out ($ f ,"#endif \n" );
3126
3127
}
3127
3128
out ($ f , "\tDCL_OPLINE; \n" );
0 commit comments