Lines Matching refs:out

611 function out($f, $s) {  function
949 out($f, $code);
986 out($f, "#line $lineno \"$definition_file\"\n");
993 out($f,"\t\t\tHYBRID_CASE({$spec_name}):\n");
994 out($f,"\t\t\t\t{$spec_name}_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
995 out($f,"\t\t\t\tHYBRID_BREAK();\n");
999out($f,"static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE_…
1001out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL {$spec_name}_HANDLER(ZEND_OPCODE_HANDLER_ARGS…
1007 out($f,"case $cur: /* $spec_name */");
1010 out($f,"case ".$name.":");
1014 out($f," {$spec_name}_LABEL:\n");
1016 out($f,"\n");
1020 out($f,"{$spec_name}_LABEL: ZEND_VM_GUARD($spec_name);\n");
1041 out($f, "#line $lineno \"$definition_file\"\n");
1058out($f, "static$zend_always_inline ZEND_OPCODE_HANDLER_RET$zend_fastcall $spec_name(ZEND_OPCODE_HA…
1061out($f, "static$zend_always_inline ZEND_OPCODE_HANDLER_RET$zend_fastcall $spec_name($param ZEND_OP…
1065 out($f, "$spec_name:\n");
1068 out($f, "$spec_name:\n");
1080 out($f,$prolog."ZEND_NULL_HANDLER,\n");
1083 out($f,$prolog."(void*)(uintptr_t)-1,\n");
1086 out($f,$prolog."(void*)&&ZEND_NULL_LABEL,\n");
1229 out($f,"$prolog{$spec_name}_HANDLER,\n");
1233 out($f,$prolog."(void*)(uintptr_t)$switch_labels[$spec_name],\n");
1237 out($f,$prolog."(void*)&&{$spec_name}_LABEL,\n");
1277 out($f,$prolog."ZEND_NULL_HANDLER,\n");
1280 out($f,$prolog."(void*)(uintptr_t)-1,\n");
1283 out($f,$prolog."(void*)&&ZEND_NULL_LABEL,\n");
1298 out($f,$prolog.$dsc["op"]."_HANDLER,\n");
1301 out($f,$prolog."(void*)(uintptr_t)".((string)$num).",\n");
1304 out($f,$prolog."(void*)&&".$dsc["op"]."_LABEL,\n");
1310 out($f,$prolog."ZEND_NULL_HANDLER,\n");
1313 out($f,$prolog."(void*)(uintptr_t)-1,\n");
1316 out($f,$prolog."(void*)&&ZEND_NULL_LABEL,\n");
1326 out($f,$prolog."ZEND_NULL_HANDLER\n");
1329 out($f,$prolog."(void*)(uintptr_t)-1\n");
1332 out($f,$prolog."(void*)&&ZEND_NULL_LABEL\n");
1344 out($f, "$prolog$lastdef,\n");
1347 out($f, "$prolog$def,\n");
1349 out($f, "$prolog$lastdef\n");
1360out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS)\n…
1361 out($f,"{\n");
1362 out($f,"\tUSE_OPLINE\n");
1363 out($f,"\n");
1364out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", OPLINE->opcode, OPLINE->op1_t…
1365 out($f,"\tZEND_VM_NEXT_OPCODE(); /* Never reached */\n");
1366 out($f,"}\n\n");
1533 out($f,"default:\n");
1534out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", OPLINE->opcode, OPLINE->op1_t…
1535 out($f,"\tZEND_VM_NEXT_OPCODE(); /* Never reached */\n");
1538 out($f,"ZEND_NULL_LABEL:\n");
1539out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", OPLINE->opcode, OPLINE->op1_t…
1540 out($f,"\tZEND_VM_NEXT_OPCODE(); /* Never reached */\n");
1543 out($f,"\t\t\tHYBRID_CASE(HYBRID_HALT):\n");
1544 out($f,"\t\t\t\texecute_data = orig_execute_data;\n");
1545 out($f,"\t\t\t\topline = orig_opline;\n");
1546 out($f,"\t\t\t\treturn;\n");
1547 out($f,"\t\t\tHYBRID_DEFAULT:\n");
1548out($f,"\t\t\t\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", OPLINE->opcode, OPLINE-…
1549 out($f,"\t\t\t\tHYBRID_BREAK(); /* Never reached */\n");
1556 out($f, $prolog.$epilog);
1572 out($f,"#define SPEC_START_MASK 0x0000ffff\n");
1573 out($f,"#define SPEC_RULE_OP1 0x00010000\n");
1574 out($f,"#define SPEC_RULE_OP2 0x00020000\n");
1575 out($f,"#define SPEC_RULE_OP_DATA 0x00040000\n");
1576 out($f,"#define SPEC_RULE_RETVAL 0x00080000\n");
1577 out($f,"#define SPEC_RULE_QUICK_ARG 0x00100000\n");
1578 out($f,"#define SPEC_RULE_SMART_BRANCH 0x00200000\n");
1579 out($f,"#define SPEC_RULE_DIM_OBJ 0x00400000\n");
1580 out($f,"\n");
1581 out($f,"static const uint32_t *zend_spec_handlers;\n");
1582 out($f,"static const void **zend_opcode_handlers;\n");
1583 out($f,"static int zend_handlers_count;\n");
1585 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1586 out($f,"static const void **zend_opcode_handler_funcs;\n");
1587 out($f,"static zend_op hybrid_halt_op;\n");
1588 out($f,"#endif\n");
1590out($f,"static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op);\n\n");
1592 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1593out($f,"static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend_op* op);\…
1594 out($f,"#else\n");
1595 out($f,"# define zend_vm_get_opcode_handler_func zend_vm_get_opcode_handler\n");
1596 out($f,"#endif\n\n");
1600 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1601 out($f,"#define HYBRID_NEXT() goto *(void**)(OPLINE->handler)\n");
1602 out($f,"#define HYBRID_SWITCH() HYBRID_NEXT();\n");
1603 out($f,"#define HYBRID_CASE(op) op ## _LABEL\n");
1604 out($f,"#define HYBRID_BREAK() HYBRID_NEXT()\n");
1605 out($f,"#define HYBRID_DEFAULT ZEND_NULL_LABEL\n");
1606 out($f,"#endif\n");
1608 out($f,"\n");
1609 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
1610 out($f,"# define ZEND_OPCODE_HANDLER_ARGS void\n");
1611 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU\n");
1612 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_DC\n");
1613 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC\n");
1614 out($f,"#else\n");
1615 out($f,"# define ZEND_OPCODE_HANDLER_ARGS zend_execute_data *execute_data\n");
1616 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU execute_data\n");
1617 out($f,"# define ZEND_OPCODE_HANDLER_ARGS_DC , ZEND_OPCODE_HANDLER_ARGS\n");
1618out($f,"# define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC , ZEND_OPCODE_HANDLER_ARGS_PASSTHRU\n");
1619 out($f,"#endif\n");
1620 out($f,"\n");
1621 out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
1622 out($f,"# define ZEND_OPCODE_HANDLER_RET void\n");
1623 out($f,"# define ZEND_VM_TAIL_CALL(call) call; return\n");
1624 out($f,"# ifdef ZEND_VM_TAIL_CALL_DISPATCH\n");
1625out($f,"# define ZEND_VM_CONTINUE() ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_A…
1626 out($f,"# else\n");
1627 out($f,"# define ZEND_VM_CONTINUE() return\n");
1628 out($f,"# endif\n");
1630 out($f,"# if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1631 out($f,"# define ZEND_VM_RETURN() opline = &hybrid_halt_op; return\n");
1632 out($f,"# define ZEND_VM_HOT zend_always_inline\n");
1633 out($f,"# else\n");
1634 out($f,"# define ZEND_VM_RETURN() opline = NULL; return\n");
1635 out($f,"# define ZEND_VM_HOT\n");
1636 out($f,"# endif\n");
1638 out($f,"# define ZEND_VM_RETURN() opline = NULL; return\n");
1640 out($f,"#else\n");
1641 out($f,"# define ZEND_OPCODE_HANDLER_RET int\n");
1642 out($f,"# define ZEND_VM_TAIL_CALL(call) return call\n");
1643 out($f,"# define ZEND_VM_CONTINUE() return 0\n");
1644 out($f,"# define ZEND_VM_RETURN() return -1\n");
1646 out($f,"# define ZEND_VM_HOT\n");
1648 out($f,"#endif\n");
1649 out($f,"\n");
1650out($f,"typedef ZEND_OPCODE_HANDLER_RET (ZEND_FASTCALL *opcode_handler_t) (ZEND_OPCODE_HANDLER_ARG…
1651 out($f,"\n");
1652 out($f,"#undef OPLINE\n");
1653 out($f,"#undef DCL_OPLINE\n");
1654 out($f,"#undef USE_OPLINE\n");
1655 out($f,"#undef LOAD_OPLINE\n");
1656 out($f,"#undef LOAD_OPLINE_EX\n");
1657 out($f,"#undef SAVE_OPLINE\n");
1658 out($f,"#define DCL_OPLINE\n");
1659 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
1660 out($f,"# define OPLINE opline\n");
1661 out($f,"# define USE_OPLINE\n");
1662 out($f,"# define LOAD_OPLINE() opline = EX(opline)\n");
1663 out($f,"# define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n");
1664 out($f,"# define SAVE_OPLINE() EX(opline) = opline\n");
1665 out($f,"#else\n");
1666 out($f,"# define OPLINE EX(opline)\n");
1667 out($f,"# define USE_OPLINE const zend_op *opline = EX(opline);\n");
1668 out($f,"# define LOAD_OPLINE()\n");
1669 out($f,"# define LOAD_NEXT_OPLINE() ZEND_VM_INC_OPCODE()\n");
1670 out($f,"# define SAVE_OPLINE()\n");
1671 out($f,"#endif\n");
1672 out($f,"#undef HANDLE_EXCEPTION\n");
1673 out($f,"#undef HANDLE_EXCEPTION_LEAVE\n");
1674 out($f,"#define HANDLE_EXCEPTION() LOAD_OPLINE(); ZEND_VM_CONTINUE()\n");
1675 out($f,"#define HANDLE_EXCEPTION_LEAVE() LOAD_OPLINE(); ZEND_VM_LEAVE()\n");
1676 out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG)\n");
1677out($f,"# define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE();…
1678 out($f,"# define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n");
1679 out($f,"#elif defined(ZEND_VM_IP_GLOBAL_REG)\n");
1680out($f,"# define ZEND_VM_ENTER() opline = EG(current_execute_data)->opline; return 1\n");
1681 out($f,"# define ZEND_VM_LEAVE() return 2\n");
1682 out($f,"#else\n");
1683 out($f,"# define ZEND_VM_ENTER() return 1\n");
1684 out($f,"# define ZEND_VM_LEAVE() return 2\n");
1685 out($f,"#endif\n");
1686out($f,"#define ZEND_VM_INTERRUPT() ZEND_VM_TAIL_CALL(zend_interrupt_helper".($spec?"_SPEC":"…
1687out($f,"#define ZEND_VM_LOOP_INTERRUPT() zend_interrupt_helper".($spec?"_SPEC":"")."(ZEND_OPCODE_H…
1689out($f,"#define ZEND_VM_DISPATCH(opcode, opline) ZEND_VM_TAIL_CALL(((opcode_handler_t)zend_vm_get_…
1691out($f,"#define ZEND_VM_DISPATCH(opcode, opline) ZEND_VM_TAIL_CALL(((opcode_handler_t)zend_vm_get_…
1693 out($f,"\n");
1694out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_interrupt_helper".($spec?"_SPEC":"")."(Z…
1695 out($f,"\n");
1698 out($f,"\n");
1699 out($f,"#undef OPLINE\n");
1700 out($f,"#undef DCL_OPLINE\n");
1701 out($f,"#undef USE_OPLINE\n");
1702 out($f,"#undef LOAD_OPLINE\n");
1703 out($f,"#undef LOAD_NEXT_OPLINE\n");
1704 out($f,"#undef SAVE_OPLINE\n");
1705 out($f,"#define OPLINE opline\n");
1706 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
1707out($f,"# define DCL_OPLINE register const zend_op *opline __asm__(ZEND_VM_IP_GLOBAL_REG);\n");
1708 out($f,"#else\n");
1709 out($f,"# define DCL_OPLINE const zend_op *opline;\n");
1710 out($f,"#endif\n");
1711 out($f,"#define USE_OPLINE\n");
1712 out($f,"#define LOAD_OPLINE() opline = EX(opline)\n");
1713 out($f,"#define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n");
1714 out($f,"#define SAVE_OPLINE() EX(opline) = opline\n");
1715 out($f,"#undef HANDLE_EXCEPTION\n");
1716 out($f,"#undef HANDLE_EXCEPTION_LEAVE\n");
1717 out($f,"#define HANDLE_EXCEPTION() LOAD_OPLINE(); ZEND_VM_CONTINUE()\n");
1718 out($f,"#define HANDLE_EXCEPTION_LEAVE() LOAD_OPLINE(); ZEND_VM_LEAVE()\n");
1719 out($f,"#define ZEND_VM_CONTINUE() goto zend_vm_continue\n");
1720 out($f,"#define ZEND_VM_RETURN() return\n");
1721out($f,"#define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE(); ZEND_VM…
1722 out($f,"#define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n");
1723out($f,"#define ZEND_VM_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
1724out($f,"#define ZEND_VM_LOOP_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
1725out($f,"#define ZEND_VM_DISPATCH(opcode, opline) dispatch_handler = zend_vm_get_opcode_handler(opc…
1726 out($f,"\n");
1729 out($f,"\n");
1730 out($f,"#undef OPLINE\n");
1731 out($f,"#undef DCL_OPLINE\n");
1732 out($f,"#undef USE_OPLINE\n");
1733 out($f,"#undef LOAD_OPLINE\n");
1734 out($f,"#undef LOAD_NEXT_OPLINE\n");
1735 out($f,"#undef SAVE_OPLINE\n");
1736 out($f,"#define OPLINE opline\n");
1737 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
1738out($f,"# define DCL_OPLINE register const zend_op *opline __asm__(ZEND_VM_IP_GLOBAL_REG);\n");
1739 out($f,"#else\n");
1740 out($f,"# define DCL_OPLINE const zend_op *opline;\n");
1741 out($f,"#endif\n");
1742 out($f,"#define USE_OPLINE\n");
1743 out($f,"#define LOAD_OPLINE() opline = EX(opline)\n");
1744 out($f,"#define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n");
1745 out($f,"#define SAVE_OPLINE() EX(opline) = opline\n");
1746 out($f,"#undef HANDLE_EXCEPTION\n");
1747 out($f,"#undef HANDLE_EXCEPTION_LEAVE\n");
1749 out($f,"#define HANDLE_EXCEPTION() goto ZEND_HANDLE_EXCEPTION_SPEC_LABEL\n");
1750 out($f,"#define HANDLE_EXCEPTION_LEAVE() goto ZEND_HANDLE_EXCEPTION_SPEC_LABEL\n");
1752 out($f,"#define HANDLE_EXCEPTION() goto ZEND_HANDLE_EXCEPTION_LABEL\n");
1753 out($f,"#define HANDLE_EXCEPTION_LEAVE() goto ZEND_HANDLE_EXCEPTION_LABEL\n");
1755 out($f,"#define ZEND_VM_CONTINUE() goto *(void**)(OPLINE->handler)\n");
1756 out($f,"#define ZEND_VM_RETURN() return\n");
1757out($f,"#define ZEND_VM_ENTER() execute_data = EG(current_execute_data); LOAD_OPLINE(); ZEND_VM…
1758 out($f,"#define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n");
1759out($f,"#define ZEND_VM_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
1760out($f,"#define ZEND_VM_LOOP_INTERRUPT() goto zend_interrupt_helper".($spec?"_SPEC":"").";…
1761out($f,"#define ZEND_VM_DISPATCH(opcode, opline) goto *(void**)(zend_vm_get_opcode_handler(opcode,…
1762 out($f,"\n");
1770 out($f, $m[1].$executor_name.$m[3]."\n");
1775 out($f,$m[1]."const void *dispatch_handler;\n");
1779 out($f,$m[1].$param.";\n");
1781 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
1782out($f,$m[1]."register zend_execute_data *execute_data __asm__(ZEND_VM_FP_GLOBAL_REG) = ex;\n");
1783 out($f,"#else\n");
1784 out($f,$m[1]."zend_execute_data *execute_data = ex;\n");
1785 out($f,"#endif\n");
1787 out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n");
1788 out($f,$m[1]."const zend_op *orig_opline = opline;\n");
1789 out($f,"#endif\n");
1790 out($f,"#ifdef ZEND_VM_FP_GLOBAL_REG\n");
1791 out($f,$m[1]."zend_execute_data *orig_execute_data = execute_data;\n");
1792 out($f,$m[1]."execute_data = ex;\n");
1793 out($f,"#else\n");
1794 out($f,$m[1]."zend_execute_data *execute_data = ex;\n");
1795 out($f,"#endif\n");
1803 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1806 out($f,$prolog."if (UNEXPECTED(execute_data == NULL)) {\n");
1807 out($f,$prolog."\tstatic const void* labels[] = {\n");
1809 out($f,$prolog."\t};\n");
1810 out($f,$prolog."\tzend_opcode_handlers = (const void **) labels;\n");
1811 out($f,$prolog."\tzend_handlers_count = sizeof(labels) / sizeof(void*);\n");
1813 out($f,$prolog."\tmemset(&hybrid_halt_op, 0, sizeof(hybrid_halt_op));\n");
1814 out($f,$prolog."\thybrid_halt_op.handler = (void*)&&HYBRID_HALT_LABEL;\n");
1815 out($f,$prolog."\tgoto HYBRID_HALT_LABEL;\n");
1817 out($f,$prolog."\treturn;\n");
1819 out($f,$prolog."}\n");
1821 out($f,"#endif\n");
1830 out($f,"#if !defined(ZEND_VM_FP_GLOBAL_REG) || !defined(ZEND_VM_IP_GLOBAL_REG)\n");
1831 out($f,$m[1]."\tint ret;".$m[3]."\n");
1832 out($f,"#endif\n");
1835 out($f,"zend_vm_continue:".$m[3]."\n");
1844out($f, $m[1]."dispatch_handler = OPLINE->handler;\nzend_vm_dispatch:\n".$m[1]."switch ((int)(uint…
1847 out($f, $m[1]."goto *(void**)(OPLINE->handler);".$m[3]."\n");
1850 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1851 out($f, $m[1]."HYBRID_SWITCH()".$m[3]."\n");
1852 out($f,"#else\n");
1854 out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
1855 out($f, $m[1]."((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
1856 out($f, $m[1]."if (UNEXPECTED(!OPLINE))".$m[3]."\n");
1857 out($f,"#else\n");
1858out($f, $m[1]."if (UNEXPECTED((ret = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_…
1859 out($f,"#endif\n");
1861 out($f,"#endif\n");
1870 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1877 out($f,"#else\n");
1879 out($f,
1898 out($f,"#endif\n");
1908 out($f, $m[1].$initializer_name.$m[3]."\n");
1916 out($f,$prolog."static const uint32_t specs[] = {\n");
1918 out($f,$prolog."};\n");
1919 out($f,$prolog."zend_spec_handlers = specs;\n");
1920 out($f,$prolog.$executor_name."_ex(NULL);\n");
1922 out($f,$prolog."static const void *labels[] = {\n");
1924 out($f,$prolog."};\n");
1925 out($f,$prolog."static const uint32_t specs[] = {\n");
1927 out($f,$prolog."};\n");
1929 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
1930 out($f,$prolog."zend_opcode_handler_funcs = labels;\n");
1931 out($f,$prolog."zend_spec_handlers = specs;\n");
1932 out($f,$prolog.$executor_name."_ex(NULL);\n");
1933 out($f,"#else\n");
1935 out($f,$prolog."zend_opcode_handlers = labels;\n");
1936 out($f,$prolog."zend_handlers_count = sizeof(labels) / sizeof(void*);\n");
1937 out($f,$prolog."zend_spec_handlers = specs;\n");
1939 out($f,"#endif\n");
1948 out($f, $line);
2265 out($f, HEADER_TEXT);
2315 out($f, HEADER_TEXT);
2347 out($f, HEADER_TEXT);
2349 out($f, "#ifdef ZEND_WIN32\n");
2351 out($f, "# pragma warning(disable : 4101)\n");
2354 out($f, "# pragma warning(once : 6235)\n");
2356 out($f, "# pragma warning(once : 6237)\n");
2358 out($f, "# pragma warning(once : 6239)\n");
2360 out($f, "# pragma warning(once : 6240)\n");
2362 out($f, "# pragma warning(once : 6285)\n");
2364 out($f, "# pragma warning(once : 6286)\n");
2366 out($f, "# pragma warning(once : 6326)\n");
2368 out($f, "#endif\n");
2371 out($f, "static user_opcode_handler_t zend_user_opcode_handlers[256] = {\n");
2373 out($f, "\t(user_opcode_handler_t)NULL,\n");
2375 out($f, "\t(user_opcode_handler_t)NULL\n};\n\n");
2377 out($f, "static zend_uchar zend_user_opcodes[256] = {");
2379 if ($i % 16 == 1) out($f, "\n\t");
2380 out($f, "$i,");
2382 out($f, "255\n};\n\n");
2386 out($f, "\n");
2389 out($f, "static const void *zend_vm_get_opcode_handler_ex(uint32_t spec, const zend_op* op)\n");
2390 out($f, "{\n");
2392 out($f, "\treturn zend_opcode_handlers[spec];\n");
2394 out($f, "\tstatic const int zend_vm_decode[] = {\n");
2395 out($f, "\t\t_UNUSED_CODE, /* 0 */\n");
2396 out($f, "\t\t_CONST_CODE, /* 1 = IS_CONST */\n");
2397 out($f, "\t\t_TMP_CODE, /* 2 = IS_TMP_VAR */\n");
2398 out($f, "\t\t_UNUSED_CODE, /* 3 */\n");
2399 out($f, "\t\t_VAR_CODE, /* 4 = IS_VAR */\n");
2400 out($f, "\t\t_UNUSED_CODE, /* 5 */\n");
2401 out($f, "\t\t_UNUSED_CODE, /* 6 */\n");
2402 out($f, "\t\t_UNUSED_CODE, /* 7 */\n");
2403 out($f, "\t\t_UNUSED_CODE, /* 8 = IS_UNUSED */\n");
2404 out($f, "\t\t_UNUSED_CODE, /* 9 */\n");
2405 out($f, "\t\t_UNUSED_CODE, /* 10 */\n");
2406 out($f, "\t\t_UNUSED_CODE, /* 11 */\n");
2407 out($f, "\t\t_UNUSED_CODE, /* 12 */\n");
2408 out($f, "\t\t_UNUSED_CODE, /* 13 */\n");
2409 out($f, "\t\t_UNUSED_CODE, /* 14 */\n");
2410 out($f, "\t\t_UNUSED_CODE, /* 15 */\n");
2411 out($f, "\t\t_CV_CODE /* 16 = IS_CV */\n");
2412 out($f, "\t};\n");
2413 out($f, "\tuint32_t offset = 0;\n");
2414 out($f, "\tif (spec & SPEC_RULE_OP1) offset = offset * 5 + zend_vm_decode[op->op1_type];\n");
2415 out($f, "\tif (spec & SPEC_RULE_OP2) offset = offset * 5 + zend_vm_decode[op->op2_type];\n");
2417out($f, "\tif (spec & SPEC_RULE_OP_DATA) offset = offset * 5 + zend_vm_decode[(op + 1)->op1_type];…
2420out($f, "\tif (spec & SPEC_RULE_RETVAL) offset = offset * 2 + (op->result_type != IS_UNUSED);\n");
2423out($f, "\tif (spec & SPEC_RULE_QUICK_ARG) offset = offset * 2 + (op->op2.num < MAX_ARG_FLAG_NUM);…
2426 out($f, "\tif (spec & SPEC_RULE_SMART_BRANCH) {\n");
2427 out($f, "\t\toffset = offset * 3;\n");
2428 out($f, "\t\tif ((op+1)->opcode == ZEND_JMPZ) {\n");
2429 out($f, "\t\t\toffset += 1;\n");
2430 out($f, "\t\t} else if ((op+1)->opcode == ZEND_JMPNZ) {\n");
2431 out($f, "\t\t\toffset += 2;\n");
2432 out($f, "\t\t}\n");
2433 out($f, "\t}\n");
2436 out($f, "\tif (spec & SPEC_RULE_DIM_OBJ) {\n");
2437 out($f, "\t\toffset = offset * 3;\n");
2438 out($f, "\t\tif (op->extended_value == ZEND_ASSIGN_DIM) {\n");
2439 out($f, "\t\t\toffset += 1;\n");
2440 out($f, "\t\t} else if (op->extended_value == ZEND_ASSIGN_OBJ) {\n");
2441 out($f, "\t\t\toffset += 2;\n");
2442 out($f, "\t\t}\n");
2443 out($f, "\t}\n");
2445 out($f, "\treturn zend_opcode_handlers[(spec & SPEC_START_MASK) + offset];\n");
2447 out($f, "}\n\n");
2448 out($f, "static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op)\n");
2449 out($f, "{\n");
2451 out($f, "\treturn zend_vm_get_opcode_handler_ex(opcode, op);\n");
2453 out($f, "\treturn zend_vm_get_opcode_handler_ex(zend_spec_handlers[opcode], op);\n");
2455 out($f, "}\n\n");
2459 out($f, "#if ZEND_VM_KIND == ZEND_VM_KIND_HYBRID\n");
2460out($f,"static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend_op* op)\n…
2461 out($f, "{\n");
2462 out($f, "\tuint32_t spec = zend_spec_handlers[opcode];\n");
2464 out($f, "\treturn zend_opcode_handler_funcs[spec];\n");
2466 out($f, "\tstatic const int zend_vm_decode[] = {\n");
2467 out($f, "\t\t_UNUSED_CODE, /* 0 */\n");
2468 out($f, "\t\t_CONST_CODE, /* 1 = IS_CONST */\n");
2469 out($f, "\t\t_TMP_CODE, /* 2 = IS_TMP_VAR */\n");
2470 out($f, "\t\t_UNUSED_CODE, /* 3 */\n");
2471 out($f, "\t\t_VAR_CODE, /* 4 = IS_VAR */\n");
2472 out($f, "\t\t_UNUSED_CODE, /* 5 */\n");
2473 out($f, "\t\t_UNUSED_CODE, /* 6 */\n");
2474 out($f, "\t\t_UNUSED_CODE, /* 7 */\n");
2475 out($f, "\t\t_UNUSED_CODE, /* 8 = IS_UNUSED */\n");
2476 out($f, "\t\t_UNUSED_CODE, /* 9 */\n");
2477 out($f, "\t\t_UNUSED_CODE, /* 10 */\n");
2478 out($f, "\t\t_UNUSED_CODE, /* 11 */\n");
2479 out($f, "\t\t_UNUSED_CODE, /* 12 */\n");
2480 out($f, "\t\t_UNUSED_CODE, /* 13 */\n");
2481 out($f, "\t\t_UNUSED_CODE, /* 14 */\n");
2482 out($f, "\t\t_UNUSED_CODE, /* 15 */\n");
2483 out($f, "\t\t_CV_CODE /* 16 = IS_CV */\n");
2484 out($f, "\t};\n");
2485 out($f, "\tuint32_t offset = 0;\n");
2486 out($f, "\tif (spec & SPEC_RULE_OP1) offset = offset * 5 + zend_vm_decode[op->op1_type];\n");
2487 out($f, "\tif (spec & SPEC_RULE_OP2) offset = offset * 5 + zend_vm_decode[op->op2_type];\n");
2489out($f, "\tif (spec & SPEC_RULE_OP_DATA) offset = offset * 5 + zend_vm_decode[(op + 1)->op1_type];…
2492out($f, "\tif (spec & SPEC_RULE_RETVAL) offset = offset * 2 + (op->result_type != IS_UNUSED);\n");
2495out($f, "\tif (spec & SPEC_RULE_QUICK_ARG) offset = offset * 2 + (op->op2.num < MAX_ARG_FLAG_NUM);…
2498 out($f, "\tif (spec & SPEC_RULE_SMART_BRANCH) {\n");
2499 out($f, "\t\toffset = offset * 3;\n");
2500 out($f, "\t\tif ((op+1)->opcode == ZEND_JMPZ) {\n");
2501 out($f, "\t\t\toffset += 1;\n");
2502 out($f, "\t\t} else if ((op+1)->opcode == ZEND_JMPNZ) {\n");
2503 out($f, "\t\t\toffset += 2;\n");
2504 out($f, "\t\t}\n");
2505 out($f, "\t}\n");
2508 out($f, "\tif (spec & SPEC_RULE_DIM_OBJ) {\n");
2509 out($f, "\t\toffset = offset * 3;\n");
2510 out($f, "\t\tif (op->extended_value == ZEND_ASSIGN_DIM) {\n");
2511 out($f, "\t\t\toffset += 1;\n");
2512 out($f, "\t\t} else if (op->extended_value == ZEND_ASSIGN_OBJ) {\n");
2513 out($f, "\t\t\toffset += 2;\n");
2514 out($f, "\t\t}\n");
2515 out($f, "\t}\n");
2517 out($f, "\treturn zend_opcode_handler_funcs[(spec & SPEC_START_MASK) + offset];\n");
2519 out($f, "}\n\n");
2520 out($f, "#endif\n\n");
2524 out($f, "ZEND_API void zend_vm_set_opcode_handler(zend_op* op)\n");
2525 out($f, "{\n");
2526 out($f, "\top->handler = zend_vm_get_opcode_handler(zend_user_opcodes[op->opcode], op);\n");
2527 out($f, "}\n\n");
2530out($f, "ZEND_API void zend_vm_set_opcode_handler_ex(zend_op* op, uint32_t op1_info, uint32_t op2_…
2531 out($f, "{\n");
2532 out($f, "\tzend_uchar opcode = zend_user_opcodes[op->opcode];\n");
2534 out($f, "\top->handler = zend_vm_get_opcode_handler_ex(opcode, op);\n");
2536 out($f, "\tuint32_t spec = zend_spec_handlers[opcode];\n");
2538 out($f, "\tswitch (opcode) {\n");
2542 out($f, "\t\tcase $orig_op:\n");
2547 out($f, "\t\t\tif $condition {\n");
2550 out($f, "\t\t\t} else if $condition {\n");
2554 out($f, "\t\t\t\tif (op->op1_type == IS_CONST && op->op2_type == IS_CONST) {\n");
2555 out($f, "\t\t\t\t\tbreak;\n");
2556 out($f, "\t\t\t\t}\n");
2558 out($f, "\t\t\t\tspec = ${spec_dsc['spec_code']};\n");
2560 out($f, "\t\t\t\tif (op->op1_type > op->op2_type) {\n");
2561 out($f, "\t\t\t\t\tzend_swap_operands(op);\n");
2562 out($f, "\t\t\t\t}\n");
2566 out($f, "\t\t\t}\n");
2568 out($f, "\t\t\tbreak;\n");
2571 out($f, "\t\tdefault:\n");
2572 out($f, "\t\t\tbreak;\n");
2573 out($f, "\t}\n");
2575 out($f, "\top->handler = zend_vm_get_opcode_handler_ex(spec, op);\n");
2577 out($f, "}\n\n");
2581 out($f, "ZEND_API int zend_vm_call_opcode_handler(zend_execute_data* ex)\n");
2582 out($f, "{\n");
2584 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2585 out($f, "\topcode_handler_t handler;\n");
2586 out($f,"#endif\n");
2588 out($f, "\tint ret;\n");
2589 out($f, "#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2590 out($f, "\tconst zend_op *orig_opline = opline;\n");
2591 out($f, "#endif\n");
2592 out($f, "#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2593 out($f, "\tzend_execute_data *orig_execute_data = execute_data;\n");
2594 out($f, "\texecute_data = ex;\n");
2595 out($f, "#else\n");
2596 out($f, "\tzend_execute_data *execute_data = ex;\n");
2597 out($f, "#endif\n");
2598 out($f, "\n");
2599 out($f, "\tLOAD_OPLINE();\n");
2600 out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
2602 out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
2603out($f, "\thandler = (opcode_handler_t)zend_vm_get_opcode_handler_func(zend_user_opcodes[opline->o…
2604 out($f, "\thandler(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2605 out($f, "\tif (EXPECTED(opline != &hybrid_halt_op)) {\n");
2606 out($f,"#else\n");
2608 out($f, "\t((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2610 out($f, "\tif (EXPECTED(opline)) {\n");
2611 out($f,"#endif\n");
2613 out($f, "\tif (EXPECTED(opline)) {\n");
2615 out($f, "\t\tret = execute_data != ex ? (int)(execute_data->prev_execute_data != ex) + 1 : 0;\n");
2616 out($f, "\t\tSAVE_OPLINE();\n");
2617 out($f, "\t} else {\n");
2618 out($f, "\t\tret = -1;\n");
2619 out($f, "\t}\n");
2620 out($f, "#else\n");
2621 out($f, "\tret = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
2622 out($f, "\tSAVE_OPLINE();\n");
2623 out($f, "#endif\n");
2624 out($f, "#ifdef ZEND_VM_FP_GLOBAL_REG\n");
2625 out($f, "\texecute_data = orig_execute_data;\n");
2626 out($f, "#endif\n");
2627 out($f, "#ifdef ZEND_VM_IP_GLOBAL_REG\n");
2628 out($f, "\topline = orig_opline;\n");
2629 out($f, "#endif\n");
2630 out($f, "\treturn ret;\n");
2631 out($f, "}\n\n");
2633 out($f, "ZEND_API int zend_vm_call_opcode_handler(zend_execute_data* ex)\n");
2634 out($f, "{\n");
2635out($f, "\tzend_error_noreturn(E_CORE_ERROR, \"zend_vm_call_opcode_handler() is not supported\");\…
2636 out($f, "\treturn 0;\n");
2637 out($f, "}\n\n");
2643 out($f,"#undef OPLINE\n");
2644 out($f,"#undef DCL_OPLINE\n");
2645 out($f,"#undef USE_OPLINE\n");
2646 out($f,"#undef LOAD_OPLINE\n");
2647 out($f,"#undef LOAD_NEXT_OPLINE\n");
2648 out($f,"#undef SAVE_OPLINE\n");
2649 out($f,"#define OPLINE EX(opline)\n");
2650 out($f,"#define DCL_OPLINE\n");
2651 out($f,"#define USE_OPLINE const zend_op *opline = EX(opline);\n");
2652 out($f,"#define LOAD_OPLINE()\n");
2653 out($f,"#define LOAD_NEXT_OPLINE() ZEND_VM_INC_OPCODE()\n");
2654 out($f,"#define SAVE_OPLINE()\n");
2655 out($f,"#undef HANDLE_EXCEPTION\n");
2656 out($f,"#undef HANDLE_EXCEPTION_LEAVE\n");
2657 out($f,"#define HANDLE_EXCEPTION() LOAD_OPLINE(); ZEND_VM_CONTINUE()\n");
2658 out($f,"#define HANDLE_EXCEPTION_LEAVE() LOAD_OPLINE(); ZEND_VM_LEAVE()\n");
2659 out($f,"#undef ZEND_VM_CONTINUE\n");
2660 out($f,"#undef ZEND_VM_RETURN\n");
2661 out($f,"#undef ZEND_VM_ENTER\n");
2662 out($f,"#undef ZEND_VM_LEAVE\n");
2663 out($f,"#undef ZEND_VM_DISPATCH\n");
2664 out($f,"#define ZEND_VM_CONTINUE() return 0\n");
2665 out($f,"#define ZEND_VM_RETURN() return -1\n");
2666 out($f,"#define ZEND_VM_ENTER() return 1\n");
2667 out($f,"#define ZEND_VM_LEAVE() return 2\n");
2668out($f,"#define ZEND_VM_INTERRUPT() return zend_interrupt_helper(ZEND_OPCODE_HANDLER_ARGS_PASSTHR…
2669out($f,"#define ZEND_VM_DISPATCH(opcode, opline) return zend_vm_get_opcode_handler(opcode, opline)…
2670 out($f,"\n");
2674 out($f, "ZEND_API int $func(");
2676 out($f, "ZEND_OPCODE_HANDLER_ARGS)\n");
2681 out($f, "ZEND_OPCODE_HANDLER_ARGS)\n");
2683 out($f, $h['param']. " ZEND_OPCODE_HANDLER_ARGS_DC)\n");
2692out($f, "{\n\treturn ".$name.(ZEND_VM_SPEC?"_SPEC":"")."_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU…
2698out($f, "{\n\treturn ".$name.(ZEND_VM_SPEC?"_SPEC":"")."(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n}\n\…