Various changes to the garbage collector and other relocators to
authorGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Sat, 28 Oct 1989 15:39:09 +0000 (15:39 +0000)
committerGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Sat, 28 Oct 1989 15:39:09 +0000 (15:39 +0000)
accomodate machines where jsr-style instructions do not encode the
target address directly and contiguously.

Some changes to cmp68kgc.h to better match the portable version,
cmpgc-portable.h .

Split the defaulting of various macros from gccode.h into
cmpgc-stub.h .  gccode.h includes cmpgc.h which should be a copy of (or
link to) cmp68kgc.h, cmpvaxgc.h, cmpgc-portable.g, or cmpgc-stub.h

19 files changed:
v7/src/microcode/bchdmp.c
v7/src/microcode/bchgcc.h
v7/src/microcode/bchgcl.c
v7/src/microcode/bchpur.c
v7/src/microcode/bintopsb.c
v7/src/microcode/fasdump.c
v7/src/microcode/fasload.c
v7/src/microcode/gc.h
v7/src/microcode/gccode.h
v7/src/microcode/gcloop.c
v7/src/microcode/interp.c
v7/src/microcode/memmag.c
v7/src/microcode/purify.c
v7/src/microcode/purutl.c
v7/src/microcode/unxutl/ymkfile
v7/src/microcode/version.h
v8/src/microcode/bintopsb.c
v8/src/microcode/interp.c
v8/src/microcode/version.h

index e1bfd7ca69e27fd5c57d057869fb02e6583e33c4..a3d4d54d24816a1acbd4ea1a9ed35fec133aa369 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchdmp.c,v 9.45 1989/09/20 23:05:37 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchdmp.c,v 9.46 1989/10/28 15:37:50 jinx Exp $
 
 Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
 
@@ -149,7 +149,7 @@ static Boolean compiled_code_present_p;
 }
 
 #define fasdump_compiled_entry()                                       \
-{                                                                      \
+do {                                                                   \
   compiled_code_present_p = true;                                      \
   Old = OBJECT_ADDRESS (Temp);                                         \
   Compiled_BH(false, continue);                                                \
@@ -164,24 +164,26 @@ static Boolean compiled_code_present_p;
       return (PRIM_INTERRUPT);                                         \
     }                                                                  \
     *Saved_Old = New_Address;                                          \
-    *Scan = Relocate_Compiled(Temp, OBJECT_ADDRESS (New_Address),      \
-                             Saved_Old);                               \
+    Temp = RELOCATE_COMPILED(Temp, (OBJECT_ADDRESS (New_Address)),     \
+                            Saved_Old);                                \
     continue;                                                          \
   }                                                                    \
-}
+} while (false)
 
 #define fasdump_linked_operator()                                      \
 {                                                                      \
-  Scan = OPERATOR_LINKAGE_ENTRY_ADDRESS(word_ptr);                     \
-  Temp = *Scan;                                                                \
+  Scan = ((SCHEME_OBJECT *) (word_ptr));                               \
+  EXTRACT_OPERATOR_LINKAGE_ADDRESS (Temp, Scan);                       \
   fasdump_compiled_entry();                                            \
+  STORE_OPERATOR_LINKAGE_ADDRESS (Temp, Scan);                         \
 }
 
 #define fasdump_manifest_closure()                                     \
 {                                                                      \
-  Scan = MANIFEST_CLOSURE_ENTRY_ADDRESS(word_ptr);                     \
-  Temp = *Scan;                                                                \
+  Scan = ((SCHEME_OBJECT *) (word_ptr));                               \
+  EXTRACT_CLOSURE_ENTRY_ADDRESS (Temp, Scan);                          \
   fasdump_compiled_entry();                                            \
+  STORE_CLOSURE_ENTRY_ADDRESS (Temp, Scan);                            \
 }
 \f
 Boolean
@@ -339,6 +341,8 @@ dumploop(Scan, To_ptr, To_Address_ptr)
 \f
       case_compiled_entry_point:
        fasdump_compiled_entry();
+       *Scan = Temp;
+       break;
 
       case TC_LINKAGE_SECTION:
       {
@@ -381,81 +385,90 @@ dumploop(Scan, To_ptr, To_Address_ptr)
          fast machine_word *word_ptr, *next_ptr;
          long overflow;
 
-         count = READ_OPERATOR_LINKAGE_COUNT(Temp);
-         word_ptr = FIRST_OPERATOR_LINKAGE_ENTRY(Scan);
-         overflow = ((END_OPERATOR_LINKAGE_AREA(Scan, count)) -
+         count = (READ_OPERATOR_LINKAGE_COUNT (Temp));
+         word_ptr = (FIRST_OPERATOR_LINKAGE_ENTRY (Scan));
+         overflow = ((END_OPERATOR_LINKAGE_AREA (Scan, count)) -
                      scan_buffer_top);
 
-         for (next_ptr = NEXT_LINKAGE_OPERATOR_ENTRY(word_ptr);
+         for (next_ptr = (NEXT_LINKAGE_OPERATOR_ENTRY (word_ptr));
               (--count >= 0);
               word_ptr = next_ptr,
-              next_ptr = NEXT_LINKAGE_OPERATOR_ENTRY(word_ptr))
+              next_ptr = (NEXT_LINKAGE_OPERATOR_ENTRY (word_ptr)))
          {
            if (next_ptr > ((machine_word *) scan_buffer_top))
            {
-             extend_scan_buffer((char *) next_ptr, To);
-             ONCE_ONLY(fasdump_linked_operator());
+             extend_scan_buffer (((char *) next_ptr), To);
+             fasdump_linked_operator ();
              next_ptr = ((machine_word *)
-                         end_scan_buffer_extension((char *) next_ptr));
+                         (end_scan_buffer_extension ((char *) next_ptr)));
              overflow -= GC_DISK_BUFFER_SIZE;
            }
            else
            {
-             fasdump_linked_operator();
+             fasdump_linked_operator ();
            }
          }
-         Scan = scan_buffer_top + overflow;
+         Scan = (scan_buffer_top + overflow);
          break;
        }
       }
 \f
       case TC_MANIFEST_CLOSURE:
       {
-       machine_word *start_ptr;
-       fast machine_word *word_ptr, *next_ptr;
+       fast long count;
+       fast machine_word *word_ptr;
+       machine_word *end_ptr;
 
        Scan += 1;
-       start_ptr = FIRST_MANIFEST_CLOSURE_ENTRY(Scan);
+       /* Is there enough space to read the count? */
+       if ((((machine_word *) Scan) + 2) >
+           ((machine_word *) scan_buffer_top))
+       {
+         long dw;
+         machine_word *header_end;
+
+         header_end = (((machine_word *) Scan) + 2);
+         extend_scan_buffer (((char *) header_end), To);
+         count = (MANIFEST_CLOSURE_COUNT (Scan));
+         word_ptr = (FIRST_MANIFEST_CLOSURE_ENTRY (Scan));
+         dw = (word_ptr - header_end);
+         header_end = ((machine_word *)
+                       (end_scan_buffer_extension ((char *) header_end)));
+         word_ptr = (header_end + dw);
+         Scan = ((SCHEME_OBJECT *) (header_end - 2));
+       }
+       else
+       {
+         count = (MANIFEST_CLOSURE_COUNT (Scan));
+         word_ptr = (FIRST_MANIFEST_CLOSURE_ENTRY (Scan));
+       }
+       end_ptr = ((machine_word *) (MANIFEST_CLOSURE_END (Scan, count)));
 
-       for (word_ptr = start_ptr,
-            next_ptr = NEXT_MANIFEST_CLOSURE_ENTRY(word_ptr);
-            true;
-            word_ptr = next_ptr,
-            next_ptr = NEXT_MANIFEST_CLOSURE_ENTRY(word_ptr))
+       for ( ; ((--count) >= 0);
+            (word_ptr = (NEXT_MANIFEST_CLOSURE_ENTRY (word_ptr))))
        {
-         if (!MANIFEST_CLOSURE_VALID_FITS_P(word_ptr, scan_buffer_top))
-         {
-           long dw, ds;
-
-           dw = (word_ptr - ((machine_word *) scan_buffer_top));
-           ds = (word_ptr - start_ptr);
-           word_ptr = (((machine_word *)
-                        (dump_and_reload_scan_buffer(0, NULL))) +
-                       dw);
-           start_ptr = word_ptr - ds;
-           next_ptr = NEXT_MANIFEST_CLOSURE_ENTRY(word_ptr);
-         }
-         if (!VALID_MANIFEST_CLOSURE_ENTRY(word_ptr))
-         {
-           break;
-         }
-         else if (next_ptr > ((machine_word *) scan_buffer_top))
+         if ((CLOSURE_ENTRY_END (word_ptr)) >
+             ((machine_word *) scan_buffer_top))
          {
-           long ds;
-
-           ds = (next_ptr - start_ptr);
-           extend_scan_buffer((char *) next_ptr, To);
-           ONCE_ONLY(fasdump_manifest_closure());
-           next_ptr = ((machine_word *)
-                       end_scan_buffer_extension((char *) next_ptr));
-           start_ptr = next_ptr - ds;
+           machine_word *entry_end;
+           long de, dw;
+
+           entry_end = (CLOSURE_ENTRY_END (word_ptr));
+           de = (end_ptr - entry_end);
+           dw = (entry_end - word_ptr);
+           extend_scan_buffer (((char *) entry_end), To);
+           fasdump_manifest_closure ();
+           entry_end = ((machine_word *)
+                        (end_scan_buffer_extension ((char *) entry_end)));
+           word_ptr = (entry_end - dw);
+           end_ptr = (entry_end + de);
          }
          else
          {
-           fasdump_manifest_closure();
+           fasdump_manifest_closure ();
          }
        }
-       Scan = MANIFEST_CLOSURE_END(word_ptr, start_ptr);
+       Scan = ((SCHEME_OBJECT *) (end_ptr));
        break;
       }
 \f
index f7937152f075bd7a6fc4671f34a461c2080ede47..824b8992378f716e0c025c46f25c5a0c775c6ac9 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchgcc.h,v 9.34 1989/09/20 23:05:41 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchgcc.h,v 9.35 1989/10/28 15:37:55 jinx Exp $
 
 Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
 
@@ -221,7 +221,7 @@ extern char gc_death_message_buffer[];
 }
 \f
 #define relocate_compiled_entry(in_gc_p)                               \
-{                                                                      \
+do {                                                                   \
   Old = OBJECT_ADDRESS (Temp);                                         \
   if (Old >= Low_Constant)                                             \
     continue;                                                          \
@@ -232,29 +232,25 @@ extern char gc_death_message_buffer[];
     New_Address = (MAKE_BROKEN_HEART (To_Address));                    \
     copy_vector(NULL);                                                 \
     *Saved_Old = New_Address;                                          \
-    *Scan = Relocate_Compiled(Temp,                                    \
-                             OBJECT_ADDRESS (New_Address),             \
-                             Saved_Old);                               \
+    Temp = RELOCATE_COMPILED(Temp,                                     \
+                            OBJECT_ADDRESS (New_Address),              \
+                            Saved_Old);                                \
     continue;                                                          \
   }                                                                    \
-}
+} while (0)
 
 #define relocate_linked_operator(in_gc_p)                              \
 {                                                                      \
-  Scan = OPERATOR_LINKAGE_ENTRY_ADDRESS(word_ptr);                     \
-  Temp = *Scan;                                                                \
+  Scan = ((SCHEME_OBJECT *) (word_ptr));                               \
+  EXTRACT_OPERATOR_LINKAGE_ADDRESS (Temp, Scan);                       \
   relocate_compiled_entry(in_gc_p);                                    \
+  STORE_OPERATOR_LINKAGE_ADDRESS (Temp, Scan);                         \
 }
 
 #define relocate_manifest_closure(in_gc_p)                             \
 {                                                                      \
-  Scan = MANIFEST_CLOSURE_ENTRY_ADDRESS(word_ptr);                     \
-  Temp = *Scan;                                                                \
+  Scan = ((SCHEME_OBJECT *) (word_ptr));                               \
+  EXTRACT_CLOSURE_ENTRY_ADDRESS (Temp, Scan);                          \
   relocate_compiled_entry(in_gc_p);                                    \
+  STORE_CLOSURE_ENTRY_ADDRESS (Temp, Scan);                            \
 }
-
-#define ONCE_ONLY(stmt)                                                        \
-do                                                                     \
-{                                                                      \
-  stmt;                                                                        \
-} while (false)
index cfe6ad41478f5e37164512fcb46e9ed846bce94c..25c53e091b146c095ea1f0602cf1978bb2369afd 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchgcl.c,v 9.36 1989/09/20 23:05:45 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchgcl.c,v 9.37 1989/10/28 15:37:58 jinx Exp $
 
 Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
 
@@ -90,13 +90,16 @@ GCLoop(Scan, To_ptr, To_Address_ptr)
 
          /* The + & -1 are here because of the Scan++ in the for header. */
          overflow = (Scan - scan_buffer_top) + 1;
-         Scan = ((dump_and_reload_scan_buffer((overflow / GC_DISK_BUFFER_SIZE), NULL) +
+         Scan = ((dump_and_reload_scan_buffer
+                  ((overflow / GC_DISK_BUFFER_SIZE), NULL) +
                   (overflow % GC_DISK_BUFFER_SIZE)) - 1);
          break;
        }
 \f
       case_compiled_entry_point:
        relocate_compiled_entry(true);
+       *Scan = Temp;
+       break;
 
       case TC_LINKAGE_SECTION:
       {
@@ -139,81 +142,90 @@ GCLoop(Scan, To_ptr, To_Address_ptr)
          fast machine_word *word_ptr, *next_ptr;
          long overflow;
 
-         count = READ_OPERATOR_LINKAGE_COUNT(Temp);
-         word_ptr = FIRST_OPERATOR_LINKAGE_ENTRY(Scan);
-         overflow = ((END_OPERATOR_LINKAGE_AREA(Scan, count)) -
+         count = (READ_OPERATOR_LINKAGE_COUNT (Temp));
+         word_ptr = (FIRST_OPERATOR_LINKAGE_ENTRY (Scan));
+         overflow = ((END_OPERATOR_LINKAGE_AREA (Scan, count)) -
                      scan_buffer_top);
 
-         for (next_ptr = NEXT_LINKAGE_OPERATOR_ENTRY(word_ptr);
+         for (next_ptr = (NEXT_LINKAGE_OPERATOR_ENTRY (word_ptr));
               (--count >= 0);
               word_ptr = next_ptr,
-              next_ptr = NEXT_LINKAGE_OPERATOR_ENTRY(word_ptr))
+              next_ptr = (NEXT_LINKAGE_OPERATOR_ENTRY (word_ptr)))
          {
            if (next_ptr > ((machine_word *) scan_buffer_top))
            {
-             extend_scan_buffer((char *) next_ptr, To);
-             ONCE_ONLY(relocate_linked_operator(true));
+             extend_scan_buffer ((char *) next_ptr, To);
+             relocate_linked_operator (true);
              next_ptr = ((machine_word *)
-                         end_scan_buffer_extension((char *) next_ptr));
+                         (end_scan_buffer_extension ((char *) next_ptr)));
              overflow -= GC_DISK_BUFFER_SIZE;
            }
            else
            {
-             relocate_linked_operator(true);
+             relocate_linked_operator (true);
            }
          }
-         Scan = scan_buffer_top + overflow;
+         Scan = (scan_buffer_top + overflow);
          break;
        }
       }
 \f
       case TC_MANIFEST_CLOSURE:
       {
-       machine_word *start_ptr;
-       fast machine_word *word_ptr, *next_ptr;
+       fast long count;
+       fast machine_word *word_ptr;
+       machine_word *end_ptr;
 
        Scan += 1;
-       start_ptr = FIRST_MANIFEST_CLOSURE_ENTRY(Scan);
+       /* Is there enough space to read the count? */
+       if ((((machine_word *) Scan) + 2) >
+           ((machine_word *) scan_buffer_top))
+       {
+         long dw;
+         machine_word *header_end;
+
+         header_end = (((machine_word *) Scan) + 2);
+         extend_scan_buffer (((char *) header_end), To);
+         count = (MANIFEST_CLOSURE_COUNT (Scan));
+         word_ptr = (FIRST_MANIFEST_CLOSURE_ENTRY (Scan));
+         dw = (word_ptr - header_end);
+         header_end = ((machine_word *)
+                       (end_scan_buffer_extension ((char *) header_end)));
+         word_ptr = (header_end + dw);
+         Scan = ((SCHEME_OBJECT *) (header_end - 2));
+       }
+       else
+       {
+         count = (MANIFEST_CLOSURE_COUNT (Scan));
+         word_ptr = (FIRST_MANIFEST_CLOSURE_ENTRY (Scan));
+       }
+       end_ptr = ((machine_word *) (MANIFEST_CLOSURE_END (Scan, count)));
 
-       for (word_ptr = start_ptr,
-            next_ptr = NEXT_MANIFEST_CLOSURE_ENTRY(word_ptr);
-            true;
-            word_ptr = next_ptr,
-            next_ptr = NEXT_MANIFEST_CLOSURE_ENTRY(word_ptr))
+       for ( ; ((--count) >= 0);
+            (word_ptr = (NEXT_MANIFEST_CLOSURE_ENTRY (word_ptr))))
        {
-         if (!MANIFEST_CLOSURE_VALID_FITS_P(word_ptr, scan_buffer_top))
+         if ((CLOSURE_ENTRY_END (word_ptr)) >
+             ((machine_word *) scan_buffer_top))
          {
-           long dw, ds;
-
-           dw = (word_ptr - ((machine_word *) scan_buffer_top));
-           ds = (word_ptr - start_ptr);
-           word_ptr = (((machine_word *)
-                        (dump_and_reload_scan_buffer(0, NULL))) +
-                       dw);
-           start_ptr = word_ptr - ds;
-           next_ptr = NEXT_MANIFEST_CLOSURE_ENTRY(word_ptr);
-         }
-         if (!VALID_MANIFEST_CLOSURE_ENTRY(word_ptr))
-         {
-           break;
-         }
-         else if (next_ptr > ((machine_word *) scan_buffer_top))
-         {
-           long ds;
-
-           ds = (next_ptr - start_ptr);
-           extend_scan_buffer((char *) next_ptr, To);
-           ONCE_ONLY(relocate_manifest_closure(true));
-           next_ptr = ((machine_word *)
-                       end_scan_buffer_extension((char *) next_ptr));
-           start_ptr = next_ptr - ds;
+           machine_word *entry_end;
+           long de, dw;
+
+           entry_end = (CLOSURE_ENTRY_END (word_ptr));
+           de = (end_ptr - entry_end);
+           dw = (entry_end - word_ptr);
+           extend_scan_buffer (((char *) entry_end), To);
+           relocate_manifest_closure(true);
+           entry_end = ((machine_word *)
+                        (end_scan_buffer_extension ((char *) entry_end)));
+           word_ptr = (entry_end - dw);
+           end_ptr = (entry_end + de);
          }
          else
          {
            relocate_manifest_closure(true);
          }
        }
-       Scan = MANIFEST_CLOSURE_END(word_ptr, start_ptr);
+       Scan = ((SCHEME_OBJECT *) (end_ptr));
        break;
       }
 \f
index ab0c4973203d1c8e956b8f43fab7e94cc5ec9974..3843d955387c4c3c19dfb98cd6a74db10eff0f59 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchpur.c,v 9.45 1989/09/20 23:05:53 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchpur.c,v 9.46 1989/10/28 15:38:01 jinx Exp $
 
 Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
 
@@ -135,6 +135,8 @@ purifyloop(Scan, To_ptr, To_Address_ptr, purify_mode)
        if (purify_mode == PURE_COPY)
          break;
        relocate_compiled_entry(false);
+       *Scan = Temp;
+       break;
 
       case TC_LINKAGE_SECTION:
       {
@@ -184,30 +186,30 @@ purifyloop(Scan, To_ptr, To_Address_ptr, purify_mode)
          fast machine_word *word_ptr, *next_ptr;
          long overflow;
 
-         count = READ_OPERATOR_LINKAGE_COUNT(Temp);
-         word_ptr = FIRST_OPERATOR_LINKAGE_ENTRY(Scan);
-         overflow = ((END_OPERATOR_LINKAGE_AREA(Scan, count)) -
+         count = (READ_OPERATOR_LINKAGE_COUNT (Temp));
+         word_ptr = (FIRST_OPERATOR_LINKAGE_ENTRY (Scan));
+         overflow = ((END_OPERATOR_LINKAGE_AREA (Scan, count)) -
                      scan_buffer_top);
 
-         for (next_ptr = NEXT_LINKAGE_OPERATOR_ENTRY(word_ptr);
+         for (next_ptr = (NEXT_LINKAGE_OPERATOR_ENTRY (word_ptr));
               (--count >= 0);
               word_ptr = next_ptr,
-              next_ptr = NEXT_LINKAGE_OPERATOR_ENTRY(word_ptr))
+              next_ptr = (NEXT_LINKAGE_OPERATOR_ENTRY (word_ptr)))
          {
            if (next_ptr > ((machine_word *) scan_buffer_top))
            {
-             extend_scan_buffer((char *) next_ptr, To);
-             ONCE_ONLY(relocate_linked_operator(false));
+             extend_scan_buffer (((char *) next_ptr), To);
+             relocate_linked_operator (false);
              next_ptr = ((machine_word *)
-                         end_scan_buffer_extension((char *) next_ptr));
+                         (end_scan_buffer_extension ((char *) next_ptr)));
              overflow -= GC_DISK_BUFFER_SIZE;
            }
            else
            {
-             relocate_linked_operator(false);
+             relocate_linked_operator (false);
            }
          }
-         Scan = scan_buffer_top + overflow;
+         Scan = (scan_buffer_top + overflow);
          break;
        }
       }
@@ -223,51 +225,60 @@ purifyloop(Scan, To_ptr, To_Address_ptr, purify_mode)
        }
       }
       {
-       machine_word *start_ptr;
-       fast machine_word *word_ptr, *next_ptr;
+       fast long count;
+       fast machine_word *word_ptr;
+       machine_word *end_ptr;
 
        Scan += 1;
-       start_ptr = FIRST_MANIFEST_CLOSURE_ENTRY(Scan);
+       /* Is there enough space to read the count? */
+       if ((((machine_word *) Scan) + 2) >
+           ((machine_word *) scan_buffer_top))
+       {
+         long dw;
+         machine_word *header_end;
+
+         header_end = (((machine_word *) Scan) + 2);
+         extend_scan_buffer (((char *) header_end), To);
+         count = (MANIFEST_CLOSURE_COUNT (Scan));
+         word_ptr = (FIRST_MANIFEST_CLOSURE_ENTRY (Scan));
+         dw = (word_ptr - header_end);
+         header_end = ((machine_word *)
+                       (end_scan_buffer_extension ((char *) header_end)));
+         word_ptr = (header_end + dw);
+         Scan = ((SCHEME_OBJECT *) (header_end - 2));
+       }
+       else
+       {
+         count = (MANIFEST_CLOSURE_COUNT (Scan));
+         word_ptr = (FIRST_MANIFEST_CLOSURE_ENTRY (Scan));
+       }
+       end_ptr = ((machine_word *) (MANIFEST_CLOSURE_END (Scan, count)));
 
-       for (word_ptr = start_ptr,
-            next_ptr = NEXT_MANIFEST_CLOSURE_ENTRY(word_ptr);
-            true;
-            word_ptr = next_ptr,
-            next_ptr = NEXT_MANIFEST_CLOSURE_ENTRY(word_ptr))
+       for ( ; ((--count) >= 0);
+            (word_ptr = (NEXT_MANIFEST_CLOSURE_ENTRY (word_ptr))))
        {
-         if (!MANIFEST_CLOSURE_VALID_FITS_P(word_ptr, scan_buffer_top))
-         {
-           long dw, ds;
-
-           dw = (word_ptr - ((machine_word *) scan_buffer_top));
-           ds = (word_ptr - start_ptr);
-           word_ptr = (((machine_word *)
-                        (dump_and_reload_scan_buffer(0, NULL))) +
-                       dw);
-           start_ptr = word_ptr - ds;
-           next_ptr = NEXT_MANIFEST_CLOSURE_ENTRY(word_ptr);
-         }
-         if (!VALID_MANIFEST_CLOSURE_ENTRY(word_ptr))
-         {
-           break;
-         }
-         else if (next_ptr > ((machine_word *) scan_buffer_top))
+         if ((CLOSURE_ENTRY_END(word_ptr)) >
+             ((machine_word *) scan_buffer_top))
          {
-           long ds;
-
-           ds = (next_ptr - start_ptr);
-           extend_scan_buffer((char *) next_ptr, To);
-           ONCE_ONLY(relocate_manifest_closure(false));
-           next_ptr = ((machine_word *)
-                       end_scan_buffer_extension((char *) next_ptr));
-           start_ptr = next_ptr - ds;
+           machine_word *entry_end;
+           long de, dw;
+
+           entry_end = (CLOSURE_ENTRY_END(word_ptr));
+           de = (end_ptr - entry_end);
+           dw = (entry_end - word_ptr);
+           extend_scan_buffer(((char *) entry_end), To);
+           relocate_manifest_closure (false);
+           entry_end = ((machine_word *)
+                        (end_scan_buffer_extension((char *) entry_end)));
+           word_ptr = (entry_end - dw);
+           end_ptr = (entry_end + de);
          }
          else
          {
            relocate_manifest_closure(false);
          }
        }
-       Scan = MANIFEST_CLOSURE_END(word_ptr, start_ptr);
+       Scan = ((SCHEME_OBJECT *) (end_ptr));
        break;
       }
 \f
index fc7b21f12a6920c4e923ecc91c8085df4bb19fcd..2449c2063207d06ea0e92fe87e5f5dc680516cc1 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bintopsb.c,v 9.40 1989/09/20 23:04:28 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bintopsb.c,v 9.41 1989/10/28 15:37:45 jinx Exp $
 
 Copyright (c) 1987, 1989 Massachusetts Institute of Technology
 
@@ -708,7 +708,7 @@ print_a_flonum(val)
     }                                                                  \
 }
 \f
-#ifdef CMPGCFILE
+#ifdef HAS_COMPILER_SUPPORT
 
 #define Do_Compiled_Entry(Code, Rel, Fre, Scn, Obj, FObj)              \
 {                                                                      \
@@ -736,7 +736,7 @@ print_a_flonum(val)
     }                                                                  \
 }
 
-#else /* no CMPGCFILE */
+#else /* no HAS_COMPILER_SUPPORT */
 
 #define Do_Compiled_Entry(Code, Rel, Fre, Scn, Obj, FObj)              \
 {                                                                      \
@@ -747,7 +747,7 @@ print_a_flonum(val)
   quit (1);                                                            \
 }
 
-#endif /* CMPGCFILE */
+#endif /* HAS_COMPILER_SUPPORT */
 \f
 /* Common Pointer Code */
 
index 9c69a389bc270151ea254d908f434ef9f5838149..29b81cec7110048f6a262f534fed1c59065f170c 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/fasdump.c,v 9.43 1989/09/20 23:07:54 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/fasdump.c,v 9.44 1989/10/28 15:38:18 jinx Exp $
 
 Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
 
@@ -90,10 +90,10 @@ Dump_Pointer(Fasdump_Setup_Pointer(Extra_Code, Normal_BH(false, continue)))
 Old = OBJECT_ADDRESS (Temp);                                           \
 Code
 
-#define Dump_Compiled_Entry()                                          \
+#define Dump_Compiled_Entry(label)                                     \
 {                                                                      \
   Dump_Pointer(Fasdump_Setup_Pointer(Transport_Compiled(),             \
-                                    Compiled_BH(false, continue)));    \
+                                    Compiled_BH(false, goto label)));  \
 }
 
 /* Dump_Mode is currently a fossil.  It should be resurrected. */
@@ -150,27 +150,33 @@ DumpLoop(Scan, Dump_Mode)
 
       case_compiled_entry_point:
        compiled_code_present_p = true;
-       Dump_Compiled_Entry();
+       Dump_Compiled_Entry(after_entry);
+      after_entry:
+       *Scan = Temp;
        break;
 
       case TC_MANIFEST_CLOSURE:
       {
-       machine_word *start_ptr;
+       fast long count;
        fast machine_word *word_ptr;
+       SCHEME_OBJECT *area_end;
 
        compiled_code_present_p = true;
        Scan += 1;
-       word_ptr = FIRST_MANIFEST_CLOSURE_ENTRY(Scan);
-       start_ptr = word_ptr;
+       count = (MANIFEST_CLOSURE_COUNT (Scan));
+       word_ptr = (FIRST_MANIFEST_CLOSURE_ENTRY (Scan));
+       area_end = (MANIFEST_CLOSURE_END (Scan, count));
 
-       while (VALID_MANIFEST_CLOSURE_ENTRY(word_ptr))
+       while ((--count) >= 0)
        {
-         Scan = MANIFEST_CLOSURE_ENTRY_ADDRESS(word_ptr);
-         word_ptr = NEXT_MANIFEST_CLOSURE_ENTRY(word_ptr);
-         Temp = *Scan;
-         Dump_Compiled_Entry();
+         Scan = ((SCHEME_OBJECT *) (word_ptr));
+         word_ptr = (NEXT_MANIFEST_CLOSURE_ENTRY (word_ptr));
+         EXTRACT_CLOSURE_ENTRY_ADDRESS (Temp, Scan);
+         Dump_Compiled_Entry (after_closure);
+       after_closure:
+         STORE_CLOSURE_ENTRY_ADDRESS (Temp, Scan);
        }
-       Scan = MANIFEST_CLOSURE_END(word_ptr, start_ptr);
+       Scan = area_end;
        break;
       }
 \f
@@ -208,10 +214,12 @@ DumpLoop(Scan, Dump_Mode)
 
          while(--count >= 0)
          {
-           Scan = OPERATOR_LINKAGE_ENTRY_ADDRESS(word_ptr);
+           Scan = ((SCHEME_OBJECT *) (word_ptr));
            word_ptr = NEXT_LINKAGE_OPERATOR_ENTRY(word_ptr);
-           Temp = *Scan;
-           Dump_Compiled_Entry();
+           EXTRACT_OPERATOR_LINKAGE_ADDRESS(Temp, Scan);
+           Dump_Compiled_Entry(after_operator);
+         after_operator:
+           STORE_OPERATOR_LINKAGE_ADDRESS(Temp, Scan);
          }
          Scan = end_scan;
          break;
index e93a787162f4f30d5905b6fcdcff633680ddeecc..aaf8f75be1377743fc3d7a82781b66eaa627cd49 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/fasload.c,v 9.43 1989/09/20 23:08:02 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/fasload.c,v 9.44 1989/10/28 15:38:21 jinx Exp $
 
 Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
 
@@ -320,10 +320,11 @@ Relocate_Block(Scan, Stop_At)
 
          while(--count >= 0)
          {
-           Scan = OPERATOR_LINKAGE_ENTRY_ADDRESS(word_ptr);
+           Scan = ((SCHEME_OBJECT *) (word_ptr));
            word_ptr = NEXT_LINKAGE_OPERATOR_ENTRY(word_ptr);
-           address = ((long) *Scan);
-           *Scan = ((SCHEME_OBJECT) Relocate(address));
+           EXTRACT_OPERATOR_LINKAGE_ADDRESS(address, Scan);
+           address = ((long) (Relocate(address)));
+           STORE_OPERATOR_LINKAGE_ADDRESS(address, Scan);
          }
          Scan = &end_scan[1];
          break;
@@ -332,21 +333,24 @@ Relocate_Block(Scan, Stop_At)
 \f
       case TC_MANIFEST_CLOSURE:
       {
-       machine_word *start_ptr;
+       fast long count;
        fast machine_word *word_ptr;
+       SCHEME_OBJECT *area_end;
 
        Scan += 1;
-       word_ptr = FIRST_MANIFEST_CLOSURE_ENTRY(Scan);
-       start_ptr = word_ptr;
+       count = (MANIFEST_CLOSURE_COUNT (Scan));
+       word_ptr = (FIRST_MANIFEST_CLOSURE_ENTRY (Scan));
+       area_end = ((MANIFEST_CLOSURE_END (Scan, count)) + 1);
 
-       while (VALID_MANIFEST_CLOSURE_ENTRY(word_ptr))
+       while ((--count) >= 0)
        {
-         Scan = MANIFEST_CLOSURE_ENTRY_ADDRESS(word_ptr);
-         word_ptr = NEXT_MANIFEST_CLOSURE_ENTRY(word_ptr);
-         address = ((long) *Scan);
-         *Scan = ((SCHEME_OBJECT) Relocate(address));
+         Scan = ((SCHEME_OBJECT *) (word_ptr));
+         word_ptr = (NEXT_MANIFEST_CLOSURE_ENTRY (word_ptr));
+         EXTRACT_CLOSURE_ENTRY_ADDRESS (address, Scan);
+         address = ((long) (Relocate (address)));
+         STORE_CLOSURE_ENTRY_ADDRESS (address, Scan);
        }
-       Scan = &((MANIFEST_CLOSURE_END(word_ptr, start_ptr))[1]);
+       Scan = area_end;
        break;
       }
 \f
index 619c3a0fc121c2b570dbf6b06859794ce9681211..0f1d07f0d0b40c7800f1cf56d087d976e4823a2c 100644 (file)
@@ -30,7 +30,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.29 1989/09/20 23:08:43 cph Exp $
+/* $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.
@@ -38,13 +38,13 @@ MIT in each case. */
 \f
 /* GC Types. */
 
-#ifdef CMPGCFILE
+#ifdef HAS_COMPILER_SUPPORT
 #ifndef BAD_TYPES_LETHAL
 #ifndef BAD_TYPES_INNOCUOUS
 #define BAD_TYPES_INNOCUOUS
 #endif /* BAD_TYPES_INNOCUOUS */
 #endif /* BAD_TYPES_LETHAL */
-#endif /* CMPGCFILE */
+#endif /* HAS_COMPILER_SUPPORT */
 
 #ifdef BAD_TYPES_INNOCUOUS
 #ifdef BAD_TYPES_LETHAL
index 8e46fec98267ec9008b1031c957918604896b730..58f6b4e85aba0314b74508391744349afc345b1a 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/gccode.h,v 9.41 1989/09/20 23:08:46 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/gccode.h,v 9.42 1989/10/28 15:38:29 jinx Rel $
 
 Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
 
@@ -426,76 +426,7 @@ extern SCHEME_OBJECT Weak_Chain;
   (*To++) = SHARP_F;                                                   \
   Pointer_End ();                                                      \
 }
-\f
-/* Compiled Code Relocation Utilities */
-
-#ifdef CMPGCFILE
-/* Bug in bsd cpp */
-#ifdef vax
-#include "cmpvaxgc.h"
-#else
-#include CMPGCFILE
-#endif
-#else
-
-typedef unsigned long machine_word;
-
-/* Is there anything else that can be done here? */
-
-#define GC_NO_COMPILER_STMT()                                          \
-  gc_death                                                             \
-    (TERM_COMPILER_DEATH,                                              \
-     "relocate_compiled: No compiler support!",                                \
-     0, 0)
-
-#define GC_NO_COMPILER_EXPR(value_type)                                        \
-  ((GC_NO_COMPILER_STMT ()), (value_type 0))
-
-
-#define Relocate_Compiled(obj, nb, ob) (GC_NO_COMPILER_EXPR ((SCHEME_OBJECT)))
-
-#define Transport_Compiled() (GC_NO_COMPILER_STMT ())
-#define Compiled_BH(flag, then_what) (GC_NO_COMPILER_STMT ())
-#define Get_Compiled_Block(var, address) (GC_NO_COMPILER_STMT ())
-
-#define FIRST_MANIFEST_CLOSURE_ENTRY(scan)                             \
-  (GC_NO_COMPILER_EXPR ((machine_word *)))
 
-#define VALID_MANIFEST_CLOSURE_ENTRY(word_ptr) (GC_NO_COMPILER_EXPR ((int)))
-
-#define NEXT_MANIFEST_CLOSURE_ENTRY(word_ptr)                          \
-  (GC_NO_COMPILER_EXPR ((machine_word *)))
-
-#define MANIFEST_CLOSURE_ENTRY_ADDRESS(ptr)                            \
-  (GC_NO_COMPILER_EXPR ((SCHEME_OBJECT *)))
-
-#define MANIFEST_CLOSURE_END(end, start)                               \
-  (GC_NO_COMPILER_EXPR ((SCHEME_OBJECT *)))
-
-#define MANIFEST_CLOSURE_VALID_FITS_P(end, st)                         \
-  (GC_NO_COMPILER_EXPR ((int)))
-
-#define READ_LINKAGE_KIND(header)                                      \
-  (GC_NO_COMPILER_EXPR ((int)))
-
-#define OPERATOR_LINKAGE_KIND 0
-
-#define READ_CACHE_LINKAGE_COUNT(header)                               \
-  (GC_NO_COMPILER_EXPR ((int)))
-
-#define READ_OPERATOR_LINKAGE_COUNT(header)                            \
-  (GC_NO_COMPILER_EXPR ((int)))
-
-#define END_OPERATOR_LINKAGE_AREA(scan, count)                         \
-  (GC_NO_COMPILER_EXPR ((SCHEME_OBJECT *)))
-
-#define FIRST_OPERATOR_LINKAGE_ENTRY(scan)                             \
-  (GC_NO_COMPILER_EXPR ((machine_word *)))
-
-#define NEXT_LINKAGE_OPERATOR_ENTRY(ptr)                               \
-  (GC_NO_COMPILER_EXPR ((machine_word *)))
-
-#define OPERATOR_LINKAGE_ENTRY_ADDRESS(ptr)                            \
-  (GC_NO_COMPILER_EXPR ((SCHEME_OBJECT *)))
+/* Compiled Code Relocation Utilities */
 
-#endif
+#include "cmpgc.h"
index 3fdc79ae37612e6563510f46266782cf5e199a9b..6035639793108fba1e974c040c9d90119a09843a 100644 (file)
@@ -30,7 +30,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/gcloop.c,v 9.31 1989/09/20 23:08:50 cph Exp $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/gcloop.c,v 9.32 1989/10/28 15:38:33 jinx Exp $
  *
  * This file contains the code for the most primitive part
  * of garbage collection.
@@ -146,12 +146,14 @@ GCLoop(Scan, To_Pointer)
 
          while(--count >= 0)
          {
-           Scan = OPERATOR_LINKAGE_ENTRY_ADDRESS(word_ptr);
+           Scan = ((SCHEME_OBJECT *) word_ptr);
            word_ptr = NEXT_LINKAGE_OPERATOR_ENTRY(word_ptr);
-           Temp = *Scan;
+           EXTRACT_OPERATOR_LINKAGE_ADDRESS(Temp, Scan);
            GC_Pointer(Setup_Internal(true,
                                      Transport_Compiled(),
-                                     Compiled_BH(true, continue)));
+                                     Compiled_BH(true, goto next_operator)));
+         next_operator:
+           STORE_OPERATOR_LINKAGE_ADDRESS(Temp, Scan);
          }
          Scan = end_scan;
          break;
@@ -160,30 +162,37 @@ GCLoop(Scan, To_Pointer)
 \f
       case TC_MANIFEST_CLOSURE:
       {
-       machine_word *start_ptr;
+       fast long count;
        fast machine_word *word_ptr;
+       SCHEME_OBJECT *area_end;
 
        Scan += 1;
-       word_ptr = FIRST_MANIFEST_CLOSURE_ENTRY(Scan);
-       start_ptr = word_ptr;
+       count = (MANIFEST_CLOSURE_COUNT (Scan));
+       word_ptr = (FIRST_MANIFEST_CLOSURE_ENTRY (Scan));
+       area_end = (MANIFEST_CLOSURE_END (Scan, count));
 
-       while (VALID_MANIFEST_CLOSURE_ENTRY(word_ptr))
+       while ((--count) >= 0)
        {
-         Scan = MANIFEST_CLOSURE_ENTRY_ADDRESS(word_ptr);
-         word_ptr = NEXT_MANIFEST_CLOSURE_ENTRY(word_ptr);
-         Temp = *Scan;
+         Scan = ((SCHEME_OBJECT *) (word_ptr));
+         word_ptr = (NEXT_MANIFEST_CLOSURE_ENTRY (word_ptr));
+         EXTRACT_CLOSURE_ENTRY_ADDRESS (Temp, Scan);
          GC_Pointer(Setup_Internal(true,
                                    Transport_Compiled(),
-                                   Compiled_BH(true, continue)));
+                                   Compiled_BH(true, goto next_closure)));
+       next_closure:
+         STORE_CLOSURE_ENTRY_ADDRESS (Temp, Scan);
        }
-       Scan = MANIFEST_CLOSURE_END(word_ptr, start_ptr);
+
+       Scan = area_end;
        break;
       }
 
       case_compiled_entry_point:
        GC_Pointer(Setup_Internal(true,
                                  Transport_Compiled(),
-                                 Compiled_BH(true, continue)));
+                                 Compiled_BH(true, goto after_entry)));
+      after_entry:
+       *Scan = Temp;
        break;
 
       case_Cell:
index 3502c95d4ace471f8fa5cea027bfd30bd21e442d..8f8d9f5b51f1b1b150cad1dc2e3e872d03923ba9 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/interp.c,v 9.52 1989/09/20 23:09:32 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/interp.c,v 9.53 1989/10/28 15:38:37 jinx Exp $
 
 Copyright (c) 1988, 1989 Massachusetts Institute of Technology
 
@@ -1691,7 +1691,6 @@ return_from_compiled_code:
              Interrupt(PENDING_INTERRUPTS());
            }
 
-
            case PRIM_APPLY_INTERRUPT:
            {
              apply_compiled_backout();
@@ -1699,6 +1698,9 @@ return_from_compiled_code:
              Interrupt(PENDING_INTERRUPTS());
            }
 
+           /* The assembly language interfaces return errors
+              here.  The portable version does not.
+            */
            case ERR_COMPILED_CODE_ERROR:
            {
              /* The compiled code is signalling a microcode error. */
@@ -1709,7 +1711,8 @@ return_from_compiled_code:
 \f
            case ERR_INAPPLICABLE_OBJECT:
            /* This error code means that apply_compiled_procedure
-              was called on an object which is not a compiled procedure.
+              was called on an object which is not a compiled procedure,
+              or it was called in a system without compiler support.
 
               Fall through...
             */
@@ -1720,20 +1723,11 @@ return_from_compiled_code:
              Apply_Error( Which_Way);
            }
 
-           case ERR_UNIMPLEMENTED_PRIMITIVE:
-           {
-             /* This error code means that compiled code
-                attempted to call an unimplemented primitive.
-              */
-
-             BACK_OUT_AFTER_PRIMITIVE();
-             Pop_Return_Error( ERR_UNIMPLEMENTED_PRIMITIVE);
-           }
-\f
            case ERR_EXECUTE_MANIFEST_VECTOR:
            {
              /* This error code means that enter_compiled_expression
                 was called in a system without compiler support.
+                This is a kludge!
               */
 
              execute_compiled_backout();
@@ -1742,21 +1736,11 @@ return_from_compiled_code:
              Pop_Return_Error( Which_Way);
            }
 
-           case ERR_BAD_COMBINATION:
-           {
-             /* This error code means that apply_compiled_procedure
-                was called in a system without compiler support.
-              */
-
-             apply_compiled_backout();
-             Apply_Error( Which_Way);
-           }
-
            case ERR_INAPPLICABLE_CONTINUATION:
            {
              /* This error code means that return_to_compiled_code
-                or some other compiler continuation was called in a
-                system without compiler support.
+                saw a non-continuation on the stack, or was called
+                in a system without compiler support.
               */
 
              Store_Expression(SHARP_F);
@@ -1765,7 +1749,8 @@ return_from_compiled_code:
            }
 
            default:
-             Microcode_Termination( TERM_COMPILER_DEATH);
+             compiled_error_backout();
+             Pop_Return_Error(Which_Way);
             }
           }
 
index ee8e2ba1a2ffbc3bf63262d75c96e666e551563a..733936e517cece44e34da1751e14128cec227bbc 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/memmag.c,v 9.40 1989/09/20 23:10:15 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/memmag.c,v 9.41 1989/10/28 15:38:44 jinx Exp $
 
 Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
 
@@ -257,7 +257,7 @@ Fix_Weak_Chain()
          *Scan = Temp;
          continue;
        }
-       Compiled_BH(false, continue);
+       Compiled_BH(false, { *Scan = Temp; continue; });
        *Scan = SHARP_F;
        continue;
 
index 558275876d743d676f32553acdec3a1f53c20de4..2d926932113448099bfba7d9dc0e5560d6664529 100644 (file)
@@ -30,7 +30,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/purify.c,v 9.40 1989/09/20 23:10:54 cph Exp $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/purify.c,v 9.41 1989/10/28 15:38:48 jinx Exp $
  *
  * This file contains the code that copies objects into pure
  * and constant space.
@@ -157,12 +157,15 @@ PurifyLoop(Scan, To_Pointer, GC_Mode)
 
          while(--count >= 0)
          {
-           Scan = OPERATOR_LINKAGE_ENTRY_ADDRESS(word_ptr);
+           Scan = ((SCHEME_OBJECT *) word_ptr);
            word_ptr = NEXT_LINKAGE_OPERATOR_ENTRY(word_ptr);
-           Temp = *Scan;
+           EXTRACT_OPERATOR_LINKAGE_ADDRESS(Temp, Scan);
            Purify_Pointer(Setup_Internal(false,
                                          Transport_Compiled(),
-                                         Compiled_BH(false, continue)));
+                                         Compiled_BH(false,
+                                                     goto next_operator)));
+         next_operator:
+           STORE_OPERATOR_LINKAGE_ADDRESS(Temp, Scan);
          }
          Scan = end_scan;
          break;
@@ -171,8 +174,9 @@ PurifyLoop(Scan, To_Pointer, GC_Mode)
 \f
       case TC_MANIFEST_CLOSURE:
       {
-       machine_word *start_ptr;
+       fast long count;
        fast machine_word *word_ptr;
+       SCHEME_OBJECT *area_end;
 
        if (GC_Mode == PURE_COPY)
        {
@@ -183,19 +187,23 @@ PurifyLoop(Scan, To_Pointer, GC_Mode)
        }
 
        Scan += 1;
-       word_ptr = FIRST_MANIFEST_CLOSURE_ENTRY(Scan);
-       start_ptr = word_ptr;
+       count = (MANIFEST_CLOSURE_COUNT (Scan));
+       word_ptr = (FIRST_MANIFEST_CLOSURE_ENTRY (Scan));
+       area_end = (MANIFEST_CLOSURE_END (Scan, count));
 
-       while (VALID_MANIFEST_CLOSURE_ENTRY(word_ptr))
+       while ((--count) >= 0)
        {
-         Scan = MANIFEST_CLOSURE_ENTRY_ADDRESS(word_ptr);
-         word_ptr = NEXT_MANIFEST_CLOSURE_ENTRY(word_ptr);
-         Temp = *Scan;
+         Scan = ((SCHEME_OBJECT *) (word_ptr));
+         word_ptr = (NEXT_MANIFEST_CLOSURE_ENTRY (word_ptr));
+         EXTRACT_CLOSURE_ENTRY_ADDRESS (Temp, Scan);
          Purify_Pointer(Setup_Internal(false,
                                        Transport_Compiled(),
-                                       Compiled_BH(false, continue)));
+                                       Compiled_BH(false,
+                                                   goto next_closure)));
+       next_closure:
+         STORE_CLOSURE_ENTRY_ADDRESS(Temp, Scan);
        }
-       Scan = MANIFEST_CLOSURE_END(word_ptr, start_ptr);
+       Scan = area_end;
        break;
       }
 
@@ -204,7 +212,9 @@ PurifyLoop(Scan, To_Pointer, GC_Mode)
        {
          Purify_Pointer(Setup_Internal(false,
                                        Transport_Compiled(),
-                                       Compiled_BH(false, continue)));
+                                       Compiled_BH(false, goto after_entry)));
+        after_entry:
+         *Scan = Temp;
        }
        break;
 
index a9da6ddaa80c23a1524e9914fd14aea58b21bca2..8d504f73f7160eac76bf964a866dc7b029c55d4d 100644 (file)
@@ -30,7 +30,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/purutl.c,v 9.37 1989/09/20 23:10:58 cph Exp $ */
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/purutl.c,v 9.38 1989/10/28 15:38:53 jinx Exp $ */
 
 /* Pure/Constant space utilities. */
 
@@ -74,19 +74,11 @@ Update(From, To, Was, Will_Be)
 \f
        case TC_MANIFEST_CLOSURE:
        {
-         machine_word *start_ptr;
-         fast machine_word *word_ptr;
+         fast long count;
 
          From += 1;
-         word_ptr = FIRST_MANIFEST_CLOSURE_ENTRY(From);
-         start_ptr = word_ptr;
-
-         while (VALID_MANIFEST_CLOSURE_ENTRY(word_ptr))
-         {
-           word_ptr = NEXT_MANIFEST_CLOSURE_ENTRY(word_ptr);
-         }
-         From = MANIFEST_CLOSURE_END(word_ptr, start_ptr);
-
+         count = (MANIFEST_CLOSURE_COUNT (From));
+         From = (MANIFEST_CLOSURE_END (From, count));
          continue;
        }
 
index 3b899893a1268eec74e4a21831bf44a37fe366c9..77bee4a970878eaf2bb14c362f804f9ed60d5741 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/unxutl/Attic/ymkfile,v 1.14 1989/09/24 15:25:19 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/unxutl/Attic/ymkfile,v 1.15 1989/10/28 15:39:09 jinx Exp $
 
 Copyright (c) 1989 Massachusetts Institute of Technology
 
@@ -155,7 +155,7 @@ CTERM_LIB =
 
 #if (PROC_TYPE == PROC_TYPE_68020)
 
-MACHINE_SWITCHES = -DMC68020 -DCMPGCFILE=\"cmp68kgc.h\"
+MACHINE_SWITCHES = -DMC68020 -DHAS_COMPILER_SUPPORT
 MACHINE_SOURCES = cmp68020.m4
 MACHINE_OBJECTS = cmp68020.o
 GC_HEAD_FILES = gccode.h cmp68kgc.h
@@ -163,7 +163,7 @@ GC_HEAD_FILES = gccode.h cmp68kgc.h
 #else
 #if (PROC_TYPE == PROC_TYPE_VAX)
 
-MACHINE_SWITCHES = -DCMPGCFILE=\"cmpvaxgc.h\"
+MACHINE_SWITCHES = -DHAS_COMPILER_SUPPORT
 MACHINE_SOURCES = cmpvax.m4
 MACHINE_OBJECTS = cmpvax.o
 GC_HEAD_FILES = gccode.h cmpvaxgc.h
index 3976dc60431602832a126b425f9298aa9d5c1c7a..9bdba6fbf765f6ac0382fa79135530c009806619 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.6 1989/10/26 07:50:01 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.7 1989/10/28 15:39:06 jinx Exp $
 
 Copyright (c) 1988, 1989 Massachusetts Institute of Technology
 
@@ -46,7 +46,7 @@ MIT in each case. */
 #define VERSION                11
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     6
+#define SUBVERSION     7
 #endif
 
 #ifndef UCODE_TABLES_FILENAME
index f9effac29e2da8a5672c96edde71e63184998c6b..7265dcfdd5430e5280977770d419a3e9ec29f65d 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/bintopsb.c,v 9.40 1989/09/20 23:04:28 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/bintopsb.c,v 9.41 1989/10/28 15:37:45 jinx Exp $
 
 Copyright (c) 1987, 1989 Massachusetts Institute of Technology
 
@@ -708,7 +708,7 @@ print_a_flonum(val)
     }                                                                  \
 }
 \f
-#ifdef CMPGCFILE
+#ifdef HAS_COMPILER_SUPPORT
 
 #define Do_Compiled_Entry(Code, Rel, Fre, Scn, Obj, FObj)              \
 {                                                                      \
@@ -736,7 +736,7 @@ print_a_flonum(val)
     }                                                                  \
 }
 
-#else /* no CMPGCFILE */
+#else /* no HAS_COMPILER_SUPPORT */
 
 #define Do_Compiled_Entry(Code, Rel, Fre, Scn, Obj, FObj)              \
 {                                                                      \
@@ -747,7 +747,7 @@ print_a_flonum(val)
   quit (1);                                                            \
 }
 
-#endif /* CMPGCFILE */
+#endif /* HAS_COMPILER_SUPPORT */
 \f
 /* Common Pointer Code */
 
index b55ff3e299c87a419b13e4d5bba144e3f064c984..4fd8384d49b3a03b49858e4c733c1a540dee3f67 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/interp.c,v 9.52 1989/09/20 23:09:32 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/interp.c,v 9.53 1989/10/28 15:38:37 jinx Exp $
 
 Copyright (c) 1988, 1989 Massachusetts Institute of Technology
 
@@ -1691,7 +1691,6 @@ return_from_compiled_code:
              Interrupt(PENDING_INTERRUPTS());
            }
 
-
            case PRIM_APPLY_INTERRUPT:
            {
              apply_compiled_backout();
@@ -1699,6 +1698,9 @@ return_from_compiled_code:
              Interrupt(PENDING_INTERRUPTS());
            }
 
+           /* The assembly language interfaces return errors
+              here.  The portable version does not.
+            */
            case ERR_COMPILED_CODE_ERROR:
            {
              /* The compiled code is signalling a microcode error. */
@@ -1709,7 +1711,8 @@ return_from_compiled_code:
 \f
            case ERR_INAPPLICABLE_OBJECT:
            /* This error code means that apply_compiled_procedure
-              was called on an object which is not a compiled procedure.
+              was called on an object which is not a compiled procedure,
+              or it was called in a system without compiler support.
 
               Fall through...
             */
@@ -1720,20 +1723,11 @@ return_from_compiled_code:
              Apply_Error( Which_Way);
            }
 
-           case ERR_UNIMPLEMENTED_PRIMITIVE:
-           {
-             /* This error code means that compiled code
-                attempted to call an unimplemented primitive.
-              */
-
-             BACK_OUT_AFTER_PRIMITIVE();
-             Pop_Return_Error( ERR_UNIMPLEMENTED_PRIMITIVE);
-           }
-\f
            case ERR_EXECUTE_MANIFEST_VECTOR:
            {
              /* This error code means that enter_compiled_expression
                 was called in a system without compiler support.
+                This is a kludge!
               */
 
              execute_compiled_backout();
@@ -1742,21 +1736,11 @@ return_from_compiled_code:
              Pop_Return_Error( Which_Way);
            }
 
-           case ERR_BAD_COMBINATION:
-           {
-             /* This error code means that apply_compiled_procedure
-                was called in a system without compiler support.
-              */
-
-             apply_compiled_backout();
-             Apply_Error( Which_Way);
-           }
-
            case ERR_INAPPLICABLE_CONTINUATION:
            {
              /* This error code means that return_to_compiled_code
-                or some other compiler continuation was called in a
-                system without compiler support.
+                saw a non-continuation on the stack, or was called
+                in a system without compiler support.
               */
 
              Store_Expression(SHARP_F);
@@ -1765,7 +1749,8 @@ return_from_compiled_code:
            }
 
            default:
-             Microcode_Termination( TERM_COMPILER_DEATH);
+             compiled_error_backout();
+             Pop_Return_Error(Which_Way);
             }
           }
 
index 2464a96e2db253b5667e12e7c63ca3cd983c3aaa..3e0d8dfbb3b2ce213a6edc8cbcbb2f12f12a4bce 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.6 1989/10/26 07:50:01 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.7 1989/10/28 15:39:06 jinx Exp $
 
 Copyright (c) 1988, 1989 Massachusetts Institute of Technology
 
@@ -46,7 +46,7 @@ MIT in each case. */
 #define VERSION                11
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     6
+#define SUBVERSION     7
 #endif
 
 #ifndef UCODE_TABLES_FILENAME