Lines Matching refs:out
551 function out($f, $s) { function
918 out($f, $code);
1045 out($f, "#line $lineno \"$definition_file\"\n");
1054 $out = fopen('php://memory', 'w+');
1055 gen_code($out, $spec, $kind, $code, $op1, $op2, $name, $extra_spec);
1056 rewind($out);
1060 . stream_get_contents($out);
1061 fclose($out);
1076 out($f, $code);
1082 …out($f,"static zend_always_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_INLINE_HANDLE…
1085 …out($f,"static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE_…
1088 …out($f,"static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE…
1090 …out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE_HANDLER_ARGS…
1096 out($f,"case $cur: /* $spec_name */");
1099 out($f,"case ".$name.":");
1103 out($f," {$spec_name}_LABEL: ZEND_ATTRIBUTE_UNUSED_LABEL\n");
1105 out($f,"\n");
1109 out($f,"{$spec_name}_LABEL: ZEND_VM_GUARD($spec_name);\n");
1117 …out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE_HANDLER_ARGS…
1118 out($f,"{\n");
1119 … out($f,"\tZEND_VM_TAIL_CALL({$spec_name}_INLINE_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));\n");
1120 out($f,"}\n");
1121 out($f,"\n");
1138 out($f, "#line $lineno \"$definition_file\"\n");
1146 out($f, $spec_name . "_LABEL:\n");
1162 …out($f, "static$zend_attributes ZEND_OPCODE_HANDLER_RET$zend_fastcall $spec_name(ZEND_OPCODE_HANDL…
1165 …out($f, "static$zend_attributes ZEND_OPCODE_HANDLER_RET$zend_fastcall $spec_name($param ZEND_OPCOD…
1169 out($f, "$spec_name:\n");
1172 out($f, "$spec_name:\n");
1184 out($f,$prolog."ZEND_NULL_HANDLER,\n");
1187 out($f,$prolog."(void*)(uintptr_t)-1,\n");
1190 out($f,$prolog."(void*)&&ZEND_NULL_LABEL,\n");
1386 out($f,"$prolog{$spec_name}_HANDLER,\n");
1389 out($f,$prolog."(void*)(uintptr_t)$switch_labels[$spec_name],\n");
1392 out($f,$prolog."(void*)&&{$spec_name}_LABEL,\n");
1434 out($f,$prolog."ZEND_NULL_HANDLER,\n");
1437 out($f,$prolog."(void*)(uintptr_t)-1,\n");
1440 out($f,$prolog."(void*)&&ZEND_NULL_LABEL,\n");
1454 out($f,$prolog.$dsc['alias']."_HANDLER,\n");
1457 out($f,$prolog."(void*)&&".$dsc['alias']."_LABEL,\n");
1465 out($f,$prolog.$dsc["op"]."_HANDLER,\n");
1468 out($f,$prolog."(void*)(uintptr_t)".((string)$num).",\n");
1471 out($f,$prolog."(void*)&&".$dsc["op"]."_LABEL,\n");
1478 out($f,$prolog."ZEND_NULL_HANDLER,\n");
1481 out($f,$prolog."(void*)(uintptr_t)-1,\n");
1484 out($f,$prolog."(void*)&&ZEND_NULL_LABEL,\n");
1495 out($f,$prolog."ZEND_NULL_HANDLER\n");
1498 out($f,$prolog."(void*)(uintptr_t)-1\n");
1501 out($f,$prolog."(void*)&&ZEND_NULL_LABEL\n");
1507 out($l, "#define VM_HANDLERS(_) \\\n");
1510 out($l, "\t_($n, $name) \\\n");
1513 out($l, "\t_($n+1, ZEND_NULL)\n");
1523 out($f, "$prolog$lastdef,\n");
1526 out($f, "$prolog$def,\n");
1529 out($f, "$prolog$lastdef,\n");
1541 …out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS)\n…
1542 out($f,"{\n");
1543 out($f,"\tUSE_OPLINE\n");
1544 out($f,"\n");
1545 out($f,"\tSAVE_OPLINE();\n");
1546 …out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", OPLINE->opcode, OPLINE->op1_t…
1547 out($f,"\tZEND_VM_NEXT_OPCODE(); /* Never reached */\n");
1548 out($f,"}\n\n");
1734 out($f, $txt);
1750 out($f,"default: ZEND_NULL_LABEL:\n");
1751 …out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", OPLINE->opcode, OPLINE->op1_t…
1752 out($f,"\tZEND_VM_NEXT_OPCODE(); /* Never reached */\n");
1755 out($f,"ZEND_NULL_LABEL:\n");
1756 …out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", OPLINE->opcode, OPLINE->op1_t…
1757 out($f,"\tZEND_VM_NEXT_OPCODE(); /* Never reached */\n");
1760 out($f,"\t\t\tHYBRID_CASE(HYBRID_HALT):\n");
1761 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
1762 out($f,"\t\t\t\texecute_data = vm_stack_data.orig_execute_data;\n");
1763 out($f,"#endif\n");
1764 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
1765 out($f,"\t\t\t\topline = vm_stack_data.orig_opline;\n");
1766 out($f,"#endif\n");
1767 out($f,"\t\t\t\treturn;\n");
1768 out($f,"\t\t\tHYBRID_DEFAULT:\n");
1769 out($f,"\t\t\t\tVM_TRACE(ZEND_NULL)\n");
1770 out($f,"\t\t\t\tZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
1771 out($f,"\t\t\t\tHYBRID_BREAK(); /* Never reached */\n");
1778 out($f, $prolog.$epilog);
1800 out($f,"#define SPEC_START_MASK 0x0000ffff\n");
1801 out($f,"#define SPEC_EXTRA_MASK 0xfffc0000\n");
1802 out($f,"#define SPEC_RULE_OP1 0x00010000\n");
1803 out($f,"#define SPEC_RULE_OP2 0x00020000\n");
1804 out($f,"#define SPEC_RULE_OP_DATA 0x00040000\n");
1805 out($f,"#define SPEC_RULE_RETVAL 0x00080000\n");
1806 out($f,"#define SPEC_RULE_QUICK_ARG 0x00100000\n");
1807 out($f,"#define SPEC_RULE_SMART_BRANCH 0x00200000\n");
1808 out($f,"#define SPEC_RULE_COMMUTATIVE 0x00800000\n");
1809 out($f,"#define SPEC_RULE_ISSET 0x01000000\n");
1810 out($f,"#define SPEC_RULE_OBSERVER 0x02000000\n");
1811 out($f,"\n");
1812 out($f,"static const uint32_t *zend_spec_handlers;\n");
1813 out($f,"static const void * const *zend_opcode_handlers;\n");
1814 out($f,"static int zend_handlers_count;\n");
1816 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1817 out($f,"static const void * const * zend_opcode_handler_funcs;\n");
1818 out($f,"static zend_op hybrid_halt_op;\n");
1819 out($f,"#endif\n");
1821 out($f,"#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID) || !ZEND_VM_SPEC\n");
1822 … out($f,"static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op);\n");
1823 out($f,"#endif\n\n");
1825 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1826 …out($f,"static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend_op* op);\…
1827 out($f,"#else\n");
1828 … out($f,"# define zend_vm_get_opcode_handler_func zend_vm_get_opcode_handler\n");
1829 out($f,"#endif\n\n");
1831 out($f,"#ifndef VM_TRACE\n");
1833 out($f,"# define VM_TRACE(op) ZEND_VM_GUARD(op);\n");
1835 out($f,"# define VM_TRACE(op)\n");
1837 out($f,"#endif\n");
1838 out($f,"#ifndef VM_TRACE_START\n");
1839 out($f,"# define VM_TRACE_START()\n");
1840 out($f,"#endif\n");
1841 out($f,"#ifndef VM_TRACE_END\n");
1842 out($f,"# define VM_TRACE_END()\n");
1843 out($f,"#endif\n");
1846 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1847 out($f,"#define HYBRID_NEXT() goto *(void**)(OPLINE->handler)\n");
1848 out($f,"#define HYBRID_SWITCH() HYBRID_NEXT();\n");
1849 out($f,"#define HYBRID_CASE(op) op ## _LABEL\n");
1850 out($f,"#define HYBRID_BREAK() HYBRID_NEXT()\n");
1851 out($f,"#define HYBRID_DEFAULT ZEND_NULL_LABEL\n");
1852 out($f,"#endif\n");
1854 out($f,"\n");
1855 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
1856 out($f,"# define ZEND_OPCODE_HANDLER_ARGS void\n");
1857 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU\n");
1858 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_DC\n");
1859 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC\n");
1860 out($f,"#else\n");
1861 … out($f,"# define ZEND_OPCODE_HANDLER_ARGS zend_execute_data *execute_data\n");
1862 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU execute_data\n");
1863 … out($f,"# define ZEND_OPCODE_HANDLER_ARGS_DC , ZEND_OPCODE_HANDLER_ARGS\n");
1864 … out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC , ZEND_OPCODE_HANDLER_ARGS_PASSTHRU\n");
1865 out($f,"#endif\n");
1866 out($f,"\n");
1867 … out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
1868 out($f,"# define ZEND_OPCODE_HANDLER_RET void\n");
1869 out($f,"# define ZEND_VM_TAIL_CALL(call) call; return\n");
1870 out($f,"# ifdef ZEND_VM_TAIL_CALL_DISPATCH\n");
1871 …out($f,"# define ZEND_VM_CONTINUE() ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_A…
1872 out($f,"# else\n");
1873 out($f,"# define ZEND_VM_CONTINUE() return\n");
1874 out($f,"# endif\n");
1876 out($f,"# if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1877 … out($f,"# define ZEND_VM_RETURN() opline = &hybrid_halt_op; return\n");
1878 … out($f,"# define ZEND_VM_HOT zend_always_inline ZEND_COLD ZEND_OPT_SIZE\n");
1879 … out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
1880 out($f,"# else\n");
1881 out($f,"# define ZEND_VM_RETURN() opline = NULL; return\n");
1882 out($f,"# define ZEND_VM_HOT\n");
1883 … out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
1884 out($f,"# endif\n");
1886 out($f,"# define ZEND_VM_RETURN() opline = NULL; return\n");
1887 … out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
1889 out($f,"#else\n");
1890 out($f,"# define ZEND_OPCODE_HANDLER_RET int\n");
1891 out($f,"# define ZEND_VM_TAIL_CALL(call) return call\n");
1892 out($f,"# define ZEND_VM_CONTINUE() return 0\n");
1893 out($f,"# define ZEND_VM_RETURN() return -1\n");
1895 out($f,"# define ZEND_VM_HOT\n");
1897 out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
1898 out($f,"#endif\n");
1899 out($f,"\n");
1900 …out($f,"typedef ZEND_OPCODE_HANDLER_RET (ZEND_FASTCALL *opcode_handler_t) (ZEND_OPCODE_HANDLER_ARG…
1901 out($f,"\n");
1902 out($f,"#define DCL_OPLINE\n");
1903 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
1904 out($f,"# define OPLINE opline\n");
1905 out($f,"# define USE_OPLINE\n");
1906 out($f,"# define LOAD_OPLINE() opline = EX(opline)\n");
1907 out($f,"# define LOAD_OPLINE_EX()\n");
1908 out($f,"# define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n");
1909 out($f,"# define SAVE_OPLINE() EX(opline) = opline\n");
1910 out($f,"# define SAVE_OPLINE_EX() SAVE_OPLINE()\n");
1911 out($f,"#else\n");
1912 out($f,"# define OPLINE EX(opline)\n");
1913 out($f,"# define USE_OPLINE const zend_op *opline = EX(opline);\n");
1914 out($f,"# define LOAD_OPLINE()\n");
1915 out($f,"# define LOAD_OPLINE_EX()\n");
1916 out($f,"# define LOAD_NEXT_OPLINE() ZEND_VM_INC_OPCODE()\n");
1917 out($f,"# define SAVE_OPLINE()\n");
1918 out($f,"# define SAVE_OPLINE_EX()\n");
1919 out($f,"#endif\n");
1920 …out($f,"#define HANDLE_EXCEPTION() ZEND_ASSERT(EG(exception)); LOAD_OPLINE(); ZEND_VM_CONTINUE()\n…
1921 …out($f,"#define HANDLE_EXCEPTION_LEAVE() ZEND_ASSERT(EG(exception)); LOAD_OPLINE(); ZEND_VM_LEAVE(…
1922 out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG)\n");
1923 … out($f,"# define ZEND_VM_ENTER_EX() ZEND_VM_INTERRUPT_CHECK(); ZEND_VM_CONTINUE()\n");
1924 …out($f,"# define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE();…
1925 out($f,"# define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n");
1926 out($f,"#elif defined(ZEND_VM_IP_GLOBAL_REG)\n");
1927 out($f,"# define ZEND_VM_ENTER_EX() return 1\n");
1928 …out($f,"# define ZEND_VM_ENTER() opline = EG(current_execute_data)->opline; ZEND_VM_ENTE…
1929 out($f,"# define ZEND_VM_LEAVE() return 2\n");
1930 out($f,"#else\n");
1931 out($f,"# define ZEND_VM_ENTER_EX() return 1\n");
1932 out($f,"# define ZEND_VM_ENTER() return 1\n");
1933 out($f,"# define ZEND_VM_LEAVE() return 2\n");
1934 out($f,"#endif\n");
1935 …out($f,"#define ZEND_VM_INTERRUPT() ZEND_VM_TAIL_CALL(zend_interrupt_helper".($spec?"_SPEC":"…
1936 …out($f,"#define ZEND_VM_LOOP_INTERRUPT() zend_interrupt_helper".($spec?"_SPEC":"")."(ZEND_OPCODE_H…
1938 …out($f,"#define ZEND_VM_DISPATCH(opcode, opline) ZEND_VM_TAIL_CALL(((opcode_handler_t)zend_vm_get_…
1940 …out($f,"#define ZEND_VM_DISPATCH(opcode, opline) ZEND_VM_TAIL_CALL(((opcode_handler_t)zend_vm_get_…
1942 out($f,"\n");
1943 …out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_interrupt_helper".($spec?"_SPEC":"")."(Z…
1944 …out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS);\…
1945 out($f,"\n");
1948 out($f,"\n");
1949 out($f,"#define OPLINE opline\n");
1950 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
1951 … out($f,"# define DCL_OPLINE register const zend_op *opline __asm__(ZEND_VM_IP_GLOBAL_REG);\n");
1952 out($f,"#else\n");
1953 out($f,"# define DCL_OPLINE const zend_op *opline;\n");
1954 out($f,"#endif\n");
1955 out($f,"#define USE_OPLINE\n");
1956 out($f,"#define LOAD_OPLINE() opline = EX(opline)\n");
1957 out($f,"# define LOAD_OPLINE_EX() LOAD_OPLINE()\n");
1958 out($f,"#define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n");
1959 out($f,"#define SAVE_OPLINE() EX(opline) = opline\n");
1960 out($f,"#define SAVE_OPLINE_EX()\n");
1961 …out($f,"#define HANDLE_EXCEPTION() ZEND_ASSERT(EG(exception)); LOAD_OPLINE(); ZEND_VM_CONTINUE()\n…
1962 …out($f,"#define HANDLE_EXCEPTION_LEAVE() ZEND_ASSERT(EG(exception)); LOAD_OPLINE(); ZEND_VM_LEAVE(…
1963 out($f,"#define ZEND_VM_CONTINUE() goto zend_vm_continue\n");
1964 out($f,"#define ZEND_VM_RETURN() return\n");
1965 … out($f,"#define ZEND_VM_ENTER_EX() ZEND_VM_INTERRUPT_CHECK(); ZEND_VM_CONTINUE()\n");
1966 …out($f,"#define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE(); ZEND_VM…
1967 out($f,"#define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n");
1968 …out($f,"#define ZEND_VM_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
1969 …out($f,"#define ZEND_VM_LOOP_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
1970 …out($f,"#define ZEND_VM_DISPATCH(opcode, opline) dispatch_handler = zend_vm_get_opcode_handler(opc…
1971 out($f,"\n");
1974 out($f,"\n");
1975 out($f,"#define OPLINE opline\n");
1976 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
1977 … out($f,"# define DCL_OPLINE register const zend_op *opline __asm__(ZEND_VM_IP_GLOBAL_REG);\n");
1978 out($f,"#else\n");
1979 out($f,"# define DCL_OPLINE const zend_op *opline;\n");
1980 out($f,"#endif\n");
1981 out($f,"#define USE_OPLINE\n");
1982 out($f,"#define LOAD_OPLINE() opline = EX(opline)\n");
1983 out($f,"#define LOAD_OPLINE_EX() LOAD_OPLINE()\n");
1984 out($f,"#define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n");
1985 out($f,"#define SAVE_OPLINE() EX(opline) = opline\n");
1986 out($f,"#define SAVE_OPLINE_EX()\n");
1988 …out($f,"#define HANDLE_EXCEPTION() ZEND_ASSERT(EG(exception)); goto ZEND_HANDLE_EXCEPTION_SPEC_LAB…
1989 …out($f,"#define HANDLE_EXCEPTION_LEAVE() ZEND_ASSERT(EG(exception)); goto ZEND_HANDLE_EXCEPTION_SP…
1991 …out($f,"#define HANDLE_EXCEPTION() ZEND_ASSERT(EG(exception)); goto ZEND_HANDLE_EXCEPTION_LABEL\n"…
1992 …out($f,"#define HANDLE_EXCEPTION_LEAVE() ZEND_ASSERT(EG(exception)); goto ZEND_HANDLE_EXCEPTION_LA…
1994 out($f,"#define ZEND_VM_CONTINUE() goto *(void**)(OPLINE->handler)\n");
1995 out($f,"#define ZEND_VM_RETURN() return\n");
1996 … out($f,"#define ZEND_VM_ENTER_EX() ZEND_VM_INTERRUPT_CHECK(); ZEND_VM_CONTINUE()\n");
1997 …out($f,"#define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE(); ZEND_VM…
1998 out($f,"#define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n");
1999 …out($f,"#define ZEND_VM_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
2000 …out($f,"#define ZEND_VM_LOOP_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
2001 …out($f,"#define ZEND_VM_DISPATCH(opcode, opline) goto *(void**)(zend_vm_get_opcode_handler(opcode,…
2002 out($f,"\n");
2007 out($f,"\n");
2008 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2009 out($f,"# undef ZEND_VM_TAIL_CALL\n");
2010 out($f,"# undef ZEND_VM_CONTINUE\n");
2011 out($f,"# undef ZEND_VM_RETURN\n");
2013 out($f,"\n");
2014 out($f,"# define ZEND_VM_TAIL_CALL(call) call; ZEND_VM_CONTINUE()\n");
2015 out($f,"# define ZEND_VM_CONTINUE() HYBRID_NEXT()\n");
2016 out($f,"# define ZEND_VM_RETURN() goto HYBRID_HALT_LABEL\n");
2018 out($f,"#endif\n\n");
2022 out($f, $m[1].$executor_name.$m[3]."\n");
2026 out($f,$m[1]."const void *dispatch_handler;\n");
2030 out($f, "#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2034 out($f,$m[1].$param.";\n");
2037 out($f, "#endif\n");
2041 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2042 … out($f,$m[1]."register zend_execute_data *execute_data __asm__(ZEND_VM_FP_GLOBAL_REG) = ex;\n");
2043 out($f,"#else\n");
2044 out($f,$m[1]."zend_execute_data *execute_data = ex;\n");
2045 out($f,"#endif\n");
2047 … out($f,"#if defined(ZEND_VM_IP_GLOBAL_REG) || defined(ZEND_VM_FP_GLOBAL_REG)\n");
2048 out($f,$m[1]."struct {\n");
2049 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2050 out($f,$m[1]."\tconst zend_op *orig_opline;\n");
2051 out($f,"#endif\n");
2052 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2053 out($f,$m[1]."\tzend_execute_data *orig_execute_data;\n");
2054 out($f,"#ifdef ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE\n");
2055 … out($f,$m[1]."\tchar hybrid_jit_red_zone[ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE];\n");
2056 out($f,"#endif\n");
2057 out($f,"#endif\n");
2058 out($f,$m[1]."} vm_stack_data;\n");
2059 out($f,"#endif\n");
2060 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2061 out($f,$m[1]."vm_stack_data.orig_opline = opline;\n");
2062 out($f,"#endif\n");
2063 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2064 out($f,$m[1]."vm_stack_data.orig_execute_data = execute_data;\n");
2065 out($f,$m[1]."execute_data = ex;\n");
2066 out($f,"#else\n");
2067 out($f,$m[1]."zend_execute_data *execute_data = ex;\n");
2068 out($f,"#endif\n");
2076 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2079 out($f,$prolog."if (UNEXPECTED(execute_data == NULL)) {\n");
2080 out($f,$prolog."\tstatic const void * const labels[] = {\n");
2082 out($f,$prolog."\t};\n");
2083 out($f,$prolog."\tzend_opcode_handlers = (const void **) labels;\n");
2084 out($f,$prolog."\tzend_handlers_count = sizeof(labels) / sizeof(void*);\n");
2086 … out($f,$prolog."\tmemset(&hybrid_halt_op, 0, sizeof(hybrid_halt_op));\n");
2087 … out($f,$prolog."\thybrid_halt_op.handler = (void*)&&HYBRID_HALT_LABEL;\n");
2088 out($f,"#ifdef ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE\n");
2089 …out($f,$prolog."\tmemset(vm_stack_data.hybrid_jit_red_zone, 0, ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE);\…
2090 out($f,"#endif\n");
2091 out($f,$prolog."\tif (zend_touch_vm_stack_data) {\n");
2092 out($f,$prolog."\t\tzend_touch_vm_stack_data(&vm_stack_data);\n");
2093 out($f,$prolog."\t}\n");
2094 out($f,$prolog."\tgoto HYBRID_HALT_LABEL;\n");
2096 out($f,$prolog."\treturn;\n");
2098 out($f,$prolog."}\n");
2100 out($f,"#endif\n");
2109 … out($f,"#if !defined(ZEND_VM_FP_GLOBAL_REG) || !defined(ZEND_VM_IP_GLOBAL_REG)\n");
2110 out($f,$m[1]."\tint ret;".$m[3]."\n");
2111 out($f,"#endif\n");
2114 out($f,"zend_vm_continue:".$m[3]."\n");
2123 …out($f, $m[1]."dispatch_handler = OPLINE->handler;\nzend_vm_dispatch:\n".$m[1]."switch ((int)(uint…
2126 out($f, $m[1]."goto *(void**)(OPLINE->handler);".$m[3]."\n");
2129 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2130 out($f, $m[1]."HYBRID_SWITCH()".$m[3]."\n");
2131 out($f,"#else\n");
2133 … out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
2134 … out($f, $m[1]."((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2135 out($f, $m[1]."if (UNEXPECTED(!OPLINE))".$m[3]."\n");
2136 out($f,"#else\n");
2137 …out($f, $m[1]."if (UNEXPECTED((ret = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_…
2138 out($f,"#endif\n");
2140 out($f,"#endif\n");
2149 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2156 out($f,"#else\n");
2158 out($f,
2177 out($f,"#endif\n");
2187 out($f, $m[1].$initializer_name.$m[3]."\n");
2195 out($f,$prolog."static const uint32_t specs[] = {\n");
2197 out($f,$prolog."};\n");
2198 out($f,$prolog."zend_spec_handlers = specs;\n");
2199 out($f,$prolog.$executor_name."_ex(NULL);\n");
2201 out($f,$prolog."static const void * const labels[] = {\n");
2203 out($f,$prolog."};\n");
2204 out($f,$prolog."static const uint32_t specs[] = {\n");
2206 out($f,$prolog."};\n");
2208 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2209 out($f,$prolog."zend_opcode_handler_funcs = labels;\n");
2210 out($f,$prolog."zend_spec_handlers = specs;\n");
2211 out($f,$prolog.$executor_name."_ex(NULL);\n");
2212 out($f,"#else\n");
2214 out($f,$prolog."zend_opcode_handlers = labels;\n");
2215 out($f,$prolog."zend_handlers_count = sizeof(labels) / sizeof(void*);\n");
2216 out($f,$prolog."zend_spec_handlers = specs;\n");
2218 out($f,"#endif\n");
2227 out($f, $line);
2622 out($f, HEADER_TEXT);
2672 out($f, HEADER_TEXT);
2674 out($f, "#ifdef ZEND_WIN32\n");
2676 out($f, "# pragma warning(disable : 4101)\n");
2679 out($f, "# pragma warning(once : 6235)\n");
2681 out($f, "# pragma warning(once : 6237)\n");
2683 out($f, "# pragma warning(once : 6239)\n");
2685 out($f, "# pragma warning(once : 6240)\n");
2687 out($f, "# pragma warning(once : 6285)\n");
2689 out($f, "# pragma warning(once : 6286)\n");
2691 out($f, "# pragma warning(once : 6326)\n");
2693 out($f, "#endif\n");
2696 out($f, "static user_opcode_handler_t zend_user_opcode_handlers[256] = {\n");
2698 out($f, "\t(user_opcode_handler_t)NULL,\n");
2700 out($f, "\t(user_opcode_handler_t)NULL\n};\n\n");
2702 out($f, "static zend_uchar zend_user_opcodes[256] = {");
2704 if ($i % 16 == 1) out($f, "\n\t");
2705 out($f, "$i,");
2707 out($f, "255\n};\n\n");
2711 out($f, "\n");
2714 …out($f, "static uint32_t ZEND_FASTCALL zend_vm_get_opcode_handler_idx(uint32_t spec, const zend_op…
2715 out($f, "{\n");
2717 out($f, "\treturn spec;\n");
2719 out($f, "\tstatic const int zend_vm_decode[] = {\n");
2720 out($f, "\t\t_UNUSED_CODE, /* 0 = IS_UNUSED */\n");
2721 out($f, "\t\t_CONST_CODE, /* 1 = IS_CONST */\n");
2722 out($f, "\t\t_TMP_CODE, /* 2 = IS_TMP_VAR */\n");
2723 out($f, "\t\t_UNUSED_CODE, /* 3 */\n");
2724 out($f, "\t\t_VAR_CODE, /* 4 = IS_VAR */\n");
2725 out($f, "\t\t_UNUSED_CODE, /* 5 */\n");
2726 out($f, "\t\t_UNUSED_CODE, /* 6 */\n");
2727 out($f, "\t\t_UNUSED_CODE, /* 7 */\n");
2728 out($f, "\t\t_CV_CODE /* 8 = IS_CV */\n");
2729 out($f, "\t};\n");
2730 out($f, "\tuint32_t offset = 0;\n");
2731 … out($f, "\tif (spec & SPEC_RULE_OP1) offset = offset * 5 + zend_vm_decode[op->op1_type];\n");
2732 … out($f, "\tif (spec & SPEC_RULE_OP2) offset = offset * 5 + zend_vm_decode[op->op2_type];\n");
2742 out($f, "\tif (spec & SPEC_EXTRA_MASK) {\n");
2745 out($f, "\t\t{$else}if (spec & SPEC_RULE_RETVAL) {\n");
2746 out($f, "\t\t\toffset = offset * 2 + (op->result_type != IS_UNUSED);\n");
2747 out($f, "\t\t\tif ((spec & SPEC_RULE_OBSERVER) && ZEND_OBSERVER_ENABLED) {\n");
2748 out($f, "\t\t\t\toffset += 2;\n");
2749 out($f, "\t\t\t}\n");
2753 out($f, "\t\t{$else}if (spec & SPEC_RULE_QUICK_ARG) {\n");
2754 out($f, "\t\t\toffset = offset * 2 + (op->op2.num <= MAX_ARG_FLAG_NUM);\n");
2758 out($f, "\t\t{$else}if (spec & SPEC_RULE_OP_DATA) {\n");
2759 out($f, "\t\t\toffset = offset * 5 + zend_vm_decode[(op + 1)->op1_type];\n");
2763 out($f, "\t\t{$else}if (spec & SPEC_RULE_ISSET) {\n");
2764 out($f, "\t\t\toffset = offset * 2 + (op->extended_value & ZEND_ISEMPTY);\n");
2768 out($f, "\t\t{$else}if (spec & SPEC_RULE_SMART_BRANCH) {\n");
2769 out($f, "\t\t\toffset = offset * 3;\n");
2770 out($f, "\t\t\tif (op->result_type == (IS_SMART_BRANCH_JMPZ|IS_TMP_VAR)) {\n");
2771 out($f, "\t\t\t\toffset += 1;\n");
2772 … out($f, "\t\t\t} else if (op->result_type == (IS_SMART_BRANCH_JMPNZ|IS_TMP_VAR)) {\n");
2773 out($f, "\t\t\t\toffset += 2;\n");
2774 out($f, "\t\t\t}\n");
2778 out($f, "\t\t{$else}if (spec & SPEC_RULE_OBSERVER) {\n");
2779 out($f, "\t\t\toffset = offset * 2;\n");
2780 out($f, "\t\t\tif (ZEND_OBSERVER_ENABLED) {\n");
2781 out($f, "\t\t\t\toffset += 1;\n");
2782 out($f, "\t\t\t}\n");
2786 out($f, "\t\t}\n");
2788 out($f, "\t}\n");
2790 out($f, "\treturn (spec & SPEC_START_MASK) + offset;\n");
2792 out($f, "}\n\n");
2793 out($f, "#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID) || !ZEND_VM_SPEC\n");
2794 … out($f, "static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op)\n");
2795 out($f, "{\n");
2797 out($f, "\treturn zend_opcode_handlers[zend_vm_get_opcode_handler_idx(opcode, op)];\n");
2799 …out($f, "\treturn zend_opcode_handlers[zend_vm_get_opcode_handler_idx(zend_spec_handlers[opcode], …
2801 out($f, "}\n");
2802 out($f, "#endif\n\n");
2806 out($f, "#if ZEND_VM_KIND == ZEND_VM_KIND_HYBRID\n");
2807 …out($f,"static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend_op* op)\n…
2808 out($f, "{\n");
2809 out($f, "\tuint32_t spec = zend_spec_handlers[opcode];\n");
2811 out($f, "\treturn zend_opcode_handler_funcs[spec];\n");
2813 … out($f, "\treturn zend_opcode_handler_funcs[zend_vm_get_opcode_handler_idx(spec, op)];\n");
2815 out($f, "}\n\n");
2816 out($f, "#endif\n\n");
2820 out($f, "ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler(zend_op* op)\n");
2821 out($f, "{\n");
2822 out($f, "\tzend_uchar opcode = zend_user_opcodes[op->opcode];\n");
2824 … out($f, "\top->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(opcode, op)];\n");
2826 out($f, "\n");
2827 out($f, "\tif (zend_spec_handlers[op->opcode] & SPEC_RULE_COMMUTATIVE) {\n");
2828 out($f, "\t\tif (op->op1_type < op->op2_type) {\n");
2829 out($f, "\t\t\tzend_swap_operands(op);\n");
2830 out($f, "\t\t}\n");
2831 out($f, "\t}\n");
2832 …out($f, "\top->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(zend_spec_handlers[op…
2834 out($f, "}\n\n");
2837 …out($f, "ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t op1_info,…
2838 out($f, "{\n");
2839 out($f, "\tzend_uchar opcode = zend_user_opcodes[op->opcode];\n");
2841 … out($f, "\top->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(opcode, op)];\n");
2843 out($f, "\tuint32_t spec = zend_spec_handlers[opcode];\n");
2845 out($f, "\tswitch (opcode) {\n");
2849 out($f, "\t\tcase $orig_op:\n");
2851 out($f, "\t\t\tif (op->op1_type < op->op2_type) {\n");
2852 out($f, "\t\t\t\tzend_swap_operands(op);\n");
2853 out($f, "\t\t\t}\n");
2859 out($f, "\t\t\tif $condition {\n");
2862 out($f, "\t\t\t} else if $condition {\n");
2866 … out($f, "\t\t\t\tif (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {\n");
2867 out($f, "\t\t\t\t\tbreak;\n");
2868 out($f, "\t\t\t\t}\n");
2870 out($f, "\t\t\t\tspec = {$spec_dsc['spec_code']};\n");
2872 out($f, "\t\t\t\tif (op->op1_type < op->op2_type) {\n");
2873 out($f, "\t\t\t\t\tzend_swap_operands(op);\n");
2874 out($f, "\t\t\t\t}\n");
2878 out($f, "\t\t\t}\n");
2880 out($f, "\t\t\tbreak;\n");
2889 out($f, "\t\tcase $orig_op:\n");
2894 out($f, "\t\t\tif (op->op1_type < op->op2_type) {\n");
2895 out($f, "\t\t\t\tzend_swap_operands(op);\n");
2896 out($f, "\t\t\t}\n");
2897 out($f, "\t\t\tbreak;\n");
2898 out($f, "\t\tcase ZEND_USER_OPCODE:\n");
2899 out($f, "\t\t\tif (zend_spec_handlers[op->opcode] & SPEC_RULE_COMMUTATIVE) {\n");
2900 out($f, "\t\t\t\tif (op->op1_type < op->op2_type) {\n");
2901 out($f, "\t\t\t\t\tzend_swap_operands(op);\n");
2902 out($f, "\t\t\t\t}\n");
2903 out($f, "\t\t\t}\n");
2904 out($f, "\t\t\tbreak;\n");
2906 out($f, "\t\tdefault:\n");
2907 out($f, "\t\t\tbreak;\n");
2908 out($f, "\t}\n");
2910 … out($f, "\top->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(spec, op)];\n");
2912 out($f, "}\n\n");
2916 out($f, "ZEND_API int ZEND_FASTCALL zend_vm_call_opcode_handler(zend_execute_data* ex)\n");
2917 out($f, "{\n");
2919 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2920 out($f, "\topcode_handler_t handler;\n");
2921 out($f,"#endif\n");
2923 out($f, "\tint ret;\n");
2924 out($f, "#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2925 out($f, "\tconst zend_op *orig_opline = opline;\n");
2926 out($f, "#endif\n");
2927 out($f, "#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2928 out($f, "\tzend_execute_data *orig_execute_data = execute_data;\n");
2929 out($f, "\texecute_data = ex;\n");
2930 out($f, "#else\n");
2931 out($f, "\tzend_execute_data *execute_data = ex;\n");
2932 out($f, "#endif\n");
2933 out($f, "\n");
2934 out($f, "\tLOAD_OPLINE();\n");
2935 out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
2937 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2938 …out($f, "\thandler = (opcode_handler_t)zend_vm_get_opcode_handler_func(zend_user_opcodes[opline->o…
2939 out($f, "\thandler(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2940 out($f, "\tif (EXPECTED(opline != &hybrid_halt_op)) {\n");
2941 out($f,"#else\n");
2943 out($f, "\t((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2945 out($f, "\tif (EXPECTED(opline)) {\n");
2946 out($f,"#endif\n");
2948 out($f, "\tif (EXPECTED(opline)) {\n");
2950 … out($f, "\t\tret = execute_data != ex ? (int)(execute_data->prev_execute_data != ex) + 1 : 0;\n");
2951 out($f, "\t\tSAVE_OPLINE();\n");
2952 out($f, "\t} else {\n");
2953 out($f, "\t\tret = -1;\n");
2954 out($f, "\t}\n");
2955 out($f, "#else\n");
2956 … out($f, "\tret = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2957 out($f, "\tSAVE_OPLINE();\n");
2958 out($f, "#endif\n");
2959 out($f, "#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2960 out($f, "\texecute_data = orig_execute_data;\n");
2961 out($f, "#endif\n");
2962 out($f, "#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2963 out($f, "\topline = orig_opline;\n");
2964 out($f, "#endif\n");
2965 out($f, "\treturn ret;\n");
2966 out($f, "}\n\n");
2968 out($f, "ZEND_API int ZEND_FASTCALL zend_vm_call_opcode_handler(zend_execute_data* ex)\n");
2969 out($f, "{\n");
2970 …out($f, "\tzend_error_noreturn(E_CORE_ERROR, \"zend_vm_call_opcode_handler() is not supported\");\…
2971 out($f, "\treturn 0;\n");
2972 out($f, "}\n\n");