X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fbytecode.c;h=af9d3f464d49251ffc67cbdcae1aab9a6dc99d6b;hb=ddf160705829afe71eae7c9f4cb9c54425fbec98;hp=b5111d1eb031d1dd4cb2aac6f151dc560691b05e;hpb=77dcef404dc78635f6ffa8f71a803d2bc7cc8921;p=chise%2Fxemacs-chise.git- diff --git a/src/bytecode.c b/src/bytecode.c index b5111d1..af9d3f4 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -56,7 +56,6 @@ by Hallvard: #include "opaque.h" #include "syntax.h" -#include #include EXFUN (Ffetch_bytecode, 1); @@ -226,12 +225,6 @@ static Lisp_Object execute_optimized_program (CONST Opbyte *program, extern Lisp_Object Qand_rest, Qand_optional; -/* Define ERROR_CHECK_BYTE_CODE to enable some minor sanity checking. - Useful for debugging the byte compiler. */ -#ifdef DEBUG_XEMACS -#define ERROR_CHECK_BYTE_CODE -#endif - /* Define BYTE_CODE_METER to enable generation of a byte-op usage histogram. This isn't defined in FSF Emacs and isn't defined in XEmacs v19. */ /* #define BYTE_CODE_METER */ @@ -529,7 +522,11 @@ funcall_compiled_function (Lisp_Object fun, int nargs, Lisp_Object args[]) f->stack_depth, XVECTOR_DATA (f->constants)); - UNBIND_TO_GCPRO_VARIABLES_ONLY (speccount, value); + /* The attempt to optimize this by only unbinding variables failed + because using buffer-local variables as function parameters + leads to specpdl_ptr->func != 0 */ + /* UNBIND_TO_GCPRO_VARIABLES_ONLY (speccount, value); */ + UNBIND_TO_GCPRO (speccount, value); return value; } @@ -2026,11 +2023,20 @@ compiled_function_hash (Lisp_Object obj, int depth) internal_hash (f->constants, depth + 1)); } +static const struct lrecord_description compiled_function_description[] = { + { XD_LISP_OBJECT, offsetof(struct Lisp_Compiled_Function, instructions), 4 }, +#ifdef COMPILED_FUNCTION_ANNOTATION_HACK + { XD_LISP_OBJECT, offsetof(struct Lisp_Compiled_Function, annotated), 1 }, +#endif + { XD_END } +}; + DEFINE_BASIC_LRECORD_IMPLEMENTATION ("compiled-function", compiled_function, mark_compiled_function, print_compiled_function, 0, compiled_function_equal, compiled_function_hash, + compiled_function_description, Lisp_Compiled_Function); DEFUN ("compiled-function-p", Fcompiled_function_p, 1, 1, 0, /* @@ -2336,7 +2342,7 @@ If the byte code for compiled function FUNCTION is lazy-loaded, fetch it now. if (OPAQUEP (f->instructions) || STRINGP (f->instructions)) return function; - if (CONSP (XCOMPILED_FUNCTION (function)->instructions)) + if (CONSP (f->instructions)) { Lisp_Object tem = read_doc_string (f->instructions); if (!CONSP (tem)) @@ -2346,8 +2352,8 @@ If the byte code for compiled function FUNCTION is lazy-loaded, fetch it now. ebolify_bytecode_constants (XCDR (tem)); /* VERY IMPORTANT to purecopy here!!!!! See load_force_doc_string_unwind. */ - /* f->instructions = Fpurecopy (XCAR (tem)); */ - f->constants = Fpurecopy (XCDR (tem)); + f->instructions = Fpurecopy (XCAR (tem)); + f->constants = Fpurecopy (XCDR (tem)); return function; } abort ();