From 7dcaefce56dfaf634fd3352cc4cdfbef4fb8efef Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 18 Mar 2015 02:32:30 +0300 Subject: GC_stack_range_for code refactoring for Darwin/arm64 * darwin_stop_world.c (GC_stack_range_for): Replace "__" register name prefix with THREAD_FLD(); roll x[0..28] push statements in a loop (for AARCH64). --- darwin_stop_world.c | 47 +++++++++++------------------------------------ 1 file changed, 11 insertions(+), 36 deletions(-) diff --git a/darwin_stop_world.c b/darwin_stop_world.c index 3c4f85bc..84c60eb2 100644 --- a/darwin_stop_world.c +++ b/darwin_stop_world.c @@ -279,44 +279,19 @@ STATIC ptr_t GC_stack_range_for(ptr_t *phi, thread_act_t thread, GC_thread p, GC_push_one(state.THREAD_FLD(cpsr)); # elif defined(AARCH64) - lo = (void *)state.__sp; + lo = (void *)state.THREAD_FLD(sp); # ifndef DARWIN_DONT_PARSE_STACK - *phi = GC_FindTopOfStack(state.__sp); + *phi = GC_FindTopOfStack(state.THREAD_FLD(sp)); # endif - GC_push_one(state.__x[0]); - GC_push_one(state.__x[1]); - GC_push_one(state.__x[2]); - GC_push_one(state.__x[3]); - GC_push_one(state.__x[4]); - GC_push_one(state.__x[5]); - GC_push_one(state.__x[6]); - GC_push_one(state.__x[7]); - GC_push_one(state.__x[8]); - GC_push_one(state.__x[9]); - GC_push_one(state.__x[10]); - GC_push_one(state.__x[11]); - GC_push_one(state.__x[12]); - GC_push_one(state.__x[13]); - GC_push_one(state.__x[14]); - GC_push_one(state.__x[15]); - GC_push_one(state.__x[16]); - GC_push_one(state.__x[17]); - GC_push_one(state.__x[18]); - GC_push_one(state.__x[19]); - GC_push_one(state.__x[20]); - GC_push_one(state.__x[21]); - GC_push_one(state.__x[22]); - GC_push_one(state.__x[23]); - GC_push_one(state.__x[24]); - GC_push_one(state.__x[25]); - GC_push_one(state.__x[26]); - GC_push_one(state.__x[27]); - GC_push_one(state.__x[28]); - GC_push_one(state.__fp); - GC_push_one(state.__lr); - /* GC_push_one(state.__sp); */ - /* GC_push_one(state.__pc); */ - /* GC_push_one(state.__cpsr); */ + { + int j; + for (j = 0; j <= 28; j++) { + GC_push_one(state.THREAD_FLD(x[j])); + } + } + /* "cpsr", "pc" and "sp" are skipped */ + GC_push_one(state.THREAD_FLD(fp)); + GC_push_one(state.THREAD_FLD(lr)); # else # error FIXME for non-x86 || ppc || arm architectures -- cgit v1.2.1