@@ -1898,8 +1898,8 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
18981898 case ZEND_VM_KIND_CALL :
18991899 out ($ f ,"\n" );
19001900 out ($ f ,"#ifdef ZEND_VM_FP_GLOBAL_REG \n" );
1901+ out ($ f ,"# define ZEND_OPCODE_HANDLER_ARGS void \n" );
19011902 out ($ f ,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU \n" );
1902- out ($ f ,"# define ZEND_OPCODE_HANDLER_ARGS \n" );
19031903 out ($ f ,"# define ZEND_OPCODE_HANDLER_ARGS_EX \n" );
19041904 out ($ f ,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_EX \n" );
19051905 out ($ f ,"#else \n" );
@@ -1950,14 +1950,12 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
19501950 out ($ f , " ZEND_VM_DISPATCH(t.handler); \\\n" );
19511951 out ($ f , " } while (0) \\\n" );
19521952 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" );
19561953 if ($ kind == ZEND_VM_KIND_HYBRID ) {
19571954 out ($ f ,"# define ZEND_VM_HOT \n" );
19581955 }
19591956 out ($ f ,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE \n" );
19601957 out ($ f ,"#else \n" );
1958+ out ($ f ,"# define ZEND_OPCODE_HANDLER_RET const zend_op * \n" );
19611959 out ($ f ,"# define ZEND_OPCODE_HANDLER_RET_EX const zend_op * \n" );
19621960 out ($ f ,"# define ZEND_VM_TAIL_CALL(call) return call \n" );
19631961 out ($ f ,"# define ZEND_VM_CONTINUE() return opline \n" );
@@ -1972,6 +1970,9 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
19721970 }
19731971 out ($ f ,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE \n" );
19741972 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" );
19751976 out ($ f ,"\n" );
19761977 out ($ f ,"#if ZEND_VM_TAIL_CALL_DISPATCH \n" );
19771978 out ($ f ,"typedef struct _zend_vm_trampoline { \n" );
@@ -2504,7 +2505,7 @@ function gen_vm_opcodes_header(
25042505 $ str .= "#endif \n" ;
25052506 $ str .= "\n" ;
25062507 $ 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" ;
25082509 $ str .= "typedef void (ZEND_FASTCALL *zend_vm_opcode_handler_func_t)(void); \n" ;
25092510 $ str .= "#elif ZEND_VM_KIND == ZEND_VM_KIND_CALL \n" ;
25102511 $ 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) {
29952996 }
29962997 out ($ f , "} \n\n" );
29972998 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" );
29993000 out ($ f , "{ \n" );
30003001 if (!ZEND_VM_SPEC ) {
30013002 out ($ f , "\treturn zend_opcode_handlers[zend_vm_get_opcode_handler_idx(opcode, op)]; \n" );
@@ -3121,7 +3122,7 @@ function gen_vm($def, $skel) {
31213122 out ($ f , "{ \n" );
31223123 if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID ) {
31233124 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" );
31253126 out ($ f ,"#endif \n" );
31263127 }
31273128 out ($ f , "\tDCL_OPLINE; \n" );
0 commit comments