/* -*-C-*-
-$Id: cmpint.c,v 1.62 1993/08/21 01:49:41 gjr Exp $
+$Id: cmpint.c,v 1.63 1993/08/22 20:25:25 gjr Exp $
Copyright (c) 1989-1993 Massachusetts Institute of Technology
EXFUN (compiler_reset, (SCHEME_OBJECT new_block)),
EXFUN (store_variable_cache,
(SCHEME_OBJECT extension, SCHEME_OBJECT block, long offset)),
- EXFUN (compiled_entry_type,
- (SCHEME_OBJECT entry, long *buffer));
+ EXFUN (compiled_entry_type, (SCHEME_OBJECT entry, long *buffer)),
+ EXFUN (declare_compiled_code, (SCHEME_OBJECT block));
extern C_TO_SCHEME long
EXFUN (enter_compiled_expression, (void)),
Val = (Fetch_Expression ());
ENTER_SCHEME (OBJECT_ADDRESS (STACK_POP ()));
}
-
-#ifdef SPLIT_CACHES
- /* This is a kludge to handle the first execution. */
-
- {
- SCHEME_OBJECT * block_address, environment;
- unsigned long length;
-
- Get_Compiled_Block (block_address,
- ((SCHEME_OBJECT *) compiled_entry_address));
- length = (OBJECT_DATUM (* block_address));
- environment = (block_address [length]);
- if (! (ENVIRONMENT_P (environment)))
- {
- /* We could actually flush just the non-marked section.
- The uuo-section will be flushed when linked.
- */
-
- PUSH_D_CACHE_REGION (block_address, (length + 1));
- }
- }
-#endif /* SPLIT_CACHES */
-
ENTER_SCHEME (compiled_entry_address);
}
-\f
+
C_TO_SCHEME long
DEFUN_VOID (apply_compiled_procedure)
{
(((unsigned long) min_arity) & 0x7f));
}
else if (min_arity != (-1))
- {
kind = KIND_ILLEGAL;
- }
+\f
else
{
switch (((unsigned long) max_arity) & 0xff)
buffer[2] = field2;
return;
}
+
+void
+DEFUN (declare_compiled_code, (block), SCHEME_OBJECT block)
+{
+ SCHEME_OBJECT * block_addr = (OBJECT_ADDRESS (block));
+
+ PUSH_D_CACHE_REGION (block_addr, (1+ (OBJECT_DATUM (* block_addr))));
+ return;
+}
\f
/* Destructuring free variable caches. */
EXFUN (compiler_initialize, (long fasl_p)),
EXFUN (store_variable_cache,
(SCHEME_OBJECT extension, SCHEME_OBJECT block, long offset)),
- EXFUN (compiled_entry_type,
- (SCHEME_OBJECT entry, long *buffer));
+ EXFUN (compiled_entry_type, (SCHEME_OBJECT entry, long *buffer)),
+ EXFUN (declare_compiled_code, (SCHEME_OBJECT block));
\f
SCHEME_OBJECT
#ifndef WINNT
}
SCHEME_OBJECT
-DEFUN (compiled_closure_to_entry,
- (entry),
- SCHEME_OBJECT entry)
+DEFUN (compiled_closure_to_entry, (entry), SCHEME_OBJECT entry)
{
Microcode_Termination (TERM_COMPILER_DEATH);
/*NOTREACHED*/
}
+void
+DEFUN (declare_compiled_code, (block), SCHEME_OBJECT block)
+{
+ return;
+}
+
#define LOSING_RETURN_ADDRESS(name) \
extern long EXFUN (name, (void)); \
long \
/* -*-C-*-
-$Id: comutl.c,v 1.23 1993/07/29 07:02:50 gjr Exp $
+$Id: comutl.c,v 1.24 1993/08/22 20:25:32 gjr Exp $
Copyright (c) 1987-1993 Massachusetts Institute of Technology
PRIMITIVE_RETURN (SHARP_F);
#endif
}
+
+DEFINE_PRIMITIVE ("DECLARE-COMPILED-CODE-BLOCK",
+ Prim_declare_compiled_code_block, 1, 1,
+ "Ensure cache coherence for a compiled-code block newly constructed.")
+{
+ extern void EXFUN (declare_compiled_code, (SCHEME_OBJECT));
+ SCHEME_OBJECT new_cc_block;
+ PRIMITIVE_HEADER (1);
+
+ new_cc_block = (ARG_REF (1));
+ if ((OBJECT_TYPE (new_cc_block)) != TC_COMPILED_CODE_BLOCK)
+ error_wrong_type_arg (1);
+ declare_compiled_code (new_cc_block);
+ PRIMITIVE_RETURN (SHARP_T);
+}
/* -*-C-*-
-$Id: fasload.c,v 9.70 1993/08/21 01:55:48 gjr Exp $
+$Id: fasload.c,v 9.71 1993/08/22 20:25:13 gjr Exp $
Copyright (c) 1987-1993 Massachusetts Institute of Technology
extern void EXFUN (compiler_reset_error, (void));
extern void EXFUN (compiler_initialize, (long));
extern void EXFUN (compiler_reset, (SCHEME_OBJECT));
+
+#ifndef FLUSH_I_CACHE_REGION
+# define FLUSH_I_CACHE_REGION(addr, nwords) NOP()
+#endif
+
+#ifndef PUSH_D_CACHE_REGION
+# define PUSH_D_CACHE_REGION(addr, nwords) FLUSH_I_CACHE_REGION(addr, nwords)
+#endif
\f
static long failed_heap_length = -1;
if (value != FASL_FILE_FINE)
{
if (mode != MODE_CHANNEL)
- {
OS_channel_close_noerror (load_channel);
- }
switch (value)
{
/* These may want to be separated further. */
}
if (Or2 (Reloc_Debug, File_Load_Debug))
- {
print_fasl_information();
- }
if (!(TEST_CONSTANT_TOP (Free_Constant + Const_Count)))
{
if (mode != MODE_CHANNEL)
- {
OS_channel_close_noerror (load_channel);
- }
signal_error_from_primitive (ERR_FASL_FILE_TOO_BIG);
/*NOTREACHED*/
}
(mode == MODE_BAND))
{
if (mode != MODE_CHANNEL)
- {
OS_channel_close_noerror (load_channel);
- }
signal_error_from_primitive (ERR_FASL_FILE_TOO_BIG);
/*NOTREACHED*/
}
if ((band_p) && (mode != MODE_BAND))
{
if (mode != MODE_CHANNEL)
- {
OS_channel_close_noerror (load_channel);
- }
signal_error_from_primitive (ERR_FASLOAD_BAND);
}
return;
if (GC_Check (FASL_HEADER_LENGTH + 1))
{
if (mode != MODE_CHANNEL)
- {
OS_channel_close_noerror (load_channel);
- }
Request_GC (FASL_HEADER_LENGTH + 1);
signal_interrupt_from_primitive ();
/* NOTREACHED */
}
- if (Load_Data (FASL_HEADER_LENGTH, ((char *) (Free + 1))) !=
- FASL_HEADER_LENGTH)
+ if ((Load_Data (FASL_HEADER_LENGTH, ((char *) (Free + 1))))
+ != FASL_HEADER_LENGTH)
{
if (mode != MODE_CHANNEL)
- {
OS_channel_close_noerror (load_channel);
- }
signal_error_from_primitive (ERR_FASL_FILE_BAD_DATA);
}
channel = (OS_open_load_file (file_name));
if (Per_File)
- {
debug_edit_flags ();
- }
if (channel == NO_CHANNEL)
- {
error_bad_range_arg (1);
- }
read_channel_start (channel,
(from_band_load ? MODE_BAND : MODE_FNAME));
return;
if ((Load_Data (Heap_Count, ((char *) Free))) != Heap_Count)
{
if (mode != MODE_CHANNEL)
- {
OS_channel_close_noerror (load_channel);
- }
signal_error_from_primitive (ERR_IO_ERROR);
}
computed_checksum =
(checksum_area (((unsigned long *) Free),
Heap_Count,
computed_checksum));
+ if ((dumped_interface_version != 0) && (Heap_Count != 0))
+ PUSH_D_CACHE_REGION (Free, Heap_Count);
NORMALIZE_REGION(((char *) Free), Heap_Count);
Free += Heap_Count;
(checksum_area (((unsigned long *) Free_Constant),
Const_Count,
computed_checksum));
+ if ((dumped_interface_version != 0) && (Const_Count != 0))
+ PUSH_D_CACHE_REGION (Free_Constant, Const_Count);
NORMALIZE_REGION (((char *) Free_Constant), Const_Count);
Free_Constant += Const_Count;
SET_CONSTANT_TOP ();
table = Free;
- if ((Load_Data (Primitive_Table_Size, ((char *) Free))) !=
- Primitive_Table_Size)
+ if ((Load_Data (Primitive_Table_Size, ((char *) Free)))
+ != Primitive_Table_Size)
{
if (mode != MODE_CHANNEL)
OS_channel_close_noerror (load_channel);
SCHEME_OBJECT *Result;
if ((P >= Heap_Base) && (P < Dumped_Heap_Top))
- {
Result = ((SCHEME_OBJECT *) (P + heap_relocation));
- }
else if ((P >= Const_Base) && (P < Dumped_Constant_Top))
- {
Result = ((SCHEME_OBJECT *) (P + const_relocation));
- }
else if ((P >= Dumped_Constant_Top) && (P < Dumped_Stack_Top))
- {
Result = ((SCHEME_OBJECT *) (P + stack_relocation));
- }
else
{
outf_console ("Pointer out of range: 0x%lx\n", P);
Result = ((SCHEME_OBJECT *) 0);
}
if (Reloc_Debug)
- {
outf_console ("0x%06lx -> 0x%06lx\n", P, ((long) Result));
- }
return (Result);
}
#define Relocate_Into(Loc, P) \
{ \
if ((P) < Dumped_Heap_Top) \
- { \
(Loc) = ((SCHEME_OBJECT *) ((P) + heap_relocation)); \
- } \
else if ((P) < Dumped_Constant_Top) \
- { \
(Loc) = ((SCHEME_OBJECT *) ((P) + const_relocation)); \
- } \
else \
- { \
(Loc) = ((SCHEME_OBJECT *) ((P) + stack_relocation)); \
- } \
}
#ifndef Conditional_Bug
DEFUN_VOID (compiler_reset_error)
{
outf_fatal ("\ncompiler_reset_error: The band being restored and\n");
- outf_fatal (
- "the compiled code interface in this microcode are inconsistent.\n");
+ outf_fatal
+ ("the compiled code interface in this microcode are inconsistent.\n");
Microcode_Termination (TERM_COMPILER_DEATH);
}
\f
#ifndef START_BAND_LOAD
-#define START_BAND_LOAD() \
+#define START_BAND_LOAD() do \
{ \
ENTER_CRITICAL_SECTION ("band load"); \
-}
+} while (0)
#endif
#ifndef END_BAND_LOAD
-#define END_BAND_LOAD(success, dying) \
+#define END_BAND_LOAD(success, dying) do \
{ \
if (success || dying) \
execute_reload_cleanups (); \
EXIT_CRITICAL_SECTION ({}); \
-}
+} while (0)
#endif
struct memmag_state
result = (load_file (MODE_BAND));
transaction_commit ();
if (reload_band_name != 0)
- {
free (reload_band_name);
- }
reload_band_name = band_name;
}
}
DEFUN_VOID (Finish_String_Inversion)
{
if (Byte_Invert_Fasl_Files)
- {
while (String_Chain != SHARP_F)
{
long Count;
SET_STRING_LENGTH (String_Chain, Count);
String_Chain = Next;
}
- }
return;
}
\f
long Code;
if (!Byte_Invert_Fasl_Files)
- {
return;
- }
Code = OBJECT_TYPE (Orig_Pointer[STRING_LENGTH_INDEX]);
if (Code == 0) /* Already reversed? */
Count = ((long) (Orig_Pointer[STRING_LENGTH_INDEX])) % 4;
if (Count == 0)
- {
Count = 4;
- }
if (Last_String == SHARP_F)
- {
String_Chain = MAKE_POINTER_OBJECT (Count + MAGIC_OFFSET, Orig_Pointer);
- }
else
- {
FAST_MEMORY_SET
(Last_String, STRING_LENGTH_INDEX,
(MAKE_POINTER_OBJECT ((Count + MAGIC_OFFSET), Orig_Pointer)));
- }
\f
Last_String = (MAKE_POINTER_OBJECT (TC_NULL, Orig_Pointer));
Orig_Pointer[STRING_LENGTH_INDEX] = SHARP_F;
Count = (OBJECT_DATUM (Orig_Pointer[STRING_HEADER])) - 1;
if (Reloc_Debug)
- {
outf_console ("\nCell count = %ld\n", ((long) Count));
- }
Pointer_Address = &(Orig_Pointer[STRING_CHARS]);
To_Char = (char *) Pointer_Address;
for (i = 0; i < Count; i++, Pointer_Address++)
}
}
if (Reloc_Debug)
- {
outf_console ("\n");
- }
return;
}
#endif /* BYTE_INVERSION */
/* -*-C-*-
-$Id: version.h,v 11.136 1993/08/21 04:50:07 gjr Exp $
+$Id: version.h,v 11.137 1993/08/22 20:25:39 gjr Exp $
Copyright (c) 1988-1993 Massachusetts Institute of Technology
#define VERSION 11
#endif
#ifndef SUBVERSION
-#define SUBVERSION 136
+#define SUBVERSION 137
#endif
/* -*-C-*-
-$Id: cmpint.c,v 1.62 1993/08/21 01:49:41 gjr Exp $
+$Id: cmpint.c,v 1.63 1993/08/22 20:25:25 gjr Exp $
Copyright (c) 1989-1993 Massachusetts Institute of Technology
EXFUN (compiler_reset, (SCHEME_OBJECT new_block)),
EXFUN (store_variable_cache,
(SCHEME_OBJECT extension, SCHEME_OBJECT block, long offset)),
- EXFUN (compiled_entry_type,
- (SCHEME_OBJECT entry, long *buffer));
+ EXFUN (compiled_entry_type, (SCHEME_OBJECT entry, long *buffer)),
+ EXFUN (declare_compiled_code, (SCHEME_OBJECT block));
extern C_TO_SCHEME long
EXFUN (enter_compiled_expression, (void)),
Val = (Fetch_Expression ());
ENTER_SCHEME (OBJECT_ADDRESS (STACK_POP ()));
}
-
-#ifdef SPLIT_CACHES
- /* This is a kludge to handle the first execution. */
-
- {
- SCHEME_OBJECT * block_address, environment;
- unsigned long length;
-
- Get_Compiled_Block (block_address,
- ((SCHEME_OBJECT *) compiled_entry_address));
- length = (OBJECT_DATUM (* block_address));
- environment = (block_address [length]);
- if (! (ENVIRONMENT_P (environment)))
- {
- /* We could actually flush just the non-marked section.
- The uuo-section will be flushed when linked.
- */
-
- PUSH_D_CACHE_REGION (block_address, (length + 1));
- }
- }
-#endif /* SPLIT_CACHES */
-
ENTER_SCHEME (compiled_entry_address);
}
-\f
+
C_TO_SCHEME long
DEFUN_VOID (apply_compiled_procedure)
{
(((unsigned long) min_arity) & 0x7f));
}
else if (min_arity != (-1))
- {
kind = KIND_ILLEGAL;
- }
+\f
else
{
switch (((unsigned long) max_arity) & 0xff)
buffer[2] = field2;
return;
}
+
+void
+DEFUN (declare_compiled_code, (block), SCHEME_OBJECT block)
+{
+ SCHEME_OBJECT * block_addr = (OBJECT_ADDRESS (block));
+
+ PUSH_D_CACHE_REGION (block_addr, (1+ (OBJECT_DATUM (* block_addr))));
+ return;
+}
\f
/* Destructuring free variable caches. */
EXFUN (compiler_initialize, (long fasl_p)),
EXFUN (store_variable_cache,
(SCHEME_OBJECT extension, SCHEME_OBJECT block, long offset)),
- EXFUN (compiled_entry_type,
- (SCHEME_OBJECT entry, long *buffer));
+ EXFUN (compiled_entry_type, (SCHEME_OBJECT entry, long *buffer)),
+ EXFUN (declare_compiled_code, (SCHEME_OBJECT block));
\f
SCHEME_OBJECT
#ifndef WINNT
}
SCHEME_OBJECT
-DEFUN (compiled_closure_to_entry,
- (entry),
- SCHEME_OBJECT entry)
+DEFUN (compiled_closure_to_entry, (entry), SCHEME_OBJECT entry)
{
Microcode_Termination (TERM_COMPILER_DEATH);
/*NOTREACHED*/
}
+void
+DEFUN (declare_compiled_code, (block), SCHEME_OBJECT block)
+{
+ return;
+}
+
#define LOSING_RETURN_ADDRESS(name) \
extern long EXFUN (name, (void)); \
long \
/* -*-C-*-
-$Id: version.h,v 11.136 1993/08/21 04:50:07 gjr Exp $
+$Id: version.h,v 11.137 1993/08/22 20:25:39 gjr Exp $
Copyright (c) 1988-1993 Massachusetts Institute of Technology
#define VERSION 11
#endif
#ifndef SUBVERSION
-#define SUBVERSION 136
+#define SUBVERSION 137
#endif