summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-04-13 09:20:02 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-04-17 12:50:54 +0300
commit353babf906332cd47a76ba9a25a84137a66c4ca7 (patch)
treebb883639584e72f201afd85c44cab126cbf3f428
parent7f97528c5c3e657629eb407b45fc858436f0af80 (diff)
downloadbdwgc-353babf906332cd47a76ba9a25a84137a66c4ca7.tar.gz
Eliminate duplicate GC_save_regs_in_stack calls (E2K)
(fix of commit 9ddbbae8e) Issue #411 (bdwgc). Also, add the corresponding TODO item for IA64 and SPARC. * pthread_stop_world.c [!GC_OPENBSD_UTHREADS && !NACL] (GC_store_stack_ptr): Add TODO item. * pthread_support.c [SPARC || IA64] (do_blocking_enter): Likewise. * pthread_stop_world.c [!GC_OPENBSD_UTHREADS && !NACL && E2K] (GC_store_stack_ptr): Remove GC_save_regs_in_stack() call. * pthread_support.c [E2K] (do_blocking_enter): Likewise.
-rw-r--r--pthread_stop_world.c5
-rw-r--r--pthread_support.c4
2 files changed, 3 insertions, 6 deletions
diff --git a/pthread_stop_world.c b/pthread_stop_world.c
index 6e02502f..1a229b52 100644
--- a/pthread_stop_world.c
+++ b/pthread_stop_world.c
@@ -310,10 +310,9 @@ GC_INLINE void GC_store_stack_ptr(GC_thread me)
# ifdef SPARC
ao_store_async((volatile AO_t *)&me->stop_info.stack_ptr,
(AO_t)GC_save_regs_in_stack());
+ /* TODO: regs saving already done by GC_with_callee_saves_pushed */
# else
-# ifdef E2K
- (void)GC_save_regs_in_stack();
-# elif defined(IA64)
+# ifdef IA64
me -> backing_store_ptr = GC_save_regs_in_stack();
# endif
ao_store_async((volatile AO_t *)&me->stop_info.stack_ptr,
diff --git a/pthread_support.c b/pthread_support.c
index 6664d626..a4a98a88 100644
--- a/pthread_support.c
+++ b/pthread_support.c
@@ -1522,15 +1522,13 @@ static GC_bool do_blocking_enter(GC_thread me)
{
# if defined(SPARC) || defined(IA64)
ptr_t stack_ptr = GC_save_regs_in_stack();
+ /* TODO: regs saving already done by GC_with_callee_saves_pushed */
# elif defined(E2K)
size_t stack_size;
# endif
GC_bool topOfStackUnset = FALSE;
GC_ASSERT(I_HOLD_LOCK());
-# ifdef E2K
- (void)GC_save_regs_in_stack();
-# endif
GC_ASSERT(!(me -> thread_blocked));
# ifdef SPARC
me -> stop_info.stack_ptr = stack_ptr;