From 36d6edc95196d5e7c411ef5fcf4f8169950f35a2 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 21 Nov 2023 08:01:32 +0300 Subject: [PATCH] Refine that GC_save_regs_in_stack is used by save_callers only on SPARC (refactoring) * os_dep.c [NEED_CALLINFO && SAVE_CALL_CHAIN && (NARGS!=0 || NFRAMES%2!=0 || !GC_HAVE_BUILTIN_BACKTRACE)] (FR_SAVFP, FR_SAVPC, BIAS, GC_save_callers): Define only if I386 or SPARC. * os_dep.c [NEED_CALLINFO && SAVE_CALL_CHAIN && (NARGS!=0 || NFRAMES%2!=0 || !GC_HAVE_BUILTIN_BACKTRACE) && (I386 || SPARC)] (GC_save_callers): Adjust indent of for() statement. --- os_dep.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/os_dep.c b/os_dep.c index c20964a96..3c7626f1f 100644 --- a/os_dep.c +++ b/os_dep.c @@ -5129,7 +5129,7 @@ GC_INNER void GC_save_callers(struct callinfo info[NFRAMES]) # endif } -#else /* !GC_HAVE_BUILTIN_BACKTRACE */ +#elif defined(I386) || defined(SPARC) #if defined(ANY_BSD) && defined(SPARC) # define FR_SAVFP fr_fp @@ -5154,12 +5154,12 @@ GC_INNER void GC_save_callers(struct callinfo info[NFRAMES]) /* We assume this is turned on only with gcc as the compiler. */ asm("movl %%ebp,%0" : "=r"(frame)); fp = frame; -# else +# else /* SPARC */ frame = (struct frame *)GC_save_regs_in_stack(); fp = (struct frame *)((long)(frame -> FR_SAVFP) + BIAS); #endif - for (; !((word)fp HOTTER_THAN (word)frame) + for (; !((word)fp HOTTER_THAN (word)frame) # ifndef THREADS && !((word)GC_stackbottom HOTTER_THAN (word)fp) # elif defined(STACK_GROWS_UP)