comparison src/bytecode.c @ 1737:68ed93de81b7

[xemacs-hg @ 2003-10-10 11:50:56 by stephent] E Benson bytecomp patch <87oewpmi1m.fsf_-_@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Fri, 10 Oct 2003 11:51:05 +0000
parents 2264738f7ae4
children 90502933fb98
comparison
equal deleted inserted replaced
1736:92dd8587c485 1737:68ed93de81b7
1722 Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (compiled_function); 1722 Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (compiled_function);
1723 int program_length; 1723 int program_length;
1724 int varbind_count; 1724 int varbind_count;
1725 Opbyte *program; 1725 Opbyte *program;
1726 1726
1727 {
1728 int minargs = 0, maxargs = 0, totalargs = 0;
1729 int optional_p = 0, rest_p = 0, i = 0;
1730 {
1731 LIST_LOOP_2 (arg, f->arglist)
1732 {
1733 if (EQ (arg, Qand_optional))
1734 optional_p = 1;
1735 else if (EQ (arg, Qand_rest))
1736 rest_p = 1;
1737 else
1738 {
1739 if (rest_p)
1740 {
1741 maxargs = MANY;
1742 totalargs++;
1743 break;
1744 }
1745 if (!optional_p)
1746 minargs++;
1747 maxargs++;
1748 totalargs++;
1749 }
1750 }
1751 }
1752
1753 if (totalargs)
1754 f->args = xnew_array (Lisp_Object, totalargs);
1755
1756 {
1757 LIST_LOOP_2 (arg, f->arglist)
1758 {
1759 if (!EQ (arg, Qand_optional) && !EQ (arg, Qand_rest))
1760 f->args[i++] = arg;
1761 }
1762 }
1763
1764 f->max_args = maxargs;
1765 f->min_args = minargs;
1766 f->args_in_array = totalargs;
1767 }
1768
1727 /* If we have not actually read the bytecode string 1769 /* If we have not actually read the bytecode string
1728 and constants vector yet, fetch them from the file. */ 1770 and constants vector yet, fetch them from the file. */
1729 if (CONSP (f->instructions)) 1771 if (CONSP (f->instructions))
1730 Ffetch_bytecode (compiled_function); 1772 Ffetch_bytecode (compiled_function);
1731 1773