Lines Matching refs:f
584 function out($f, $s) { argument
587 fputs($f,$s);
592 function out_line($f) { argument
595 fputs($f,"#line ".($line_no+1)." \"".$executor_file."\"\n");
719 function gen_code($f, $spec, $kind, $code, $op1, $op2, $name, $extra_spec=null) { argument
953 out($f, $code);
1021 function gen_handler($f, $spec, $kind, $name, $op1, $op2, $use, $code, $lineno, $opcode, $extra_spe… argument
1080 out($f, "#line $lineno \"$definition_file\"\n");
1111 out($f, $code);
1117 …out($f,"static zend_always_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_INLINE_HANDLE…
1120 …out($f,"static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE_…
1123 …out($f,"static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE…
1125 …out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE_HANDLER_ARGS…
1131 out($f,"case $cur: /* $spec_name */");
1134 out($f,"case ".$name.":");
1138 out($f," {$spec_name}_LABEL: ZEND_ATTRIBUTE_UNUSED_LABEL\n");
1140 out($f,"\n");
1144 out($f,"{$spec_name}_LABEL: ZEND_VM_GUARD($spec_name);\n");
1149 gen_code($f, $spec, $kind, $code, $op1, $op2, $name, $extra_spec);
1152 …out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE_HANDLER_ARGS…
1153 out($f,"{\n");
1154 … out($f,"\tZEND_VM_TAIL_CALL({$spec_name}_INLINE_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));\n");
1155 out($f,"}\n");
1156 out($f,"\n");
1161 function gen_helper($f, $spec, $kind, $name, $op1, $op2, $param, $code, $lineno, $inline, $cold = f… argument
1173 out($f, "#line $lineno \"$definition_file\"\n");
1181 out($f, $spec_name . "_LABEL:\n");
1197 …out($f, "static$zend_attributes ZEND_OPCODE_HANDLER_RET$zend_fastcall $spec_name(ZEND_OPCODE_HANDL…
1200 …out($f, "static$zend_attributes ZEND_OPCODE_HANDLER_RET$zend_fastcall $spec_name($param ZEND_OPCOD…
1204 out($f, "$spec_name:\n");
1207 out($f, "$spec_name:\n");
1212 gen_code($f, $spec, $kind, $code, $op1, $op2, $name, $extra_spec);
1216 function gen_null_label($f, $kind, $prolog) { argument
1219 out($f,$prolog."ZEND_NULL_HANDLER,\n");
1222 out($f,$prolog."(void*)(uintptr_t)-1,\n");
1225 out($f,$prolog."(void*)&&ZEND_NULL_LABEL,\n");
1231 function gen_labels($f, $spec, $kind, $prolog, &$specs, $switch_labels = array()) { argument
1374 …$generate = function ($op1, $op2, $extra_spec = array()) use ($f, $kind, $dsc, $prefix, $prolog, $…
1383 gen_null_label($f, $kind, $prolog);
1421 out($f,"$prolog{$spec_name}_HANDLER,\n");
1424 out($f,$prolog."(void*)(uintptr_t)$switch_labels[$spec_name],\n");
1427 out($f,$prolog."(void*)&&{$spec_name}_LABEL,\n");
1434 gen_null_label($f, $kind, $prolog);
1469 out($f,$prolog."ZEND_NULL_HANDLER,\n");
1472 out($f,$prolog."(void*)(uintptr_t)-1,\n");
1475 out($f,$prolog."(void*)&&ZEND_NULL_LABEL,\n");
1489 out($f,$prolog.$dsc['alias']."_HANDLER,\n");
1492 out($f,$prolog."(void*)&&".$dsc['alias']."_LABEL,\n");
1500 out($f,$prolog.$dsc["op"]."_HANDLER,\n");
1503 out($f,$prolog."(void*)(uintptr_t)".((string)$num).",\n");
1506 out($f,$prolog."(void*)&&".$dsc["op"]."_LABEL,\n");
1513 out($f,$prolog."ZEND_NULL_HANDLER,\n");
1516 out($f,$prolog."(void*)(uintptr_t)-1,\n");
1519 out($f,$prolog."(void*)&&ZEND_NULL_LABEL,\n");
1530 out($f,$prolog."ZEND_NULL_HANDLER\n");
1533 out($f,$prolog."(void*)(uintptr_t)-1\n");
1536 out($f,$prolog."(void*)&&ZEND_NULL_LABEL\n");
1553 function gen_specs($f, $prolog, $specs) { argument
1558 out($f, "$prolog$lastdef,\n");
1561 out($f, "$prolog$def,\n");
1563 out($f, "$prolog$lastdef\n");
1567 function gen_null_handler($f) { argument
1574 …out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS)\n…
1575 out($f,"{\n");
1576 out($f,"\tUSE_OPLINE\n");
1577 out($f,"\n");
1578 out($f,"\tSAVE_OPLINE();\n");
1579 …out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", OPLINE->opcode, OPLINE->op1_t…
1580 out($f,"\tZEND_VM_NEXT_OPCODE(); /* Never reached */\n");
1581 out($f,"}\n\n");
1666 $f = function($specs) use (&$f) {
1670 $next = $f($specs);
1682 return $f($specs);
1686 $f = fopen($fn, "r");
1687 if (!is_resource($f)) {
1691 while (!feof($f)) {
1692 $op = trim(fgets($f));
1697 fclose($f);
1702 function gen_executor_code($f, $spec, $kind, $prolog, &$switch_labels = array()) { argument
1722 …gen_handler($f, 1, $kind, $opcodes[$num]["op"], $op1, $op2, isset($opcodes[$num]["use"]), $opcodes…
1732 …gen_helper($f, 1, $kind, $num, $op1, $op2, $helpers[$num]["param"], $helpers[$num]["code"], $linen…
1751 …gen_handler($f, 0, $kind, $opcodes[$num]["op"], "ANY", "ANY", isset($opcodes[$num]["use"]), $opcod…
1756 …gen_helper($f, 0, $kind, $num, "ANY", "ANY", $helpers[$num]["param"], $helpers[$num]["code"], $lin…
1767 out($f, $txt);
1774 out_line($f);
1780 gen_null_handler($f);
1783 out($f,"default: ZEND_NULL_LABEL:\n");
1784 …out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", OPLINE->opcode, OPLINE->op1_t…
1785 out($f,"\tZEND_VM_NEXT_OPCODE(); /* Never reached */\n");
1788 out($f,"ZEND_NULL_LABEL:\n");
1789 …out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", OPLINE->opcode, OPLINE->op1_t…
1790 out($f,"\tZEND_VM_NEXT_OPCODE(); /* Never reached */\n");
1793 out($f,"\t\t\tHYBRID_CASE(HYBRID_HALT):\n");
1794 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
1795 out($f,"\t\t\t\texecute_data = vm_stack_data.orig_execute_data;\n");
1796 out($f,"#endif\n");
1797 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
1798 out($f,"\t\t\t\topline = vm_stack_data.orig_opline;\n");
1799 out($f,"#endif\n");
1800 out($f,"\t\t\t\treturn;\n");
1801 out($f,"\t\t\tHYBRID_DEFAULT:\n");
1802 out($f,"\t\t\t\tVM_TRACE(ZEND_NULL)\n");
1803 out($f,"\t\t\t\tZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
1804 out($f,"\t\t\t\tHYBRID_BREAK(); /* Never reached */\n");
1809 function skip_blanks($f, $prolog, $epilog) { argument
1811 out($f, $prolog.$epilog);
1816 function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name) { argument
1833 out($f,"#define SPEC_START_MASK 0x0000ffff\n");
1834 out($f,"#define SPEC_EXTRA_MASK 0xfffc0000\n");
1835 out($f,"#define SPEC_RULE_OP1 0x00010000\n");
1836 out($f,"#define SPEC_RULE_OP2 0x00020000\n");
1837 out($f,"#define SPEC_RULE_OP_DATA 0x00040000\n");
1838 out($f,"#define SPEC_RULE_RETVAL 0x00080000\n");
1839 out($f,"#define SPEC_RULE_QUICK_ARG 0x00100000\n");
1840 out($f,"#define SPEC_RULE_SMART_BRANCH 0x00200000\n");
1841 out($f,"#define SPEC_RULE_COMMUTATIVE 0x00800000\n");
1842 out($f,"#define SPEC_RULE_ISSET 0x01000000\n");
1843 out($f,"#define SPEC_RULE_OBSERVER 0x02000000\n");
1844 out($f,"\n");
1845 out($f,"static const uint32_t *zend_spec_handlers;\n");
1846 out($f,"static const void * const *zend_opcode_handlers;\n");
1847 out($f,"static int zend_handlers_count;\n");
1849 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1850 out($f,"static const void * const * zend_opcode_handler_funcs;\n");
1851 out($f,"static zend_op hybrid_halt_op;\n");
1852 out($f,"#endif\n");
1854 out($f,"#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID) || !ZEND_VM_SPEC\n");
1855 … out($f,"static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op);\n");
1856 out($f,"#endif\n\n");
1858 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1859 …out($f,"static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend_op* op);\…
1860 out($f,"#else\n");
1861 … out($f,"# define zend_vm_get_opcode_handler_func zend_vm_get_opcode_handler\n");
1862 out($f,"#endif\n\n");
1864 out($f,"#ifndef VM_TRACE\n");
1866 out($f,"# define VM_TRACE(op) ZEND_VM_GUARD(op);\n");
1868 out($f,"# define VM_TRACE(op)\n");
1870 out($f,"#endif\n");
1871 out($f,"#ifndef VM_TRACE_START\n");
1872 out($f,"# define VM_TRACE_START()\n");
1873 out($f,"#endif\n");
1874 out($f,"#ifndef VM_TRACE_END\n");
1875 out($f,"# define VM_TRACE_END()\n");
1876 out($f,"#endif\n");
1879 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1880 out($f,"#define HYBRID_NEXT() goto *(void**)(OPLINE->handler)\n");
1881 out($f,"#define HYBRID_SWITCH() HYBRID_NEXT();\n");
1882 out($f,"#define HYBRID_CASE(op) op ## _LABEL\n");
1883 out($f,"#define HYBRID_BREAK() HYBRID_NEXT()\n");
1884 out($f,"#define HYBRID_DEFAULT ZEND_NULL_LABEL\n");
1885 out($f,"#endif\n");
1887 out($f,"\n");
1888 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
1889 out($f,"# define ZEND_OPCODE_HANDLER_ARGS void\n");
1890 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU\n");
1891 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_DC\n");
1892 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC\n");
1893 out($f,"#else\n");
1894 … out($f,"# define ZEND_OPCODE_HANDLER_ARGS zend_execute_data *execute_data\n");
1895 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU execute_data\n");
1896 … out($f,"# define ZEND_OPCODE_HANDLER_ARGS_DC , ZEND_OPCODE_HANDLER_ARGS\n");
1897 … out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC , ZEND_OPCODE_HANDLER_ARGS_PASSTHRU\n");
1898 out($f,"#endif\n");
1899 out($f,"\n");
1900 … out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
1901 out($f,"# define ZEND_OPCODE_HANDLER_RET void\n");
1902 out($f,"# define ZEND_VM_TAIL_CALL(call) call; return\n");
1903 out($f,"# ifdef ZEND_VM_TAIL_CALL_DISPATCH\n");
1904 …out($f,"# define ZEND_VM_CONTINUE() ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_A…
1905 out($f,"# else\n");
1906 out($f,"# define ZEND_VM_CONTINUE() return\n");
1907 out($f,"# endif\n");
1909 out($f,"# if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1910 … out($f,"# define ZEND_VM_RETURN() opline = &hybrid_halt_op; return\n");
1911 … out($f,"# define ZEND_VM_HOT zend_always_inline ZEND_COLD ZEND_OPT_SIZE\n");
1912 … out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
1913 out($f,"# else\n");
1914 out($f,"# define ZEND_VM_RETURN() opline = NULL; return\n");
1915 out($f,"# define ZEND_VM_HOT\n");
1916 … out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
1917 out($f,"# endif\n");
1919 out($f,"# define ZEND_VM_RETURN() opline = NULL; return\n");
1920 … out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
1922 out($f,"#else\n");
1923 out($f,"# define ZEND_OPCODE_HANDLER_RET int\n");
1924 out($f,"# define ZEND_VM_TAIL_CALL(call) return call\n");
1925 out($f,"# define ZEND_VM_CONTINUE() return 0\n");
1926 out($f,"# define ZEND_VM_RETURN() return -1\n");
1928 out($f,"# define ZEND_VM_HOT\n");
1930 out($f,"# define ZEND_VM_COLD ZEND_COLD ZEND_OPT_SIZE\n");
1931 out($f,"#endif\n");
1932 out($f,"\n");
1933 …out($f,"typedef ZEND_OPCODE_HANDLER_RET (ZEND_FASTCALL *opcode_handler_t) (ZEND_OPCODE_HANDLER_ARG…
1934 out($f,"\n");
1935 out($f,"#define DCL_OPLINE\n");
1936 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
1937 out($f,"# define OPLINE opline\n");
1938 out($f,"# define USE_OPLINE\n");
1939 out($f,"# define LOAD_OPLINE() opline = EX(opline)\n");
1940 out($f,"# define LOAD_OPLINE_EX()\n");
1941 out($f,"# define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n");
1942 out($f,"# define SAVE_OPLINE() EX(opline) = opline\n");
1943 out($f,"# define SAVE_OPLINE_EX() SAVE_OPLINE()\n");
1944 out($f,"#else\n");
1945 out($f,"# define OPLINE EX(opline)\n");
1946 out($f,"# define USE_OPLINE const zend_op *opline = EX(opline);\n");
1947 out($f,"# define LOAD_OPLINE()\n");
1948 out($f,"# define LOAD_OPLINE_EX()\n");
1949 out($f,"# define LOAD_NEXT_OPLINE() ZEND_VM_INC_OPCODE()\n");
1950 out($f,"# define SAVE_OPLINE()\n");
1951 out($f,"# define SAVE_OPLINE_EX()\n");
1952 out($f,"#endif\n");
1953 …out($f,"#define HANDLE_EXCEPTION() ZEND_ASSERT(EG(exception)); LOAD_OPLINE(); ZEND_VM_CONTINUE()\n…
1954 …out($f,"#define HANDLE_EXCEPTION_LEAVE() ZEND_ASSERT(EG(exception)); LOAD_OPLINE(); ZEND_VM_LEAVE(…
1955 out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG)\n");
1956 … out($f,"# define ZEND_VM_ENTER_EX() ZEND_VM_INTERRUPT_CHECK(); ZEND_VM_CONTINUE()\n");
1957 …out($f,"# define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE();…
1958 out($f,"# define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n");
1959 out($f,"#elif defined(ZEND_VM_IP_GLOBAL_REG)\n");
1960 out($f,"# define ZEND_VM_ENTER_EX() return 1\n");
1961 …out($f,"# define ZEND_VM_ENTER() opline = EG(current_execute_data)->opline; ZEND_VM_ENTE…
1962 out($f,"# define ZEND_VM_LEAVE() return 2\n");
1963 out($f,"#else\n");
1964 out($f,"# define ZEND_VM_ENTER_EX() return 1\n");
1965 out($f,"# define ZEND_VM_ENTER() return 1\n");
1966 out($f,"# define ZEND_VM_LEAVE() return 2\n");
1967 out($f,"#endif\n");
1968 …out($f,"#define ZEND_VM_INTERRUPT() ZEND_VM_TAIL_CALL(zend_interrupt_helper".($spec?"_SPEC":"…
1969 …out($f,"#define ZEND_VM_LOOP_INTERRUPT() zend_interrupt_helper".($spec?"_SPEC":"")."(ZEND_OPCODE_H…
1971 …out($f,"#define ZEND_VM_DISPATCH(opcode, opline) ZEND_VM_TAIL_CALL(((opcode_handler_t)zend_vm_get_…
1973 …out($f,"#define ZEND_VM_DISPATCH(opcode, opline) ZEND_VM_TAIL_CALL(((opcode_handler_t)zend_vm_get_…
1975 out($f,"\n");
1976 …out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_interrupt_helper".($spec?"_SPEC":"")."(Z…
1977 …out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS);\…
1978 out($f,"\n");
1981 out($f,"\n");
1982 out($f,"#define OPLINE opline\n");
1983 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
1984 … out($f,"# define DCL_OPLINE register const zend_op *opline __asm__(ZEND_VM_IP_GLOBAL_REG);\n");
1985 out($f,"#else\n");
1986 out($f,"# define DCL_OPLINE const zend_op *opline;\n");
1987 out($f,"#endif\n");
1988 out($f,"#define USE_OPLINE\n");
1989 out($f,"#define LOAD_OPLINE() opline = EX(opline)\n");
1990 out($f,"# define LOAD_OPLINE_EX() LOAD_OPLINE()\n");
1991 out($f,"#define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n");
1992 out($f,"#define SAVE_OPLINE() EX(opline) = opline\n");
1993 out($f,"#define SAVE_OPLINE_EX()\n");
1994 …out($f,"#define HANDLE_EXCEPTION() ZEND_ASSERT(EG(exception)); LOAD_OPLINE(); ZEND_VM_CONTINUE()\n…
1995 …out($f,"#define HANDLE_EXCEPTION_LEAVE() ZEND_ASSERT(EG(exception)); LOAD_OPLINE(); ZEND_VM_LEAVE(…
1996 out($f,"#define ZEND_VM_CONTINUE() goto zend_vm_continue\n");
1997 out($f,"#define ZEND_VM_RETURN() return\n");
1998 … out($f,"#define ZEND_VM_ENTER_EX() ZEND_VM_INTERRUPT_CHECK(); ZEND_VM_CONTINUE()\n");
1999 …out($f,"#define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE(); ZEND_VM…
2000 out($f,"#define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n");
2001 …out($f,"#define ZEND_VM_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
2002 …out($f,"#define ZEND_VM_LOOP_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
2003 …out($f,"#define ZEND_VM_DISPATCH(opcode, opline) dispatch_handler = zend_vm_get_opcode_handler(opc…
2004 out($f,"\n");
2007 out($f,"\n");
2008 out($f,"#define OPLINE opline\n");
2009 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2010 … out($f,"# define DCL_OPLINE register const zend_op *opline __asm__(ZEND_VM_IP_GLOBAL_REG);\n");
2011 out($f,"#else\n");
2012 out($f,"# define DCL_OPLINE const zend_op *opline;\n");
2013 out($f,"#endif\n");
2014 out($f,"#define USE_OPLINE\n");
2015 out($f,"#define LOAD_OPLINE() opline = EX(opline)\n");
2016 out($f,"#define LOAD_OPLINE_EX() LOAD_OPLINE()\n");
2017 out($f,"#define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n");
2018 out($f,"#define SAVE_OPLINE() EX(opline) = opline\n");
2019 out($f,"#define SAVE_OPLINE_EX()\n");
2021 …out($f,"#define HANDLE_EXCEPTION() ZEND_ASSERT(EG(exception)); goto ZEND_HANDLE_EXCEPTION_SPEC_LAB…
2022 …out($f,"#define HANDLE_EXCEPTION_LEAVE() ZEND_ASSERT(EG(exception)); goto ZEND_HANDLE_EXCEPTION_SP…
2024 …out($f,"#define HANDLE_EXCEPTION() ZEND_ASSERT(EG(exception)); goto ZEND_HANDLE_EXCEPTION_LABEL\n"…
2025 …out($f,"#define HANDLE_EXCEPTION_LEAVE() ZEND_ASSERT(EG(exception)); goto ZEND_HANDLE_EXCEPTION_LA…
2027 out($f,"#define ZEND_VM_CONTINUE() goto *(void**)(OPLINE->handler)\n");
2028 out($f,"#define ZEND_VM_RETURN() return\n");
2029 … out($f,"#define ZEND_VM_ENTER_EX() ZEND_VM_INTERRUPT_CHECK(); ZEND_VM_CONTINUE()\n");
2030 …out($f,"#define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE(); ZEND_VM…
2031 out($f,"#define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n");
2032 …out($f,"#define ZEND_VM_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
2033 …out($f,"#define ZEND_VM_LOOP_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
2034 …out($f,"#define ZEND_VM_DISPATCH(opcode, opline) goto *(void**)(zend_vm_get_opcode_handler(opcode,…
2035 out($f,"\n");
2039 gen_executor_code($f, $spec, ZEND_VM_KIND_CALL, $m[1]);
2040 out($f,"\n");
2041 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2042 out($f,"# undef ZEND_VM_TAIL_CALL\n");
2043 out($f,"# undef ZEND_VM_CONTINUE\n");
2044 out($f,"# undef ZEND_VM_RETURN\n");
2046 out($f,"\n");
2047 out($f,"# define ZEND_VM_TAIL_CALL(call) call; ZEND_VM_CONTINUE()\n");
2048 out($f,"# define ZEND_VM_CONTINUE() HYBRID_NEXT()\n");
2049 out($f,"# define ZEND_VM_RETURN() goto HYBRID_HALT_LABEL\n");
2051 out($f,"#endif\n\n");
2055 out($f, $m[1].$executor_name.$m[3]."\n");
2059 out($f,$m[1]."const void *dispatch_handler;\n");
2063 out($f, "#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2067 out($f,$m[1].$param.";\n");
2070 out($f, "#endif\n");
2074 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2075 … out($f,$m[1]."register zend_execute_data *execute_data __asm__(ZEND_VM_FP_GLOBAL_REG) = ex;\n");
2076 out($f,"#else\n");
2077 out($f,$m[1]."zend_execute_data *execute_data = ex;\n");
2078 out($f,"#endif\n");
2080 … out($f,"#if defined(ZEND_VM_IP_GLOBAL_REG) || defined(ZEND_VM_IP_GLOBAL_REG)\n");
2081 out($f,$m[1]."struct {\n");
2082 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2083 out($f,$m[1]."\tconst zend_op *orig_opline;\n");
2084 out($f,"#endif\n");
2085 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2086 out($f,$m[1]."\tzend_execute_data *orig_execute_data;\n");
2087 out($f,"#ifdef ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE\n");
2088 … out($f,$m[1]."\tchar hybrid_jit_red_zone[ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE];\n");
2089 out($f,"#endif\n");
2090 out($f,"#endif\n");
2091 out($f,$m[1]."} vm_stack_data;\n");
2092 out($f,"#endif\n");
2093 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2094 out($f,$m[1]."vm_stack_data.orig_opline = opline;\n");
2095 out($f,"#endif\n");
2096 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2097 out($f,$m[1]."vm_stack_data.orig_execute_data = execute_data;\n");
2098 out($f,$m[1]."execute_data = ex;\n");
2099 out($f,"#else\n");
2100 out($f,$m[1]."zend_execute_data *execute_data = ex;\n");
2101 out($f,"#endif\n");
2102 out($f,"#ifdef ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE\n");
2103 … out($f,$m[1]."memset(vm_stack_data.hybrid_jit_red_zone, 0, ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE);\n");
2104 out($f,$m[1]."if (zend_touch_vm_stack_data) {\n");
2105 out($f,$m[1]."\tzend_touch_vm_stack_data(&vm_stack_data);\n");
2106 out($f,$m[1]."}\n");
2107 out($f,"#endif\n");
2115 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2118 out($f,$prolog."if (UNEXPECTED(execute_data == NULL)) {\n");
2119 out($f,$prolog."\tstatic const void * const labels[] = {\n");
2120 …gen_labels($f, $spec, ($kind == ZEND_VM_KIND_HYBRID) ? ZEND_VM_KIND_GOTO : $kind, $prolog."\t\t", …
2121 out($f,$prolog."\t};\n");
2122 out($f,$prolog."\tzend_opcode_handlers = (const void **) labels;\n");
2123 out($f,$prolog."\tzend_handlers_count = sizeof(labels) / sizeof(void*);\n");
2125 … out($f,$prolog."\tmemset(&hybrid_halt_op, 0, sizeof(hybrid_halt_op));\n");
2126 … out($f,$prolog."\thybrid_halt_op.handler = (void*)&&HYBRID_HALT_LABEL;\n");
2127 out($f,$prolog."\tgoto HYBRID_HALT_LABEL;\n");
2129 out($f,$prolog."\treturn;\n");
2131 out($f,$prolog."}\n");
2133 out($f,"#endif\n");
2136 skip_blanks($f, $m[1], $m[3]);
2142 … out($f,"#if !defined(ZEND_VM_FP_GLOBAL_REG) || !defined(ZEND_VM_IP_GLOBAL_REG)\n");
2143 out($f,$m[1]."\tint ret;".$m[3]."\n");
2144 out($f,"#endif\n");
2147 out($f,"zend_vm_continue:".$m[3]."\n");
2149 skip_blanks($f, $m[1], $m[3]);
2156 …out($f, $m[1]."dispatch_handler = OPLINE->handler;\nzend_vm_dispatch:\n".$m[1]."switch ((int)(uint…
2159 out($f, $m[1]."goto *(void**)(OPLINE->handler);".$m[3]."\n");
2162 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2163 out($f, $m[1]."HYBRID_SWITCH()".$m[3]."\n");
2164 out($f,"#else\n");
2166 … out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
2167 … out($f, $m[1]."((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2168 out($f, $m[1]."if (UNEXPECTED(!OPLINE))".$m[3]."\n");
2169 out($f,"#else\n");
2170 …out($f, $m[1]."if (UNEXPECTED((ret = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_…
2171 out($f,"#endif\n");
2173 out($f,"#endif\n");
2182 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2184 gen_executor_code($f, $spec, $kind, $m[1], $switch_labels);
2189 out($f,"#else\n");
2191 out($f,
2210 out($f,"#endif\n");
2216 gen_executor_code($f, $spec, $kind, $m[1]);
2220 out($f, $m[1].$initializer_name.$m[3]."\n");
2228 out($f,$prolog."static const uint32_t specs[] = {\n");
2229 gen_specs($f, $prolog."\t", $specs);
2230 out($f,$prolog."};\n");
2231 out($f,$prolog."zend_spec_handlers = specs;\n");
2232 out($f,$prolog.$executor_name."_ex(NULL);\n");
2234 out($f,$prolog."static const void * const labels[] = {\n");
2235 …gen_labels($f, $spec, ($kind == ZEND_VM_KIND_HYBRID) ? ZEND_VM_KIND_CALL : $kind, $prolog."\t", $s…
2236 out($f,$prolog."};\n");
2237 out($f,$prolog."static const uint32_t specs[] = {\n");
2238 gen_specs($f, $prolog."\t", $specs);
2239 out($f,$prolog."};\n");
2241 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2242 out($f,$prolog."zend_opcode_handler_funcs = labels;\n");
2243 out($f,$prolog."zend_spec_handlers = specs;\n");
2244 out($f,$prolog.$executor_name."_ex(NULL);\n");
2245 out($f,"#else\n");
2247 out($f,$prolog."zend_opcode_handlers = labels;\n");
2248 out($f,$prolog."zend_handlers_count = sizeof(labels) / sizeof(void*);\n");
2249 out($f,$prolog."zend_spec_handlers = specs;\n");
2251 out($f,"#endif\n");
2260 out($f, $line);
2590 …$f = fopen(__DIR__ . "/zend_vm_opcodes.h", "w+") or die("ERROR: Cannot create zend_vm_opcodes.h\n"…
2593 out($f, HEADER_TEXT);
2594 fputs($f, "#ifndef ZEND_VM_OPCODES_H\n#define ZEND_VM_OPCODES_H\n\n");
2595 fputs($f, "#define ZEND_VM_SPEC\t\t" . ZEND_VM_SPEC . "\n");
2596 fputs($f, "#define ZEND_VM_LINES\t\t" . ZEND_VM_LINES . "\n");
2597 fputs($f, "#define ZEND_VM_KIND_CALL\t" . ZEND_VM_KIND_CALL . "\n");
2598 fputs($f, "#define ZEND_VM_KIND_SWITCH\t" . ZEND_VM_KIND_SWITCH . "\n");
2599 fputs($f, "#define ZEND_VM_KIND_GOTO\t" . ZEND_VM_KIND_GOTO . "\n");
2600 fputs($f, "#define ZEND_VM_KIND_HYBRID\t" . ZEND_VM_KIND_HYBRID . "\n");
2602 fputs($f, "/* HYBRID requires support for computed GOTO and global register variables*/\n");
2603 fputs($f, "#if (defined(__GNUC__) && defined(HAVE_GCC_GLOBAL_REGS))\n");
2604 fputs($f, "# define ZEND_VM_KIND\t\tZEND_VM_KIND_HYBRID\n");
2605 fputs($f, "#else\n");
2606 fputs($f, "# define ZEND_VM_KIND\t\tZEND_VM_KIND_CALL\n");
2607 fputs($f, "#endif\n");
2609 fputs($f, "#define ZEND_VM_KIND\t\t" . $GLOBALS["vm_kind_name"][ZEND_VM_KIND] . "\n");
2611 fputs($f, "\n");
2612 fputs($f, "#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) && !defined(__SANITIZE_ADDRESS__)\n");
2613 …fputs($f, "# if ((defined(i386) && !defined(__PIC__)) || defined(__x86_64__) || defined(_M_X64))\n…
2614 fputs($f, "# define ZEND_VM_HYBRID_JIT_RED_ZONE_SIZE 16\n");
2615 fputs($f, "# endif\n");
2616 fputs($f, "#endif\n");
2617 fputs($f, "\n");
2619 fprintf($f, "#define %-24s 0x%08x\n", $name, $val);
2621 fputs($f, "#define ZEND_VM_OP1_FLAGS(flags) (flags & 0xff)\n");
2622 fputs($f, "#define ZEND_VM_OP2_FLAGS(flags) ((flags >> 8) & 0xff)\n");
2623 fputs($f, "\n");
2624 fputs($f, "BEGIN_EXTERN_C()\n\n");
2625 fputs($f, "ZEND_API const char* ZEND_FASTCALL zend_get_opcode_name(zend_uchar opcode);\n");
2626 fputs($f, "ZEND_API uint32_t ZEND_FASTCALL zend_get_opcode_flags(zend_uchar opcode);\n\n");
2627 fputs($f, "END_EXTERN_C()\n\n");
2633 fputs($f,"#define $op $code\n");
2639 fputs($f,"\n#define $op $code\n");
2641 fputs($f, "\n#endif\n");
2642 fclose($f);
2646 …$f = fopen(__DIR__ . "/zend_vm_opcodes.c", "w+") or die("ERROR: Cannot create zend_vm_opcodes.c\n"…
2649 out($f, HEADER_TEXT);
2650 fputs($f,"#include <stdio.h>\n");
2651 fputs($f,"#include <zend.h>\n");
2652 fputs($f,"#include <zend_vm_opcodes.h>\n\n");
2654 fputs($f,"static const char *zend_vm_opcodes_names[".($max_opcode + 1)."] = {\n");
2656 fputs($f,"\t".(isset($opcodes[$i]["op"])?'"'.$opcodes[$i]["op"].'"':"NULL").",\n");
2658 fputs($f, "};\n\n");
2660 fputs($f,"static uint32_t zend_vm_opcodes_flags[".($max_opcode + 1)."] = {\n");
2662 fprintf($f, "\t0x%08x,\n", isset($opcodes[$i]["flags"]) ? $opcodes[$i]["flags"] : 0);
2664 fputs($f, "};\n\n");
2666 fputs($f, "ZEND_API const char* ZEND_FASTCALL zend_get_opcode_name(zend_uchar opcode) {\n");
2667 fputs($f, "\tif (UNEXPECTED(opcode > ZEND_VM_LAST_OPCODE)) {\n");
2668 fputs($f, "\t\treturn NULL;\n");
2669 fputs($f, "\t}\n");
2670 fputs($f, "\treturn zend_vm_opcodes_names[opcode];\n");
2671 fputs($f, "}\n");
2673 fputs($f, "ZEND_API uint32_t ZEND_FASTCALL zend_get_opcode_flags(zend_uchar opcode) {\n");
2674 fputs($f, "\tif (UNEXPECTED(opcode > ZEND_VM_LAST_OPCODE)) {\n");
2675 fputs($f, "\t\topcode = ZEND_NOP;\n");
2676 fputs($f, "\t}\n");
2677 fputs($f, "\treturn zend_vm_opcodes_flags[opcode];\n");
2678 fputs($f, "}\n");
2680 fclose($f);
2684 …$f = fopen(__DIR__ . "/zend_vm_execute.h", "w+") or die("ERROR: Cannot create zend_vm_execute.h\n"…
2688 out($f, HEADER_TEXT);
2690 out($f, "#ifdef ZEND_WIN32\n");
2692 out($f, "# pragma warning(disable : 4101)\n");
2695 out($f, "# pragma warning(once : 6235)\n");
2697 out($f, "# pragma warning(once : 6237)\n");
2699 out($f, "# pragma warning(once : 6239)\n");
2701 out($f, "# pragma warning(once : 6240)\n");
2703 out($f, "# pragma warning(once : 6285)\n");
2705 out($f, "# pragma warning(once : 6286)\n");
2707 out($f, "# pragma warning(once : 6326)\n");
2709 out($f, "#endif\n");
2712 out($f, "static user_opcode_handler_t zend_user_opcode_handlers[256] = {\n");
2714 out($f, "\t(user_opcode_handler_t)NULL,\n");
2716 out($f, "\t(user_opcode_handler_t)NULL\n};\n\n");
2718 out($f, "static zend_uchar zend_user_opcodes[256] = {");
2720 if ($i % 16 == 1) out($f, "\n\t");
2721 out($f, "$i,");
2723 out($f, "255\n};\n\n");
2726 gen_executor($f, $skl, ZEND_VM_SPEC, ZEND_VM_KIND, "execute", "zend_vm_init");
2727 out($f, "\n");
2730 …out($f, "static uint32_t ZEND_FASTCALL zend_vm_get_opcode_handler_idx(uint32_t spec, const zend_op…
2731 out($f, "{\n");
2733 out($f, "\treturn spec;\n");
2735 out($f, "\tstatic const int zend_vm_decode[] = {\n");
2736 out($f, "\t\t_UNUSED_CODE, /* 0 = IS_UNUSED */\n");
2737 out($f, "\t\t_CONST_CODE, /* 1 = IS_CONST */\n");
2738 out($f, "\t\t_TMP_CODE, /* 2 = IS_TMP_VAR */\n");
2739 out($f, "\t\t_UNUSED_CODE, /* 3 */\n");
2740 out($f, "\t\t_VAR_CODE, /* 4 = IS_VAR */\n");
2741 out($f, "\t\t_UNUSED_CODE, /* 5 */\n");
2742 out($f, "\t\t_UNUSED_CODE, /* 6 */\n");
2743 out($f, "\t\t_UNUSED_CODE, /* 7 */\n");
2744 out($f, "\t\t_CV_CODE /* 8 = IS_CV */\n");
2745 out($f, "\t};\n");
2746 out($f, "\tuint32_t offset = 0;\n");
2747 … out($f, "\tif (spec & SPEC_RULE_OP1) offset = offset * 5 + zend_vm_decode[op->op1_type];\n");
2748 … out($f, "\tif (spec & SPEC_RULE_OP2) offset = offset * 5 + zend_vm_decode[op->op2_type];\n");
2758 out($f, "\tif (spec & SPEC_EXTRA_MASK) {\n");
2761 out($f, "\t\t{$else}if (spec & SPEC_RULE_RETVAL) {\n");
2762 out($f, "\t\t\toffset = offset * 2 + (op->result_type != IS_UNUSED);\n");
2763 out($f, "\t\t\tif ((spec & SPEC_RULE_OBSERVER) && ZEND_OBSERVER_ENABLED) {\n");
2764 out($f, "\t\t\t\toffset += 2;\n");
2765 out($f, "\t\t\t}\n");
2769 out($f, "\t\t{$else}if (spec & SPEC_RULE_QUICK_ARG) {\n");
2770 out($f, "\t\t\toffset = offset * 2 + (op->op2.num <= MAX_ARG_FLAG_NUM);\n");
2774 out($f, "\t\t{$else}if (spec & SPEC_RULE_OP_DATA) {\n");
2775 out($f, "\t\t\toffset = offset * 5 + zend_vm_decode[(op + 1)->op1_type];\n");
2779 out($f, "\t\t{$else}if (spec & SPEC_RULE_ISSET) {\n");
2780 out($f, "\t\t\toffset = offset * 2 + (op->extended_value & ZEND_ISEMPTY);\n");
2784 out($f, "\t\t{$else}if (spec & SPEC_RULE_SMART_BRANCH) {\n");
2785 out($f, "\t\t\toffset = offset * 3;\n");
2786 out($f, "\t\t\tif (op->result_type == (IS_SMART_BRANCH_JMPZ|IS_TMP_VAR)) {\n");
2787 out($f, "\t\t\t\toffset += 1;\n");
2788 … out($f, "\t\t\t} else if (op->result_type == (IS_SMART_BRANCH_JMPNZ|IS_TMP_VAR)) {\n");
2789 out($f, "\t\t\t\toffset += 2;\n");
2790 out($f, "\t\t\t}\n");
2794 out($f, "\t\t{$else}if (spec & SPEC_RULE_OBSERVER) {\n");
2795 out($f, "\t\t\toffset = offset * 2;\n");
2796 out($f, "\t\t\tif (ZEND_OBSERVER_ENABLED) {\n");
2797 out($f, "\t\t\t\toffset += 1;\n");
2798 out($f, "\t\t\t}\n");
2802 out($f, "\t\t}\n");
2804 out($f, "\t}\n");
2806 out($f, "\treturn (spec & SPEC_START_MASK) + offset;\n");
2808 out($f, "}\n\n");
2809 out($f, "#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID) || !ZEND_VM_SPEC\n");
2810 … out($f, "static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op)\n");
2811 out($f, "{\n");
2813 out($f, "\treturn zend_opcode_handlers[zend_vm_get_opcode_handler_idx(opcode, op)];\n");
2815 …out($f, "\treturn zend_opcode_handlers[zend_vm_get_opcode_handler_idx(zend_spec_handlers[opcode], …
2817 out($f, "}\n");
2818 out($f, "#endif\n\n");
2822 out($f, "#if ZEND_VM_KIND == ZEND_VM_KIND_HYBRID\n");
2823 …out($f,"static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend_op* op)\n…
2824 out($f, "{\n");
2825 out($f, "\tuint32_t spec = zend_spec_handlers[opcode];\n");
2827 out($f, "\treturn zend_opcode_handler_funcs[spec];\n");
2829 … out($f, "\treturn zend_opcode_handler_funcs[zend_vm_get_opcode_handler_idx(spec, op)];\n");
2831 out($f, "}\n\n");
2832 out($f, "#endif\n\n");
2836 out($f, "ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler(zend_op* op)\n");
2837 out($f, "{\n");
2838 out($f, "\tzend_uchar opcode = zend_user_opcodes[op->opcode];\n");
2840 … out($f, "\top->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(opcode, op)];\n");
2842 out($f, "\n");
2843 out($f, "\tif (zend_spec_handlers[op->opcode] & SPEC_RULE_COMMUTATIVE) {\n");
2844 out($f, "\t\tif (op->op1_type < op->op2_type) {\n");
2845 out($f, "\t\t\tzend_swap_operands(op);\n");
2846 out($f, "\t\t}\n");
2847 out($f, "\t}\n");
2848 …out($f, "\top->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(zend_spec_handlers[op…
2850 out($f, "}\n\n");
2853 …out($f, "ZEND_API void ZEND_FASTCALL zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t op1_info,…
2854 out($f, "{\n");
2855 out($f, "\tzend_uchar opcode = zend_user_opcodes[op->opcode];\n");
2857 … out($f, "\top->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(opcode, op)];\n");
2859 out($f, "\tuint32_t spec = zend_spec_handlers[opcode];\n");
2861 out($f, "\tswitch (opcode) {\n");
2865 out($f, "\t\tcase $orig_op:\n");
2867 out($f, "\t\t\tif (op->op1_type < op->op2_type) {\n");
2868 out($f, "\t\t\t\tzend_swap_operands(op);\n");
2869 out($f, "\t\t\t}\n");
2875 out($f, "\t\t\tif $condition {\n");
2878 out($f, "\t\t\t} else if $condition {\n");
2882 … out($f, "\t\t\t\tif (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {\n");
2883 out($f, "\t\t\t\t\tbreak;\n");
2884 out($f, "\t\t\t\t}\n");
2886 out($f, "\t\t\t\tspec = ${spec_dsc['spec_code']};\n");
2888 out($f, "\t\t\t\tif (op->op1_type < op->op2_type) {\n");
2889 out($f, "\t\t\t\t\tzend_swap_operands(op);\n");
2890 out($f, "\t\t\t\t}\n");
2894 out($f, "\t\t\t}\n");
2896 out($f, "\t\t\tbreak;\n");
2905 out($f, "\t\tcase $orig_op:\n");
2910 out($f, "\t\t\tif (op->op1_type < op->op2_type) {\n");
2911 out($f, "\t\t\t\tzend_swap_operands(op);\n");
2912 out($f, "\t\t\t}\n");
2913 out($f, "\t\t\tbreak;\n");
2914 out($f, "\t\tcase ZEND_USER_OPCODE:\n");
2915 out($f, "\t\t\tif (zend_spec_handlers[op->opcode] & SPEC_RULE_COMMUTATIVE) {\n");
2916 out($f, "\t\t\t\tif (op->op1_type < op->op2_type) {\n");
2917 out($f, "\t\t\t\t\tzend_swap_operands(op);\n");
2918 out($f, "\t\t\t\t}\n");
2919 out($f, "\t\t\t}\n");
2920 out($f, "\t\t\tbreak;\n");
2922 out($f, "\t\tdefault:\n");
2923 out($f, "\t\t\tbreak;\n");
2924 out($f, "\t}\n");
2926 … out($f, "\top->handler = zend_opcode_handlers[zend_vm_get_opcode_handler_idx(spec, op)];\n");
2928 out($f, "}\n\n");
2932 out($f, "ZEND_API int ZEND_FASTCALL zend_vm_call_opcode_handler(zend_execute_data* ex)\n");
2933 out($f, "{\n");
2935 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2936 out($f, "\topcode_handler_t handler;\n");
2937 out($f,"#endif\n");
2939 out($f, "\tint ret;\n");
2940 out($f, "#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2941 out($f, "\tconst zend_op *orig_opline = opline;\n");
2942 out($f, "#endif\n");
2943 out($f, "#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2944 out($f, "\tzend_execute_data *orig_execute_data = execute_data;\n");
2945 out($f, "\texecute_data = ex;\n");
2946 out($f, "#else\n");
2947 out($f, "\tzend_execute_data *execute_data = ex;\n");
2948 out($f, "#endif\n");
2949 out($f, "\n");
2950 out($f, "\tLOAD_OPLINE();\n");
2951 out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
2953 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2954 …out($f, "\thandler = (opcode_handler_t)zend_vm_get_opcode_handler_func(zend_user_opcodes[opline->o…
2955 out($f, "\thandler(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2956 out($f, "\tif (EXPECTED(opline != &hybrid_halt_op)) {\n");
2957 out($f,"#else\n");
2959 out($f, "\t((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2961 out($f, "\tif (EXPECTED(opline)) {\n");
2962 out($f,"#endif\n");
2964 out($f, "\tif (EXPECTED(opline)) {\n");
2966 … out($f, "\t\tret = execute_data != ex ? (int)(execute_data->prev_execute_data != ex) + 1 : 0;\n");
2967 out($f, "\t\tSAVE_OPLINE();\n");
2968 out($f, "\t} else {\n");
2969 out($f, "\t\tret = -1;\n");
2970 out($f, "\t}\n");
2971 out($f, "#else\n");
2972 … out($f, "\tret = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2973 out($f, "\tSAVE_OPLINE();\n");
2974 out($f, "#endif\n");
2975 out($f, "#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2976 out($f, "\texecute_data = orig_execute_data;\n");
2977 out($f, "#endif\n");
2978 out($f, "#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2979 out($f, "\topline = orig_opline;\n");
2980 out($f, "#endif\n");
2981 out($f, "\treturn ret;\n");
2982 out($f, "}\n\n");
2984 out($f, "ZEND_API int ZEND_FASTCALL zend_vm_call_opcode_handler(zend_execute_data* ex)\n");
2985 out($f, "{\n");
2986 …out($f, "\tzend_error_noreturn(E_CORE_ERROR, \"zend_vm_call_opcode_handler() is not supported\");\…
2987 out($f, "\treturn 0;\n");
2988 out($f, "}\n\n");
2991 fclose($f);