Lines Matching refs:out
584 function out($f, $s) { function
955 out($f, $code);
1082 out($f, "#line $lineno \"$definition_file\"\n");
1091 $out = fopen('php://memory', 'w+');
1092 gen_code($out, $spec, $kind, $code, $op1, $op2, $name, $extra_spec);
1093 rewind($out);
1097 . stream_get_contents($out);
1098 fclose($out);
1113 out($f, $code);
1119 …out($f,"static zend_always_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_INLINE_HANDLE…
1122 …out($f,"static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE_…
1125 …out($f,"static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE…
1127 …out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE_HANDLER_ARGS…
1133 out($f,"case $cur: /* $spec_name */");
1136 out($f,"case ".$name.":");
1140 out($f," {$spec_name}_LABEL: ZEND_ATTRIBUTE_UNUSED_LABEL\n");
1142 out($f,"\n");
1146 out($f,"{$spec_name}_LABEL: ZEND_VM_GUARD($spec_name);\n");
1154 …out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE_HANDLER_ARGS…
1155 out($f,"{\n");
1156 … out($f,"\tZEND_VM_TAIL_CALL({$spec_name}_INLINE_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));\n");
1157 out($f,"}\n");
1158 out($f,"\n");
1175 out($f, "#line $lineno \"$definition_file\"\n");
1183 out($f, $spec_name . "_LABEL:\n");
1199 …out($f, "static$zend_attributes ZEND_OPCODE_HANDLER_RET$zend_fastcall $spec_name(ZEND_OPCODE_HANDL…
1202 …out($f, "static$zend_attributes ZEND_OPCODE_HANDLER_RET$zend_fastcall $spec_name($param ZEND_OPCOD…
1206 out($f, "$spec_name:\n");
1209 out($f, "$spec_name:\n");
1221 out($f,$prolog."ZEND_NULL_HANDLER,\n");
1224 out($f,$prolog."(void*)(uintptr_t)-1,\n");
1227 out($f,$prolog."(void*)&&ZEND_NULL_LABEL,\n");
1423 out($f,"$prolog{$spec_name}_HANDLER,\n");
1426 out($f,$prolog."(void*)(uintptr_t)$switch_labels[$spec_name],\n");
1429 out($f,$prolog."(void*)&&{$spec_name}_LABEL,\n");
1471 out($f,$prolog."ZEND_NULL_HANDLER,\n");
1474 out($f,$prolog."(void*)(uintptr_t)-1,\n");
1477 out($f,$prolog."(void*)&&ZEND_NULL_LABEL,\n");
1491 out($f,$prolog.$dsc['alias']."_HANDLER,\n");
1494 out($f,$prolog."(void*)&&".$dsc['alias']."_LABEL,\n");
1502 out($f,$prolog.$dsc["op"]."_HANDLER,\n");
1505 out($f,$prolog."(void*)(uintptr_t)".((string)$num).",\n");
1508 out($f,$prolog."(void*)&&".$dsc["op"]."_LABEL,\n");
1515 out($f,$prolog."ZEND_NULL_HANDLER,\n");
1518 out($f,$prolog."(void*)(uintptr_t)-1,\n");
1521 out($f,$prolog."(void*)&&ZEND_NULL_LABEL,\n");
1532 out($f,$prolog."ZEND_NULL_HANDLER\n");
1535 out($f,$prolog."(void*)(uintptr_t)-1\n");
1538 out($f,$prolog."(void*)&&ZEND_NULL_LABEL\n");
1544 out($l, "#define VM_HANDLERS(_) \\\n");
1547 out($l, "\t_($n, $name) \\\n");
1550 out($l, "\t_($n+1, ZEND_NULL)\n");
1560 out($f, "$prolog$lastdef,\n");
1563 out($f, "$prolog$def,\n");
1565 out($f, "$prolog$lastdef\n");
1576 …out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS)\n…
1577 out($f,"{\n");
1578 out($f,"\tUSE_OPLINE\n");
1579 out($f,"\n");
1580 out($f,"\tSAVE_OPLINE();\n");
1581 …out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", OPLINE->opcode, OPLINE->op1_t…
1582 out($f,"\tZEND_VM_NEXT_OPCODE(); /* Never reached */\n");
1583 out($f,"}\n\n");
1769 out($f, $txt);
1785 out($f,"default: ZEND_NULL_LABEL:\n");
1786 …out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", OPLINE->opcode, OPLINE->op1_t…
1787 out($f,"\tZEND_VM_NEXT_OPCODE(); /* Never reached */\n");
1790 out($f,"ZEND_NULL_LABEL:\n");
1791 …out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", OPLINE->opcode, OPLINE->op1_t…
1792 out($f,"\tZEND_VM_NEXT_OPCODE(); /* Never reached */\n");
1795 out($f,"\t\t\tHYBRID_CASE(HYBRID_HALT):\n");
1796 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
1797 out($f,"\t\t\t\texecute_data = vm_stack_data.orig_execute_data;\n");
1798 out($f,"#endif\n");
1799 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
1800 out($f,"\t\t\t\topline = vm_stack_data.orig_opline;\n");
1801 out($f,"#endif\n");
1802 out($f,"\t\t\t\treturn;\n");
1803 out($f,"\t\t\tHYBRID_DEFAULT:\n");
1804 out($f,"\t\t\t\tVM_TRACE(ZEND_NULL)\n");
1805 out($f,"\t\t\t\tZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
1806 out($f,"\t\t\t\tHYBRID_BREAK(); /* Never reached */\n");
1813 out($f, $prolog.$epilog);
1835 out($f,"#define SPEC_START_MASK 0x0000ffff\n");
1836 out($f,"#define SPEC_EXTRA_MASK 0xfffc0000\n");
1837 out($f,"#define SPEC_RULE_OP1 0x00010000\n");
1838 out($f,"#define SPEC_RULE_OP2 0x00020000\n");
1839 out($f,"#define SPEC_RULE_OP_DATA 0x00040000\n");
1840 out($f,"#define SPEC_RULE_RETVAL 0x00080000\n");
1841 out($f,"#define SPEC_RULE_QUICK_ARG 0x00100000\n");
1842 out($f,"#define SPEC_RULE_SMART_BRANCH 0x00200000\n");
1843 out($f,"#define SPEC_RULE_COMMUTATIVE 0x00800000\n");
1844 out($f,"#define SPEC_RULE_ISSET 0x01000000\n");
1845 out($f,"#define SPEC_RULE_OBSERVER 0x02000000\n");
1846 out($f,"\n");
1847 out($f,"static const uint32_t *zend_spec_handlers;\n");
1848 out($f,"static const void * const *zend_opcode_handlers;\n");
1849 out($f,"static int zend_handlers_count;\n");
1851 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1852 out($f,"static const void * const * zend_opcode_handler_funcs;\n");
1853 out($f,"static zend_op hybrid_halt_op;\n");
1854 out($f,"#endif\n");
1856 out($f,"#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID) || !ZEND_VM_SPEC\n");
1857 … out($f,"static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op);\n");
1858 out($f,"#endif\n\n");
1860 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1861 …out($f,"static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend_op* op);\…
1862 out($f,"#else\n");
1863 … out($f,"# define zend_vm_get_opcode_handler_func zend_vm_get_opcode_handler\n");
1864 out($f,"#endif\n\n");
1866 out($f,"#ifndef VM_TRACE\n");
1868 out($f,"# define VM_TRACE(op) ZEND_VM_GUARD(op);\n");
1870 out($f,"# define VM_TRACE(op)\n");
1872 out($f,"#endif\n");
1873 out($f,"#ifndef VM_TRACE_START\n");
1874 out($f,"# define VM_TRACE_START()\n");
1875 out($f,"#endif\n");
1876 out($f,"#ifndef VM_TRACE_END\n");
1877 out($f,"# define VM_TRACE_END()\n");
1878 out($f,"#endif\n");
1881 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1882 out($f,"#define HYBRID_NEXT() goto *(void**)(OPLINE->handler)\n");
1883 out($f,"#define HYBRID_SWITCH() HYBRID_NEXT();\n");
1884 out($f,"#define HYBRID_CASE(op) op ## _LABEL\n");
1885 out($f,"#define HYBRID_BREAK() HYBRID_NEXT()\n");
1886 out($f,"#define HYBRID_DEFAULT ZEND_NULL_LABEL\n");
1887 out($f,"#endif\n");
1889 out($f,"\n");
1890 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
1891 out($f,"# define ZEND_OPCODE_HANDLER_ARGS void\n");
1892 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU\n");
1893 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_DC\n");
1894 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC\n");
1895 out($f,"#else\n");
1896 … out($f,"# define ZEND_OPCODE_HANDLER_ARGS zend_execute_data *execute_data\n");
1897 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU execute_data\n");
1898 … out($f,"# define ZEND_OPCODE_HANDLER_ARGS_DC , ZEND_OPCODE_HANDLER_ARGS\n");
1899 … out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC , ZEND_OPCODE_HANDLER_ARGS_PASSTHRU\n");
1900 out($f,"#endif\n");
1901 out($f,"\n");
1902 … out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
1903 out($f,"# define ZEND_OPCODE_HANDLER_RET void\n");
1904 out($f,"# define ZEND_VM_TAIL_CALL(call) call; return\n");
1905 out($f,"# ifdef ZEND_VM_TAIL_CALL_DISPATCH\n");
1906 …out($f,"# define ZEND_VM_CONTINUE() ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_A…
1907 out($f,"# else\n");
1908 out($f,"# define ZEND_VM_CONTINUE() return\n");
1909 out($f,"# endif\n");
1911 out($f,"# if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1912 … out($f,"# define ZEND_VM_RETURN() opline = &hybrid_halt_op; return\n");
1913 … out($f,"# define ZEND_VM_HOT zend_always_inline ZEND_COLD ZEND_OPT_SIZE\n");
1914 … out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
1915 out($f,"# else\n");
1916 out($f,"# define ZEND_VM_RETURN() opline = NULL; return\n");
1917 out($f,"# define ZEND_VM_HOT\n");
1918 … out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
1919 out($f,"# endif\n");
1921 out($f,"# define ZEND_VM_RETURN() opline = NULL; return\n");
1922 … out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
1924 out($f,"#else\n");
1925 out($f,"# define ZEND_OPCODE_HANDLER_RET int\n");
1926 out($f,"# define ZEND_VM_TAIL_CALL(call) return call\n");
1927 out($f,"# define ZEND_VM_CONTINUE() return 0\n");
1928 out($f,"# define ZEND_VM_RETURN() return -1\n");
1930 out($f,"# define ZEND_VM_HOT\n");
1932 out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
1933 out($f,"#endif\n");
1934 out($f,"\n");
1935 …out($f,"typedef ZEND_OPCODE_HANDLER_RET (ZEND_FASTCALL *opcode_handler_t) (ZEND_OPCODE_HANDLER_ARG…
1936 out($f,"\n");
1937 out($f,"#define DCL_OPLINE\n");
1938 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
1939 out($f,"# define OPLINE opline\n");
1940 out($f,"# define USE_OPLINE\n");
1941 out($f,"# define LOAD_OPLINE() opline = EX(opline)\n");
1942 out($f,"# define LOAD_OPLINE_EX()\n");
1943 out($f,"# define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n");
1944 out($f,"# define SAVE_OPLINE() EX(opline) = opline\n");
1945 out($f,"# define SAVE_OPLINE_EX() SAVE_OPLINE()\n");
1946 out($f,"#else\n");
1947 out($f,"# define OPLINE EX(opline)\n");
1948 out($f,"# define USE_OPLINE const zend_op *opline = EX(opline);\n");
1949 out($f,"# define LOAD_OPLINE()\n");
1950 out($f,"# define LOAD_OPLINE_EX()\n");
1951 out($f,"# define LOAD_NEXT_OPLINE() ZEND_VM_INC_OPCODE()\n");
1952 out($f,"# define SAVE_OPLINE()\n");
1953 out($f,"# define SAVE_OPLINE_EX()\n");
1954 out($f,"#endif\n");
1955 …out($f,"#define HANDLE_EXCEPTION() ZEND_ASSERT(EG(exception)); LOAD_OPLINE(); ZEND_VM_CONTINUE()\n…
1956 …out($f,"#define HANDLE_EXCEPTION_LEAVE() ZEND_ASSERT(EG(exception)); LOAD_OPLINE(); ZEND_VM_LEAVE(…
1957 out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG)\n");
1958 … out($f,"# define ZEND_VM_ENTER_EX() ZEND_VM_INTERRUPT_CHECK(); ZEND_VM_CONTINUE()\n");
1959 …out($f,"# define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE();…
1960 out($f,"# define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n");
1961 out($f,"#elif defined(ZEND_VM_IP_GLOBAL_REG)\n");
1962 out($f,"# define ZEND_VM_ENTER_EX() return 1\n");
1963 …out($f,"# define ZEND_VM_ENTER() opline = EG(current_execute_data)->opline; ZEND_VM_ENTE…
1964 out($f,"# define ZEND_VM_LEAVE() return 2\n");
1965 out($f,"#else\n");
1966 out($f,"# define ZEND_VM_ENTER_EX() return 1\n");
1967 out($f,"# define ZEND_VM_ENTER() return 1\n");
1968 out($f,"# define ZEND_VM_LEAVE() return 2\n");
1969 out($f,"#endif\n");
1970 …out($f,"#define ZEND_VM_INTERRUPT() ZEND_VM_TAIL_CALL(zend_interrupt_helper".($spec?"_SPEC":"…
1971 …out($f,"#define ZEND_VM_LOOP_INTERRUPT() zend_interrupt_helper".($spec?"_SPEC":"")."(ZEND_OPCODE_H…
1973 …out($f,"#define ZEND_VM_DISPATCH(opcode, opline) ZEND_VM_TAIL_CALL(((opcode_handler_t)zend_vm_get_…
1975 …out($f,"#define ZEND_VM_DISPATCH(opcode, opline) ZEND_VM_TAIL_CALL(((opcode_handler_t)zend_vm_get_…
1977 out($f,"\n");
1978 …out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_interrupt_helper".($spec?"_SPEC":"")."(Z…
1979 …out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS);\…
1980 out($f,"\n");
1983 out($f,"\n");
1984 out($f,"#define OPLINE opline\n");
1985 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
1986 … out($f,"# define DCL_OPLINE register const zend_op *opline __asm__(ZEND_VM_IP_GLOBAL_REG);\n");
1987 out($f,"#else\n");
1988 out($f,"# define DCL_OPLINE const zend_op *opline;\n");
1989 out($f,"#endif\n");
1990 out($f,"#define USE_OPLINE\n");
1991 out($f,"#define LOAD_OPLINE() opline = EX(opline)\n");
1992 out($f,"# define LOAD_OPLINE_EX() LOAD_OPLINE()\n");
1993 out($f,"#define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n");
1994 out($f,"#define SAVE_OPLINE() EX(opline) = opline\n");
1995 out($f,"#define SAVE_OPLINE_EX()\n");
1996 …out($f,"#define HANDLE_EXCEPTION() ZEND_ASSERT(EG(exception)); LOAD_OPLINE(); ZEND_VM_CONTINUE()\n…
1997 …out($f,"#define HANDLE_EXCEPTION_LEAVE() ZEND_ASSERT(EG(exception)); LOAD_OPLINE(); ZEND_VM_LEAVE(…
1998 out($f,"#define ZEND_VM_CONTINUE() goto zend_vm_continue\n");
1999 out($f,"#define ZEND_VM_RETURN() return\n");
2000 … out($f,"#define ZEND_VM_ENTER_EX() ZEND_VM_INTERRUPT_CHECK(); ZEND_VM_CONTINUE()\n");
2001 …out($f,"#define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE(); ZEND_VM…
2002 out($f,"#define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n");
2003 …out($f,"#define ZEND_VM_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
2004 …out($f,"#define ZEND_VM_LOOP_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
2005 …out($f,"#define ZEND_VM_DISPATCH(opcode, opline) dispatch_handler = zend_vm_get_opcode_handler(opc…
2006 out($f,"\n");
2009 out($f,"\n");
2010 out($f,"#define OPLINE opline\n");
2011 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2012 … out($f,"# define DCL_OPLINE register const zend_op *opline __asm__(ZEND_VM_IP_GLOBAL_REG);\n");
2013 out($f,"#else\n");
2014 out($f,"# define DCL_OPLINE const zend_op *opline;\n");
2015 out($f,"#endif\n");
2016 out($f,"#define USE_OPLINE\n");
2017 out($f,"#define LOAD_OPLINE() opline = EX(opline)\n");
2018 out($f,"#define LOAD_OPLINE_EX() LOAD_OPLINE()\n");
2019 out($f,"#define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n");
2020 out($f,"#define SAVE_OPLINE() EX(opline) = opline\n");
2021 out($f,"#define SAVE_OPLINE_EX()\n");
2023 …out($f,"#define HANDLE_EXCEPTION() ZEND_ASSERT(EG(exception)); goto ZEND_HANDLE_EXCEPTION_SPEC_LAB…
2024 …out($f,"#define HANDLE_EXCEPTION_LEAVE() ZEND_ASSERT(EG(exception)); goto ZEND_HANDLE_EXCEPTION_SP…
2026 …out($f,"#define HANDLE_EXCEPTION() ZEND_ASSERT(EG(exception)); goto ZEND_HANDLE_EXCEPTION_LABEL\n"…
2027 …out($f,"#define HANDLE_EXCEPTION_LEAVE() ZEND_ASSERT(EG(exception)); goto ZEND_HANDLE_EXCEPTION_LA…
2029 out($f,"#define ZEND_VM_CONTINUE() goto *(void**)(OPLINE->handler)\n");
2030 out($f,"#define ZEND_VM_RETURN() return\n");
2031 … out($f,"#define ZEND_VM_ENTER_EX() ZEND_VM_INTERRUPT_CHECK(); ZEND_VM_CONTINUE()\n");
2032 …out($f,"#define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE(); ZEND_VM…
2033 out($f,"#define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n");
2034 …out($f,"#define ZEND_VM_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
2035 …out($f,"#define ZEND_VM_LOOP_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
2036 …out($f,"#define ZEND_VM_DISPATCH(opcode, opline) goto *(void**)(zend_vm_get_opcode_handler(opcode,…
2037 out($f,"\n");
2042 out($f,"\n");
2043 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2044 out($f,"# undef ZEND_VM_TAIL_CALL\n");
2045 out($f,"# undef ZEND_VM_CONTINUE\n");
2046 out($f,"# undef ZEND_VM_RETURN\n");
2048 out($f,"\n");
2049 out($f,"# define ZEND_VM_TAIL_CALL(call) call; ZEND_VM_CONTINUE()\n");
2050 out($f,"# define ZEND_VM_CONTINUE() HYBRID_NEXT()\n");
2051 out($f,"# define ZEND_VM_RETURN() goto HYBRID_HALT_LABEL\n");
2053 out($f,"#endif\n\n");
2057 out($f, $m[1].$executor_name.$m[3]."\n");
2061 out($f,$m[1]."const void *dispatch_handler;\n");
2065 out($f, "#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2069 out($f,$m[1].$param.";\n");
2072 out($f, "#endif\n");
2076 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2077 … out($f,$m[1]."register zend_execute_data *execute_data __asm__(ZEND_VM_FP_GLOBAL_REG) = ex;\n");
2078 out($f,"#else\n");
2079 out($f,$m[1]."zend_execute_data *execute_data = ex;\n");
2080 out($f,"#endif\n");
2082 … out($f,"#if defined(ZEND_VM_IP_GLOBAL_REG) || defined(ZEND_VM_FP_GLOBAL_REG)\n");
2083 out($f,$m[1]."struct {\n");
2084 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2085 out($f,$m[1]."\tconst zend_op *orig_opline;\n");
2086 out($f,"#endif\n");
2087 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2088 out($f,$m[1]."\tzend_execute_data *orig_execute_data;\n");
2089 out($f,"#ifdef ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE\n");
2090 … out($f,$m[1]."\tchar hybrid_jit_red_zone[ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE];\n");
2091 out($f,"#endif\n");
2092 out($f,"#endif\n");
2093 out($f,$m[1]."} vm_stack_data;\n");
2094 out($f,"#endif\n");
2095 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2096 out($f,$m[1]."vm_stack_data.orig_opline = opline;\n");
2097 out($f,"#endif\n");
2098 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2099 out($f,$m[1]."vm_stack_data.orig_execute_data = execute_data;\n");
2100 out($f,$m[1]."execute_data = ex;\n");
2101 out($f,"#else\n");
2102 out($f,$m[1]."zend_execute_data *execute_data = ex;\n");
2103 out($f,"#endif\n");
2111 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2114 out($f,$prolog."if (UNEXPECTED(execute_data == NULL)) {\n");
2115 out($f,$prolog."\tstatic const void * const labels[] = {\n");
2117 out($f,$prolog."\t};\n");
2118 out($f,$prolog."\tzend_opcode_handlers = (const void **) labels;\n");
2119 out($f,$prolog."\tzend_handlers_count = sizeof(labels) / sizeof(void*);\n");
2121 … out($f,$prolog."\tmemset(&hybrid_halt_op, 0, sizeof(hybrid_halt_op));\n");
2122 … out($f,$prolog."\thybrid_halt_op.handler = (void*)&&HYBRID_HALT_LABEL;\n");
2123 out($f,"#ifdef ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE\n");
2124 …out($f,$prolog."\tmemset(vm_stack_data.hybrid_jit_red_zone, 0, ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE);\…
2125 out($f,"#endif\n");
2126 out($f,$prolog."\tif (zend_touch_vm_stack_data) {\n");
2127 out($f,$prolog."\t\tzend_touch_vm_stack_data(&vm_stack_data);\n");
2128 out($f,$prolog."\t}\n");
2129 out($f,$prolog."\tgoto HYBRID_HALT_LABEL;\n");
2131 out($f,$prolog."\treturn;\n");
2133 out($f,$prolog."}\n");
2135 out($f,"#endif\n");
2144 … out($f,"#if !defined(ZEND_VM_FP_GLOBAL_REG) || !defined(ZEND_VM_IP_GLOBAL_REG)\n");
2145 out($f,$m[1]."\tint ret;".$m[3]."\n");
2146 out($f,"#endif\n");
2149 out($f,"zend_vm_continue:".$m[3]."\n");
2158 …out($f, $m[1]."dispatch_handler = OPLINE->handler;\nzend_vm_dispatch:\n".$m[1]."switch ((int)(uint…
2161 out($f, $m[1]."goto *(void**)(OPLINE->handler);".$m[3]."\n");
2164 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2165 out($f, $m[1]."HYBRID_SWITCH()".$m[3]."\n");
2166 out($f,"#else\n");
2168 … out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
2169 … out($f, $m[1]."((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2170 out($f, $m[1]."if (UNEXPECTED(!OPLINE))".$m[3]."\n");
2171 out($f,"#else\n");
2172 …out($f, $m[1]."if (UNEXPECTED((ret = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_…
2173 out($f,"#endif\n");
2175 out($f,"#endif\n");
2184 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2191 out($f,"#else\n");
2193 out($f,
2212 out($f,"#endif\n");
2222 out($f, $m[1].$initializer_name.$m[3]."\n");
2230 out($f,$prolog."static const uint32_t specs[] = {\n");
2232 out($f,$prolog."};\n");
2233 out($f,$prolog."zend_spec_handlers = specs;\n");
2234 out($f,$prolog.$executor_name."_ex(NULL);\n");
2236 out($f,$prolog."static const void * const labels[] = {\n");
2238 out($f,$prolog."};\n");
2239 out($f,$prolog."static const uint32_t specs[] = {\n");
2241 out($f,$prolog."};\n");
2243 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2244 out($f,$prolog."zend_opcode_handler_funcs = labels;\n");
2245 out($f,$prolog."zend_spec_handlers = specs;\n");
2246 out($f,$prolog.$executor_name."_ex(NULL);\n");
2247 out($f,"#else\n");
2249 out($f,$prolog."zend_opcode_handlers = labels;\n");
2250 out($f,$prolog."zend_handlers_count = sizeof(labels) / sizeof(void*);\n");
2251 out($f,$prolog."zend_spec_handlers = specs;\n");
2253 out($f,"#endif\n");
2262 out($f, $line);
2657 out($f, HEADER_TEXT);
2707 out($f, HEADER_TEXT);
2709 out($f, "#ifdef ZEND_WIN32\n");
2711 out($f, "# pragma warning(disable : 4101)\n");
2714 out($f, "# pragma warning(once : 6235)\n");
2716 out($f, "# pragma warning(once : 6237)\n");
2718 out($f, "# pragma warning(once : 6239)\n");
2720 out($f, "# pragma warning(once : 6240)\n");
2722 out($f, "# pragma warning(once : 6285)\n");
2724 out($f, "# pragma warning(once : 6286)\n");
2726 out($f, "# pragma warning(once : 6326)\n");
2728 out($f, "#endif\n");
2731 out($f, "static user_opcode_handler_t zend_user_opcode_handlers[256] = {\n");
2733 out($f, "\t(user_opcode_handler_t)NULL,\n");
2735 out($f, "\t(user_opcode_handler_t)NULL\n};\n\n");
2737 out($f, "static zend_uchar zend_user_opcodes[256] = {");
2739 if ($i % 16 == 1) out($f, "\n\t");
2740 out($f, "$i,");
2742 out($f, "255\n};\n\n");
2746 out($f, "\n");
2749 …out($f, "static uint32_t ZEND_FASTCALL zend_vm_get_opcode_handler_idx(uint32_t spec, const zend_op…
2750 out($f, "{\n");
2752 out($f, "\treturn spec;\n");
2754 out($f, "\tstatic const int zend_vm_decode[] = {\n");
2755 out($f, "\t\t_UNUSED_CODE, /* 0 = IS_UNUSED */\n");
2756 out($f, "\t\t_CONST_CODE, /* 1 = IS_CONST */\n");
2757 out($f, "\t\t_TMP_CODE, /* 2 = IS_TMP_VAR */\n");
2758 out($f, "\t\t_UNUSED_CODE, /* 3 */\n");
2759 out($f, "\t\t_VAR_CODE, /* 4 = IS_VAR */\n");
2760 out($f, "\t\t_UNUSED_CODE, /* 5 */\n");
2761 out($f, "\t\t_UNUSED_CODE, /* 6 */\n");
2762 out($f, "\t\t_UNUSED_CODE, /* 7 */\n");
2763 out($f, "\t\t_CV_CODE /* 8 = IS_CV */\n");
2764 out($f, "\t};\n");
2765 out($f, "\tuint32_t offset = 0;\n");
2766 … out($f, "\tif (spec & SPEC_RULE_OP1) offset = offset * 5 + zend_vm_decode[op->op1_type];\n");
2767 … out($f, "\tif (spec & SPEC_RULE_OP2) offset = offset * 5 + zend_vm_decode[op->op2_type];\n");
2777 out($f, "\tif (spec & SPEC_EXTRA_MASK) {\n");
2780 out($f, "\t\t{$else}if (spec & SPEC_RULE_RETVAL) {\n");
2781 out($f, "\t\t\toffset = offset * 2 + (op->result_type != IS_UNUSED);\n");
2782 out($f, "\t\t\tif ((spec & SPEC_RULE_OBSERVER) && ZEND_OBSERVER_ENABLED) {\n");
2783 out($f, "\t\t\t\toffset += 2;\n");
2784 out($f, "\t\t\t}\n");
2788 out($f, "\t\t{$else}if (spec & SPEC_RULE_QUICK_ARG) {\n");
2789 out($f, "\t\t\toffset = offset * 2 + (op->op2.num <= MAX_ARG_FLAG_NUM);\n");
2793 out($f, "\t\t{$else}if (spec & SPEC_RULE_OP_DATA) {\n");
2794 out($f, "\t\t\toffset = offset * 5 + zend_vm_decode[(op + 1)->op1_type];\n");
2798 out($f, "\t\t{$else}if (spec & SPEC_RULE_ISSET) {\n");
2799 out($f, "\t\t\toffset = offset * 2 + (op->extended_value & ZEND_ISEMPTY);\n");
2803 out($f, "\t\t{$else}if (spec & SPEC_RULE_SMART_BRANCH) {\n");
2804 out($f, "\t\t\toffset = offset * 3;\n");
2805 out($f, "\t\t\tif (op->result_type == (IS_SMART_BRANCH_JMPZ|IS_TMP_VAR)) {\n");
2806 out($f, "\t\t\t\toffset += 1;\n");
2807 … out($f, "\t\t\t} else if (op->result_type == (IS_SMART_BRANCH_JMPNZ|IS_TMP_VAR)) {\n");
2808 out($f, "\t\t\t\toffset += 2;\n");
2809 out($f, "\t\t\t}\n");
2813 out($f, "\t\t{$else}if (spec & SPEC_RULE_OBSERVER) {\n");
2814 out($f, "\t\t\toffset = offset * 2;\n");
2815 out($f, "\t\t\tif (ZEND_OBSERVER_ENABLED) {\n");
2816 out($f, "\t\t\t\toffset += 1;\n");
2817 out($f, "\t\t\t}\n");
2821 out($f, "\t\t}\n");
2823 out($f, "\t}\n");
2825 out($f, "\treturn (spec & SPEC_START_MASK) + offset;\n");
2827 out($f, "}\n\n");
2828 out($f, "#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID) || !ZEND_VM_SPEC\n");
2829 … out($f, "static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op)\n");
2830 out($f, "{\n");
2832 out($f, "\treturn zend_opcode_handlers[zend_vm_get_opcode_handler_idx(opcode, op)];\n");
2834 …out($f, "\treturn zend_opcode_handlers[zend_vm_get_opcode_handler_idx(zend_spec_handlers[opcode], …
2836 out($f, "}\n");
2837 out($f, "#endif\n\n");
2841 out($f, "#if ZEND_VM_KIND == ZEND_VM_KIND_HYBRID\n");
2842 …out($f,"static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend_op* op)\n…
2843 out($f, "{\n");
2844 out($f, "\tuint32_t spec = zend_spec_handlers[opcode];\n");
2846 out($f, "\treturn zend_opcode_handler_funcs[spec];\n");
2848 … out($f, "\treturn zend_opcode_handler_funcs[zend_vm_get_opcode_handler_idx(spec, op)];\n");
2850 out($f, "}\n\n");
2851 out($f, "#endif\n\n");
2855 out($f, "ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler(zend_op* op)\n");
2856 out($f, "{\n");
2857 out($f, "\tzend_uchar opcode = zend_user_opcodes[op->opcode];\n");
2859 … out($f, "\top->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(opcode, op)];\n");
2861 out($f, "\n");
2862 out($f, "\tif (zend_spec_handlers[op->opcode] & SPEC_RULE_COMMUTATIVE) {\n");
2863 out($f, "\t\tif (op->op1_type < op->op2_type) {\n");
2864 out($f, "\t\t\tzend_swap_operands(op);\n");
2865 out($f, "\t\t}\n");
2866 out($f, "\t}\n");
2867 …out($f, "\top->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(zend_spec_handlers[op…
2869 out($f, "}\n\n");
2872 …out($f, "ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t op1_info,…
2873 out($f, "{\n");
2874 out($f, "\tzend_uchar opcode = zend_user_opcodes[op->opcode];\n");
2876 … out($f, "\top->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(opcode, op)];\n");
2878 out($f, "\tuint32_t spec = zend_spec_handlers[opcode];\n");
2880 out($f, "\tswitch (opcode) {\n");
2884 out($f, "\t\tcase $orig_op:\n");
2886 out($f, "\t\t\tif (op->op1_type < op->op2_type) {\n");
2887 out($f, "\t\t\t\tzend_swap_operands(op);\n");
2888 out($f, "\t\t\t}\n");
2894 out($f, "\t\t\tif $condition {\n");
2897 out($f, "\t\t\t} else if $condition {\n");
2901 … out($f, "\t\t\t\tif (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {\n");
2902 out($f, "\t\t\t\t\tbreak;\n");
2903 out($f, "\t\t\t\t}\n");
2905 out($f, "\t\t\t\tspec = ${spec_dsc['spec_code']};\n");
2907 out($f, "\t\t\t\tif (op->op1_type < op->op2_type) {\n");
2908 out($f, "\t\t\t\t\tzend_swap_operands(op);\n");
2909 out($f, "\t\t\t\t}\n");
2913 out($f, "\t\t\t}\n");
2915 out($f, "\t\t\tbreak;\n");
2924 out($f, "\t\tcase $orig_op:\n");
2929 out($f, "\t\t\tif (op->op1_type < op->op2_type) {\n");
2930 out($f, "\t\t\t\tzend_swap_operands(op);\n");
2931 out($f, "\t\t\t}\n");
2932 out($f, "\t\t\tbreak;\n");
2933 out($f, "\t\tcase ZEND_USER_OPCODE:\n");
2934 out($f, "\t\t\tif (zend_spec_handlers[op->opcode] & SPEC_RULE_COMMUTATIVE) {\n");
2935 out($f, "\t\t\t\tif (op->op1_type < op->op2_type) {\n");
2936 out($f, "\t\t\t\t\tzend_swap_operands(op);\n");
2937 out($f, "\t\t\t\t}\n");
2938 out($f, "\t\t\t}\n");
2939 out($f, "\t\t\tbreak;\n");
2941 out($f, "\t\tdefault:\n");
2942 out($f, "\t\t\tbreak;\n");
2943 out($f, "\t}\n");
2945 … out($f, "\top->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(spec, op)];\n");
2947 out($f, "}\n\n");
2951 out($f, "ZEND_API int ZEND_FASTCALL zend_vm_call_opcode_handler(zend_execute_data* ex)\n");
2952 out($f, "{\n");
2954 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2955 out($f, "\topcode_handler_t handler;\n");
2956 out($f,"#endif\n");
2958 out($f, "\tint ret;\n");
2959 out($f, "#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2960 out($f, "\tconst zend_op *orig_opline = opline;\n");
2961 out($f, "#endif\n");
2962 out($f, "#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2963 out($f, "\tzend_execute_data *orig_execute_data = execute_data;\n");
2964 out($f, "\texecute_data = ex;\n");
2965 out($f, "#else\n");
2966 out($f, "\tzend_execute_data *execute_data = ex;\n");
2967 out($f, "#endif\n");
2968 out($f, "\n");
2969 out($f, "\tLOAD_OPLINE();\n");
2970 out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
2972 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2973 …out($f, "\thandler = (opcode_handler_t)zend_vm_get_opcode_handler_func(zend_user_opcodes[opline->o…
2974 out($f, "\thandler(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2975 out($f, "\tif (EXPECTED(opline != &hybrid_halt_op)) {\n");
2976 out($f,"#else\n");
2978 out($f, "\t((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2980 out($f, "\tif (EXPECTED(opline)) {\n");
2981 out($f,"#endif\n");
2983 out($f, "\tif (EXPECTED(opline)) {\n");
2985 … out($f, "\t\tret = execute_data != ex ? (int)(execute_data->prev_execute_data != ex) + 1 : 0;\n");
2986 out($f, "\t\tSAVE_OPLINE();\n");
2987 out($f, "\t} else {\n");
2988 out($f, "\t\tret = -1;\n");
2989 out($f, "\t}\n");
2990 out($f, "#else\n");
2991 … out($f, "\tret = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2992 out($f, "\tSAVE_OPLINE();\n");
2993 out($f, "#endif\n");
2994 out($f, "#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2995 out($f, "\texecute_data = orig_execute_data;\n");
2996 out($f, "#endif\n");
2997 out($f, "#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2998 out($f, "\topline = orig_opline;\n");
2999 out($f, "#endif\n");
3000 out($f, "\treturn ret;\n");
3001 out($f, "}\n\n");
3003 out($f, "ZEND_API int ZEND_FASTCALL zend_vm_call_opcode_handler(zend_execute_data* ex)\n");
3004 out($f, "{\n");
3005 …out($f, "\tzend_error_noreturn(E_CORE_ERROR, \"zend_vm_call_opcode_handler() is not supported\");\…
3006 out($f, "\treturn 0;\n");
3007 out($f, "}\n\n");