Move Stack_Guard into the register block so that compiler can
authorChris Hanson <org/chris-hanson/cph>
Wed, 29 Jul 1992 19:54:58 +0000 (19:54 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 29 Jul 1992 19:54:58 +0000 (19:54 +0000)
reference it for stack-overflow checks.

12 files changed:
v7/src/microcode/cmpint.c
v7/src/microcode/const.h
v7/src/microcode/extern.h
v7/src/microcode/gc.h
v7/src/microcode/interp.h
v7/src/microcode/stack.h
v7/src/microcode/storage.c
v7/src/microcode/utils.c
v7/src/microcode/version.h
v8/src/microcode/cmpint.c
v8/src/microcode/const.h
v8/src/microcode/version.h

index c211dfe6304a66cdab421df770f89b6795ee841d..fedf3374741cac63c431decb2b97608a5fd68f3c 100644 (file)
@@ -1,8 +1,8 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/cmpint.c,v 1.46 1992/06/11 18:51:35 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/cmpint.c,v 1.47 1992/07/29 19:54:49 cph Exp $
 
-Copyright (c) 1989-1992 Massachusetts Institute of Technology
+Copyright (c) 1989-92 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -1365,7 +1365,7 @@ DEFUN (comutil_interrupt_closure,
        long ignore_1 AND long ignore_2 AND long ignore_3 AND long ignore_4)
 {
   TEST_GC_NEEDED();
-  if ((PENDING_INTERRUPTS()) == 0)
+  if (((PENDING_INTERRUPTS()) == 0) && (Stack_Pointer > Stack_Guard))
   {
     SCHEME_OBJECT entry_point;
 
@@ -1398,7 +1398,7 @@ DEFUN (compiler_interrupt_common,
        SCHEME_OBJECT state)
 {
   TEST_GC_NEEDED();
-  if ((PENDING_INTERRUPTS()) == 0)
+  if (((PENDING_INTERRUPTS()) == 0) && (Stack_Pointer > Stack_Guard))
   {
     Store_Env (state);
     Val = state;
index 0004db6a60e246884576d9c1d4a27c7f662d1a50..841cd1f3bf3f82a80efe126e60437b58f283daba 100644 (file)
@@ -1,6 +1,8 @@
 /* -*-C-*-
 
-Copyright (c) 1987-1991 Massachusetts Institute of Technology
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/const.h,v 9.40 1992/07/29 19:54:52 cph Exp $
+
+Copyright (c) 1987-92 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -30,11 +32,7 @@ Technology nor of any adaptation thereof in any advertising,
 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/const.h,v 9.39 1991/07/24 02:26:55 cph Exp $
- *
- * Named constants used throughout the interpreter
- *
- */
+/* Named constants used throughout the interpreter */
 \f
 #if (CHAR_BIT != 8)
 #define MAX_CHAR               ((1<<CHAR_BIT)-1)
@@ -178,7 +176,8 @@ MIT in each case. */
 #define REGBLOCK_PRIMITIVE             8
 #define REGBLOCK_CLOSURE_FREE          9       /* For use by compiler */
 #define REGBLOCK_CLOSURE_SPACE         10      /* For use by compiler */
-#define REGBLOCK_MINIMUM_LENGTH                11
+#define REGBLOCK_STACK_GUARD           11
+#define REGBLOCK_MINIMUM_LENGTH                12
 \f
 /* Codes specifying how to start scheme at boot time. */
 
index eec5f7690213a10dcc79753dc111cc9252b3dc1e..ff259ab8b75c0748e936bd280f211bbd24fdb907 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/extern.h,v 9.44 1992/02/03 23:26:46 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/extern.h,v 9.45 1992/07/29 19:54:52 cph Exp $
 
 Copyright (c) 1987-92 Massachusetts Institute of Technology
 
@@ -93,7 +93,6 @@ extern SCHEME_OBJECT
  * MemTop,             /* Top of heap space available */
  * Ext_Stack_Pointer,  /* Next available slot in control stack */
  * Stack_Top,          /* Top of control stack */
- * Stack_Guard,                /* Guard area at end of stack */
  * Free_Stacklets,     /* Free list of stacklets */
  * Constant_Space,     /* Bottom of constant+pure space */
  * Free_Constant,      /* Next free cell in constant+pure area */
index 0f1d07f0d0b40c7800f1cf56d087d976e4823a2c..ad044c88302dbd8fb03aacf1f53eceff7e568b5b 100644 (file)
@@ -1,6 +1,8 @@
 /* -*-C-*-
 
-Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/gc.h,v 9.31 1992/07/29 19:54:53 cph Exp $
+
+Copyright (c) 1987-92 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -30,8 +32,7 @@ Technology nor of any adaptation thereof in any advertising,
 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/gc.h,v 9.30 1989/10/28 15:38:26 jinx Rel $
- *
+/* 
  * Garbage collection related macros of sufficient utility to be
  * included in all compilations.
  */
@@ -127,5 +128,5 @@ MIT in each case. */
 
 #define Set_Stack_Guard(Addr)                                          \
 {                                                                      \
-  Stack_Guard = Addr;                                                  \
+  (Regs[REGBLOCK_STACK_GUARD]) = ((SCHEME_OBJECT) (Addr));             \
 }
index 9d2443cf8317a31910a51ec1ad2ae989ea7e08f1..fbe3da5d6ac9cad7edeea73dcf1d1eb1d1279f1b 100644 (file)
@@ -1,8 +1,8 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/interp.h,v 9.34 1991/07/18 15:59:41 markf Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/interp.h,v 9.35 1992/07/29 19:54:54 cph Exp $
 
-Copyright (c) 1987, 1988, 1989, 1990 Massachusetts Institute of Technology
+Copyright (c) 1987-92 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -90,6 +90,7 @@ extern int EXFUN (abort_to_interpreter_argument, (void));
 #define Val            Regs[REGBLOCK_VAL]
 #define Expression     Regs[REGBLOCK_EXPR]
 #define Return         Regs[REGBLOCK_RETURN]
+#define Stack_Guard    ((SCHEME_OBJECT *) (Regs[REGBLOCK_STACK_GUARD]))
 \f
 /* Internal_Will_Push is in stack.h. */
 
index 5fe407b6a0f05e01c6857155334f09389861aa3d..2a474d4f4a2714ddfacba4f42a0263cd752f0d5f 100644 (file)
@@ -1,8 +1,8 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/stack.h,v 9.30 1992/02/03 23:38:30 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/stack.h,v 9.31 1992/07/29 19:54:55 cph Exp $
 
-Copyright (c) 1987-1992 Massachusetts Institute of Technology
+Copyright (c) 1987-92 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -46,7 +46,7 @@ MIT in each case. */
   {                                                                    \
     Microcode_Termination(TERM_STACK_ALLOCATION_FAILED);               \
   }                                                                    \
-  Stack_Guard = (Free + STACKLET_HEADER_SIZE);                         \
+  Set_Stack_Guard (Free + STACKLET_HEADER_SIZE);                       \
   *Free =                                                              \
     (MAKE_OBJECT (TC_MANIFEST_VECTOR, (Default_Stacklet_Size - 1)));   \
   Free += Default_Stacklet_Size;                                       \
@@ -127,7 +127,7 @@ MIT in each case. */
   SCHEME_OBJECT Our_Where;                                             \
                                                                        \
   Our_Where = (Where);                                                 \
-  Stack_Guard = MEMORY_LOC (Our_Where, STACKLET_HEADER_SIZE);          \
+  Set_Stack_Guard (MEMORY_LOC (Our_Where, STACKLET_HEADER_SIZE));      \
   Stack_Pointer = Previous_Stack_Pointer(Our_Where);                   \
 }
 
@@ -248,7 +248,7 @@ Pushed()
        MEMORY_SET (Older_Stacklet, STACKLET_REUSE_FLAG, SHARP_F);      \
       }                                                                        \
       temp = Free;                                                     \
-      Stack_Guard = &(temp[STACKLET_HEADER_SIZE]);                     \
+      Set_Stack_Guard (& (temp[STACKLET_HEADER_SIZE]));                        \
       temp[STACKLET_LENGTH] = Old_Stacklet_Top[STACKLET_LENGTH];       \
       Unused_Length =                                                  \
        OBJECT_DATUM (Old_Stacklet_Top[STACKLET_UNUSED_LENGTH]) +       \
index becdb849373672368175b469864369c04c3b93f7..60282584f18b129917b43781c76ef52764db6ce5 100644 (file)
@@ -1,8 +1,8 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/storage.c,v 9.49 1992/07/28 14:44:37 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/storage.c,v 9.50 1992/07/29 19:54:55 cph Exp $
 
-Copyright (c) 1987-1992 Massachusetts Institute of Technology
+Copyright (c) 1987-92 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -49,7 +49,6 @@ SCHEME_OBJECT
  * Free,               /* Next free word in storage */
  * Ext_Stack_Pointer,  /* Next available slot in control stack */
  * Stack_Top,          /* Top of control stack */
- * Stack_Guard,                /* Guard area at end of stack */
  * Free_Stacklets,     /* Free list of stacklets */
  * Constant_Space,     /* Bottom of constant+pure space */
  * Free_Constant,      /* Next free cell in constant+pure area */
index 7bf8eec06e60e8d109c846d9d98a0a624f03d265..7ece804c8f2dfa58da4ae11175a0003873fef168 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/utils.c,v 9.52 1992/02/03 23:41:57 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/utils.c,v 9.53 1992/07/29 19:54:56 cph Exp $
 
 Copyright (c) 1987-92 Massachusetts Institute of Technology
 
@@ -828,7 +828,7 @@ DEFUN (Allocate_New_Stacklet, (N), long N)
       }
     }
     Free[STACKLET_LENGTH] = MAKE_OBJECT (TC_MANIFEST_VECTOR, (size - 1));
-    Stack_Guard = &(Free[STACKLET_HEADER_SIZE]);
+    Set_Stack_Guard (& (Free[STACKLET_HEADER_SIZE]));
     Free += size;
     Stack_Pointer = Free;
   }
@@ -843,7 +843,7 @@ DEFUN (Allocate_New_Stacklet, (N), long N)
       ((SCHEME_OBJECT *) Free_Stacklets[STACKLET_FREE_LIST_LINK]);
     Stack_Pointer =
       &New_Stacklet[1 + (OBJECT_DATUM (New_Stacklet[STACKLET_LENGTH]))];
-    Stack_Guard = &New_Stacklet[STACKLET_HEADER_SIZE];
+    Set_Stack_Guard (& (New_Stacklet[STACKLET_HEADER_SIZE]));
   }
   Old_Expression = Fetch_Expression();
   Old_Return = Fetch_Return();
index 8efb908a7f8024aa39b7965e0927a3805d686624..934302f4aa84e22b8f73069d8553193e351cbb2d 100644 (file)
@@ -1,8 +1,8 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.117 1992/07/20 20:12:30 arthur Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.118 1992/07/29 19:54:58 cph Exp $
 
-Copyright (c) 1988-1992 Massachusetts Institute of Technology
+Copyright (c) 1988-92 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -46,5 +46,5 @@ MIT in each case. */
 #define VERSION                11
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     117
+#define SUBVERSION     118
 #endif
index 666a3e69cd180d16c09f13610f348fdf4bd3b3cd..baea32f9f131c9ec2983a40770dcfee30b94b00a 100644 (file)
@@ -1,8 +1,8 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/cmpint.c,v 1.46 1992/06/11 18:51:35 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/cmpint.c,v 1.47 1992/07/29 19:54:49 cph Exp $
 
-Copyright (c) 1989-1992 Massachusetts Institute of Technology
+Copyright (c) 1989-92 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -1365,7 +1365,7 @@ DEFUN (comutil_interrupt_closure,
        long ignore_1 AND long ignore_2 AND long ignore_3 AND long ignore_4)
 {
   TEST_GC_NEEDED();
-  if ((PENDING_INTERRUPTS()) == 0)
+  if (((PENDING_INTERRUPTS()) == 0) && (Stack_Pointer > Stack_Guard))
   {
     SCHEME_OBJECT entry_point;
 
@@ -1398,7 +1398,7 @@ DEFUN (compiler_interrupt_common,
        SCHEME_OBJECT state)
 {
   TEST_GC_NEEDED();
-  if ((PENDING_INTERRUPTS()) == 0)
+  if (((PENDING_INTERRUPTS()) == 0) && (Stack_Pointer > Stack_Guard))
   {
     Store_Env (state);
     Val = state;
index bcfab556ac625141b9a5b5bcd476219d3da0c2c2..d9a61f220f86cbb4629531428608f46e883134e3 100644 (file)
@@ -1,6 +1,8 @@
 /* -*-C-*-
 
-Copyright (c) 1987-1991 Massachusetts Institute of Technology
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/const.h,v 9.40 1992/07/29 19:54:52 cph Exp $
+
+Copyright (c) 1987-92 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -30,11 +32,7 @@ Technology nor of any adaptation thereof in any advertising,
 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/const.h,v 9.39 1991/07/24 02:26:55 cph Exp $
- *
- * Named constants used throughout the interpreter
- *
- */
+/* Named constants used throughout the interpreter */
 \f
 #if (CHAR_BIT != 8)
 #define MAX_CHAR               ((1<<CHAR_BIT)-1)
@@ -178,7 +176,8 @@ MIT in each case. */
 #define REGBLOCK_PRIMITIVE             8
 #define REGBLOCK_CLOSURE_FREE          9       /* For use by compiler */
 #define REGBLOCK_CLOSURE_SPACE         10      /* For use by compiler */
-#define REGBLOCK_MINIMUM_LENGTH                11
+#define REGBLOCK_STACK_GUARD           11
+#define REGBLOCK_MINIMUM_LENGTH                12
 \f
 /* Codes specifying how to start scheme at boot time. */
 
index d300b0ddcbc2a1308a561a862392971e984ae0fa..49fa398aff91f4796fa52d10f1f36a6c0d22fe15 100644 (file)
@@ -1,8 +1,8 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.117 1992/07/20 20:12:30 arthur Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.118 1992/07/29 19:54:58 cph Exp $
 
-Copyright (c) 1988-1992 Massachusetts Institute of Technology
+Copyright (c) 1988-92 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -46,5 +46,5 @@ MIT in each case. */
 #define VERSION                11
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     117
+#define SUBVERSION     118
 #endif