[MLton-commit] r5315

Matthew Fluet fluet at mlton.org
Sun Feb 25 12:09:49 PST 2007


More accurate type for returnAddressToFrameIndex.


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

U   mlton/branches/on-20050822-x86_64-branch/include/bytecode-main.h
U   mlton/branches/on-20050822-x86_64-branch/include/c-main.h
U   mlton/branches/on-20050822-x86_64-branch/include/x86-main.h
U   mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.h

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

Modified: mlton/branches/on-20050822-x86_64-branch/include/bytecode-main.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/include/bytecode-main.h	2007-02-25 20:02:47 UTC (rev 5314)
+++ mlton/branches/on-20050822-x86_64-branch/include/bytecode-main.h	2007-02-25 20:09:43 UTC (rev 5315)
@@ -17,8 +17,9 @@
 
 struct Bytecode MLton_bytecode;
 
-static Word32 returnAddressToFrameIndex (Word32 w) {
-        return *(Word32*)(MLton_bytecode.code + w - sizeof (Word32));
+static GC_frameIndex returnAddressToFrameIndex (GC_returnAddress ra) {
+        return *(GC_frameIndex*)(MLton_bytecode.code 
+                                 + ra - sizeof (GC_frameIndex*));
 }
 
 #define Main(al, mg, mfs, mmc, pk, ps, ml)                              \

Modified: mlton/branches/on-20050822-x86_64-branch/include/c-main.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/include/c-main.h	2007-02-25 20:02:47 UTC (rev 5314)
+++ mlton/branches/on-20050822-x86_64-branch/include/c-main.h	2007-02-25 20:09:43 UTC (rev 5315)
@@ -12,8 +12,8 @@
 #include "main.h"
 #include "c-common.h"
 
-static Word32 returnAddressToFrameIndex (Word32 w) {
-        return w;
+static GC_frameIndex returnAddressToFrameIndex (GC_returnAddress ra) {
+        return (GC_frameIndex)ra;
 }
 
 #define Main(al, mg, mfs, mmc, pk, ps, mc, ml)                          \

Modified: mlton/branches/on-20050822-x86_64-branch/include/x86-main.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/include/x86-main.h	2007-02-25 20:02:47 UTC (rev 5314)
+++ mlton/branches/on-20050822-x86_64-branch/include/x86-main.h	2007-02-25 20:09:43 UTC (rev 5315)
@@ -38,8 +38,8 @@
 #define DEBUG_X86CODEGEN FALSE
 #endif
 
-static Word32 returnAddressToFrameIndex (Word32 w) {
-        return *((Word32*)(w - sizeof(Word32)));
+static GC_frameIndex returnAddressToFrameIndex (GC_returnAddress ra) {
+        return *((GC_frameIndex*)(ra - sizeof(GC_frameIndex*)));
 }
 
 #define Main(al, mg, mfs, mmc, pk, ps, ml)                              \

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.h	2007-02-25 20:02:47 UTC (rev 5314)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.h	2007-02-25 20:09:43 UTC (rev 5315)
@@ -51,7 +51,7 @@
   GC_objectType objectTypes; /* Array of object types. */
   uint32_t objectTypesLength; /* Cardinality of objectTypes array. */
   struct GC_profiling profiling;
-  uint32_t (*returnAddressToFrameIndex) (GC_returnAddress ra);
+  GC_frameIndex (*returnAddressToFrameIndex) (GC_returnAddress ra);
   objptr savedThread; /* Result of GC_copyCurrentThread.
                        * Thread interrupted by arrival of signal.
                        */




More information about the MLton-commit mailing list