[MLton-commit] r6014

Matthew Fluet fluet at mlton.org
Tue Sep 11 21:11:10 PDT 2007


Properly access the callFromCHandlerThread field
----------------------------------------------------------------------

U   mlton/trunk/include/amd64-main.h
U   mlton/trunk/include/bytecode-main.h
U   mlton/trunk/include/c-main.h
U   mlton/trunk/include/x86-main.h
U   mlton/trunk/runtime/gc/gc_state.c
U   mlton/trunk/runtime/gc/gc_state.h

----------------------------------------------------------------------

Modified: mlton/trunk/include/amd64-main.h
===================================================================
--- mlton/trunk/include/amd64-main.h	2007-09-12 03:57:29 UTC (rev 6013)
+++ mlton/trunk/include/amd64-main.h	2007-09-12 04:11:08 UTC (rev 6014)
@@ -49,7 +49,7 @@
         if (s->signalsInfo.signalIsPending)                             \
                 s->limit = s->limitPlusSlop - GC_HEAP_LIMIT_SLOP;       \
         /* Return to the C Handler thread. */                           \
-        GC_switchToThread (s, s->callFromCHandlerThread, 0);            \
+        GC_switchToThread (s, GC_getCallFromCHandlerThread (s), 0);     \
         jump = *(pointer*)(s->stackTop - GC_RETURNADDRESS_SIZE);        \
         MLton_jumpToSML(jump);                                          \
         s->atomicState += 1;                                            \

Modified: mlton/trunk/include/bytecode-main.h
===================================================================
--- mlton/trunk/include/bytecode-main.h	2007-09-12 03:57:29 UTC (rev 6013)
+++ mlton/trunk/include/bytecode-main.h	2007-09-12 04:11:08 UTC (rev 6014)
@@ -34,7 +34,7 @@
         if (s->signalsInfo.signalIsPending)                             \
                 s->limit = s->limitPlusSlop - GC_HEAP_LIMIT_SLOP;       \
         /* Switch to the C Handler thread. */                           \
-        GC_switchToThread (s, s->callFromCHandlerThread, 0);            \
+        GC_switchToThread (s, GC_getCallFromCHandlerThread (s), 0);     \
         nextFun = *(uintptr_t*)(s->stackTop - GC_RETURNADDRESS_SIZE);   \
         MLton_Bytecode_interpret (&MLton_bytecode, nextFun);            \
         s->atomicState += 1;                                            \

Modified: mlton/trunk/include/c-main.h
===================================================================
--- mlton/trunk/include/c-main.h	2007-09-12 03:57:29 UTC (rev 6013)
+++ mlton/trunk/include/c-main.h	2007-09-12 04:11:08 UTC (rev 6014)
@@ -32,7 +32,7 @@
         if (s->signalsInfo.signalIsPending)                             \
                 s->limit = s->limitPlusSlop - GC_HEAP_LIMIT_SLOP;       \
         /* Switch to the C Handler thread. */                           \
-        GC_switchToThread (s, s->callFromCHandlerThread, 0);            \
+        GC_switchToThread (s, GC_getCallFromCHandlerThread (s), 0);     \
         nextFun = *(uintptr_t*)(s->stackTop - GC_RETURNADDRESS_SIZE);   \
         cont.nextChunk = nextChunks[nextFun];                           \
         returnToC = FALSE;                                              \

Modified: mlton/trunk/include/x86-main.h
===================================================================
--- mlton/trunk/include/x86-main.h	2007-09-12 03:57:29 UTC (rev 6013)
+++ mlton/trunk/include/x86-main.h	2007-09-12 04:11:08 UTC (rev 6014)
@@ -56,7 +56,7 @@
         if (s->signalsInfo.signalIsPending)                             \
                 s->limit = s->limitPlusSlop - GC_HEAP_LIMIT_SLOP;       \
         /* Return to the C Handler thread. */                           \
-        GC_switchToThread (s, s->callFromCHandlerThread, 0);            \
+        GC_switchToThread (s, GC_getCallFromCHandlerThread (s), 0);     \
         jump = *(pointer*)(s->stackTop - GC_RETURNADDRESS_SIZE);        \
         MLton_jumpToSML(jump);                                          \
         s->atomicState += 1;                                            \

Modified: mlton/trunk/runtime/gc/gc_state.c
===================================================================
--- mlton/trunk/runtime/gc/gc_state.c	2007-09-12 03:57:29 UTC (rev 6013)
+++ mlton/trunk/runtime/gc/gc_state.c	2007-09-12 04:11:08 UTC (rev 6014)
@@ -151,6 +151,11 @@
   s->signalsInfo.gcSignalPending = b;
 }
 
+pointer GC_getCallFromCHandlerThread (GC_state s) {
+  pointer p = objptrToPointer (s->callFromCHandlerThread, s->heap.start);
+  return p;
+}
+
 void GC_setCallFromCHandlerThread (GC_state s, pointer p) {
   objptr op = pointerToObjptr (p, s->heap.start);
   s->callFromCHandlerThread = op;

Modified: mlton/trunk/runtime/gc/gc_state.h
===================================================================
--- mlton/trunk/runtime/gc/gc_state.h	2007-09-12 03:57:29 UTC (rev 6013)
+++ mlton/trunk/runtime/gc/gc_state.h	2007-09-12 04:11:08 UTC (rev 6014)
@@ -93,6 +93,7 @@
 void GC_setRusageMeasureGC (GC_state s, bool b);
 void GC_setHashConsDuringGC (GC_state s, bool b);
 
+pointer GC_getCallFromCHandlerThread (GC_state s);
 pointer GC_getCurrentThread (GC_state s);
 pointer GC_getSavedThread (GC_state s);
 void GC_setCallFromCHandlerThread (GC_state s, pointer p);




More information about the MLton-commit mailing list