SCHEME_OBJECT Registers [REGBLOCK_LENGTH];
#endif
+#ifndef ASM_INIT_HOOK
+# define ASM_INIT_HOOK() do {} while (false)
+#endif
#ifndef ASM_RESET_HOOK
# define ASM_RESET_HOOK() do {} while (false)
#endif
\f
/* Initialization */
+void
+compiler_initialize_processor (void)
+{
+ assert (compiler_utilities != SHARP_F);
+ compiler_reset_processor ();
+}
+
void
compiler_initialize (bool fasl_p)
{
return (MAKE_CC_BLOCK (block));
}
+void
+compiler_reset_processor (void)
+{
+ SET_PRIMITIVE (SHARP_F);
+ SET_CLOSURE_FREE (0);
+ SET_CLOSURE_SPACE (0);
+ SET_REFLECTOR (reflect_to_interface);
+
+ ASM_RESET_HOOK ();
+}
+
void
compiler_reset (SCHEME_OBJECT new_block)
{
compiler_utilities = new_block;
return_to_interpreter = (MAKE_CC_ENTRY (trampoline_entry_addr (nbp, 0)));
reflect_to_interface = (MAKE_CC_ENTRY (trampoline_entry_addr (nbp, 1)));
- SET_CLOSURE_FREE (0);
- SET_CLOSURE_SPACE (0);
- SET_REFLECTOR (reflect_to_interface);
- ASM_RESET_HOOK ();
+ ASM_INIT_HOOK ();
+
+ compiler_reset_processor ();
+#ifdef ENABLE_SMP
+ {
+ processor_t *p;
+ for (p = processors; p != NULL; p = p->next)
+ {
+ if (p != self)
+ p->compiler_reset_p = true;
+ }
+ }
+#endif
}
\f
/* Main compiled-code entry points */
extern void compiled_with_stack_marker (SCHEME_OBJECT);
extern void compiler_initialize (bool);
+extern void compiler_initialize_processor (void);
extern void compiler_reset (SCHEME_OBJECT);
+extern void compiler_reset_processor (void);
extern void declare_compiled_code_block (SCHEME_OBJECT);
struct processor {
struct processor *next;
char id;
+ /* Set by compiler_reset (load-band) when there are new compiler utilities. */
+ bool compiler_reset_p;
processor_state_t state;
pthread_t pthread;
SCHEME_OBJECT * stack_end;
+ id * saved_processor_heap_size);
new->next = processors;
new->id = id;
+ new->compiler_reset_p = false;
new->state = PROCESSOR_NEW;
new->stack_start = stack_start;
new->stack_end = stack_start + saved_stack_size;
cond_wait (&finished, &state_mutex);
trace (";%d GC wait finished.", self->id);
+ if (self->compiler_reset_p)
+ {
+ compiler_reset_processor ();
+ self->compiler_reset_p = false;
+ }
+
assert (self->state == PROCESSOR_RUNNING);
}
for band-load. */
}
+ compiler_initialize_processor ();
+
Will_Push (STACK_ENV_EXTRA_SLOTS + 1);
STACK_PUSH (get_smp_idle_prim ());
PUSH_APPLY_FRAME_HEADER (0);