fix debugging mode for checking runstack overflow
This commit is contained in:
parent
60fb3e06b2
commit
685e74a1c6
|
@ -716,15 +716,16 @@ static void *top4;
|
|||
#define mz_popr_p(x) scheme_mz_popr_p_it(jitter, x, 0)
|
||||
#define mz_popr_x() scheme_mz_popr_p_it(jitter, JIT_R1, 1)
|
||||
|
||||
#if 0
|
||||
#define CHECK_RUNSTACK_REGISTER_UPDATE 0
|
||||
|
||||
#if CHECK_RUNSTACK_REGISTER_UPDATE
|
||||
/* Debugging: at each _finish(), double-check that the runstack register has been
|
||||
copied into scheme_current_runstack. This code assumes that mz_finishr() is not
|
||||
used with JIT_R0. Failure is "reported" by going into an immediate loop, but
|
||||
check_location is set to the source line number to help indicate where the
|
||||
problem originated. */
|
||||
static void *top;
|
||||
int check_location;
|
||||
# define CONFIRM_RUNSTACK() (jit_movi_l(JIT_R0, __LINE__), jit_sti_l(&check_location, JIT_R0), \
|
||||
# define CONFIRM_RUNSTACK() (jit_movi_l(JIT_R0, __LINE__), \
|
||||
mz_tl_ldi_p(JIT_R0, tl_MZ_RUNSTACK), top = (_jit.x.pc), jit_bner_p(top, JIT_RUNSTACK, JIT_R0))
|
||||
#else
|
||||
# define CONFIRM_RUNSTACK() 0
|
||||
|
@ -733,6 +734,7 @@ int check_location;
|
|||
#define mz_prepare(x) jit_prepare(x)
|
||||
#define mz_finish(x) ((void)CONFIRM_RUNSTACK(), jit_finish(x))
|
||||
#define mz_finishr(x) ((void)CONFIRM_RUNSTACK(), jit_finishr(x))
|
||||
#define mz_finish_unsynced_runstack(x) jit_finish(x)
|
||||
|
||||
#define mz_nonrs_finish(x) jit_finish(x)
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ static jit_insn *generate_proc_struct_retry(mz_jit_state *jitter, int num_rands,
|
|||
jit_movi_i(JIT_R0, num_rands);
|
||||
jit_pusharg_i(JIT_R0); /* argc */
|
||||
jit_pusharg_p(JIT_R1); /* closure */
|
||||
(void)mz_finish(scheme_native_arity_check);
|
||||
(void)mz_finish_unsynced_runstack(scheme_native_arity_check);
|
||||
CHECK_LIMIT();
|
||||
jit_retval(JIT_R0);
|
||||
refz5 = jit_beqi_i(jit_forward(), JIT_R0, 0);
|
||||
|
|
|
@ -694,7 +694,7 @@ typedef void (*Thread_Start_Child_Proc)(Scheme_Thread *child, Scheme_Object *chi
|
|||
void *scheme_module_run_start(Scheme_Env *menv, Scheme_Env *env, Scheme_Object *name)
|
||||
{
|
||||
Module_Run_Proc proc = (Module_Run_Proc)sjc.module_run_start_code;
|
||||
if (proc)
|
||||
if (proc && !CHECK_RUNSTACK_REGISTER_UPDATE)
|
||||
return proc(menv, env, &name);
|
||||
else
|
||||
return scheme_module_run_finish(menv, env);
|
||||
|
@ -703,7 +703,7 @@ void *scheme_module_run_start(Scheme_Env *menv, Scheme_Env *env, Scheme_Object *
|
|||
void *scheme_module_exprun_start(Scheme_Env *menv, int set_ns, Scheme_Object *name)
|
||||
{
|
||||
Module_Exprun_Proc proc = (Module_Exprun_Proc)sjc.module_exprun_start_code;
|
||||
if (proc)
|
||||
if (proc && !CHECK_RUNSTACK_REGISTER_UPDATE)
|
||||
return proc(menv, set_ns, &name);
|
||||
else
|
||||
return scheme_module_exprun_finish(menv, set_ns);
|
||||
|
@ -712,7 +712,7 @@ void *scheme_module_exprun_start(Scheme_Env *menv, int set_ns, Scheme_Object *na
|
|||
void *scheme_module_start_start(struct Start_Module_Args *a, Scheme_Object *name)
|
||||
{
|
||||
Module_Start_Proc proc = (Module_Start_Proc)sjc.module_start_start_code;
|
||||
if (proc)
|
||||
if (proc && !CHECK_RUNSTACK_REGISTER_UPDATE)
|
||||
return proc(a, &name);
|
||||
else
|
||||
return scheme_module_start_finish(a);
|
||||
|
@ -722,7 +722,7 @@ void scheme_thread_start_child(Scheme_Thread *child, Scheme_Object *child_thunk)
|
|||
XFORM_SKIP_PROC
|
||||
{
|
||||
Thread_Start_Child_Proc proc = (Thread_Start_Child_Proc)sjc.thread_start_child_code;
|
||||
if (proc)
|
||||
if (proc && !CHECK_RUNSTACK_REGISTER_UPDATE)
|
||||
proc(child, child_thunk);
|
||||
else
|
||||
scheme_do_thread_start_child(child, child_thunk);
|
||||
|
|
Loading…
Reference in New Issue
Block a user