summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2015-03-18 02:32:30 +0300
committerIvan Maidanski <ivmai@mail.ru>2015-03-18 02:32:30 +0300
commit7dcaefce56dfaf634fd3352cc4cdfbef4fb8efef (patch)
treea1d3a0d8b52c1c952d3fa9b98909c0777f60ac7d
parentd5d091accae6046d2a5dadb283e110b31f4684bd (diff)
downloadbdwgc-ios-unified-ts-fix.tar.gz
GC_stack_range_for code refactoring for Darwin/arm64ios-unified-ts-fix
* 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).
-rw-r--r--darwin_stop_world.c47
1 files 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