From 1741274f2a746d4ed9d3c2eb0463c7caefe7e3f9 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 23 Jan 2015 11:20:53 +0300 Subject: [PATCH] GC_stack_range_for code refactoring (Darwin/arm) * darwin_stop_world.c (GC_stack_range_for): Roll GC_push_one() calls to a loop (for ARM32 only). * os_dep.c: Remove redundant include mach/thread_status.h as already included from gc_priv.h (for DARWIN only). --- darwin_stop_world.c | 22 +++++++--------------- os_dep.c | 1 - 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/darwin_stop_world.c b/darwin_stop_world.c index 6ca345a..04e978e 100644 --- a/darwin_stop_world.c +++ b/darwin_stop_world.c @@ -232,22 +232,14 @@ STATIC ptr_t GC_stack_range_for(ptr_t *phi, thread_act_t thread, GC_thread p, # ifndef DARWIN_DONT_PARSE_STACK *phi = GC_FindTopOfStack(state.THREAD_FLD(sp)); # endif - GC_push_one(state.THREAD_FLD(r[0])); - GC_push_one(state.THREAD_FLD(r[1])); - GC_push_one(state.THREAD_FLD(r[2])); - GC_push_one(state.THREAD_FLD(r[3])); - GC_push_one(state.THREAD_FLD(r[4])); - GC_push_one(state.THREAD_FLD(r[5])); - GC_push_one(state.THREAD_FLD(r[6])); - GC_push_one(state.THREAD_FLD(r[7])); - GC_push_one(state.THREAD_FLD(r[8])); - GC_push_one(state.THREAD_FLD(r[9])); - GC_push_one(state.THREAD_FLD(r[10])); - GC_push_one(state.THREAD_FLD(r[11])); - GC_push_one(state.THREAD_FLD(r[12])); - /* GC_push_one(state.THREAD_FLD(sp)); */ + { + int j; + for (j = 0; j <= 12; j++) { + GC_push_one(state.THREAD_FLD(r[j])); + } + } + /* "pc" and "sp" are skipped */ GC_push_one(state.THREAD_FLD(lr)); - /* GC_push_one(state.THREAD_FLD(pc)); */ GC_push_one(state.THREAD_FLD(cpsr)); # else diff --git a/os_dep.c b/os_dep.c index 4a77d31..98e2af9 100644 --- a/os_dep.c +++ b/os_dep.c @@ -3832,7 +3832,6 @@ GC_INNER void GC_remove_protection(struct hblk *h, word nblocks, #include #include -#include #include #include #include -- 2.7.4