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)
1062 fclose($out);
1078 out($f, $code);
1084out($f,"static zend_always_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_INLINE_HANDLE…
1087out($f,"static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE_…
1090out($f,"static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE…
1092out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE_HANDLER_ARGS…
1098 out($f,"case $cur: /* $spec_name */");
1101 out($f,"case ".$name.":");
1105 out($f," {$spec_name}_LABEL: ZEND_ATTRIBUTE_UNUSED_LABEL\n");
1107 out($f,"\n");
1111 out($f,"{$spec_name}_LABEL: ZEND_VM_GUARD($spec_name);\n");
1119out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE_HANDLER_ARGS…
1120 out($f,"{\n");
1121out($f,"\tZEND_VM_TAIL_CALL({$spec_name}_INLINE_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));\n");
1122 out($f,"}\n");
1123 out($f,"\n");
1140 out($f, "#line $lineno \"$definition_file\"\n");
1148 out($f, $spec_name . "_LABEL:\n");
1164out($f, "static$zend_attributes ZEND_OPCODE_HANDLER_RET$zend_fastcall $spec_name(ZEND_OPCODE_HANDL…
1167out($f, "static$zend_attributes ZEND_OPCODE_HANDLER_RET$zend_fastcall $spec_name($param ZEND_OPCOD…
1171 out($f, "$spec_name:\n");
1174 out($f, "$spec_name:\n");
1186 out($f,$prolog."ZEND_NULL_HANDLER,\n");
1189 out($f,$prolog."(void*)(uintptr_t)-1,\n");
1192 out($f,$prolog."(void*)&&ZEND_NULL_LABEL,\n");
1388 out($f,"$prolog{$spec_name}_HANDLER,\n");
1391 out($f,$prolog."(void*)(uintptr_t)$switch_labels[$spec_name],\n");
1394 out($f,$prolog."(void*)&&{$spec_name}_LABEL,\n");
1436 out($f,$prolog."ZEND_NULL_HANDLER,\n");
1439 out($f,$prolog."(void*)(uintptr_t)-1,\n");
1442 out($f,$prolog."(void*)&&ZEND_NULL_LABEL,\n");
1456 out($f,$prolog.$dsc['alias']."_HANDLER,\n");
1459 out($f,$prolog."(void*)&&".$dsc['alias']."_LABEL,\n");
1467 out($f,$prolog.$dsc["op"]."_HANDLER,\n");
1470 out($f,$prolog."(void*)(uintptr_t)".((string)$num).",\n");
1473 out($f,$prolog."(void*)&&".$dsc["op"]."_LABEL,\n");
1480 out($f,$prolog."ZEND_NULL_HANDLER,\n");
1483 out($f,$prolog."(void*)(uintptr_t)-1,\n");
1486 out($f,$prolog."(void*)&&ZEND_NULL_LABEL,\n");
1497 out($f,$prolog."ZEND_NULL_HANDLER\n");
1500 out($f,$prolog."(void*)(uintptr_t)-1\n");
1503 out($f,$prolog."(void*)&&ZEND_NULL_LABEL\n");
1509 out($l, "#define VM_HANDLERS(_) \\\n");
1512 out($l, "\t_($n, $name) \\\n");
1515 out($l, "\t_($n+1, ZEND_NULL)\n");
1525 out($f, "$prolog$lastdef,\n");
1528 out($f, "$prolog$def,\n");
1531 out($f, "$prolog$lastdef,\n");
1543out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS)\n…
1544 out($f,"{\n");
1545 out($f,"\tUSE_OPLINE\n");
1546 out($f,"\n");
1547 out($f,"\tSAVE_OPLINE();\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");
1736 out($f, $txt);
1752 out($f,"default: ZEND_NULL_LABEL:\n");
1753out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", OPLINE->opcode, OPLINE->op1_t…
1754 out($f,"\tZEND_VM_NEXT_OPCODE(); /* Never reached */\n");
1757 out($f,"ZEND_NULL_LABEL:\n");
1758out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", OPLINE->opcode, OPLINE->op1_t…
1759 out($f,"\tZEND_VM_NEXT_OPCODE(); /* Never reached */\n");
1762 out($f,"\t\t\tHYBRID_CASE(HYBRID_HALT):\n");
1763 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
1764 out($f,"\t\t\t\texecute_data = vm_stack_data.orig_execute_data;\n");
1765 out($f,"#endif\n");
1766 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
1767 out($f,"\t\t\t\topline = vm_stack_data.orig_opline;\n");
1768 out($f,"#endif\n");
1769 out($f,"\t\t\t\treturn;\n");
1770 out($f,"\t\t\tHYBRID_DEFAULT:\n");
1771 out($f,"\t\t\t\tVM_TRACE(ZEND_NULL)\n");
1772 out($f,"\t\t\t\tZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
1773 out($f,"\t\t\t\tVM_TRACE_OP_END(ZEND_NULL)\n");
1774 out($f,"\t\t\t\tHYBRID_BREAK(); /* Never reached */\n");
1781 out($f, $prolog.$epilog);
1803 out($f,"#define SPEC_START_MASK 0x0000ffff\n");
1804 out($f,"#define SPEC_EXTRA_MASK 0xfffc0000\n");
1805 out($f,"#define SPEC_RULE_OP1 0x00010000\n");
1806 out($f,"#define SPEC_RULE_OP2 0x00020000\n");
1807 out($f,"#define SPEC_RULE_OP_DATA 0x00040000\n");
1808 out($f,"#define SPEC_RULE_RETVAL 0x00080000\n");
1809 out($f,"#define SPEC_RULE_QUICK_ARG 0x00100000\n");
1810 out($f,"#define SPEC_RULE_SMART_BRANCH 0x00200000\n");
1811 out($f,"#define SPEC_RULE_COMMUTATIVE 0x00800000\n");
1812 out($f,"#define SPEC_RULE_ISSET 0x01000000\n");
1813 out($f,"#define SPEC_RULE_OBSERVER 0x02000000\n");
1814 out($f,"\n");
1815 out($f,"static const uint32_t *zend_spec_handlers;\n");
1816 out($f,"static const void * const *zend_opcode_handlers;\n");
1817 out($f,"static int zend_handlers_count;\n");
1819 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1820 out($f,"static const void * const * zend_opcode_handler_funcs;\n");
1821 out($f,"static zend_op hybrid_halt_op;\n");
1822 out($f,"#endif\n");
1824 out($f,"#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID) || !ZEND_VM_SPEC\n");
1825out($f,"static const void *zend_vm_get_opcode_handler(uint8_t opcode, const zend_op* op);\n");
1826 out($f,"#endif\n\n");
1828 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1829out($f,"static const void *zend_vm_get_opcode_handler_func(uint8_t opcode, const zend_op* op);\n");
1830 out($f,"#else\n");
1831out($f,"# define zend_vm_get_opcode_handler_func zend_vm_get_opcode_handler\n");
1832 out($f,"#endif\n\n");
1834 out($f,"#ifndef VM_TRACE\n");
1836 out($f,"# define VM_TRACE(op) ZEND_VM_GUARD(op);\n");
1838 out($f,"# define VM_TRACE(op)\n");
1840 out($f,"#endif\n");
1841 out($f,"#ifndef VM_TRACE_OP_END\n");
1842 out($f,"# define VM_TRACE_OP_END(op)\n");
1843 out($f,"#endif\n");
1844 out($f,"#ifndef VM_TRACE_START\n");
1845 out($f,"# define VM_TRACE_START()\n");
1846 out($f,"#endif\n");
1847 out($f,"#ifndef VM_TRACE_END\n");
1848 out($f,"# define VM_TRACE_END()\n");
1849 out($f,"#endif\n");
1852 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1853 out($f,"# if defined(__GNUC__) && defined(__i386__)\n");
1854out($f,"# define HYBRID_JIT_GUARD() __asm__ __volatile__ (\"\"::: \"ebx\")\n");
1855 out($f,"# elif defined(__GNUC__) && defined(__x86_64__)\n");
1856out($f,"# define HYBRID_JIT_GUARD() __asm__ __volatile__ (\"\"::: \"rbx\",\"r12\",\"r13\")\n");
1857 out($f,"# elif defined(__GNUC__) && defined(__aarch64__)\n");
1858out($f,"# define HYBRID_JIT_GUARD() __asm__ __volatile__ (\"\"::: \"x19\",\"x20\",\"x21\",\"x22\"…
1859 out($f,"# else\n");
1860 out($f,"# define HYBRID_JIT_GUARD()\n");
1861 out($f,"# endif\n");
1862out($f,"#define HYBRID_NEXT() HYBRID_JIT_GUARD(); goto *(void**)(OPLINE->handler)\n");
1863 out($f,"#define HYBRID_SWITCH() HYBRID_NEXT();\n");
1864 out($f,"#define HYBRID_CASE(op) op ## _LABEL\n");
1865 out($f,"#define HYBRID_BREAK() HYBRID_NEXT()\n");
1866 out($f,"#define HYBRID_DEFAULT ZEND_NULL_LABEL\n");
1867 out($f,"#endif\n");
1869 out($f,"\n");
1870 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
1871 out($f,"# define ZEND_OPCODE_HANDLER_ARGS void\n");
1872 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU\n");
1873 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_DC\n");
1874 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC\n");
1875 out($f,"#else\n");
1876out($f,"# define ZEND_OPCODE_HANDLER_ARGS zend_execute_data *execute_data\n");
1877 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU execute_data\n");
1878out($f,"# define ZEND_OPCODE_HANDLER_ARGS_DC , ZEND_OPCODE_HANDLER_ARGS\n");
1879out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC , ZEND_OPCODE_HANDLER_ARGS_PASSTHRU\n");
1880 out($f,"#endif\n");
1881 out($f,"\n");
1882out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
1883 out($f,"# define ZEND_OPCODE_HANDLER_RET void\n");
1884 out($f,"# define ZEND_VM_TAIL_CALL(call) call; return\n");
1885 out($f,"# ifdef ZEND_VM_TAIL_CALL_DISPATCH\n");
1886out($f,"# define ZEND_VM_CONTINUE() ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_A…
1887 out($f,"# else\n");
1888 out($f,"# define ZEND_VM_CONTINUE() return\n");
1889 out($f,"# endif\n");
1891 out($f,"# if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1892out($f,"# define ZEND_VM_RETURN() opline = &hybrid_halt_op; return\n");
1893out($f,"# define ZEND_VM_HOT zend_always_inline ZEND_COLD ZEND_OPT_SIZE\n");
1894out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
1895 out($f,"# else\n");
1896 out($f,"# define ZEND_VM_RETURN() opline = NULL; return\n");
1897 out($f,"# define ZEND_VM_HOT\n");
1898out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
1899 out($f,"# endif\n");
1901 out($f,"# define ZEND_VM_RETURN() opline = NULL; return\n");
1902out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
1904 out($f,"#else\n");
1905 out($f,"# define ZEND_OPCODE_HANDLER_RET int\n");
1906 out($f,"# define ZEND_VM_TAIL_CALL(call) return call\n");
1907 out($f,"# define ZEND_VM_CONTINUE() return 0\n");
1908 out($f,"# define ZEND_VM_RETURN() return -1\n");
1910 out($f,"# define ZEND_VM_HOT\n");
1912 out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
1913 out($f,"#endif\n");
1914 out($f,"\n");
1915out($f,"typedef ZEND_OPCODE_HANDLER_RET (ZEND_FASTCALL *opcode_handler_t) (ZEND_OPCODE_HANDLER_ARG…
1916 out($f,"\n");
1917 out($f,"#define DCL_OPLINE\n");
1918 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
1919 out($f,"# define OPLINE opline\n");
1920 out($f,"# define USE_OPLINE\n");
1921 out($f,"# define LOAD_OPLINE() opline = EX(opline)\n");
1922 out($f,"# define LOAD_OPLINE_EX()\n");
1923 out($f,"# define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n");
1924 out($f,"# define SAVE_OPLINE() EX(opline) = opline\n");
1925 out($f,"# define SAVE_OPLINE_EX() SAVE_OPLINE()\n");
1926 out($f,"#else\n");
1927 out($f,"# define OPLINE EX(opline)\n");
1928 out($f,"# define USE_OPLINE const zend_op *opline = EX(opline);\n");
1929 out($f,"# define LOAD_OPLINE()\n");
1930 out($f,"# define LOAD_OPLINE_EX()\n");
1931 out($f,"# define LOAD_NEXT_OPLINE() ZEND_VM_INC_OPCODE()\n");
1932 out($f,"# define SAVE_OPLINE()\n");
1933 out($f,"# define SAVE_OPLINE_EX()\n");
1934 out($f,"#endif\n");
1935out($f,"#define HANDLE_EXCEPTION() ZEND_ASSERT(EG(exception)); LOAD_OPLINE(); ZEND_VM_CONTINUE()\n…
1936out($f,"#define HANDLE_EXCEPTION_LEAVE() ZEND_ASSERT(EG(exception)); LOAD_OPLINE(); ZEND_VM_LEAVE(…
1937 out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG)\n");
1938out($f,"# define ZEND_VM_ENTER_EX() ZEND_VM_INTERRUPT_CHECK(); ZEND_VM_CONTINUE()\n");
1939out($f,"# define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE();…
1940 out($f,"# define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n");
1941 out($f,"#elif defined(ZEND_VM_IP_GLOBAL_REG)\n");
1942 out($f,"# define ZEND_VM_ENTER_EX() return 1\n");
1943out($f,"# define ZEND_VM_ENTER() opline = EG(current_execute_data)->opline; ZEND_VM_ENTE…
1944 out($f,"# define ZEND_VM_LEAVE() return 2\n");
1945 out($f,"#else\n");
1946 out($f,"# define ZEND_VM_ENTER_EX() return 1\n");
1947 out($f,"# define ZEND_VM_ENTER() return 1\n");
1948 out($f,"# define ZEND_VM_LEAVE() return 2\n");
1949 out($f,"#endif\n");
1950out($f,"#define ZEND_VM_INTERRUPT() ZEND_VM_TAIL_CALL(zend_interrupt_helper".($spec?"_SPEC":"…
1951out($f,"#define ZEND_VM_LOOP_INTERRUPT() zend_interrupt_helper".($spec?"_SPEC":"")."(ZEND_OPCODE_H…
1953out($f,"#define ZEND_VM_DISPATCH(opcode, opline) ZEND_VM_TAIL_CALL(((opcode_handler_t)zend_vm_get_…
1955out($f,"#define ZEND_VM_DISPATCH(opcode, opline) ZEND_VM_TAIL_CALL(((opcode_handler_t)zend_vm_get_…
1957 out($f,"\n");
1958out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_interrupt_helper".($spec?"_SPEC":"")."(Z…
1959out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS);\…
1960 out($f,"\n");
1963 out($f,"\n");
1964 out($f,"#define OPLINE opline\n");
1965 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
1966out($f,"# define DCL_OPLINE register const zend_op *opline __asm__(ZEND_VM_IP_GLOBAL_REG);\n");
1967 out($f,"#else\n");
1968 out($f,"# define DCL_OPLINE const zend_op *opline;\n");
1969 out($f,"#endif\n");
1970 out($f,"#define USE_OPLINE\n");
1971 out($f,"#define LOAD_OPLINE() opline = EX(opline)\n");
1972 out($f,"# define LOAD_OPLINE_EX() LOAD_OPLINE()\n");
1973 out($f,"#define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n");
1974 out($f,"#define SAVE_OPLINE() EX(opline) = opline\n");
1975 out($f,"#define SAVE_OPLINE_EX()\n");
1976out($f,"#define HANDLE_EXCEPTION() ZEND_ASSERT(EG(exception)); LOAD_OPLINE(); ZEND_VM_CONTINUE()\n…
1977out($f,"#define HANDLE_EXCEPTION_LEAVE() ZEND_ASSERT(EG(exception)); LOAD_OPLINE(); ZEND_VM_LEAVE(…
1978 out($f,"#define ZEND_VM_CONTINUE() goto zend_vm_continue\n");
1979 out($f,"#define ZEND_VM_RETURN() return\n");
1980out($f,"#define ZEND_VM_ENTER_EX() ZEND_VM_INTERRUPT_CHECK(); ZEND_VM_CONTINUE()\n");
1981out($f,"#define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE(); ZEND_VM…
1982 out($f,"#define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n");
1983out($f,"#define ZEND_VM_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
1984out($f,"#define ZEND_VM_LOOP_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
1985out($f,"#define ZEND_VM_DISPATCH(opcode, opline) dispatch_handler = zend_vm_get_opcode_handler(opc…
1986 out($f,"\n");
1989 out($f,"\n");
1990 out($f,"#define OPLINE opline\n");
1991 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
1992out($f,"# define DCL_OPLINE register const zend_op *opline __asm__(ZEND_VM_IP_GLOBAL_REG);\n");
1993 out($f,"#else\n");
1994 out($f,"# define DCL_OPLINE const zend_op *opline;\n");
1995 out($f,"#endif\n");
1996 out($f,"#define USE_OPLINE\n");
1997 out($f,"#define LOAD_OPLINE() opline = EX(opline)\n");
1998 out($f,"#define LOAD_OPLINE_EX() LOAD_OPLINE()\n");
1999 out($f,"#define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n");
2000 out($f,"#define SAVE_OPLINE() EX(opline) = opline\n");
2001 out($f,"#define SAVE_OPLINE_EX()\n");
2003out($f,"#define HANDLE_EXCEPTION() ZEND_ASSERT(EG(exception)); goto ZEND_HANDLE_EXCEPTION_SPEC_LAB…
2004out($f,"#define HANDLE_EXCEPTION_LEAVE() ZEND_ASSERT(EG(exception)); goto ZEND_HANDLE_EXCEPTION_SP…
2006out($f,"#define HANDLE_EXCEPTION() ZEND_ASSERT(EG(exception)); goto ZEND_HANDLE_EXCEPTION_LABEL\n"…
2007out($f,"#define HANDLE_EXCEPTION_LEAVE() ZEND_ASSERT(EG(exception)); goto ZEND_HANDLE_EXCEPTION_LA…
2009 out($f,"#define ZEND_VM_CONTINUE() goto *(void**)(OPLINE->handler)\n");
2010 out($f,"#define ZEND_VM_RETURN() return\n");
2011out($f,"#define ZEND_VM_ENTER_EX() ZEND_VM_INTERRUPT_CHECK(); ZEND_VM_CONTINUE()\n");
2012out($f,"#define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE(); ZEND_VM…
2013 out($f,"#define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n");
2014out($f,"#define ZEND_VM_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
2015out($f,"#define ZEND_VM_LOOP_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
2016out($f,"#define ZEND_VM_DISPATCH(opcode, opline) goto *(void**)(zend_vm_get_opcode_handler(opcode,…
2017 out($f,"\n");
2022 out($f,"\n");
2023 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2024 out($f,"# undef ZEND_VM_TAIL_CALL\n");
2025 out($f,"# undef ZEND_VM_CONTINUE\n");
2026 out($f,"# undef ZEND_VM_RETURN\n");
2028 out($f,"\n");
2029 out($f,"# define ZEND_VM_TAIL_CALL(call) call; ZEND_VM_CONTINUE()\n");
2030 out($f,"# define ZEND_VM_CONTINUE() HYBRID_NEXT()\n");
2031 out($f,"# define ZEND_VM_RETURN() goto HYBRID_HALT_LABEL\n");
2033 out($f,"#endif\n\n");
2037 out($f, $m[1].$executor_name.$m[3]."\n");
2041 out($f,$m[1]."const void *dispatch_handler;\n");
2045 out($f, "#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2049 out($f,$m[1].$param.";\n");
2052 out($f, "#endif\n");
2056 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2057out($f,$m[1]."register zend_execute_data *execute_data __asm__(ZEND_VM_FP_GLOBAL_REG) = ex;\n");
2058 out($f,"#else\n");
2059 out($f,$m[1]."zend_execute_data *execute_data = ex;\n");
2060 out($f,"#endif\n");
2062out($f,"#if defined(ZEND_VM_IP_GLOBAL_REG) || defined(ZEND_VM_FP_GLOBAL_REG)\n");
2063 out($f,$m[1]."struct {\n");
2064 out($f,"#ifdef ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE\n");
2065out($f,$m[1]."\tchar hybrid_jit_red_zone[ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE];\n");
2066 out($f,"#endif\n");
2067 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2068 out($f,$m[1]."\tconst zend_op *orig_opline;\n");
2069 out($f,"#endif\n");
2070 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2071 out($f,$m[1]."\tzend_execute_data *orig_execute_data;\n");
2072 out($f,"#endif\n");
2073 out($f,$m[1]."} vm_stack_data;\n");
2074 out($f,"#endif\n");
2075 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2076 out($f,$m[1]."vm_stack_data.orig_opline = opline;\n");
2077 out($f,"#endif\n");
2078 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2079 out($f,$m[1]."vm_stack_data.orig_execute_data = execute_data;\n");
2080 out($f,$m[1]."execute_data = ex;\n");
2081 out($f,"#else\n");
2082 out($f,$m[1]."zend_execute_data *execute_data = ex;\n");
2083 out($f,"#endif\n");
2091 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2094 out($f,$prolog."if (UNEXPECTED(execute_data == NULL)) {\n");
2095 out($f,$prolog."\tstatic const void * const labels[] = {\n");
2097 out($f,$prolog."\t};\n");
2098 out($f,$prolog."\tzend_opcode_handlers = (const void **) labels;\n");
2099 out($f,$prolog."\tzend_handlers_count = sizeof(labels) / sizeof(void*);\n");
2101out($f,$prolog."\tmemset(&hybrid_halt_op, 0, sizeof(hybrid_halt_op));\n");
2102out($f,$prolog."\thybrid_halt_op.handler = (void*)&&HYBRID_HALT_LABEL;\n");
2103 out($f,"#ifdef ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE\n");
2104out($f,$prolog."\tmemset(vm_stack_data.hybrid_jit_red_zone, 0, ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE);\…
2105 out($f,"#endif\n");
2106 out($f,$prolog."\tif (zend_touch_vm_stack_data) {\n");
2107 out($f,$prolog."\t\tzend_touch_vm_stack_data(&vm_stack_data);\n");
2108 out($f,$prolog."\t}\n");
2109 out($f,$prolog."\tgoto HYBRID_HALT_LABEL;\n");
2111 out($f,$prolog."\treturn;\n");
2113 out($f,$prolog."}\n");
2115 out($f,"#endif\n");
2124out($f,"#if !defined(ZEND_VM_FP_GLOBAL_REG) || !defined(ZEND_VM_IP_GLOBAL_REG)\n");
2125 out($f,$m[1]."\tint ret;".$m[3]."\n");
2126 out($f,"#endif\n");
2129 out($f,"zend_vm_continue:".$m[3]."\n");
2138out($f, $m[1]."dispatch_handler = OPLINE->handler;\nzend_vm_dispatch:\n".$m[1]."switch ((int)(uint…
2141 out($f, $m[1]."goto *(void**)(OPLINE->handler);".$m[3]."\n");
2144 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2145 out($f, $m[1]."HYBRID_SWITCH()".$m[3]."\n");
2146 out($f,"#else\n");
2148out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
2149out($f, $m[1]."((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2150 out($f, $m[1]."if (UNEXPECTED(!OPLINE))".$m[3]."\n");
2151 out($f,"#else\n");
2152out($f, $m[1]."if (UNEXPECTED((ret = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_…
2153 out($f,"#endif\n");
2155 out($f,"#endif\n");
2164 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2171 out($f,"#else\n");
2173 out($f,
2192 out($f,"#endif\n");
2202 out($f, $m[1].$initializer_name.$m[3]."\n");
2210 out($f,$prolog."static const uint32_t specs[] = {\n");
2212 out($f,$prolog."};\n");
2213 out($f,$prolog."zend_spec_handlers = specs;\n");
2214 out($f,$prolog.$executor_name."_ex(NULL);\n");
2216 out($f,$prolog."static const void * const labels[] = {\n");
2218 out($f,$prolog."};\n");
2219 out($f,$prolog."static const uint32_t specs[] = {\n");
2221 out($f,$prolog."};\n");
2223 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2224 out($f,$prolog."zend_opcode_handler_funcs = labels;\n");
2225 out($f,$prolog."zend_spec_handlers = specs;\n");
2226 out($f,$prolog.$executor_name."_ex(NULL);\n");
2227 out($f,"#else\n");
2229 out($f,$prolog."zend_opcode_handlers = labels;\n");
2230 out($f,$prolog."zend_handlers_count = sizeof(labels) / sizeof(void*);\n");
2231 out($f,$prolog."zend_spec_handlers = specs;\n");
2233 out($f,"#endif\n");
2242 out($f, $line);
2664 out($f, HEADER_TEXT);
2714 out($f, HEADER_TEXT);
2716 out($f, "#ifdef ZEND_WIN32\n");
2718 out($f, "# pragma warning(disable : 4101)\n");
2721 out($f, "# pragma warning(once : 6235)\n");
2723 out($f, "# pragma warning(once : 6237)\n");
2725 out($f, "# pragma warning(once : 6239)\n");
2727 out($f, "# pragma warning(once : 6240)\n");
2729 out($f, "# pragma warning(once : 6285)\n");
2731 out($f, "# pragma warning(once : 6286)\n");
2733 out($f, "# pragma warning(once : 6326)\n");
2735 out($f, "#endif\n");
2738 out($f, "static user_opcode_handler_t zend_user_opcode_handlers[256] = {\n");
2740 out($f, "\t(user_opcode_handler_t)NULL,\n");
2742 out($f, "\t(user_opcode_handler_t)NULL\n};\n\n");
2744 out($f, "static uint8_t zend_user_opcodes[256] = {");
2746 if ($i % 16 == 1) out($f, "\n\t");
2747 out($f, "$i,");
2749 out($f, "255\n};\n\n");
2753 out($f, "\n");
2756out($f, "static uint32_t ZEND_FASTCALL zend_vm_get_opcode_handler_idx(uint32_t spec, const zend_op…
2757 out($f, "{\n");
2759 out($f, "\treturn spec;\n");
2761 out($f, "\tstatic const int zend_vm_decode[] = {\n");
2762 out($f, "\t\t_UNUSED_CODE, /* 0 = IS_UNUSED */\n");
2763 out($f, "\t\t_CONST_CODE, /* 1 = IS_CONST */\n");
2764 out($f, "\t\t_TMP_CODE, /* 2 = IS_TMP_VAR */\n");
2765 out($f, "\t\t_UNUSED_CODE, /* 3 */\n");
2766 out($f, "\t\t_VAR_CODE, /* 4 = IS_VAR */\n");
2767 out($f, "\t\t_UNUSED_CODE, /* 5 */\n");
2768 out($f, "\t\t_UNUSED_CODE, /* 6 */\n");
2769 out($f, "\t\t_UNUSED_CODE, /* 7 */\n");
2770 out($f, "\t\t_CV_CODE /* 8 = IS_CV */\n");
2771 out($f, "\t};\n");
2772 out($f, "\tuint32_t offset = 0;\n");
2773out($f, "\tif (spec & SPEC_RULE_OP1) offset = offset * 5 + zend_vm_decode[op->op1_type];\n");
2774out($f, "\tif (spec & SPEC_RULE_OP2) offset = offset * 5 + zend_vm_decode[op->op2_type];\n");
2784 out($f, "\tif (spec & SPEC_EXTRA_MASK) {\n");
2787 out($f, "\t\t{$else}if (spec & SPEC_RULE_RETVAL) {\n");
2788 out($f, "\t\t\toffset = offset * 2 + (op->result_type != IS_UNUSED);\n");
2789 out($f, "\t\t\tif ((spec & SPEC_RULE_OBSERVER) && ZEND_OBSERVER_ENABLED) {\n");
2790 out($f, "\t\t\t\toffset += 2;\n");
2791 out($f, "\t\t\t}\n");
2795 out($f, "\t\t{$else}if (spec & SPEC_RULE_QUICK_ARG) {\n");
2796 out($f, "\t\t\toffset = offset * 2 + (op->op2.num <= MAX_ARG_FLAG_NUM);\n");
2800 out($f, "\t\t{$else}if (spec & SPEC_RULE_OP_DATA) {\n");
2801 out($f, "\t\t\toffset = offset * 5 + zend_vm_decode[(op + 1)->op1_type];\n");
2805 out($f, "\t\t{$else}if (spec & SPEC_RULE_ISSET) {\n");
2806 out($f, "\t\t\toffset = offset * 2 + (op->extended_value & ZEND_ISEMPTY);\n");
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->result_type == (IS_SMART_BRANCH_JMPZ|IS_TMP_VAR)) {\n");
2813 out($f, "\t\t\t\toffset += 1;\n");
2814out($f, "\t\t\t} else if (op->result_type == (IS_SMART_BRANCH_JMPNZ|IS_TMP_VAR)) {\n");
2815 out($f, "\t\t\t\toffset += 2;\n");
2816 out($f, "\t\t\t}\n");
2820 out($f, "\t\t{$else}if (spec & SPEC_RULE_OBSERVER) {\n");
2821 out($f, "\t\t\toffset = offset * 2;\n");
2822 out($f, "\t\t\tif (ZEND_OBSERVER_ENABLED) {\n");
2823 out($f, "\t\t\t\toffset += 1;\n");
2824 out($f, "\t\t\t}\n");
2828 out($f, "\t\t}\n");
2830 out($f, "\t}\n");
2832 out($f, "\treturn (spec & SPEC_START_MASK) + offset;\n");
2834 out($f, "}\n\n");
2835 out($f, "#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID) || !ZEND_VM_SPEC\n");
2836 out($f, "static const void *zend_vm_get_opcode_handler(uint8_t opcode, const zend_op* op)\n");
2837 out($f, "{\n");
2839 out($f, "\treturn zend_opcode_handlers[zend_vm_get_opcode_handler_idx(opcode, op)];\n");
2841out($f, "\treturn zend_opcode_handlers[zend_vm_get_opcode_handler_idx(zend_spec_handlers[opcode], …
2843 out($f, "}\n");
2844 out($f, "#endif\n\n");
2848 out($f, "#if ZEND_VM_KIND == ZEND_VM_KIND_HYBRID\n");
2849out($f,"static const void *zend_vm_get_opcode_handler_func(uint8_t opcode, const zend_op* op)\n");
2850 out($f, "{\n");
2851 out($f, "\tuint32_t spec = zend_spec_handlers[opcode];\n");
2853 out($f, "\treturn zend_opcode_handler_funcs[spec];\n");
2855out($f, "\treturn zend_opcode_handler_funcs[zend_vm_get_opcode_handler_idx(spec, op)];\n");
2857 out($f, "}\n\n");
2858 out($f, "#endif\n\n");
2862 out($f, "ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler(zend_op* op)\n");
2863 out($f, "{\n");
2864 out($f, "\tuint8_t opcode = zend_user_opcodes[op->opcode];\n");
2866out($f, "\top->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(opcode, op)];\n");
2868 out($f, "\n");
2869 out($f, "\tif (zend_spec_handlers[op->opcode] & SPEC_RULE_COMMUTATIVE) {\n");
2870 out($f, "\t\tif (op->op1_type < op->op2_type) {\n");
2871 out($f, "\t\t\tzend_swap_operands(op);\n");
2872 out($f, "\t\t}\n");
2873 out($f, "\t}\n");
2874out($f, "\top->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(zend_spec_handlers[op…
2876 out($f, "}\n\n");
2879out($f, "ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t op1_info,…
2880 out($f, "{\n");
2881 out($f, "\tuint8_t opcode = zend_user_opcodes[op->opcode];\n");
2883out($f, "\top->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(opcode, op)];\n");
2885 out($f, "\tuint32_t spec = zend_spec_handlers[opcode];\n");
2887 out($f, "\tswitch (opcode) {\n");
2891 out($f, "\t\tcase $orig_op:\n");
2893 out($f, "\t\t\tif (op->op1_type < op->op2_type) {\n");
2894 out($f, "\t\t\t\tzend_swap_operands(op);\n");
2895 out($f, "\t\t\t}\n");
2901 out($f, "\t\t\tif $condition {\n");
2904 out($f, "\t\t\t} else if $condition {\n");
2908out($f, "\t\t\t\tif (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {\n");
2909 out($f, "\t\t\t\t\tbreak;\n");
2910 out($f, "\t\t\t\t}\n");
2912 out($f, "\t\t\t\tspec = {$spec_dsc['spec_code']};\n");
2914 out($f, "\t\t\t\tif (op->op1_type < op->op2_type) {\n");
2915 out($f, "\t\t\t\t\tzend_swap_operands(op);\n");
2916 out($f, "\t\t\t\t}\n");
2920 out($f, "\t\t\t}\n");
2922 out($f, "\t\t\tbreak;\n");
2931 out($f, "\t\tcase $orig_op:\n");
2936 out($f, "\t\t\tif (op->op1_type < op->op2_type) {\n");
2937 out($f, "\t\t\t\tzend_swap_operands(op);\n");
2938 out($f, "\t\t\t}\n");
2939 out($f, "\t\t\tbreak;\n");
2940 out($f, "\t\tcase ZEND_USER_OPCODE:\n");
2941 out($f, "\t\t\tif (zend_spec_handlers[op->opcode] & SPEC_RULE_COMMUTATIVE) {\n");
2942 out($f, "\t\t\t\tif (op->op1_type < op->op2_type) {\n");
2943 out($f, "\t\t\t\t\tzend_swap_operands(op);\n");
2944 out($f, "\t\t\t\t}\n");
2945 out($f, "\t\t\t}\n");
2946 out($f, "\t\t\tbreak;\n");
2948 out($f, "\t\tdefault:\n");
2949 out($f, "\t\t\tbreak;\n");
2950 out($f, "\t}\n");
2952out($f, "\top->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(spec, op)];\n");
2954 out($f, "}\n\n");
2958 out($f, "ZEND_API int ZEND_FASTCALL zend_vm_call_opcode_handler(zend_execute_data* ex)\n");
2959 out($f, "{\n");
2961 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2962 out($f, "\topcode_handler_t handler;\n");
2963 out($f,"#endif\n");
2965 out($f, "\tint ret;\n");
2966 out($f, "#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2967 out($f, "\tconst zend_op *orig_opline = opline;\n");
2968 out($f, "#endif\n");
2969 out($f, "#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2970 out($f, "\tzend_execute_data *orig_execute_data = execute_data;\n");
2971 out($f, "\texecute_data = ex;\n");
2972 out($f, "#else\n");
2973 out($f, "\tzend_execute_data *execute_data = ex;\n");
2974 out($f, "#endif\n");
2975 out($f, "\n");
2976 out($f, "\tLOAD_OPLINE();\n");
2977 out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
2979 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2980out($f, "\thandler = (opcode_handler_t)zend_vm_get_opcode_handler_func(zend_user_opcodes[opline->o…
2981 out($f, "\thandler(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2982 out($f, "\tif (EXPECTED(opline != &hybrid_halt_op)) {\n");
2983 out($f,"#else\n");
2985 out($f, "\t((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2987 out($f, "\tif (EXPECTED(opline)) {\n");
2988 out($f,"#endif\n");
2990 out($f, "\tif (EXPECTED(opline)) {\n");
2992out($f, "\t\tret = execute_data != ex ? (int)(execute_data->prev_execute_data != ex) + 1 : 0;\n");
2993 out($f, "\t\tSAVE_OPLINE();\n");
2994 out($f, "\t} else {\n");
2995 out($f, "\t\tret = -1;\n");
2996 out($f, "\t}\n");
2997 out($f, "#else\n");
2998out($f, "\tret = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2999 out($f, "\tSAVE_OPLINE();\n");
3000 out($f, "#endif\n");
3001 out($f, "#ifdef ZEND_VM_FP_GLOBAL_REG\n");
3002 out($f, "\texecute_data = orig_execute_data;\n");
3003 out($f, "#endif\n");
3004 out($f, "#ifdef ZEND_VM_IP_GLOBAL_REG\n");
3005 out($f, "\topline = orig_opline;\n");
3006 out($f, "#endif\n");
3007 out($f, "\treturn ret;\n");
3008 out($f, "}\n\n");
3010 out($f, "ZEND_API int ZEND_FASTCALL zend_vm_call_opcode_handler(zend_execute_data* ex)\n");
3011 out($f, "{\n");
3012out($f, "\tzend_error_noreturn(E_CORE_ERROR, \"zend_vm_call_opcode_handler() is not supported\");\…
3013 out($f, "\treturn 0;\n");
3014 out($f, "}\n\n");