Lines Matching refs:out

601 function out($f, $s) {  function
1038 out($f, $code);
1110 out($f, "#line $lineno \"$definition_file\"\n");
1118 $out = fopen('php://memory', 'w+');
1119 gen_code($out, $spec, $kind, 0, $code, $op1, $op2, $name, $extra_spec);
1120 rewind($out);
1124 . stream_get_contents($out);
1125 fclose($out);
1136 out($f, $code);
1141out($f,"static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE_…
1143out($f,"static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE…
1145out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE_HANDLER_ARGS…
1151 out($f,"case $cur: /* $spec_name */");
1154 out($f,"case ".$name.":");
1158 out($f," {$spec_name}_LABEL:\n");
1160 out($f,"\n");
1164 out($f,"{$spec_name}_LABEL: ZEND_VM_GUARD($spec_name);\n");
1185 out($f, "#line $lineno \"$definition_file\"\n");
1193 out($f, $spec_name . "_LABEL:\n");
1209out($f, "static$zend_attributes ZEND_OPCODE_HANDLER_RET$zend_fastcall $spec_name(ZEND_OPCODE_HANDL…
1212out($f, "static$zend_attributes ZEND_OPCODE_HANDLER_RET$zend_fastcall $spec_name($param ZEND_OPCOD…
1216 out($f, "$spec_name:\n");
1219 out($f, "$spec_name:\n");
1231 out($f,$prolog."ZEND_NULL_HANDLER,\n");
1234 out($f,$prolog."(void*)(uintptr_t)-1,\n");
1237 out($f,$prolog."(void*)&&ZEND_NULL_LABEL,\n");
1401 out($f,"$prolog{$spec_name}_HANDLER,\n");
1404 out($f,$prolog."(void*)(uintptr_t)$switch_labels[$spec_name],\n");
1407 out($f,$prolog."(void*)&&{$spec_name}_LABEL,\n");
1449 out($f,$prolog."ZEND_NULL_HANDLER,\n");
1452 out($f,$prolog."(void*)(uintptr_t)-1,\n");
1455 out($f,$prolog."(void*)&&ZEND_NULL_LABEL,\n");
1470 out($f,$prolog.$dsc["op"]."_HANDLER,\n");
1473 out($f,$prolog."(void*)(uintptr_t)".((string)$num).",\n");
1476 out($f,$prolog."(void*)&&".$dsc["op"]."_LABEL,\n");
1483 out($f,$prolog."ZEND_NULL_HANDLER,\n");
1486 out($f,$prolog."(void*)(uintptr_t)-1,\n");
1489 out($f,$prolog."(void*)&&ZEND_NULL_LABEL,\n");
1500 out($f,$prolog."ZEND_NULL_HANDLER\n");
1503 out($f,$prolog."(void*)(uintptr_t)-1\n");
1506 out($f,$prolog."(void*)&&ZEND_NULL_LABEL\n");
1512 out($l, "#define VM_HANDLERS(_) \\\n");
1515 out($l, "\t_($n, $name) \\\n");
1518 out($l, "\t_($n+1, ZEND_NULL)\n");
1528 out($f, "$prolog$lastdef,\n");
1531 out($f, "$prolog$def,\n");
1533 out($f, "$prolog$lastdef\n");
1544out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS)\n…
1545 out($f,"{\n");
1546 out($f,"\tUSE_OPLINE\n");
1547 out($f,"\n");
1548out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", OPLINE->opcode, OPLINE->op1_t…
1549 out($f,"\tZEND_VM_NEXT_OPCODE(); /* Never reached */\n");
1550 out($f,"}\n\n");
1744 out($f, $txt);
1760 out($f,"default: ZEND_NULL_LABEL:\n");
1761out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", OPLINE->opcode, OPLINE->op1_t…
1762 out($f,"\tZEND_VM_NEXT_OPCODE(); /* Never reached */\n");
1765 out($f,"ZEND_NULL_LABEL:\n");
1766out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", OPLINE->opcode, OPLINE->op1_t…
1767 out($f,"\tZEND_VM_NEXT_OPCODE(); /* Never reached */\n");
1770 out($f,"\t\t\tHYBRID_CASE(HYBRID_HALT):\n");
1771 out($f,"\t\t\t\texecute_data = orig_execute_data;\n");
1772 out($f,"\t\t\t\topline = orig_opline;\n");
1773 out($f,"\t\t\t\treturn;\n");
1774 out($f,"\t\t\tHYBRID_DEFAULT:\n");
1775 out($f,"\t\t\t\tVM_TRACE(ZEND_NULL)\n");
1776 out($f,"\t\t\t\tZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
1777 out($f,"\t\t\t\tHYBRID_BREAK(); /* Never reached */\n");
1784 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_DIM_OBJ 0x00400000\n");
1809 out($f,"#define SPEC_RULE_COMMUTATIVE 0x00800000\n");
1810 out($f,"#define SPEC_RULE_ISSET 0x01000000\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");
1822out($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");
1826out($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");
1832 out($f,"# define VM_TRACE(op)\n");
1833 out($f,"#endif\n");
1834 out($f,"#ifndef VM_TRACE_START\n");
1835 out($f,"# define VM_TRACE_START()\n");
1836 out($f,"#endif\n");
1837 out($f,"#ifndef VM_TRACE_END\n");
1838 out($f,"# define VM_TRACE_END()\n");
1839 out($f,"#endif\n");
1842 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1843 out($f,"#define HYBRID_NEXT() goto *(void**)(OPLINE->handler)\n");
1844 out($f,"#define HYBRID_SWITCH() HYBRID_NEXT();\n");
1845 out($f,"#define HYBRID_CASE(op) op ## _LABEL\n");
1846 out($f,"#define HYBRID_BREAK() HYBRID_NEXT()\n");
1847 out($f,"#define HYBRID_DEFAULT ZEND_NULL_LABEL\n");
1848 out($f,"#endif\n");
1850 out($f,"\n");
1851 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
1852 out($f,"# define ZEND_OPCODE_HANDLER_ARGS void\n");
1853 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU\n");
1854 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_DC\n");
1855 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC\n");
1856 out($f,"#else\n");
1857 out($f,"# define ZEND_OPCODE_HANDLER_ARGS zend_execute_data *execute_data\n");
1858 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU execute_data\n");
1859 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_DC , ZEND_OPCODE_HANDLER_ARGS\n");
1860out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC , ZEND_OPCODE_HANDLER_ARGS_PASSTHRU\n");
1861 out($f,"#endif\n");
1862 out($f,"\n");
1863 out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
1864 out($f,"# define ZEND_OPCODE_HANDLER_RET void\n");
1865 out($f,"# define ZEND_VM_TAIL_CALL(call) call; return\n");
1866 out($f,"# ifdef ZEND_VM_TAIL_CALL_DISPATCH\n");
1867out($f,"# define ZEND_VM_CONTINUE() ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_A…
1868 out($f,"# else\n");
1869 out($f,"# define ZEND_VM_CONTINUE() return\n");
1870 out($f,"# endif\n");
1872 out($f,"# if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1873 out($f,"# define ZEND_VM_RETURN() opline = &hybrid_halt_op; return\n");
1874 out($f,"# define ZEND_VM_HOT zend_always_inline ZEND_COLD ZEND_OPT_SIZE\n");
1875 out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
1876 out($f,"# else\n");
1877 out($f,"# define ZEND_VM_RETURN() opline = NULL; return\n");
1878 out($f,"# define ZEND_VM_HOT\n");
1879 out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
1880 out($f,"# endif\n");
1882 out($f,"# define ZEND_VM_RETURN() opline = NULL; return\n");
1883 out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
1885 out($f,"#else\n");
1886 out($f,"# define ZEND_OPCODE_HANDLER_RET int\n");
1887 out($f,"# define ZEND_VM_TAIL_CALL(call) return call\n");
1888 out($f,"# define ZEND_VM_CONTINUE() return 0\n");
1889 out($f,"# define ZEND_VM_RETURN() return -1\n");
1891 out($f,"# define ZEND_VM_HOT\n");
1892 out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
1894 out($f,"#endif\n");
1895 out($f,"\n");
1896out($f,"typedef ZEND_OPCODE_HANDLER_RET (ZEND_FASTCALL *opcode_handler_t) (ZEND_OPCODE_HANDLER_ARG…
1897 out($f,"\n");
1898 out($f,"#undef OPLINE\n");
1899 out($f,"#undef DCL_OPLINE\n");
1900 out($f,"#undef USE_OPLINE\n");
1901 out($f,"#undef LOAD_OPLINE\n");
1902 out($f,"#undef LOAD_OPLINE_EX\n");
1903 out($f,"#undef SAVE_OPLINE\n");
1904 out($f,"#define DCL_OPLINE\n");
1905 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
1906 out($f,"# define OPLINE opline\n");
1907 out($f,"# define USE_OPLINE\n");
1908 out($f,"# define LOAD_OPLINE() opline = EX(opline)\n");
1909 out($f,"# define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n");
1910 out($f,"# define SAVE_OPLINE() EX(opline) = 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_NEXT_OPLINE() ZEND_VM_INC_OPCODE()\n");
1916 out($f,"# define SAVE_OPLINE()\n");
1917 out($f,"#endif\n");
1918 out($f,"#undef HANDLE_EXCEPTION\n");
1919 out($f,"#undef HANDLE_EXCEPTION_LEAVE\n");
1920 out($f,"#define HANDLE_EXCEPTION() LOAD_OPLINE(); ZEND_VM_CONTINUE()\n");
1921 out($f,"#define HANDLE_EXCEPTION_LEAVE() LOAD_OPLINE(); ZEND_VM_LEAVE()\n");
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");
1924out($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");
1928out($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");
1935out($f,"#define ZEND_VM_INTERRUPT() ZEND_VM_TAIL_CALL(zend_interrupt_helper".($spec?"_SPEC":"…
1936out($f,"#define ZEND_VM_LOOP_INTERRUPT() zend_interrupt_helper".($spec?"_SPEC":"")."(ZEND_OPCODE_H…
1938out($f,"#define ZEND_VM_DISPATCH(opcode, opline) ZEND_VM_TAIL_CALL(((opcode_handler_t)zend_vm_get_…
1940out($f,"#define ZEND_VM_DISPATCH(opcode, opline) ZEND_VM_TAIL_CALL(((opcode_handler_t)zend_vm_get_…
1942 out($f,"\n");
1943out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_interrupt_helper".($spec?"_SPEC":"")."(Z…
1944out($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,"#undef OPLINE\n");
1950 out($f,"#undef DCL_OPLINE\n");
1951 out($f,"#undef USE_OPLINE\n");
1952 out($f,"#undef LOAD_OPLINE\n");
1953 out($f,"#undef LOAD_NEXT_OPLINE\n");
1954 out($f,"#undef SAVE_OPLINE\n");
1955 out($f,"#define OPLINE opline\n");
1956 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
1957out($f,"# define DCL_OPLINE register const zend_op *opline __asm__(ZEND_VM_IP_GLOBAL_REG);\n");
1958 out($f,"#else\n");
1959 out($f,"# define DCL_OPLINE const zend_op *opline;\n");
1960 out($f,"#endif\n");
1961 out($f,"#define USE_OPLINE\n");
1962 out($f,"#define LOAD_OPLINE() opline = EX(opline)\n");
1963 out($f,"#define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n");
1964 out($f,"#define SAVE_OPLINE() EX(opline) = opline\n");
1965 out($f,"#undef HANDLE_EXCEPTION\n");
1966 out($f,"#undef HANDLE_EXCEPTION_LEAVE\n");
1967 out($f,"#define HANDLE_EXCEPTION() LOAD_OPLINE(); ZEND_VM_CONTINUE()\n");
1968 out($f,"#define HANDLE_EXCEPTION_LEAVE() LOAD_OPLINE(); ZEND_VM_LEAVE()\n");
1969 out($f,"#define ZEND_VM_CONTINUE() goto zend_vm_continue\n");
1970 out($f,"#define ZEND_VM_RETURN() return\n");
1971 out($f,"#define ZEND_VM_ENTER_EX() ZEND_VM_INTERRUPT_CHECK(); ZEND_VM_CONTINUE()\n");
1972out($f,"#define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE(); ZEND_VM…
1973 out($f,"#define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n");
1974out($f,"#define ZEND_VM_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
1975out($f,"#define ZEND_VM_LOOP_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
1976out($f,"#define ZEND_VM_DISPATCH(opcode, opline) dispatch_handler = zend_vm_get_opcode_handler(opc…
1977 out($f,"\n");
1980 out($f,"\n");
1981 out($f,"#undef OPLINE\n");
1982 out($f,"#undef DCL_OPLINE\n");
1983 out($f,"#undef USE_OPLINE\n");
1984 out($f,"#undef LOAD_OPLINE\n");
1985 out($f,"#undef LOAD_NEXT_OPLINE\n");
1986 out($f,"#undef SAVE_OPLINE\n");
1987 out($f,"#define OPLINE opline\n");
1988 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
1989out($f,"# define DCL_OPLINE register const zend_op *opline __asm__(ZEND_VM_IP_GLOBAL_REG);\n");
1990 out($f,"#else\n");
1991 out($f,"# define DCL_OPLINE const zend_op *opline;\n");
1992 out($f,"#endif\n");
1993 out($f,"#define USE_OPLINE\n");
1994 out($f,"#define LOAD_OPLINE() opline = EX(opline)\n");
1995 out($f,"#define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n");
1996 out($f,"#define SAVE_OPLINE() EX(opline) = opline\n");
1997 out($f,"#undef HANDLE_EXCEPTION\n");
1998 out($f,"#undef HANDLE_EXCEPTION_LEAVE\n");
2000 out($f,"#define HANDLE_EXCEPTION() goto ZEND_HANDLE_EXCEPTION_SPEC_LABEL\n");
2001 out($f,"#define HANDLE_EXCEPTION_LEAVE() goto ZEND_HANDLE_EXCEPTION_SPEC_LABEL\n");
2003 out($f,"#define HANDLE_EXCEPTION() goto ZEND_HANDLE_EXCEPTION_LABEL\n");
2004 out($f,"#define HANDLE_EXCEPTION_LEAVE() goto ZEND_HANDLE_EXCEPTION_LABEL\n");
2006 out($f,"#define ZEND_VM_CONTINUE() goto *(void**)(OPLINE->handler)\n");
2007 out($f,"#define ZEND_VM_RETURN() return\n");
2008 out($f,"#define ZEND_VM_ENTER_EX() ZEND_VM_INTERRUPT_CHECK(); ZEND_VM_CONTINUE()\n");
2009out($f,"#define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE(); ZEND_VM…
2010 out($f,"#define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n");
2011out($f,"#define ZEND_VM_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
2012out($f,"#define ZEND_VM_LOOP_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
2013out($f,"#define ZEND_VM_DISPATCH(opcode, opline) goto *(void**)(zend_vm_get_opcode_handler(opcode,…
2014 out($f,"\n");
2019 out($f,"\n");
2020 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2021 out($f,"# undef ZEND_VM_TAIL_CALL\n");
2022 out($f,"# undef ZEND_VM_CONTINUE\n");
2023 out($f,"# undef ZEND_VM_RETURN\n");
2025 out($f,"\n");
2026 out($f,"# define ZEND_VM_TAIL_CALL(call) call; ZEND_VM_CONTINUE()\n");
2027 out($f,"# define ZEND_VM_CONTINUE() HYBRID_NEXT()\n");
2028 out($f,"# define ZEND_VM_RETURN() goto HYBRID_HALT_LABEL\n");
2030 out($f,"#endif\n\n");
2034 out($f, $m[1].$executor_name.$m[3]."\n");
2039 out($f,$m[1]."const void *dispatch_handler;\n");
2043 out($f,$m[1].$param.";\n");
2045 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2046out($f,$m[1]."register zend_execute_data *execute_data __asm__(ZEND_VM_FP_GLOBAL_REG) = ex;\n");
2047 out($f,"#else\n");
2048 out($f,$m[1]."zend_execute_data *execute_data = ex;\n");
2049 out($f,"#endif\n");
2051 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2052 out($f,$m[1]."const zend_op *orig_opline = opline;\n");
2053 out($f,"#endif\n");
2054 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2055 out($f,$m[1]."zend_execute_data *orig_execute_data = execute_data;\n");
2056 out($f,$m[1]."execute_data = ex;\n");
2057 out($f,"#else\n");
2058 out($f,$m[1]."zend_execute_data *execute_data = ex;\n");
2059 out($f,"#endif\n");
2067 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2070 out($f,$prolog."if (UNEXPECTED(execute_data == NULL)) {\n");
2071 out($f,$prolog."\tstatic const void * const labels[] = {\n");
2073 out($f,$prolog."\t};\n");
2074 out($f,$prolog."\tzend_opcode_handlers = (const void **) labels;\n");
2075 out($f,$prolog."\tzend_handlers_count = sizeof(labels) / sizeof(void*);\n");
2077 out($f,$prolog."\tmemset(&hybrid_halt_op, 0, sizeof(hybrid_halt_op));\n");
2078 out($f,$prolog."\thybrid_halt_op.handler = (void*)&&HYBRID_HALT_LABEL;\n");
2079 out($f,$prolog."\tgoto HYBRID_HALT_LABEL;\n");
2081 out($f,$prolog."\treturn;\n");
2083 out($f,$prolog."}\n");
2085 out($f,"#endif\n");
2094 out($f,"#if !defined(ZEND_VM_FP_GLOBAL_REG) || !defined(ZEND_VM_IP_GLOBAL_REG)\n");
2095 out($f,$m[1]."\tint ret;".$m[3]."\n");
2096 out($f,"#endif\n");
2099 out($f,"zend_vm_continue:".$m[3]."\n");
2108out($f, $m[1]."dispatch_handler = OPLINE->handler;\nzend_vm_dispatch:\n".$m[1]."switch ((int)(uint…
2111 out($f, $m[1]."goto *(void**)(OPLINE->handler);".$m[3]."\n");
2114 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2115 out($f, $m[1]."HYBRID_SWITCH()".$m[3]."\n");
2116 out($f,"#else\n");
2118 out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
2119 out($f, $m[1]."((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2120 out($f, $m[1]."if (UNEXPECTED(!OPLINE))".$m[3]."\n");
2121 out($f,"#else\n");
2122out($f, $m[1]."if (UNEXPECTED((ret = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_…
2123 out($f,"#endif\n");
2125 out($f,"#endif\n");
2134 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2141 out($f,"#else\n");
2143 out($f,
2162 out($f,"#endif\n");
2172 out($f, $m[1].$initializer_name.$m[3]."\n");
2180 out($f,$prolog."static const uint32_t specs[] = {\n");
2182 out($f,$prolog."};\n");
2183 out($f,$prolog."zend_spec_handlers = specs;\n");
2184 out($f,$prolog.$executor_name."_ex(NULL);\n");
2186 out($f,$prolog."static const void * const labels[] = {\n");
2188 out($f,$prolog."};\n");
2189 out($f,$prolog."static const uint32_t specs[] = {\n");
2191 out($f,$prolog."};\n");
2193 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2194 out($f,$prolog."zend_opcode_handler_funcs = labels;\n");
2195 out($f,$prolog."zend_spec_handlers = specs;\n");
2196 out($f,$prolog.$executor_name."_ex(NULL);\n");
2197 out($f,"#else\n");
2199 out($f,$prolog."zend_opcode_handlers = labels;\n");
2200 out($f,$prolog."zend_handlers_count = sizeof(labels) / sizeof(void*);\n");
2201 out($f,$prolog."zend_spec_handlers = specs;\n");
2203 out($f,"#endif\n");
2212 out($f, $line);
2548 out($f, HEADER_TEXT);
2598 out($f, HEADER_TEXT);
2637 out($f, HEADER_TEXT);
2639 out($f, "#ifdef ZEND_WIN32\n");
2641 out($f, "# pragma warning(disable : 4101)\n");
2644 out($f, "# pragma warning(once : 6235)\n");
2646 out($f, "# pragma warning(once : 6237)\n");
2648 out($f, "# pragma warning(once : 6239)\n");
2650 out($f, "# pragma warning(once : 6240)\n");
2652 out($f, "# pragma warning(once : 6285)\n");
2654 out($f, "# pragma warning(once : 6286)\n");
2656 out($f, "# pragma warning(once : 6326)\n");
2658 out($f, "#endif\n");
2661 out($f, "static user_opcode_handler_t zend_user_opcode_handlers[256] = {\n");
2663 out($f, "\t(user_opcode_handler_t)NULL,\n");
2665 out($f, "\t(user_opcode_handler_t)NULL\n};\n\n");
2667 out($f, "static zend_uchar zend_user_opcodes[256] = {");
2669 if ($i % 16 == 1) out($f, "\n\t");
2670 out($f, "$i,");
2672 out($f, "255\n};\n\n");
2676 out($f, "\n");
2679out($f, "static const void* ZEND_FASTCALL zend_vm_get_opcode_handler_ex(uint32_t spec, const zend_…
2680 out($f, "{\n");
2682 out($f, "\treturn zend_opcode_handlers[spec];\n");
2684 out($f, "\tstatic const int zend_vm_decode[] = {\n");
2685 out($f, "\t\t_UNUSED_CODE, /* 0 = IS_UNUSED */\n");
2686 out($f, "\t\t_CONST_CODE, /* 1 = IS_CONST */\n");
2687 out($f, "\t\t_TMP_CODE, /* 2 = IS_TMP_VAR */\n");
2688 out($f, "\t\t_UNUSED_CODE, /* 3 */\n");
2689 out($f, "\t\t_VAR_CODE, /* 4 = IS_VAR */\n");
2690 out($f, "\t\t_UNUSED_CODE, /* 5 */\n");
2691 out($f, "\t\t_UNUSED_CODE, /* 6 */\n");
2692 out($f, "\t\t_UNUSED_CODE, /* 7 */\n");
2693 out($f, "\t\t_CV_CODE /* 8 = IS_CV */\n");
2694 out($f, "\t};\n");
2695 out($f, "\tuint32_t offset = 0;\n");
2696 out($f, "\tif (spec & SPEC_RULE_OP1) offset = offset * 5 + zend_vm_decode[op->op1_type];\n");
2697 out($f, "\tif (spec & SPEC_RULE_OP2) offset = offset * 5 + zend_vm_decode[op->op2_type];\n");
2707 out($f, "\tif (spec & SPEC_EXTRA_MASK) {\n");
2710out($f, "\t\t{$else}if (spec & SPEC_RULE_OP_DATA) offset = offset * 5 + zend_vm_decode[(op + 1)->o…
2714out($f, "\t\t{$else}if (spec & SPEC_RULE_RETVAL) offset = offset * 2 + (op->result_type != IS_UNUS…
2718out($f, "\t\t{$else}if (spec & SPEC_RULE_QUICK_ARG) offset = offset * 2 + (op->op2.num <= MAX_ARG_…
2722 out($f, "\t\t{$else}if (spec & SPEC_RULE_SMART_BRANCH) {\n");
2723 out($f, "\t\t\toffset = offset * 3;\n");
2724 out($f, "\t\t\tif ((op+1)->opcode == ZEND_JMPZ) {\n");
2725 out($f, "\t\t\t\toffset += 1;\n");
2726 out($f, "\t\t\t} else if ((op+1)->opcode == ZEND_JMPNZ) {\n");
2727 out($f, "\t\t\t\toffset += 2;\n");
2728 out($f, "\t\t\t}\n");
2729 out($f, "\t\t}\n");
2733 out($f, "\t\t{$else}if (spec & SPEC_RULE_DIM_OBJ) {\n");
2734 out($f, "\t\t\toffset = offset * 3;\n");
2735 out($f, "\t\t\tif (op->extended_value == ZEND_ASSIGN_DIM) {\n");
2736 out($f, "\t\t\t\toffset += 1;\n");
2737 out($f, "\t\t\t} else if (op->extended_value == ZEND_ASSIGN_OBJ) {\n");
2738 out($f, "\t\t\t\toffset += 2;\n");
2739 out($f, "\t\t\t}\n");
2740 out($f, "\t\t}\n");
2744out($f, "\t\t{$else}if (spec & SPEC_RULE_ISSET) offset = offset * 2 + (op->extended_value & ZEND_I…
2747 out($f, "\t}\n");
2749 out($f, "\treturn zend_opcode_handlers[(spec & SPEC_START_MASK) + offset];\n");
2751 out($f, "}\n\n");
2752 out($f, "#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID) || !ZEND_VM_SPEC\n");
2753 out($f, "static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op)\n");
2754 out($f, "{\n");
2756 out($f, "\treturn zend_vm_get_opcode_handler_ex(opcode, op);\n");
2758 out($f, "\treturn zend_vm_get_opcode_handler_ex(zend_spec_handlers[opcode], op);\n");
2760 out($f, "}\n");
2761 out($f, "#endif\n\n");
2765 out($f, "#if ZEND_VM_KIND == ZEND_VM_KIND_HYBRID\n");
2766out($f,"static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend_op* op)\n…
2767 out($f, "{\n");
2768 out($f, "\tuint32_t spec = zend_spec_handlers[opcode];\n");
2770 out($f, "\treturn zend_opcode_handler_funcs[spec];\n");
2772 out($f, "\tstatic const int zend_vm_decode[] = {\n");
2773 out($f, "\t\t_UNUSED_CODE, /* 0 = IS_UNUSED */\n");
2774 out($f, "\t\t_CONST_CODE, /* 1 = IS_CONST */\n");
2775 out($f, "\t\t_TMP_CODE, /* 2 = IS_TMP_VAR */\n");
2776 out($f, "\t\t_UNUSED_CODE, /* 3 */\n");
2777 out($f, "\t\t_VAR_CODE, /* 4 = IS_VAR */\n");
2778 out($f, "\t\t_UNUSED_CODE, /* 5 */\n");
2779 out($f, "\t\t_UNUSED_CODE, /* 6 */\n");
2780 out($f, "\t\t_UNUSED_CODE, /* 7 */\n");
2781 out($f, "\t\t_CV_CODE /* 8 = IS_CV */\n");
2782 out($f, "\t};\n");
2783 out($f, "\tuint32_t offset = 0;\n");
2784 out($f, "\tif (spec & SPEC_RULE_OP1) offset = offset * 5 + zend_vm_decode[op->op1_type];\n");
2785 out($f, "\tif (spec & SPEC_RULE_OP2) offset = offset * 5 + zend_vm_decode[op->op2_type];\n");
2795 out($f, "\tif (spec & SPEC_EXTRA_MASK) {\n");
2798out($f, "\t\t{$else}if (spec & SPEC_RULE_OP_DATA) offset = offset * 5 + zend_vm_decode[(op + 1)->o…
2802out($f, "\t\t{$else}if (spec & SPEC_RULE_RETVAL) offset = offset * 2 + (op->result_type != IS_UNUS…
2806out($f, "\t\t{$else}if (spec & SPEC_RULE_QUICK_ARG) offset = offset * 2 + (op->op2.num <= MAX_ARG_…
2810 out($f, "\t\t{$else}if (spec & SPEC_RULE_SMART_BRANCH) {\n");
2811 out($f, "\t\t\toffset = offset * 3;\n");
2812 out($f, "\t\t\tif ((op+1)->opcode == ZEND_JMPZ) {\n");
2813 out($f, "\t\t\t\toffset += 1;\n");
2814 out($f, "\t\t\t} else if ((op+1)->opcode == ZEND_JMPNZ) {\n");
2815 out($f, "\t\t\t\toffset += 2;\n");
2816 out($f, "\t\t\t}\n");
2817 out($f, "\t\t}\n");
2821 out($f, "\t\t{$else}if (spec & SPEC_RULE_DIM_OBJ) {\n");
2822 out($f, "\t\t\toffset = offset * 3;\n");
2823 out($f, "\t\t\tif (op->extended_value == ZEND_ASSIGN_DIM) {\n");
2824 out($f, "\t\t\t\toffset += 1;\n");
2825 out($f, "\t\t\t} else if (op->extended_value == ZEND_ASSIGN_OBJ) {\n");
2826 out($f, "\t\t\t\toffset += 2;\n");
2827 out($f, "\t\t\t}\n");
2828 out($f, "\t\t}\n");
2832out($f, "\t\t{$else}if (spec & SPEC_RULE_ISSET) offset = offset * 2 + (op->extended_value & ZEND_I…
2835 out($f, "\t}\n");
2838 out($f, "\treturn zend_opcode_handler_funcs[(spec & SPEC_START_MASK) + offset];\n");
2840 out($f, "}\n\n");
2841 out($f, "#endif\n\n");
2845 out($f, "ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler(zend_op* op)\n");
2846 out($f, "{\n");
2847 out($f, "\tzend_uchar opcode = zend_user_opcodes[op->opcode];\n");
2849 out($f, "\top->handler = zend_vm_get_opcode_handler(opcode, op);\n");
2851 out($f, "\n");
2852 out($f, "\tif (zend_spec_handlers[op->opcode] & SPEC_RULE_COMMUTATIVE) {\n");
2853 out($f, "\t\tif (op->op1_type < op->op2_type) {\n");
2854 out($f, "\t\t\tzend_swap_operands(op);\n");
2855 out($f, "\t\t}\n");
2856 out($f, "\t}\n");
2857 out($f, "\top->handler = zend_vm_get_opcode_handler_ex(zend_spec_handlers[opcode], op);\n");
2859 out($f, "}\n\n");
2862out($f, "ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t op1_info,…
2863 out($f, "{\n");
2864 out($f, "\tzend_uchar opcode = zend_user_opcodes[op->opcode];\n");
2866 out($f, "\top->handler = zend_vm_get_opcode_handler_ex(opcode, op);\n");
2868 out($f, "\tuint32_t spec = zend_spec_handlers[opcode];\n");
2870 out($f, "\tswitch (opcode) {\n");
2874 out($f, "\t\tcase $orig_op:\n");
2876 out($f, "\t\t\tif (op->op1_type < op->op2_type) {\n");
2877 out($f, "\t\t\t\tzend_swap_operands(op);\n");
2878 out($f, "\t\t\t}\n");
2884 out($f, "\t\t\tif $condition {\n");
2887 out($f, "\t\t\t} else if $condition {\n");
2891 out($f, "\t\t\t\tif (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {\n");
2892 out($f, "\t\t\t\t\tbreak;\n");
2893 out($f, "\t\t\t\t}\n");
2895 out($f, "\t\t\t\tspec = ${spec_dsc['spec_code']};\n");
2897 out($f, "\t\t\t\tif (op->op1_type < op->op2_type) {\n");
2898 out($f, "\t\t\t\t\tzend_swap_operands(op);\n");
2899 out($f, "\t\t\t\t}\n");
2903 out($f, "\t\t\t}\n");
2905 out($f, "\t\t\tbreak;\n");
2914 out($f, "\t\tcase $orig_op:\n");
2919 out($f, "\t\t\tif (op->op1_type < op->op2_type) {\n");
2920 out($f, "\t\t\t\tzend_swap_operands(op);\n");
2921 out($f, "\t\t\t}\n");
2922 out($f, "\t\t\tbreak;\n");
2923 out($f, "\t\tcase ZEND_USER_OPCODE:\n");
2924 out($f, "\t\t\tif (zend_spec_handlers[op->opcode] & SPEC_RULE_COMMUTATIVE) {\n");
2925 out($f, "\t\t\t\tif (op->op1_type < op->op2_type) {\n");
2926 out($f, "\t\t\t\t\tzend_swap_operands(op);\n");
2927 out($f, "\t\t\t\t}\n");
2928 out($f, "\t\t\t}\n");
2929 out($f, "\t\t\tbreak;\n");
2931 out($f, "\t\tdefault:\n");
2932 out($f, "\t\t\tbreak;\n");
2933 out($f, "\t}\n");
2935 out($f, "\top->handler = zend_vm_get_opcode_handler_ex(spec, op);\n");
2937 out($f, "}\n\n");
2941 out($f, "ZEND_API int ZEND_FASTCALL zend_vm_call_opcode_handler(zend_execute_data* ex)\n");
2942 out($f, "{\n");
2944 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2945 out($f, "\topcode_handler_t handler;\n");
2946 out($f,"#endif\n");
2948 out($f, "\tint ret;\n");
2949 out($f, "#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2950 out($f, "\tconst zend_op *orig_opline = opline;\n");
2951 out($f, "#endif\n");
2952 out($f, "#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2953 out($f, "\tzend_execute_data *orig_execute_data = execute_data;\n");
2954 out($f, "\texecute_data = ex;\n");
2955 out($f, "#else\n");
2956 out($f, "\tzend_execute_data *execute_data = ex;\n");
2957 out($f, "#endif\n");
2958 out($f, "\n");
2959 out($f, "\tLOAD_OPLINE();\n");
2960 out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
2962 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2963out($f, "\thandler = (opcode_handler_t)zend_vm_get_opcode_handler_func(zend_user_opcodes[opline->o…
2964 out($f, "\thandler(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2965 out($f, "\tif (EXPECTED(opline != &hybrid_halt_op)) {\n");
2966 out($f,"#else\n");
2968 out($f, "\t((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2970 out($f, "\tif (EXPECTED(opline)) {\n");
2971 out($f,"#endif\n");
2973 out($f, "\tif (EXPECTED(opline)) {\n");
2975 out($f, "\t\tret = execute_data != ex ? (int)(execute_data->prev_execute_data != ex) + 1 : 0;\n");
2976 out($f, "\t\tSAVE_OPLINE();\n");
2977 out($f, "\t} else {\n");
2978 out($f, "\t\tret = -1;\n");
2979 out($f, "\t}\n");
2980 out($f, "#else\n");
2981 out($f, "\tret = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2982 out($f, "\tSAVE_OPLINE();\n");
2983 out($f, "#endif\n");
2984 out($f, "#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2985 out($f, "\texecute_data = orig_execute_data;\n");
2986 out($f, "#endif\n");
2987 out($f, "#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2988 out($f, "\topline = orig_opline;\n");
2989 out($f, "#endif\n");
2990 out($f, "\treturn ret;\n");
2991 out($f, "}\n\n");
2993 out($f, "ZEND_API int ZEND_FASTCALL zend_vm_call_opcode_handler(zend_execute_data* ex)\n");
2994 out($f, "{\n");
2995out($f, "\tzend_error_noreturn(E_CORE_ERROR, \"zend_vm_call_opcode_handler() is not supported\");\…
2996 out($f, "\treturn 0;\n");
2997 out($f, "}\n\n");
3003 out($f,"#undef OPLINE\n");
3004 out($f,"#undef DCL_OPLINE\n");
3005 out($f,"#undef USE_OPLINE\n");
3006 out($f,"#undef LOAD_OPLINE\n");
3007 out($f,"#undef LOAD_NEXT_OPLINE\n");
3008 out($f,"#undef SAVE_OPLINE\n");
3009 out($f,"#define OPLINE EX(opline)\n");
3010 out($f,"#define DCL_OPLINE\n");
3011 out($f,"#define USE_OPLINE const zend_op *opline = EX(opline);\n");
3012 out($f,"#define LOAD_OPLINE()\n");
3013 out($f,"#define LOAD_NEXT_OPLINE() ZEND_VM_INC_OPCODE()\n");
3014 out($f,"#define SAVE_OPLINE()\n");
3015 out($f,"#undef HANDLE_EXCEPTION\n");
3016 out($f,"#undef HANDLE_EXCEPTION_LEAVE\n");
3017 out($f,"#define HANDLE_EXCEPTION() LOAD_OPLINE(); ZEND_VM_CONTINUE()\n");
3018 out($f,"#define HANDLE_EXCEPTION_LEAVE() LOAD_OPLINE(); ZEND_VM_LEAVE()\n");
3019 out($f,"#undef ZEND_VM_CONTINUE\n");
3020 out($f,"#undef ZEND_VM_RETURN\n");
3021 out($f,"#undef ZEND_VM_ENTER_EX\n");
3022 out($f,"#undef ZEND_VM_ENTER\n");
3023 out($f,"#undef ZEND_VM_LEAVE\n");
3024 out($f,"#undef ZEND_VM_DISPATCH\n");
3025 out($f,"#define ZEND_VM_CONTINUE() return 0\n");
3026 out($f,"#define ZEND_VM_RETURN() return -1\n");
3027 out($f,"#define ZEND_VM_ENTER_EX() return 1\n");
3028 out($f,"#define ZEND_VM_ENTER() return 1\n");
3029 out($f,"#define ZEND_VM_LEAVE() return 2\n");
3030out($f,"#define ZEND_VM_INTERRUPT() return zend_interrupt_helper(ZEND_OPCODE_HANDLER_ARGS_PASSTHR…
3031out($f,"#define ZEND_VM_DISPATCH(opcode, opline) return zend_vm_get_opcode_handler(opcode, opline)…
3032 out($f,"\n");
3036 out($f, "ZEND_API int $func(");
3038 out($f, "ZEND_OPCODE_HANDLER_ARGS)\n");
3043 out($f, "ZEND_OPCODE_HANDLER_ARGS)\n");
3045 out($f, $h['param']. " ZEND_OPCODE_HANDLER_ARGS_DC)\n");
3054out($f, "{\n\treturn ".$name.(ZEND_VM_SPEC?"_SPEC":"")."_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU…
3060out($f, "{\n\treturn ".$name.(ZEND_VM_SPEC?"_SPEC":"")."(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n}\n\…