comparison src/bytecode.h @ 5118:e0db3c197671 ben-lisp-object

merge up to latest default branch, doesn't compile yet
author Ben Wing <ben@xemacs.org>
date Sat, 26 Dec 2009 21:18:49 -0600
parents d674024a8674
children d1247f3cc363
comparison
equal deleted inserted replaced
5117:3742ea8250b5 5118:e0db3c197671
28 Jon Reid: some changes for I18N3 (domain, etc), for 19.8. 28 Jon Reid: some changes for I18N3 (domain, etc), for 19.8.
29 */ 29 */
30 30
31 #ifndef INCLUDED_bytecode_h_ 31 #ifndef INCLUDED_bytecode_h_
32 #define INCLUDED_bytecode_h_ 32 #define INCLUDED_bytecode_h_
33
34 #ifdef NEW_GC
35 struct compiled_function_args
36 {
37 struct lrecord_header header;
38 long size;
39 Lisp_Object args[1];
40 };
41
42 typedef struct compiled_function_args Lisp_Compiled_Function_Args;
43
44 DECLARE_LISP_OBJECT (compiled_function_args, Lisp_Compiled_Function_Args);
45
46 #define XCOMPILED_FUNCTION_ARGS(x) \
47 XRECORD (x, compiled_function_args, Lisp_Compiled_Function_Args)
48 #define wrap_compiled_function_args(p) wrap_record (p, compiled_function_args)
49 #define COMPILED_FUNCTION_ARGS_P(x) RECORDP (x, compiled_function_args)
50 #define CHECK_COMPILED_FUNCTION_ARGS(x) \
51 CHECK_RECORD (x, compiled_function_args)
52 #define CONCHECK_COMPILED_FUNCTION_ARGS(x) \
53 CONCHECK_RECORD (x, compiled_function_args)
54
55 #define compiled_function_args_data(v) ((v)->args)
56 #define XCOMPILED_FUNCTION_ARGS_DATA(s) \
57 compiled_function_args_data (XCOMPILED_FUNCTION_ARGS (s))
58 #endif /* NEW_GC */
33 59
34 /* Meanings of slots in a Lisp_Compiled_Function. 60 /* Meanings of slots in a Lisp_Compiled_Function.
35 Don't use these! For backward compatibility only. */ 61 Don't use these! For backward compatibility only. */
36 #define COMPILED_ARGLIST 0 62 #define COMPILED_ARGLIST 0
37 #define COMPILED_INSTRUCTIONS 1 63 #define COMPILED_INSTRUCTIONS 1
62 Lisp_Object instructions; 88 Lisp_Object instructions;
63 Lisp_Object constants; 89 Lisp_Object constants;
64 Lisp_Object arglist; 90 Lisp_Object arglist;
65 /* For speed, we unroll arglist into an array of argument symbols, so we 91 /* For speed, we unroll arglist into an array of argument symbols, so we
66 don't have to process arglist every time we make a function call. */ 92 don't have to process arglist every time we make a function call. */
93 #ifdef NEW_GC
94 Lisp_Object arguments;
95 #else /* not NEW_GC */
67 Lisp_Object *args; 96 Lisp_Object *args;
97 #endif /* not NEW_GC */
68 /* Minimum and maximum number of arguments. If MAX_ARGS == MANY, the 98 /* Minimum and maximum number of arguments. If MAX_ARGS == MANY, the
69 function was declared with &rest, and (args_in_array - 1) indicates 99 function was declared with &rest, and (args_in_array - 1) indicates
70 how many arguments there are before the &rest argument. (We could 100 how many arguments there are before the &rest argument. (We could
71 munge the max_non_rest_args into max_args by using a negative number, 101 munge the max_non_rest_args into max_args by using a negative number,
72 but that interferes with pdump marking. We don't want to use a flag 102 but that interferes with pdump marking. We don't want to use a flag
102 typedef unsigned char Opbyte; 132 typedef unsigned char Opbyte;
103 Lisp_Object execute_optimized_program (const Opbyte *program, 133 Lisp_Object execute_optimized_program (const Opbyte *program,
104 int stack_depth, 134 int stack_depth,
105 Lisp_Object *constants_data); 135 Lisp_Object *constants_data);
106 136
107 DECLARE_LRECORD (compiled_function, Lisp_Compiled_Function); 137 DECLARE_LISP_OBJECT (compiled_function, Lisp_Compiled_Function);
108 #define XCOMPILED_FUNCTION(x) XRECORD (x, compiled_function, \ 138 #define XCOMPILED_FUNCTION(x) XRECORD (x, compiled_function, \
109 Lisp_Compiled_Function) 139 Lisp_Compiled_Function)
110 #define wrap_compiled_function(p) wrap_record (p, compiled_function) 140 #define wrap_compiled_function(p) wrap_record (p, compiled_function)
111 #define COMPILED_FUNCTIONP(x) RECORDP (x, compiled_function) 141 #define COMPILED_FUNCTIONP(x) RECORDP (x, compiled_function)
112 #define CHECK_COMPILED_FUNCTION(x) CHECK_RECORD (x, compiled_function) 142 #define CHECK_COMPILED_FUNCTION(x) CHECK_RECORD (x, compiled_function)