@@ -102,7 +102,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_runtime_jit(ZEND_OPCODE_HANDLE
102102
103103static int zend_jit_trace_op_len (const zend_op * opline );
104104static int zend_jit_trace_may_exit (const zend_op_array * op_array , const zend_op * opline );
105- static uint32_t zend_jit_trace_get_exit_point (const zend_op * to_opline , uint32_t flags );
105+
106+ typedef struct _zend_jit_ctx zend_jit_ctx ; // TODO
107+ static uint32_t zend_jit_trace_get_exit_point (zend_jit_ctx * ctx , const zend_op * to_opline , uint32_t flags );
106108static const void * zend_jit_trace_get_exit_addr (uint32_t n );
107109static void zend_jit_trace_add_code (const void * start , uint32_t size );
108110static zend_string * zend_jit_func_name (const zend_op_array * op_array );
@@ -802,6 +804,9 @@ static bool zend_jit_may_be_modified(const zend_function *func, const zend_op_ar
802804# pragma clang diagnostic ignored "-Wstring-compare"
803805#endif
804806
807+ static bool zend_jit_inc_call_level (uint8_t opcode );
808+ static bool zend_jit_dec_call_level (uint8_t opcode );
809+
805810#include "jit/zend_jit_ir.c"
806811
807812#if defined(__clang__ )
@@ -1608,6 +1613,18 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
16081613 call_level ++ ;
16091614 }
16101615
1616+ #if ZEND_DEBUG && 0
1617+ {
1618+ const void * handler ;
1619+ if (zend_jit_vm_kind == ZEND_VM_KIND_HYBRID ) {
1620+ handler = zend_get_opcode_handler_func (opline );
1621+ } else {
1622+ handler = opline -> handler ;
1623+ }
1624+ ir_RSTORE (8 , jit_CONST_FUNC (& ctx , (uintptr_t )handler , IR_FASTCALL_FUNC ));
1625+ }
1626+ #endif
1627+
16111628 if (JIT_G (opt_level ) >= ZEND_JIT_LEVEL_INLINE ) {
16121629 switch (opline -> opcode ) {
16131630 case ZEND_PRE_INC :
@@ -1675,10 +1692,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
16751692 && zend_jit_next_is_send_result (opline )) {
16761693 i ++ ;
16771694 res_use_info = -1 ;
1678- res_addr = ZEND_ADDR_MEM_ZVAL (ZREG_RX , (opline + 1 )-> result .var );
1679- if (!zend_jit_reuse_ip (& ctx )) {
1680- goto jit_failure ;
1681- }
1695+ res_addr = ZEND_ADDR_REF_ZVAL (ir_ADD_OFFSET (jit_EX_CALL (jit ), (opline + 1 )-> result .var ));
16821696 } else {
16831697 res_use_info = -1 ;
16841698
@@ -1729,10 +1743,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
17291743 && zend_jit_next_is_send_result (opline )) {
17301744 i ++ ;
17311745 res_use_info = -1 ;
1732- res_addr = ZEND_ADDR_MEM_ZVAL (ZREG_RX , (opline + 1 )-> result .var );
1733- if (!zend_jit_reuse_ip (& ctx )) {
1734- goto jit_failure ;
1735- }
1746+ res_addr = ZEND_ADDR_REF_ZVAL (ir_ADD_OFFSET (jit_EX_CALL (jit ), (opline + 1 )-> result .var ));
17361747 } else {
17371748 res_use_info = -1 ;
17381749
@@ -1785,10 +1796,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
17851796 if ((i + 1 ) <= end
17861797 && zend_jit_next_is_send_result (opline )) {
17871798 i ++ ;
1788- res_addr = ZEND_ADDR_MEM_ZVAL (ZREG_RX , (opline + 1 )-> result .var );
1789- if (!zend_jit_reuse_ip (& ctx )) {
1790- goto jit_failure ;
1791- }
1799+ res_addr = ZEND_ADDR_REF_ZVAL (ir_ADD_OFFSET (jit_EX_CALL (jit ), (opline + 1 )-> result .var ));
17921800 }
17931801 if (!zend_jit_concat (& ctx , opline ,
17941802 op1_info , op2_info , res_addr ,
@@ -2039,10 +2047,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
20392047 && zend_jit_next_is_send_result (opline )
20402048 && (!(op1_info & MAY_HAVE_DTOR ) || !(op1_info & MAY_BE_RC1 ))) {
20412049 i ++ ;
2042- res_addr = ZEND_ADDR_MEM_ZVAL (ZREG_RX , (opline + 1 )-> result .var );
2043- if (!zend_jit_reuse_ip (& ctx )) {
2044- goto jit_failure ;
2045- }
2050+ res_addr = ZEND_ADDR_REF_ZVAL (ir_ADD_OFFSET (jit_EX_CALL (jit ), (opline + 1 )-> result .var ));
20462051 }
20472052 }
20482053 if (!zend_jit_assign (& ctx , opline ,
0 commit comments