/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/psbmap.h,v 9.32 1989/11/30 03:04:07 jinx Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/psbmap.h,v 9.33 1991/07/03 01:32:18 cph Exp $
-Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
+Copyright (c) 1987-91 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
#define float_to_pointer \
BYTES_TO_WORDS(sizeof(double))
-#define flonum_to_pointer(nchars) \
- ((nchars) * (1 + float_to_pointer))
+#ifndef FLOATING_ALIGNMENT
+
+#define flonum_to_pointer(nfloats) \
+ ((nfloats) * (1 + float_to_pointer))
+
+#else /* FLOATING_ALIGNMENT */
+
+/* When computing the space needed for flonums, the worst case is that
+ every flonum needs alignment. To estimate the space needed, add
+ padding to each flonum to round it up to an alignment boundary. */
+
+#define flonum_to_pointer(nfloats) \
+ ((nfloats) \
+ * (((((1 + float_to_pointer) * (sizeof (char))) \
+ & FLOATING_ALIGNMENT) \
+ == 0) \
+ ? (1 + float_to_pointer) \
+ : ((((1 + float_to_pointer) * (sizeof (char))) \
+ + ((FLOATING_ALIGNMENT + 1) \
+ - (((1 + float_to_pointer) * (sizeof (char))) \
+ & FLOATING_ALIGNMENT))) \
+ / (sizeof (char)))))
+
+#endif /* FLOATING_ALIGNMENT */
#define char_to_pointer(nchars) \
BYTES_TO_WORDS(nchars)
/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/psbtobin.c,v 9.43 1991/03/24 05:06:11 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/psbtobin.c,v 9.44 1991/07/03 01:32:34 cph Exp $
-Copyright (c) 1987, 1989, 1990 Massachusetts Institute of Technology
+Copyright (c) 1987-91 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
quit (1);
/*NOTREACHED*/
}
-\f
+
#define OUT(c) return ((long) ((c) & MAX_CHAR))
long
the_max = Result;
return (Result);
}
-\f
+
long
DEFUN (read_signed_decimal, (stream),
fast FILE *stream)
*Table++ = (MAKE_OBJECT (TC_CHARACTER, the_char_code));
continue;
}
-\f
+
case TC_BIG_FLONUM:
{
double The_Flonum = (read_a_flonum ());
}
}
continue;
-\f
+
case TC_COMPILED_ENTRY:
{
SCHEME_OBJECT *temp;
(N - (Table_End - Table)),
((char *) MEMORY_LOC (*Table, STRING_CHARS)));
break;
-\f
+
case TC_BIG_FIXNUM:
fprintf (stderr,
"Table[%6d] = Bignum\n",
fprintf (stderr, (format), (value)); \
fprintf (stderr, "\n"); \
}
-\f
+
#else /* not DEBUG */
#define DEBUGGING(action)
PORTABLE_VERSION, FASL_FORMAT_VERSION, FASL_SUBVERSION);
quit (1);
}
-\f
+
READ_HEADER ("Flags", "%ld", Flags);
READ_FLAGS (Flags);
FASL_INTERNAL_FORMAT);
quit (1);
}
-\f
+
READ_HEADER ("Heap Count", "%ld", Heap_Count);
READ_HEADER ("Dumped Heap Base", "%ld", Dumped_Heap_Base);
READ_HEADER ("Heap Objects", "%ld", Heap_Objects);
}
Stack_Top = &Heap[Size];
+ DEBUGGING (fprintf (stderr, "Stack_Top: 0x%x\n", Stack_Top));
Heap_Table = &Heap[0];
Heap_Base = &Heap_Table[Heap_Objects];
ALIGN_FLOAT (Heap_Base);
Heap_Object_Base =
Read_External (Heap_Objects, Heap_Table, Heap_Base);
+ DEBUGGING (print_external_objects ("Heap", Heap_Table, Heap_Objects));
+ DEBUGGING (fprintf (stderr, "Heap_Base: 0x%x\n", Heap_Base));
+ DEBUGGING (fprintf (stderr, "Heap_Object_Base: 0x%x\n", Heap_Object_Base));
/* The various 2s below are for SNMV headers. */
Pure_Base = &Pure_Table[Pure_Objects + 2];
Pure_Object_Base =
Read_External (Pure_Objects, Pure_Table, Pure_Base);
+ DEBUGGING (print_external_objects ("Pure", Pure_Table, Pure_Objects));
+ DEBUGGING (fprintf (stderr, "Pure_Base: 0x%x\n", Pure_Base));
+ DEBUGGING (fprintf (stderr, "Pure_Object_Base: 0x%x\n", Pure_Object_Base));
Constant_Table = &Heap[Size - Constant_Objects];
Constant_Base = &Pure_Object_Base[Pure_Count + 2];
Constant_Object_Base =
Read_External (Constant_Objects, Constant_Table, Constant_Base);
+ DEBUGGING (print_external_objects ("Constant",
+ Constant_Table,
+ Constant_Objects));
+ DEBUGGING (fprintf (stderr, "Constant_Base: 0x%x\n", Constant_Base));
+ DEBUGGING (fprintf (stderr, "Constant_Object_Base: 0x%x\n",
+ Constant_Object_Base));
primitive_table = &Constant_Object_Base[Constant_Count + 2];
WHEN ((primitive_table > Constant_Table),
"primitive_table overran Constant_Table");
- DEBUGGING (print_external_objects ("Heap", Heap_Table, Heap_Objects));
- DEBUGGING (print_external_objects ("Pure", Pure_Table, Pure_Objects));
- DEBUGGING (print_external_objects ("Constant",
- Constant_Table,
- Constant_Objects));
-\f
/* Read the normal objects */
Free =
fprintf (stderr,
"NOTE: The binary file contains primitives with unknown arity.\n");
}
-\f
+
/* Dump the objects */
{
Primitive_Table_Length));
DEBUGGING (fprintf (stderr, "Primitive_Table_Size = %ld\n",
(primitive_table_end - primitive_table)));
-\f
+
/* Is there a Pure/Constant block? */
if ((Constant_Objects == 0) && (Constant_Count == 0) &&
/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/psbmap.h,v 9.32 1989/11/30 03:04:07 jinx Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/psbmap.h,v 9.33 1991/07/03 01:32:18 cph Exp $
-Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
+Copyright (c) 1987-91 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
#define float_to_pointer \
BYTES_TO_WORDS(sizeof(double))
-#define flonum_to_pointer(nchars) \
- ((nchars) * (1 + float_to_pointer))
+#ifndef FLOATING_ALIGNMENT
+
+#define flonum_to_pointer(nfloats) \
+ ((nfloats) * (1 + float_to_pointer))
+
+#else /* FLOATING_ALIGNMENT */
+
+/* When computing the space needed for flonums, the worst case is that
+ every flonum needs alignment. To estimate the space needed, add
+ padding to each flonum to round it up to an alignment boundary. */
+
+#define flonum_to_pointer(nfloats) \
+ ((nfloats) \
+ * (((((1 + float_to_pointer) * (sizeof (char))) \
+ & FLOATING_ALIGNMENT) \
+ == 0) \
+ ? (1 + float_to_pointer) \
+ : ((((1 + float_to_pointer) * (sizeof (char))) \
+ + ((FLOATING_ALIGNMENT + 1) \
+ - (((1 + float_to_pointer) * (sizeof (char))) \
+ & FLOATING_ALIGNMENT))) \
+ / (sizeof (char)))))
+
+#endif /* FLOATING_ALIGNMENT */
#define char_to_pointer(nchars) \
BYTES_TO_WORDS(nchars)
/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/psbtobin.c,v 9.43 1991/03/24 05:06:11 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/psbtobin.c,v 9.44 1991/07/03 01:32:34 cph Exp $
-Copyright (c) 1987, 1989, 1990 Massachusetts Institute of Technology
+Copyright (c) 1987-91 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
quit (1);
/*NOTREACHED*/
}
-\f
+
#define OUT(c) return ((long) ((c) & MAX_CHAR))
long
the_max = Result;
return (Result);
}
-\f
+
long
DEFUN (read_signed_decimal, (stream),
fast FILE *stream)
*Table++ = (MAKE_OBJECT (TC_CHARACTER, the_char_code));
continue;
}
-\f
+
case TC_BIG_FLONUM:
{
double The_Flonum = (read_a_flonum ());
}
}
continue;
-\f
+
case TC_COMPILED_ENTRY:
{
SCHEME_OBJECT *temp;
(N - (Table_End - Table)),
((char *) MEMORY_LOC (*Table, STRING_CHARS)));
break;
-\f
+
case TC_BIG_FIXNUM:
fprintf (stderr,
"Table[%6d] = Bignum\n",
fprintf (stderr, (format), (value)); \
fprintf (stderr, "\n"); \
}
-\f
+
#else /* not DEBUG */
#define DEBUGGING(action)
PORTABLE_VERSION, FASL_FORMAT_VERSION, FASL_SUBVERSION);
quit (1);
}
-\f
+
READ_HEADER ("Flags", "%ld", Flags);
READ_FLAGS (Flags);
FASL_INTERNAL_FORMAT);
quit (1);
}
-\f
+
READ_HEADER ("Heap Count", "%ld", Heap_Count);
READ_HEADER ("Dumped Heap Base", "%ld", Dumped_Heap_Base);
READ_HEADER ("Heap Objects", "%ld", Heap_Objects);
}
Stack_Top = &Heap[Size];
+ DEBUGGING (fprintf (stderr, "Stack_Top: 0x%x\n", Stack_Top));
Heap_Table = &Heap[0];
Heap_Base = &Heap_Table[Heap_Objects];
ALIGN_FLOAT (Heap_Base);
Heap_Object_Base =
Read_External (Heap_Objects, Heap_Table, Heap_Base);
+ DEBUGGING (print_external_objects ("Heap", Heap_Table, Heap_Objects));
+ DEBUGGING (fprintf (stderr, "Heap_Base: 0x%x\n", Heap_Base));
+ DEBUGGING (fprintf (stderr, "Heap_Object_Base: 0x%x\n", Heap_Object_Base));
/* The various 2s below are for SNMV headers. */
Pure_Base = &Pure_Table[Pure_Objects + 2];
Pure_Object_Base =
Read_External (Pure_Objects, Pure_Table, Pure_Base);
+ DEBUGGING (print_external_objects ("Pure", Pure_Table, Pure_Objects));
+ DEBUGGING (fprintf (stderr, "Pure_Base: 0x%x\n", Pure_Base));
+ DEBUGGING (fprintf (stderr, "Pure_Object_Base: 0x%x\n", Pure_Object_Base));
Constant_Table = &Heap[Size - Constant_Objects];
Constant_Base = &Pure_Object_Base[Pure_Count + 2];
Constant_Object_Base =
Read_External (Constant_Objects, Constant_Table, Constant_Base);
+ DEBUGGING (print_external_objects ("Constant",
+ Constant_Table,
+ Constant_Objects));
+ DEBUGGING (fprintf (stderr, "Constant_Base: 0x%x\n", Constant_Base));
+ DEBUGGING (fprintf (stderr, "Constant_Object_Base: 0x%x\n",
+ Constant_Object_Base));
primitive_table = &Constant_Object_Base[Constant_Count + 2];
WHEN ((primitive_table > Constant_Table),
"primitive_table overran Constant_Table");
- DEBUGGING (print_external_objects ("Heap", Heap_Table, Heap_Objects));
- DEBUGGING (print_external_objects ("Pure", Pure_Table, Pure_Objects));
- DEBUGGING (print_external_objects ("Constant",
- Constant_Table,
- Constant_Objects));
-\f
/* Read the normal objects */
Free =
fprintf (stderr,
"NOTE: The binary file contains primitives with unknown arity.\n");
}
-\f
+
/* Dump the objects */
{
Primitive_Table_Length));
DEBUGGING (fprintf (stderr, "Primitive_Table_Size = %ld\n",
(primitive_table_end - primitive_table)));
-\f
+
/* Is there a Pure/Constant block? */
if ((Constant_Objects == 0) && (Constant_Count == 0) &&