changeset 11205:81a008df9184

(Ffetch_bytecode): New function. (funcall_lambda): Call it. (syms_of_eval): defsubr it.
author Karl Heuer <kwzh@gnu.org>
date Wed, 05 Apr 1995 03:05:26 +0000
parents de3d87b4c418
children 60b7ab7d4fec
files src/eval.c
diffstat 1 files changed, 20 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/eval.c	Wed Apr 05 03:04:48 1995 +0000
+++ b/src/eval.c	Wed Apr 05 03:05:26 1995 +0000
@@ -2238,17 +2238,31 @@
       /* If we have not actually read the bytecode string
 	 and constants vector yet, fetch them from the file.  */
       if (CONSP (XVECTOR (fun)->contents[COMPILED_BYTECODE]))
-	{
-	  tem = read_doc_string (XVECTOR (fun)->contents[COMPILED_BYTECODE]);
-	  XVECTOR (fun)->contents[COMPILED_BYTECODE] = XCONS (tem)->car;
-	  XVECTOR (fun)->contents[COMPILED_CONSTANTS] = XCONS (tem)->cdr;
-	}
+	Ffetch_bytecode (fun);
       val = Fbyte_code (XVECTOR (fun)->contents[COMPILED_BYTECODE],
 			XVECTOR (fun)->contents[COMPILED_CONSTANTS],
 			XVECTOR (fun)->contents[COMPILED_STACK_DEPTH]);
     }
   return unbind_to (count, val);
 }
+
+DEFUN ("fetch-bytecode", Ffetch_bytecode, Sfetch_bytecode,
+  1, 1, 0,
+  "If byte-compiled OBJECT is lazy-loaded, fetch it now.")
+  (object)
+     Lisp_Object object;
+{
+  Lisp_Object tem;
+
+  if (COMPILEDP (object)
+      && CONSP (XVECTOR (object)->contents[COMPILED_BYTECODE]))
+    {
+      tem = read_doc_string (XVECTOR (object)->contents[COMPILED_BYTECODE]);
+      XVECTOR (object)->contents[COMPILED_BYTECODE] = XCONS (tem)->car;
+      XVECTOR (object)->contents[COMPILED_CONSTANTS] = XCONS (tem)->cdr;
+    }
+  return object;
+}
 
 void
 grow_specpdl ()
@@ -2628,6 +2642,7 @@
   defsubr (&Seval);
   defsubr (&Sapply);
   defsubr (&Sfuncall);
+  defsubr (&Sfetch_bytecode);
   defsubr (&Sbacktrace_debug);
   defsubr (&Sbacktrace);
   defsubr (&Sbacktrace_frame);