/* -*-C-*-
-Copyright (c) 1987 Massachusetts Institute of Technology
+Copyright (c) 1988 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
promotional, or sales literature without prior written consent from
MIT in each case. */
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/interp.c,v 9.43 1988/03/23 18:45:39 jinx Rel $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/interp.c,v 9.44 1988/05/05 08:42:47 cph Exp $
*
* This file contains the heart of the Scheme Scode
* interpreter
Prepare_Eval_Repeat(); \
Immediate_GC(Amount); \
}
+
+#define RESULT_OF_PURIFY(success) \
+{ \
+ Pointer words_free; \
+ \
+ words_free = (Make_Unsigned_Fixnum (MemTop - Free)); \
+ Val = (Make_Pointer (TC_LIST, Free)); \
+ (*Free++) = (success); \
+ (*Free++) = words_free; \
+}
\f
#define Prepare_Eval_Repeat() \
{ \
Result = Purify_Pass_2(Fetch_Expression());
Import_Registers();
if (Result == NIL)
- {
- /* The object does not fit in Constant space.
- There is no need to run the daemons, and we should let the runtime
- system know what happened.
- */
- Val = NIL;
- break;
- }
+ {
+ /* The object does not fit in Constant space.
+ There is no need to run the daemons, and we should let
+ the runtime system know what happened. */
+ RESULT_OF_PURIFY (NIL);
+ break;
+ }
GC_Daemon_Proc = Get_Fixed_Obj_Slot(GC_Daemon);
if (GC_Daemon_Proc == NIL)
- {
- Val = TRUTH;
- break;
- }
+ {
+ RESULT_OF_PURIFY (TRUTH);
+ break;
+ }
Store_Expression(NIL);
Store_Return(RC_PURIFY_GC_2);
Save_Cont();
}
case RC_PURIFY_GC_2:
- Val = TRUTH;
+ RESULT_OF_PURIFY (TRUTH);
break;
case RC_REPEAT_DISPATCH:
/* -*-C-*-
-Copyright (c) 1987 Massachusetts Institute of Technology
+Copyright (c) 1988 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
promotional, or sales literature without prior written consent from
MIT in each case. */
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/purify.c,v 9.33 1988/03/21 21:17:00 jinx Rel $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/purify.c,v 9.34 1988/05/05 08:42:17 cph Exp $
*
* This file contains the code that copies objects into pure
* and constant space.
*Free++ = Object;
Result = GCLoop(Heap_Start, &Free);
if (Free != Result)
- { fprintf(stderr, "\Purify: Pure Scan ended too early.\n");
+ { fprintf(stderr, "\nPurify: Pure Scan ended too early.\n");
Microcode_Termination(TERM_BROKEN_HEART);
}
Length = (Free-Heap_Start)-1; /* Length of object */
return (TRUTH);
}
\f
-/* (PRIMITIVE-PURIFY OBJECT PURE?)
+/* (PRIMITIVE-PURIFY OBJECT PURE? SAFETY-MARGIN)
Copy an object from the heap into constant space. This requires
a spare heap, and is tricky to use -- it should only be used
through the wrapper provided in the Scheme runtime system.
have changed.
*/
-Built_In_Primitive(Prim_Primitive_Purify, 2, "PRIMITIVE-PURIFY", 0xB4)
-Define_Primitive(Prim_Primitive_Purify, 2, "PRIMITIVE-PURIFY")
+DEFINE_PRIMITIVE ("PRIMITIVE-PURIFY", Prim_Primitive_Purify, 3)
{
long Saved_Zone;
Pointer Object, Lost_Objects, Purify_Result, Daemon;
- Primitive_2_Args();
+ Primitive_3_Args();
Save_Time_Zone(Zone_Purify);
if ((Arg2 != TRUTH) && (Arg2 != NIL))
Primitive_Error(ERR_ARG_2_WRONG_TYPE);
+ Arg_3_Type(TC_FIXNUM);
/* Pass 1 (Purify, above) does a first copy. Then any GC daemons
run, and then Purify_Pass_2 is called to copy back.
*/
Touch_In_Primitive(Arg1, Object);
+ GC_Reserve = (Get_Integer (Arg3));
Purify_Result = Purify(Object, Arg2);
- Pop_Primitive_Frame(2);
+ Pop_Primitive_Frame(3);
Daemon = Get_Fixed_Obj_Slot(GC_Daemon);
if (Daemon == NIL)
{
- Val = Purify_Pass_2(Purify_Result);
+ Pointer words_free;
+
+ Purify_Result = Purify_Pass_2(Purify_Result);
+ words_free = (Make_Unsigned_Fixnum (MemTop - Free));
+ Val = (Make_Pointer (TC_LIST, Free));
+ (*Free++) = Purify_Result;
+ (*Free++) = words_free;
PRIMITIVE_ABORT(PRIM_POP_RETURN);
/*NOTREACHED*/
}
/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 10.35 1988/05/04 19:22:12 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 10.36 1988/05/05 08:41:51 cph Exp $
Copyright (c) 1988 Massachusetts Institute of Technology
#define VERSION 10
#endif
#ifndef SUBVERSION
-#define SUBVERSION 35
+#define SUBVERSION 36
#endif
#ifndef UCODE_TABLES_FILENAME
;;; -*-Scheme-*-
;;;
-;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/gc.scm,v 13.43 1987/03/18 20:07:23 jinx Rel $
+;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/gc.scm,v 13.44 1988/05/05 08:39:12 cph Exp $
;;;
-;;; Copyright (c) 1987 Massachusetts Institute of Technology
+;;; Copyright (c) 1988 Massachusetts Institute of Technology
;;;
;;; This material was developed by the Scheme project at the
;;; Massachusetts Institute of Technology, Department of
(set! purify
(named-lambda (purify item #!optional really-pure?)
- (if (primitive-purify item
- (if (unassigned? really-pure?)
- false
- really-pure?))
- item
- (error "Not enough room in constant space" purify item))))
+ (if (not (car (primitive-purify item
+ (if (unassigned? really-pure?)
+ false
+ really-pure?)
+ default-safety-margin)))
+ (error "Not enough room in constant space" purify item))
+ item))
(set! impurify
(named-lambda (impurify object)
ie)))))
;;; end GARBAGE-COLLECTOR-PACKAGE.
-))
+))
\ No newline at end of file
/* -*-C-*-
-Copyright (c) 1987 Massachusetts Institute of Technology
+Copyright (c) 1988 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
promotional, or sales literature without prior written consent from
MIT in each case. */
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/interp.c,v 9.43 1988/03/23 18:45:39 jinx Rel $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/interp.c,v 9.44 1988/05/05 08:42:47 cph Exp $
*
* This file contains the heart of the Scheme Scode
* interpreter
Prepare_Eval_Repeat(); \
Immediate_GC(Amount); \
}
+
+#define RESULT_OF_PURIFY(success) \
+{ \
+ Pointer words_free; \
+ \
+ words_free = (Make_Unsigned_Fixnum (MemTop - Free)); \
+ Val = (Make_Pointer (TC_LIST, Free)); \
+ (*Free++) = (success); \
+ (*Free++) = words_free; \
+}
\f
#define Prepare_Eval_Repeat() \
{ \
Result = Purify_Pass_2(Fetch_Expression());
Import_Registers();
if (Result == NIL)
- {
- /* The object does not fit in Constant space.
- There is no need to run the daemons, and we should let the runtime
- system know what happened.
- */
- Val = NIL;
- break;
- }
+ {
+ /* The object does not fit in Constant space.
+ There is no need to run the daemons, and we should let
+ the runtime system know what happened. */
+ RESULT_OF_PURIFY (NIL);
+ break;
+ }
GC_Daemon_Proc = Get_Fixed_Obj_Slot(GC_Daemon);
if (GC_Daemon_Proc == NIL)
- {
- Val = TRUTH;
- break;
- }
+ {
+ RESULT_OF_PURIFY (TRUTH);
+ break;
+ }
Store_Expression(NIL);
Store_Return(RC_PURIFY_GC_2);
Save_Cont();
}
case RC_PURIFY_GC_2:
- Val = TRUTH;
+ RESULT_OF_PURIFY (TRUTH);
break;
case RC_REPEAT_DISPATCH:
/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 10.35 1988/05/04 19:22:12 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 10.36 1988/05/05 08:41:51 cph Exp $
Copyright (c) 1988 Massachusetts Institute of Technology
#define VERSION 10
#endif
#ifndef SUBVERSION
-#define SUBVERSION 35
+#define SUBVERSION 36
#endif
#ifndef UCODE_TABLES_FILENAME