Skip to content

Commit

Permalink
Refine that GC_save_regs_in_stack is used by save_callers only on SPARC
Browse files Browse the repository at this point in the history
(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.
  • Loading branch information
ivmai committed Nov 21, 2023
1 parent 8bb1395 commit 36d6edc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions os_dep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 36d6edc

Please sign in to comment.