Lines Matching refs:out

584 function out($f, $s) {  function
953 out($f, $code);
1080 out($f, "#line $lineno \"$definition_file\"\n");
1089 $out = fopen('php://memory', 'w+');
1090 gen_code($out, $spec, $kind, $code, $op1, $op2, $name, $extra_spec);
1091 rewind($out);
1095 . stream_get_contents($out);
1096 fclose($out);
1111 out($f, $code);
1117out($f,"static zend_always_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_INLINE_HANDLE…
1120out($f,"static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE_…
1123out($f,"static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE…
1125out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE_HANDLER_ARGS…
1131 out($f,"case $cur: /* $spec_name */");
1134 out($f,"case ".$name.":");
1138 out($f," {$spec_name}_LABEL: ZEND_ATTRIBUTE_UNUSED_LABEL\n");
1140 out($f,"\n");
1144 out($f,"{$spec_name}_LABEL: ZEND_VM_GUARD($spec_name);\n");
1152out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE_HANDLER_ARGS…
1153 out($f,"{\n");
1154out($f,"\tZEND_VM_TAIL_CALL({$spec_name}_INLINE_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));\n");
1155 out($f,"}\n");
1156 out($f,"\n");
1173 out($f, "#line $lineno \"$definition_file\"\n");
1181 out($f, $spec_name . "_LABEL:\n");
1197out($f, "static$zend_attributes ZEND_OPCODE_HANDLER_RET$zend_fastcall $spec_name(ZEND_OPCODE_HANDL…
1200out($f, "static$zend_attributes ZEND_OPCODE_HANDLER_RET$zend_fastcall $spec_name($param ZEND_OPCOD…
1204 out($f, "$spec_name:\n");
1207 out($f, "$spec_name:\n");
1219 out($f,$prolog."ZEND_NULL_HANDLER,\n");
1222 out($f,$prolog."(void*)(uintptr_t)-1,\n");
1225 out($f,$prolog."(void*)&&ZEND_NULL_LABEL,\n");
1421 out($f,"$prolog{$spec_name}_HANDLER,\n");
1424 out($f,$prolog."(void*)(uintptr_t)$switch_labels[$spec_name],\n");
1427 out($f,$prolog."(void*)&&{$spec_name}_LABEL,\n");
1469 out($f,$prolog."ZEND_NULL_HANDLER,\n");
1472 out($f,$prolog."(void*)(uintptr_t)-1,\n");
1475 out($f,$prolog."(void*)&&ZEND_NULL_LABEL,\n");
1489 out($f,$prolog.$dsc['alias']."_HANDLER,\n");
1492 out($f,$prolog."(void*)&&".$dsc['alias']."_LABEL,\n");
1500 out($f,$prolog.$dsc["op"]."_HANDLER,\n");
1503 out($f,$prolog."(void*)(uintptr_t)".((string)$num).",\n");
1506 out($f,$prolog."(void*)&&".$dsc["op"]."_LABEL,\n");
1513 out($f,$prolog."ZEND_NULL_HANDLER,\n");
1516 out($f,$prolog."(void*)(uintptr_t)-1,\n");
1519 out($f,$prolog."(void*)&&ZEND_NULL_LABEL,\n");
1530 out($f,$prolog."ZEND_NULL_HANDLER\n");
1533 out($f,$prolog."(void*)(uintptr_t)-1\n");
1536 out($f,$prolog."(void*)&&ZEND_NULL_LABEL\n");
1542 out($l, "#define VM_HANDLERS(_) \\\n");
1545 out($l, "\t_($n, $name) \\\n");
1548 out($l, "\t_($n+1, ZEND_NULL)\n");
1558 out($f, "$prolog$lastdef,\n");
1561 out($f, "$prolog$def,\n");
1563 out($f, "$prolog$lastdef\n");
1574out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS)\n…
1575 out($f,"{\n");
1576 out($f,"\tUSE_OPLINE\n");
1577 out($f,"\n");
1578 out($f,"\tSAVE_OPLINE();\n");
1579out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", OPLINE->opcode, OPLINE->op1_t…
1580 out($f,"\tZEND_VM_NEXT_OPCODE(); /* Never reached */\n");
1581 out($f,"}\n\n");
1767 out($f, $txt);
1783 out($f,"default: ZEND_NULL_LABEL:\n");
1784out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", OPLINE->opcode, OPLINE->op1_t…
1785 out($f,"\tZEND_VM_NEXT_OPCODE(); /* Never reached */\n");
1788 out($f,"ZEND_NULL_LABEL:\n");
1789out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", OPLINE->opcode, OPLINE->op1_t…
1790 out($f,"\tZEND_VM_NEXT_OPCODE(); /* Never reached */\n");
1793 out($f,"\t\t\tHYBRID_CASE(HYBRID_HALT):\n");
1794 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
1795 out($f,"\t\t\t\texecute_data = vm_stack_data.orig_execute_data;\n");
1796 out($f,"#endif\n");
1797 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
1798 out($f,"\t\t\t\topline = vm_stack_data.orig_opline;\n");
1799 out($f,"#endif\n");
1800 out($f,"\t\t\t\treturn;\n");
1801 out($f,"\t\t\tHYBRID_DEFAULT:\n");
1802 out($f,"\t\t\t\tVM_TRACE(ZEND_NULL)\n");
1803 out($f,"\t\t\t\tZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
1804 out($f,"\t\t\t\tHYBRID_BREAK(); /* Never reached */\n");
1811 out($f, $prolog.$epilog);
1833 out($f,"#define SPEC_START_MASK 0x0000ffff\n");
1834 out($f,"#define SPEC_EXTRA_MASK 0xfffc0000\n");
1835 out($f,"#define SPEC_RULE_OP1 0x00010000\n");
1836 out($f,"#define SPEC_RULE_OP2 0x00020000\n");
1837 out($f,"#define SPEC_RULE_OP_DATA 0x00040000\n");
1838 out($f,"#define SPEC_RULE_RETVAL 0x00080000\n");
1839 out($f,"#define SPEC_RULE_QUICK_ARG 0x00100000\n");
1840 out($f,"#define SPEC_RULE_SMART_BRANCH 0x00200000\n");
1841 out($f,"#define SPEC_RULE_COMMUTATIVE 0x00800000\n");
1842 out($f,"#define SPEC_RULE_ISSET 0x01000000\n");
1843 out($f,"#define SPEC_RULE_OBSERVER 0x02000000\n");
1844 out($f,"\n");
1845 out($f,"static const uint32_t *zend_spec_handlers;\n");
1846 out($f,"static const void * const *zend_opcode_handlers;\n");
1847 out($f,"static int zend_handlers_count;\n");
1849 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1850 out($f,"static const void * const * zend_opcode_handler_funcs;\n");
1851 out($f,"static zend_op hybrid_halt_op;\n");
1852 out($f,"#endif\n");
1854 out($f,"#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID) || !ZEND_VM_SPEC\n");
1855out($f,"static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op);\n");
1856 out($f,"#endif\n\n");
1858 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1859out($f,"static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend_op* op);\…
1860 out($f,"#else\n");
1861out($f,"# define zend_vm_get_opcode_handler_func zend_vm_get_opcode_handler\n");
1862 out($f,"#endif\n\n");
1864 out($f,"#ifndef VM_TRACE\n");
1866 out($f,"# define VM_TRACE(op) ZEND_VM_GUARD(op);\n");
1868 out($f,"# define VM_TRACE(op)\n");
1870 out($f,"#endif\n");
1871 out($f,"#ifndef VM_TRACE_START\n");
1872 out($f,"# define VM_TRACE_START()\n");
1873 out($f,"#endif\n");
1874 out($f,"#ifndef VM_TRACE_END\n");
1875 out($f,"# define VM_TRACE_END()\n");
1876 out($f,"#endif\n");
1879 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1880 out($f,"#define HYBRID_NEXT() goto *(void**)(OPLINE->handler)\n");
1881 out($f,"#define HYBRID_SWITCH() HYBRID_NEXT();\n");
1882 out($f,"#define HYBRID_CASE(op) op ## _LABEL\n");
1883 out($f,"#define HYBRID_BREAK() HYBRID_NEXT()\n");
1884 out($f,"#define HYBRID_DEFAULT ZEND_NULL_LABEL\n");
1885 out($f,"#endif\n");
1887 out($f,"\n");
1888 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
1889 out($f,"# define ZEND_OPCODE_HANDLER_ARGS void\n");
1890 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU\n");
1891 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_DC\n");
1892 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC\n");
1893 out($f,"#else\n");
1894out($f,"# define ZEND_OPCODE_HANDLER_ARGS zend_execute_data *execute_data\n");
1895 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU execute_data\n");
1896out($f,"# define ZEND_OPCODE_HANDLER_ARGS_DC , ZEND_OPCODE_HANDLER_ARGS\n");
1897out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC , ZEND_OPCODE_HANDLER_ARGS_PASSTHRU\n");
1898 out($f,"#endif\n");
1899 out($f,"\n");
1900out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
1901 out($f,"# define ZEND_OPCODE_HANDLER_RET void\n");
1902 out($f,"# define ZEND_VM_TAIL_CALL(call) call; return\n");
1903 out($f,"# ifdef ZEND_VM_TAIL_CALL_DISPATCH\n");
1904out($f,"# define ZEND_VM_CONTINUE() ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_A…
1905 out($f,"# else\n");
1906 out($f,"# define ZEND_VM_CONTINUE() return\n");
1907 out($f,"# endif\n");
1909 out($f,"# if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1910out($f,"# define ZEND_VM_RETURN() opline = &hybrid_halt_op; return\n");
1911out($f,"# define ZEND_VM_HOT zend_always_inline ZEND_COLD ZEND_OPT_SIZE\n");
1912out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
1913 out($f,"# else\n");
1914 out($f,"# define ZEND_VM_RETURN() opline = NULL; return\n");
1915 out($f,"# define ZEND_VM_HOT\n");
1916out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
1917 out($f,"# endif\n");
1919 out($f,"# define ZEND_VM_RETURN() opline = NULL; return\n");
1920out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
1922 out($f,"#else\n");
1923 out($f,"# define ZEND_OPCODE_HANDLER_RET int\n");
1924 out($f,"# define ZEND_VM_TAIL_CALL(call) return call\n");
1925 out($f,"# define ZEND_VM_CONTINUE() return 0\n");
1926 out($f,"# define ZEND_VM_RETURN() return -1\n");
1928 out($f,"# define ZEND_VM_HOT\n");
1930 out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
1931 out($f,"#endif\n");
1932 out($f,"\n");
1933out($f,"typedef ZEND_OPCODE_HANDLER_RET (ZEND_FASTCALL *opcode_handler_t) (ZEND_OPCODE_HANDLER_ARG…
1934 out($f,"\n");
1935 out($f,"#define DCL_OPLINE\n");
1936 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
1937 out($f,"# define OPLINE opline\n");
1938 out($f,"# define USE_OPLINE\n");
1939 out($f,"# define LOAD_OPLINE() opline = EX(opline)\n");
1940 out($f,"# define LOAD_OPLINE_EX()\n");
1941 out($f,"# define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n");
1942 out($f,"# define SAVE_OPLINE() EX(opline) = opline\n");
1943 out($f,"# define SAVE_OPLINE_EX() SAVE_OPLINE()\n");
1944 out($f,"#else\n");
1945 out($f,"# define OPLINE EX(opline)\n");
1946 out($f,"# define USE_OPLINE const zend_op *opline = EX(opline);\n");
1947 out($f,"# define LOAD_OPLINE()\n");
1948 out($f,"# define LOAD_OPLINE_EX()\n");
1949 out($f,"# define LOAD_NEXT_OPLINE() ZEND_VM_INC_OPCODE()\n");
1950 out($f,"# define SAVE_OPLINE()\n");
1951 out($f,"# define SAVE_OPLINE_EX()\n");
1952 out($f,"#endif\n");
1953out($f,"#define HANDLE_EXCEPTION() ZEND_ASSERT(EG(exception)); LOAD_OPLINE(); ZEND_VM_CONTINUE()\n…
1954out($f,"#define HANDLE_EXCEPTION_LEAVE() ZEND_ASSERT(EG(exception)); LOAD_OPLINE(); ZEND_VM_LEAVE(…
1955 out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG)\n");
1956out($f,"# define ZEND_VM_ENTER_EX() ZEND_VM_INTERRUPT_CHECK(); ZEND_VM_CONTINUE()\n");
1957out($f,"# define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE();…
1958 out($f,"# define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n");
1959 out($f,"#elif defined(ZEND_VM_IP_GLOBAL_REG)\n");
1960 out($f,"# define ZEND_VM_ENTER_EX() return 1\n");
1961out($f,"# define ZEND_VM_ENTER() opline = EG(current_execute_data)->opline; ZEND_VM_ENTE…
1962 out($f,"# define ZEND_VM_LEAVE() return 2\n");
1963 out($f,"#else\n");
1964 out($f,"# define ZEND_VM_ENTER_EX() return 1\n");
1965 out($f,"# define ZEND_VM_ENTER() return 1\n");
1966 out($f,"# define ZEND_VM_LEAVE() return 2\n");
1967 out($f,"#endif\n");
1968out($f,"#define ZEND_VM_INTERRUPT() ZEND_VM_TAIL_CALL(zend_interrupt_helper".($spec?"_SPEC":"…
1969out($f,"#define ZEND_VM_LOOP_INTERRUPT() zend_interrupt_helper".($spec?"_SPEC":"")."(ZEND_OPCODE_H…
1971out($f,"#define ZEND_VM_DISPATCH(opcode, opline) ZEND_VM_TAIL_CALL(((opcode_handler_t)zend_vm_get_…
1973out($f,"#define ZEND_VM_DISPATCH(opcode, opline) ZEND_VM_TAIL_CALL(((opcode_handler_t)zend_vm_get_…
1975 out($f,"\n");
1976out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_interrupt_helper".($spec?"_SPEC":"")."(Z…
1977out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS);\…
1978 out($f,"\n");
1981 out($f,"\n");
1982 out($f,"#define OPLINE opline\n");
1983 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
1984out($f,"# define DCL_OPLINE register const zend_op *opline __asm__(ZEND_VM_IP_GLOBAL_REG);\n");
1985 out($f,"#else\n");
1986 out($f,"# define DCL_OPLINE const zend_op *opline;\n");
1987 out($f,"#endif\n");
1988 out($f,"#define USE_OPLINE\n");
1989 out($f,"#define LOAD_OPLINE() opline = EX(opline)\n");
1990 out($f,"# define LOAD_OPLINE_EX() LOAD_OPLINE()\n");
1991 out($f,"#define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n");
1992 out($f,"#define SAVE_OPLINE() EX(opline) = opline\n");
1993 out($f,"#define SAVE_OPLINE_EX()\n");
1994out($f,"#define HANDLE_EXCEPTION() ZEND_ASSERT(EG(exception)); LOAD_OPLINE(); ZEND_VM_CONTINUE()\n…
1995out($f,"#define HANDLE_EXCEPTION_LEAVE() ZEND_ASSERT(EG(exception)); LOAD_OPLINE(); ZEND_VM_LEAVE(…
1996 out($f,"#define ZEND_VM_CONTINUE() goto zend_vm_continue\n");
1997 out($f,"#define ZEND_VM_RETURN() return\n");
1998out($f,"#define ZEND_VM_ENTER_EX() ZEND_VM_INTERRUPT_CHECK(); ZEND_VM_CONTINUE()\n");
1999out($f,"#define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE(); ZEND_VM…
2000 out($f,"#define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n");
2001out($f,"#define ZEND_VM_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
2002out($f,"#define ZEND_VM_LOOP_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
2003out($f,"#define ZEND_VM_DISPATCH(opcode, opline) dispatch_handler = zend_vm_get_opcode_handler(opc…
2004 out($f,"\n");
2007 out($f,"\n");
2008 out($f,"#define OPLINE opline\n");
2009 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2010out($f,"# define DCL_OPLINE register const zend_op *opline __asm__(ZEND_VM_IP_GLOBAL_REG);\n");
2011 out($f,"#else\n");
2012 out($f,"# define DCL_OPLINE const zend_op *opline;\n");
2013 out($f,"#endif\n");
2014 out($f,"#define USE_OPLINE\n");
2015 out($f,"#define LOAD_OPLINE() opline = EX(opline)\n");
2016 out($f,"#define LOAD_OPLINE_EX() LOAD_OPLINE()\n");
2017 out($f,"#define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n");
2018 out($f,"#define SAVE_OPLINE() EX(opline) = opline\n");
2019 out($f,"#define SAVE_OPLINE_EX()\n");
2021out($f,"#define HANDLE_EXCEPTION() ZEND_ASSERT(EG(exception)); goto ZEND_HANDLE_EXCEPTION_SPEC_LAB…
2022out($f,"#define HANDLE_EXCEPTION_LEAVE() ZEND_ASSERT(EG(exception)); goto ZEND_HANDLE_EXCEPTION_SP…
2024out($f,"#define HANDLE_EXCEPTION() ZEND_ASSERT(EG(exception)); goto ZEND_HANDLE_EXCEPTION_LABEL\n"…
2025out($f,"#define HANDLE_EXCEPTION_LEAVE() ZEND_ASSERT(EG(exception)); goto ZEND_HANDLE_EXCEPTION_LA…
2027 out($f,"#define ZEND_VM_CONTINUE() goto *(void**)(OPLINE->handler)\n");
2028 out($f,"#define ZEND_VM_RETURN() return\n");
2029out($f,"#define ZEND_VM_ENTER_EX() ZEND_VM_INTERRUPT_CHECK(); ZEND_VM_CONTINUE()\n");
2030out($f,"#define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE(); ZEND_VM…
2031 out($f,"#define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n");
2032out($f,"#define ZEND_VM_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
2033out($f,"#define ZEND_VM_LOOP_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
2034out($f,"#define ZEND_VM_DISPATCH(opcode, opline) goto *(void**)(zend_vm_get_opcode_handler(opcode,…
2035 out($f,"\n");
2040 out($f,"\n");
2041 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2042 out($f,"# undef ZEND_VM_TAIL_CALL\n");
2043 out($f,"# undef ZEND_VM_CONTINUE\n");
2044 out($f,"# undef ZEND_VM_RETURN\n");
2046 out($f,"\n");
2047 out($f,"# define ZEND_VM_TAIL_CALL(call) call; ZEND_VM_CONTINUE()\n");
2048 out($f,"# define ZEND_VM_CONTINUE() HYBRID_NEXT()\n");
2049 out($f,"# define ZEND_VM_RETURN() goto HYBRID_HALT_LABEL\n");
2051 out($f,"#endif\n\n");
2055 out($f, $m[1].$executor_name.$m[3]."\n");
2059 out($f,$m[1]."const void *dispatch_handler;\n");
2063 out($f, "#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2067 out($f,$m[1].$param.";\n");
2070 out($f, "#endif\n");
2074 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2075out($f,$m[1]."register zend_execute_data *execute_data __asm__(ZEND_VM_FP_GLOBAL_REG) = ex;\n");
2076 out($f,"#else\n");
2077 out($f,$m[1]."zend_execute_data *execute_data = ex;\n");
2078 out($f,"#endif\n");
2080out($f,"#if defined(ZEND_VM_IP_GLOBAL_REG) || defined(ZEND_VM_IP_GLOBAL_REG)\n");
2081 out($f,$m[1]."struct {\n");
2082 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2083 out($f,$m[1]."\tconst zend_op *orig_opline;\n");
2084 out($f,"#endif\n");
2085 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2086 out($f,$m[1]."\tzend_execute_data *orig_execute_data;\n");
2087 out($f,"#ifdef ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE\n");
2088out($f,$m[1]."\tchar hybrid_jit_red_zone[ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE];\n");
2089 out($f,"#endif\n");
2090 out($f,"#endif\n");
2091 out($f,$m[1]."} vm_stack_data;\n");
2092 out($f,"#endif\n");
2093 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2094 out($f,$m[1]."vm_stack_data.orig_opline = opline;\n");
2095 out($f,"#endif\n");
2096 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2097 out($f,$m[1]."vm_stack_data.orig_execute_data = execute_data;\n");
2098 out($f,$m[1]."execute_data = ex;\n");
2099 out($f,"#else\n");
2100 out($f,$m[1]."zend_execute_data *execute_data = ex;\n");
2101 out($f,"#endif\n");
2102 out($f,"#ifdef ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE\n");
2103out($f,$m[1]."memset(vm_stack_data.hybrid_jit_red_zone, 0, ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE);\n");
2104 out($f,$m[1]."if (zend_touch_vm_stack_data) {\n");
2105 out($f,$m[1]."\tzend_touch_vm_stack_data(&vm_stack_data);\n");
2106 out($f,$m[1]."}\n");
2107 out($f,"#endif\n");
2115 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2118 out($f,$prolog."if (UNEXPECTED(execute_data == NULL)) {\n");
2119 out($f,$prolog."\tstatic const void * const labels[] = {\n");
2121 out($f,$prolog."\t};\n");
2122 out($f,$prolog."\tzend_opcode_handlers = (const void **) labels;\n");
2123 out($f,$prolog."\tzend_handlers_count = sizeof(labels) / sizeof(void*);\n");
2125out($f,$prolog."\tmemset(&hybrid_halt_op, 0, sizeof(hybrid_halt_op));\n");
2126out($f,$prolog."\thybrid_halt_op.handler = (void*)&&HYBRID_HALT_LABEL;\n");
2127 out($f,$prolog."\tgoto HYBRID_HALT_LABEL;\n");
2129 out($f,$prolog."\treturn;\n");
2131 out($f,$prolog."}\n");
2133 out($f,"#endif\n");
2142out($f,"#if !defined(ZEND_VM_FP_GLOBAL_REG) || !defined(ZEND_VM_IP_GLOBAL_REG)\n");
2143 out($f,$m[1]."\tint ret;".$m[3]."\n");
2144 out($f,"#endif\n");
2147 out($f,"zend_vm_continue:".$m[3]."\n");
2156out($f, $m[1]."dispatch_handler = OPLINE->handler;\nzend_vm_dispatch:\n".$m[1]."switch ((int)(uint…
2159 out($f, $m[1]."goto *(void**)(OPLINE->handler);".$m[3]."\n");
2162 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2163 out($f, $m[1]."HYBRID_SWITCH()".$m[3]."\n");
2164 out($f,"#else\n");
2166out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
2167out($f, $m[1]."((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2168 out($f, $m[1]."if (UNEXPECTED(!OPLINE))".$m[3]."\n");
2169 out($f,"#else\n");
2170out($f, $m[1]."if (UNEXPECTED((ret = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_…
2171 out($f,"#endif\n");
2173 out($f,"#endif\n");
2182 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2189 out($f,"#else\n");
2191 out($f,
2210 out($f,"#endif\n");
2220 out($f, $m[1].$initializer_name.$m[3]."\n");
2228 out($f,$prolog."static const uint32_t specs[] = {\n");
2230 out($f,$prolog."};\n");
2231 out($f,$prolog."zend_spec_handlers = specs;\n");
2232 out($f,$prolog.$executor_name."_ex(NULL);\n");
2234 out($f,$prolog."static const void * const labels[] = {\n");
2236 out($f,$prolog."};\n");
2237 out($f,$prolog."static const uint32_t specs[] = {\n");
2239 out($f,$prolog."};\n");
2241 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2242 out($f,$prolog."zend_opcode_handler_funcs = labels;\n");
2243 out($f,$prolog."zend_spec_handlers = specs;\n");
2244 out($f,$prolog.$executor_name."_ex(NULL);\n");
2245 out($f,"#else\n");
2247 out($f,$prolog."zend_opcode_handlers = labels;\n");
2248 out($f,$prolog."zend_handlers_count = sizeof(labels) / sizeof(void*);\n");
2249 out($f,$prolog."zend_spec_handlers = specs;\n");
2251 out($f,"#endif\n");
2260 out($f, $line);
2593 out($f, HEADER_TEXT);
2649 out($f, HEADER_TEXT);
2688 out($f, HEADER_TEXT);
2690 out($f, "#ifdef ZEND_WIN32\n");
2692 out($f, "# pragma warning(disable : 4101)\n");
2695 out($f, "# pragma warning(once : 6235)\n");
2697 out($f, "# pragma warning(once : 6237)\n");
2699 out($f, "# pragma warning(once : 6239)\n");
2701 out($f, "# pragma warning(once : 6240)\n");
2703 out($f, "# pragma warning(once : 6285)\n");
2705 out($f, "# pragma warning(once : 6286)\n");
2707 out($f, "# pragma warning(once : 6326)\n");
2709 out($f, "#endif\n");
2712 out($f, "static user_opcode_handler_t zend_user_opcode_handlers[256] = {\n");
2714 out($f, "\t(user_opcode_handler_t)NULL,\n");
2716 out($f, "\t(user_opcode_handler_t)NULL\n};\n\n");
2718 out($f, "static zend_uchar zend_user_opcodes[256] = {");
2720 if ($i % 16 == 1) out($f, "\n\t");
2721 out($f, "$i,");
2723 out($f, "255\n};\n\n");
2727 out($f, "\n");
2730out($f, "static uint32_t ZEND_FASTCALL zend_vm_get_opcode_handler_idx(uint32_t spec, const zend_op…
2731 out($f, "{\n");
2733 out($f, "\treturn spec;\n");
2735 out($f, "\tstatic const int zend_vm_decode[] = {\n");
2736 out($f, "\t\t_UNUSED_CODE, /* 0 = IS_UNUSED */\n");
2737 out($f, "\t\t_CONST_CODE, /* 1 = IS_CONST */\n");
2738 out($f, "\t\t_TMP_CODE, /* 2 = IS_TMP_VAR */\n");
2739 out($f, "\t\t_UNUSED_CODE, /* 3 */\n");
2740 out($f, "\t\t_VAR_CODE, /* 4 = IS_VAR */\n");
2741 out($f, "\t\t_UNUSED_CODE, /* 5 */\n");
2742 out($f, "\t\t_UNUSED_CODE, /* 6 */\n");
2743 out($f, "\t\t_UNUSED_CODE, /* 7 */\n");
2744 out($f, "\t\t_CV_CODE /* 8 = IS_CV */\n");
2745 out($f, "\t};\n");
2746 out($f, "\tuint32_t offset = 0;\n");
2747out($f, "\tif (spec & SPEC_RULE_OP1) offset = offset * 5 + zend_vm_decode[op->op1_type];\n");
2748out($f, "\tif (spec & SPEC_RULE_OP2) offset = offset * 5 + zend_vm_decode[op->op2_type];\n");
2758 out($f, "\tif (spec & SPEC_EXTRA_MASK) {\n");
2761 out($f, "\t\t{$else}if (spec & SPEC_RULE_RETVAL) {\n");
2762 out($f, "\t\t\toffset = offset * 2 + (op->result_type != IS_UNUSED);\n");
2763 out($f, "\t\t\tif ((spec & SPEC_RULE_OBSERVER) && ZEND_OBSERVER_ENABLED) {\n");
2764 out($f, "\t\t\t\toffset += 2;\n");
2765 out($f, "\t\t\t}\n");
2769 out($f, "\t\t{$else}if (spec & SPEC_RULE_QUICK_ARG) {\n");
2770 out($f, "\t\t\toffset = offset * 2 + (op->op2.num <= MAX_ARG_FLAG_NUM);\n");
2774 out($f, "\t\t{$else}if (spec & SPEC_RULE_OP_DATA) {\n");
2775 out($f, "\t\t\toffset = offset * 5 + zend_vm_decode[(op + 1)->op1_type];\n");
2779 out($f, "\t\t{$else}if (spec & SPEC_RULE_ISSET) {\n");
2780 out($f, "\t\t\toffset = offset * 2 + (op->extended_value & ZEND_ISEMPTY);\n");
2784 out($f, "\t\t{$else}if (spec & SPEC_RULE_SMART_BRANCH) {\n");
2785 out($f, "\t\t\toffset = offset * 3;\n");
2786 out($f, "\t\t\tif (op->result_type == (IS_SMART_BRANCH_JMPZ|IS_TMP_VAR)) {\n");
2787 out($f, "\t\t\t\toffset += 1;\n");
2788out($f, "\t\t\t} else if (op->result_type == (IS_SMART_BRANCH_JMPNZ|IS_TMP_VAR)) {\n");
2789 out($f, "\t\t\t\toffset += 2;\n");
2790 out($f, "\t\t\t}\n");
2794 out($f, "\t\t{$else}if (spec & SPEC_RULE_OBSERVER) {\n");
2795 out($f, "\t\t\toffset = offset * 2;\n");
2796 out($f, "\t\t\tif (ZEND_OBSERVER_ENABLED) {\n");
2797 out($f, "\t\t\t\toffset += 1;\n");
2798 out($f, "\t\t\t}\n");
2802 out($f, "\t\t}\n");
2804 out($f, "\t}\n");
2806 out($f, "\treturn (spec & SPEC_START_MASK) + offset;\n");
2808 out($f, "}\n\n");
2809 out($f, "#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID) || !ZEND_VM_SPEC\n");
2810out($f, "static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op)\n");
2811 out($f, "{\n");
2813 out($f, "\treturn zend_opcode_handlers[zend_vm_get_opcode_handler_idx(opcode, op)];\n");
2815out($f, "\treturn zend_opcode_handlers[zend_vm_get_opcode_handler_idx(zend_spec_handlers[opcode], …
2817 out($f, "}\n");
2818 out($f, "#endif\n\n");
2822 out($f, "#if ZEND_VM_KIND == ZEND_VM_KIND_HYBRID\n");
2823out($f,"static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend_op* op)\n…
2824 out($f, "{\n");
2825 out($f, "\tuint32_t spec = zend_spec_handlers[opcode];\n");
2827 out($f, "\treturn zend_opcode_handler_funcs[spec];\n");
2829out($f, "\treturn zend_opcode_handler_funcs[zend_vm_get_opcode_handler_idx(spec, op)];\n");
2831 out($f, "}\n\n");
2832 out($f, "#endif\n\n");
2836 out($f, "ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler(zend_op* op)\n");
2837 out($f, "{\n");
2838 out($f, "\tzend_uchar opcode = zend_user_opcodes[op->opcode];\n");
2840out($f, "\top->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(opcode, op)];\n");
2842 out($f, "\n");
2843 out($f, "\tif (zend_spec_handlers[op->opcode] & SPEC_RULE_COMMUTATIVE) {\n");
2844 out($f, "\t\tif (op->op1_type < op->op2_type) {\n");
2845 out($f, "\t\t\tzend_swap_operands(op);\n");
2846 out($f, "\t\t}\n");
2847 out($f, "\t}\n");
2848out($f, "\top->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(zend_spec_handlers[op…
2850 out($f, "}\n\n");
2853out($f, "ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t op1_info,…
2854 out($f, "{\n");
2855 out($f, "\tzend_uchar opcode = zend_user_opcodes[op->opcode];\n");
2857out($f, "\top->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(opcode, op)];\n");
2859 out($f, "\tuint32_t spec = zend_spec_handlers[opcode];\n");
2861 out($f, "\tswitch (opcode) {\n");
2865 out($f, "\t\tcase $orig_op:\n");
2867 out($f, "\t\t\tif (op->op1_type < op->op2_type) {\n");
2868 out($f, "\t\t\t\tzend_swap_operands(op);\n");
2869 out($f, "\t\t\t}\n");
2875 out($f, "\t\t\tif $condition {\n");
2878 out($f, "\t\t\t} else if $condition {\n");
2882out($f, "\t\t\t\tif (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {\n");
2883 out($f, "\t\t\t\t\tbreak;\n");
2884 out($f, "\t\t\t\t}\n");
2886 out($f, "\t\t\t\tspec = ${spec_dsc['spec_code']};\n");
2888 out($f, "\t\t\t\tif (op->op1_type < op->op2_type) {\n");
2889 out($f, "\t\t\t\t\tzend_swap_operands(op);\n");
2890 out($f, "\t\t\t\t}\n");
2894 out($f, "\t\t\t}\n");
2896 out($f, "\t\t\tbreak;\n");
2905 out($f, "\t\tcase $orig_op:\n");
2910 out($f, "\t\t\tif (op->op1_type < op->op2_type) {\n");
2911 out($f, "\t\t\t\tzend_swap_operands(op);\n");
2912 out($f, "\t\t\t}\n");
2913 out($f, "\t\t\tbreak;\n");
2914 out($f, "\t\tcase ZEND_USER_OPCODE:\n");
2915 out($f, "\t\t\tif (zend_spec_handlers[op->opcode] & SPEC_RULE_COMMUTATIVE) {\n");
2916 out($f, "\t\t\t\tif (op->op1_type < op->op2_type) {\n");
2917 out($f, "\t\t\t\t\tzend_swap_operands(op);\n");
2918 out($f, "\t\t\t\t}\n");
2919 out($f, "\t\t\t}\n");
2920 out($f, "\t\t\tbreak;\n");
2922 out($f, "\t\tdefault:\n");
2923 out($f, "\t\t\tbreak;\n");
2924 out($f, "\t}\n");
2926out($f, "\top->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(spec, op)];\n");
2928 out($f, "}\n\n");
2932 out($f, "ZEND_API int ZEND_FASTCALL zend_vm_call_opcode_handler(zend_execute_data* ex)\n");
2933 out($f, "{\n");
2935 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2936 out($f, "\topcode_handler_t handler;\n");
2937 out($f,"#endif\n");
2939 out($f, "\tint ret;\n");
2940 out($f, "#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2941 out($f, "\tconst zend_op *orig_opline = opline;\n");
2942 out($f, "#endif\n");
2943 out($f, "#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2944 out($f, "\tzend_execute_data *orig_execute_data = execute_data;\n");
2945 out($f, "\texecute_data = ex;\n");
2946 out($f, "#else\n");
2947 out($f, "\tzend_execute_data *execute_data = ex;\n");
2948 out($f, "#endif\n");
2949 out($f, "\n");
2950 out($f, "\tLOAD_OPLINE();\n");
2951 out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
2953 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2954out($f, "\thandler = (opcode_handler_t)zend_vm_get_opcode_handler_func(zend_user_opcodes[opline->o…
2955 out($f, "\thandler(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2956 out($f, "\tif (EXPECTED(opline != &hybrid_halt_op)) {\n");
2957 out($f,"#else\n");
2959 out($f, "\t((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2961 out($f, "\tif (EXPECTED(opline)) {\n");
2962 out($f,"#endif\n");
2964 out($f, "\tif (EXPECTED(opline)) {\n");
2966out($f, "\t\tret = execute_data != ex ? (int)(execute_data->prev_execute_data != ex) + 1 : 0;\n");
2967 out($f, "\t\tSAVE_OPLINE();\n");
2968 out($f, "\t} else {\n");
2969 out($f, "\t\tret = -1;\n");
2970 out($f, "\t}\n");
2971 out($f, "#else\n");
2972out($f, "\tret = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2973 out($f, "\tSAVE_OPLINE();\n");
2974 out($f, "#endif\n");
2975 out($f, "#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2976 out($f, "\texecute_data = orig_execute_data;\n");
2977 out($f, "#endif\n");
2978 out($f, "#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2979 out($f, "\topline = orig_opline;\n");
2980 out($f, "#endif\n");
2981 out($f, "\treturn ret;\n");
2982 out($f, "}\n\n");
2984 out($f, "ZEND_API int ZEND_FASTCALL zend_vm_call_opcode_handler(zend_execute_data* ex)\n");
2985 out($f, "{\n");
2986out($f, "\tzend_error_noreturn(E_CORE_ERROR, \"zend_vm_call_opcode_handler() is not supported\");\…
2987 out($f, "\treturn 0;\n");
2988 out($f, "}\n\n");