You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(56) |
Sep
(40) |
Oct
(30) |
Nov
(144) |
Dec
(23) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(41) |
Feb
(29) |
Mar
(31) |
Apr
(39) |
May
(193) |
Jun
(45) |
Jul
(19) |
Aug
(3) |
Sep
(23) |
Oct
(83) |
Nov
(92) |
Dec
(123) |
| 2007 |
Jan
(90) |
Feb
(267) |
Mar
(120) |
Apr
(51) |
May
(40) |
Jun
(121) |
Jul
(109) |
Aug
(173) |
Sep
(77) |
Oct
(52) |
Nov
(121) |
Dec
(62) |
| 2008 |
Jan
(76) |
Feb
(53) |
Mar
(98) |
Apr
(87) |
May
(26) |
Jun
(27) |
Jul
(23) |
Aug
(136) |
Sep
(79) |
Oct
(68) |
Nov
(29) |
Dec
(14) |
| 2009 |
Jan
(7) |
Feb
(2) |
Mar
(11) |
Apr
(75) |
May
(1) |
Jun
(95) |
Jul
(19) |
Aug
(4) |
Sep
(8) |
Oct
(93) |
Nov
(43) |
Dec
(21) |
| 2010 |
Jan
(20) |
Feb
(23) |
Mar
(18) |
Apr
(6) |
May
(20) |
Jun
(23) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
(2) |
Feb
(6) |
Mar
(15) |
Apr
(5) |
May
(9) |
Jun
(14) |
Jul
(9) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
(2) |
Jun
(17) |
Jul
(37) |
Aug
|
Sep
(1) |
Oct
(6) |
Nov
|
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
(5) |
Apr
(2) |
May
(7) |
Jun
(11) |
Jul
(8) |
Aug
|
Sep
(1) |
Oct
(2) |
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
|
May
(1) |
Jun
(1) |
Jul
(7) |
Aug
(2) |
Sep
|
Oct
(5) |
Nov
(2) |
Dec
(4) |
| 2015 |
Jan
|
Feb
(2) |
Mar
(2) |
Apr
|
May
|
Jun
(9) |
Jul
(1) |
Aug
|
Sep
|
Oct
(4) |
Nov
(1) |
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
(5) |
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
(1) |
Feb
(3) |
Mar
(3) |
Apr
(7) |
May
(2) |
Jun
(2) |
Jul
(5) |
Aug
(1) |
Sep
(2) |
Oct
(17) |
Nov
(4) |
Dec
(7) |
| 2018 |
Jan
(5) |
Feb
(14) |
Mar
(2) |
Apr
(5) |
May
(2) |
Jun
(5) |
Jul
|
Aug
(2) |
Sep
|
Oct
(3) |
Nov
(5) |
Dec
|
| 2019 |
Jan
(4) |
Feb
(2) |
Mar
(3) |
Apr
(1) |
May
(8) |
Jun
(14) |
Jul
(2) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
(15) |
Dec
(2) |
| 2020 |
Jan
(10) |
Feb
(3) |
Mar
(1) |
Apr
|
May
(9) |
Jun
(4) |
Jul
(16) |
Aug
(10) |
Sep
(4) |
Oct
(3) |
Nov
|
Dec
|
| 2021 |
Jan
(11) |
Feb
(2) |
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(5) |
Sep
|
Oct
(6) |
Nov
(4) |
Dec
(4) |
| 2022 |
Jan
(4) |
Feb
(2) |
Mar
(2) |
Apr
|
May
(6) |
Jun
(3) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(5) |
Jun
(1) |
Jul
(4) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(13) |
Dec
|
| 2024 |
Jan
(1) |
Feb
|
Mar
(5) |
Apr
|
May
(10) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
(1) |
Dec
(14) |
| 2025 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(3) |
Jul
|
Aug
|
Sep
(2) |
Oct
(3) |
Nov
|
Dec
|
|
From: Stephen W. <sw...@ml...> - 2005-11-10 09:46:10
|
Tagged experimental release. ---------------------------------------------------------------------- A mlton/tags/on-20051109-release/ ---------------------------------------------------------------------- Copied: mlton/tags/on-20051109-release (from rev 4189, mlton/trunk) |
|
From: Stephen W. <sw...@ml...> - 2005-11-10 09:44:53
|
New debian package. ---------------------------------------------------------------------- U mlton/trunk/package/debian/changelog ---------------------------------------------------------------------- Modified: mlton/trunk/package/debian/changelog =================================================================== --- mlton/trunk/package/debian/changelog 2005-11-10 04:17:46 UTC (rev 4188) +++ mlton/trunk/package/debian/changelog 2005-11-10 17:44:52 UTC (rev 4189) @@ -1,3 +1,9 @@ +mlton (20051109-1) unstable; urgency=low + + * new upstream version + + -- Stephen Weeks <sw...@sw...> Wed, 09 Nov 2005 18:47:04 -0800 + mlton (20051102-1) unstable; urgency=low * new upstream version |
|
From: Matthew F. <fl...@ml...> - 2005-11-09 20:17:49
|
Discovered bug in the reinterpretation of crossMap as byte-offset
rather than word-offset. Since the crossMap entry at s->heap.start is
the only object allowed to have an offset of 0, every other crossMap
entry for which an object falls on the card boundary yields a
CARD_SIZE offset, which conflicts with CROSS_MAP_ENTRY.
Haven't fixed the bug; I guess I'll go back to scaling the offset by
4.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/generational.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/generational.h
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/generational.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/generational.c 2005-11-10 03:39:08 UTC (rev 4187)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/generational.c 2005-11-10 04:17:46 UTC (rev 4188)
@@ -28,7 +28,8 @@
fprintf (stderr, "crossMap trues\n");
for (i = 0; i < generational->crossMapLength; i++)
unless (CROSS_MAP_EMPTY == generational->crossMap[i])
- fprintf (stderr, "\t"FMTCMI"\n", i);
+ fprintf (stderr, "\t"FMTCMI" "FMTCME"\n",
+ i, generational->crossMap[i]);
fprintf (stderr, "\n");
}
}
@@ -215,6 +216,10 @@
pointer nextObject, objectStart;
pointer oldGenEnd;
+ if (DEBUG_GENERATIONAL) {
+ fprintf (stderr, "updateCrossMap starting\n");
+ displayGenerationalMaps (s, &s->generationalMaps, stderr);
+ }
if (s->generationalMaps.crossMapValidSize == s->heap.oldGenSize)
goto done;
oldGenEnd = s->heap.start + s->heap.oldGenSize;
@@ -231,6 +236,17 @@
assert ((objectStart == s->heap.start or cardStart < objectStart)
and objectStart <= cardEnd);
nextObject = objectStart + sizeofObject (s, advanceToObjectData (s, objectStart));
+ if (DEBUG_GENERATIONAL) {
+ fprintf (stderr,
+ "\tloopObjects:\n"
+ "\t cardIndex = "FMTCMI"\n"
+ "\t cardStart = "FMTPTR"\n"
+ "\t cardEnd = "FMTPTR"\n"
+ "\tobjectStart = "FMTPTR"\n"
+ "\t nextObject = "FMTPTR"\n",
+ cardIndex, (uintptr_t)cardStart, (uintptr_t)cardEnd,
+ (uintptr_t)objectStart, (uintptr_t)nextObject);
+ }
if (nextObject > cardEnd) {
/* We're about to move to a new card, so we are looking at the
* last object boundary in the current card.
@@ -257,4 +273,8 @@
done:
assert (s->generationalMaps.crossMapValidSize == s->heap.oldGenSize);
assert (isCrossMapOk (s));
+ if (DEBUG_GENERATIONAL) {
+ fprintf (stderr, "updateCrossMap finished\n");
+ displayGenerationalMaps (s, &s->generationalMaps, stderr);
+ }
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/generational.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/generational.h 2005-11-10 03:39:08 UTC (rev 4187)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/generational.h 2005-11-10 04:17:46 UTC (rev 4188)
@@ -18,6 +18,7 @@
#define CROSS_MAP_ELEM_SIZE sizeof(GC_crossMapElem)
#define CROSS_MAP_EMPTY ((GC_crossMapElem)255)
#define FMTCMI "%zu"
+#define FMTCME "%"PRIu8
struct GC_generationalMaps {
/* cardMap is an array with cardinality equal to the size of the
|
|
From: Matthew F. <fl...@ml...> - 2005-11-09 19:39:10
|
Fixed bug in mark-compact
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/mark-compact.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.h 2005-11-09 20:11:26 UTC (rev 4186)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.h 2005-11-10 03:39:08 UTC (rev 4187)
@@ -23,7 +23,7 @@
#define PRIxARRLEN PRIu32
#define FMTARRLEN "%"PRIxARRLEN
typedef GC_arrayLength GC_arrayCounter;
-#define GC_ARRAY_COUNTER_SIZE GC_ARRAY_LENGTH_SIZE
+#define GC_ARRAY_COUNTER_SIZE sizeof(GC_arrayCounter)
#define PRIxARRCTR PRIu32
#define FMTARRCTR "%"PRIxARRCTR
#define GC_ARRAY_HEADER_SIZE (GC_ARRAY_COUNTER_SIZE + GC_ARRAY_LENGTH_SIZE + GC_HEADER_SIZE)
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/mark-compact.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/mark-compact.c 2005-11-09 20:11:26 UTC (rev 4186)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/mark-compact.c 2005-11-10 03:39:08 UTC (rev 4187)
@@ -128,6 +128,7 @@
fprintf (stderr, "threading "FMTPTR" of size %zu\n",
(uintptr_t)p, size);
if ((size_t)(front - endOfLastMarked) >= GC_ARRAY_HEADER_SIZE + OBJPTR_SIZE) {
+ pointer newArray = endOfLastMarked;
/* Compress all of the unmarked into one vector. We require
* (GC_ARRAY_HEADER_SIZE + OBJPTR_SIZE) space to be available
* because that is the smallest possible array. You cannot
@@ -141,11 +142,12 @@
fprintf (stderr, "compressing from "FMTPTR" to "FMTPTR" (length = %zu)\n",
(uintptr_t)endOfLastMarked, (uintptr_t)front,
(size_t)(front - endOfLastMarked));
- *((GC_arrayCounter*)(endOfLastMarked)) = 0;
- endOfLastMarked = endOfLastMarked + GC_ARRAY_COUNTER_SIZE;
- *((GC_arrayLength*)(endOfLastMarked)) = ((size_t)(front - endOfLastMarked)) - GC_ARRAY_HEADER_SIZE;
- endOfLastMarked = endOfLastMarked + GC_ARRAY_LENGTH_SIZE;
- *((GC_header*)(endOfLastMarked)) = GC_WORD8_VECTOR_HEADER;
+ *((GC_arrayCounter*)(newArray)) = 0;
+ newArray += GC_ARRAY_COUNTER_SIZE;
+ *((GC_arrayLength*)(newArray)) =
+ ((size_t)(front - endOfLastMarked)) - GC_ARRAY_HEADER_SIZE;
+ newArray += GC_ARRAY_LENGTH_SIZE;
+ *((GC_header*)(newArray)) = GC_WORD8_VECTOR_HEADER;
}
front += size;
endOfLastMarked = front;
|
|
From: Stephen W. <sw...@ml...> - 2005-11-09 12:11:27
|
Added a script to replace calls to bash with calls to sh, for use on MinGW where there is no bash. ---------------------------------------------------------------------- A mlton/trunk/bin/patch-mingw ---------------------------------------------------------------------- Added: mlton/trunk/bin/patch-mingw =================================================================== --- mlton/trunk/bin/patch-mingw 2005-11-09 03:56:08 UTC (rev 4185) +++ mlton/trunk/bin/patch-mingw 2005-11-09 20:11:26 UTC (rev 4186) @@ -0,0 +1,13 @@ +#!/usr/bin/env sh + +set -e + +dir=`dirname $0` + +for f in `find "$dir" -type f | grep -v '\.svn' | grep -v '~'`; do + if head -n 1 "$f" | grep -q '#!/usr/bin/env bash'; then + echo "Processing $f" + sed 's;#!/usr/bin/env bash;#!/usr/bin/env sh;' <$f >.tmp; + mv .tmp $f; + fi +done Property changes on: mlton/trunk/bin/patch-mingw ___________________________________________________________________ Name: svn:executable + * |
|
From: Matthew F. <fl...@ml...> - 2005-11-08 19:56:13
|
Added DEBUG_DFS_MARK control
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/debug.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/dfs-mark.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/mark-compact.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/debug.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/debug.h 2005-11-09 03:17:04 UTC (rev 4184)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/debug.h 2005-11-09 03:56:08 UTC (rev 4185)
@@ -15,6 +15,7 @@
DEBUG_CALL_STACK = FALSE,
DEBUG_CARD_MARKING = FALSE,
DEBUG_DETAILED = FALSE,
+ DEBUG_DFS_MARK = FALSE,
DEBUG_ENTER_LEAVE = FALSE,
DEBUG_GENERATIONAL = FALSE,
DEBUG_MARK_COMPACT = FALSE,
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/dfs-mark.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/dfs-mark.c 2005-11-09 03:17:04 UTC (rev 4184)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/dfs-mark.c 2005-11-09 03:56:08 UTC (rev 4185)
@@ -76,7 +76,7 @@
* nextHeader is the header of next.
* todo is a pointer to the pointer inside cur that points to next.
*/
- if (DEBUG_MARK_COMPACT)
+ if (DEBUG_DFS_MARK)
fprintf (stderr,
"markNext"
" cur = "FMTPTR" next = "FMTPTR
@@ -95,7 +95,7 @@
prev = cur;
cur = next;
mark:
- if (DEBUG_MARK_COMPACT)
+ if (DEBUG_DFS_MARK)
fprintf (stderr, "mark cur = "FMTPTR" prev = "FMTPTR" mode = %s\n",
(uintptr_t)cur, (uintptr_t)prev,
(mode == MARK_MODE) ? "mark" : "unmark");
@@ -130,7 +130,7 @@
todo = cur + sizeofNumNonObjptrs (NORMAL_TAG, numNonObjptrs);
index = 0;
markInNormal:
- if (DEBUG_MARK_COMPACT)
+ if (DEBUG_DFS_MARK)
fprintf (stderr, "markInNormal index = %"PRIu32"\n", index);
assert (index < numObjptrs);
// next = *(pointer*)todo;
@@ -186,7 +186,7 @@
/* Skip to the first pointer. */
todo += sizeofNumNonObjptrs (ARRAY_TAG, numNonObjptrs);
markInArray:
- if (DEBUG_MARK_COMPACT)
+ if (DEBUG_DFS_MARK)
fprintf (stderr, "markInArray arrayIndex = %"PRIu32" index = %"PRIu32"\n",
arrayIndex, index);
assert (arrayIndex < getArrayLength (cur));
@@ -234,7 +234,7 @@
* to be marked.
*/
assert (getStackBottom (s, (GC_stack)cur) <= top);
- if (DEBUG_MARK_COMPACT)
+ if (DEBUG_DFS_MARK)
fprintf (stderr, "markInStack top = %zu\n",
(size_t)(top - getStackBottom (s, (GC_stack)cur)));
if (top == getStackBottom (s, (GC_stack)(cur)))
@@ -252,7 +252,7 @@
todo = top - frameLayout->size + frameOffsets [index + 1];
// next = *(pointer*)todo;
next = fetchObjptrToPointer (todo, s->heap.start);
- if (DEBUG_MARK_COMPACT)
+ if (DEBUG_DFS_MARK)
fprintf (stderr,
" offset %u todo "FMTPTR" next = "FMTPTR"\n",
frameOffsets [index + 1],
@@ -278,7 +278,7 @@
* Need to set the pointer in the prev object that pointed to cur
* to point back to prev, and restore prev.
*/
- if (DEBUG_MARK_COMPACT)
+ if (DEBUG_DFS_MARK)
fprintf (stderr, "return cur = "FMTPTR" prev = "FMTPTR"\n",
(uintptr_t)cur, (uintptr_t)prev);
assert (isPointerMarkedByMode (cur, mode));
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/mark-compact.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/mark-compact.c 2005-11-09 03:17:04 UTC (rev 4184)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/mark-compact.c 2005-11-09 03:56:08 UTC (rev 4185)
@@ -73,7 +73,7 @@
if (WEAK_TAG == tag and 1 == numObjptrs) {
GC_header objptrHeader;
- if (DEBUG_WEAK)
+ if (DEBUG_MARK_COMPACT or DEBUG_WEAK)
fprintf (stderr, "clearIfWeakAndUnmarkedForMarkCompact ("FMTPTR") header = "FMTHDR"\n",
(uintptr_t)p, header);
objptrHeader = getHeader (objptrToPointer(((GC_weak)p)->objptr, s->heap.start));
|
|
From: Stephen W. <sw...@ml...> - 2005-11-08 19:17:05
|
Cleaned up.
----------------------------------------------------------------------
U mlton/trunk/bin/regression
----------------------------------------------------------------------
Modified: mlton/trunk/bin/regression
===================================================================
--- mlton/trunk/bin/regression 2005-11-09 02:41:58 UTC (rev 4183)
+++ mlton/trunk/bin/regression 2005-11-09 03:17:04 UTC (rev 4184)
@@ -12,14 +12,14 @@
exit 1
}
-cross='no'
-fail='no'
-runOnly='no'
-short='no'
+cross='false'
+fail='false'
+runOnly='false'
+short='false'
while [ "$#" -gt 0 ]; do
case "$1" in
-cross)
- cross='yes'
+ cross='true'
shift
if [ "$#" = 0 ]; then
usage
@@ -28,11 +28,11 @@
shift
;;
-fail)
- fail='yes'
+ fail='true'
shift
;;
-run-only)
- runOnly='yes'
+ runOnly='true'
shift
if [ "$#" = 0 ]; then
usage
@@ -41,7 +41,7 @@
shift
;;
-short)
- short='yes'
+ short='true'
shift
;;
*)
@@ -57,7 +57,7 @@
lib="$src/build/lib"
mlton="$bin/mlton"
flags="-type-check true $flags"
-if [ $cross = 'yes' ]; then
+if $cross; then
flags="$flags -target $crossTarget -stop g"
fi
cont='callcc.sml callcc2.sml callcc3.sml once.sml'
@@ -80,7 +80,7 @@
cd $src/regression
-if [ "$fail" = 'yes' ]; then
+if $fail; then
for f in `ls fail/*.sml`; do
echo "testing $f"
( $mlton $flags -stop tc $f >/dev/null 2>&1 &&
@@ -133,8 +133,7 @@
extraFlags=""
;;
esac
- case "$runOnly" in
- no)
+ if (! $runOnly); then
mlb="$f.mlb"
echo "\$(SML_LIB)/basis/basis.mlb
\$(SML_LIB)/basis/mlton.mlb
@@ -149,12 +148,10 @@
cmd="$mlton $flags $extraFlags -output $f $mlb"
eval $cmd
rm $mlb
- if [ "$?" -ne '0' ] ||
- [ "$cross" = 'no' -a ! -x "$f" ]; then
+ if [ "$?" -ne '0' ] || ((! $cross) && [ ! -x "$f" ]); then
compFail $f
fi
- ;;
- yes)
+ else
case $crossTarget in
*mingw)
libs='-lws2_32 -lkernel32 -lpsapi -lnetapi32'
@@ -180,9 +177,8 @@
-L/usr/pkg/lib \
-L/usr/local/lib \
$files $libs
- ;;
- esac
- if [ ! -r $f.nonterm -a $cross = 'no' -a -x $f ]; then
+ fi
+ if [ ! -r $f.nonterm -a $cross = 'false' -a -x $f ]; then
nonZeroMsg='Nonzero exit status.'
if $forMinGW; then
nonZeroMsg="$nonZeroMsg"'\r'
@@ -203,7 +199,7 @@
fi
fi
done
-if [ "$cross" = 'yes' -o "$runOnly" = 'yes' -o "$short" = 'yes' ]; then
+if $cross || $runOnly || $short; then
exit 0
fi
mmake clean >/dev/null
|
|
From: Matthew F. <fl...@ml...> - 2005-11-08 18:42:02
|
Format diagnostic message
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/world.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.c 2005-11-09 02:10:07 UTC (rev 4182)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.c 2005-11-09 02:41:58 UTC (rev 4183)
@@ -9,7 +9,7 @@
void displayGCState (GC_state s, FILE *stream) {
fprintf (stream,
"GC state\n");
- fprintf (stream, "\tcurrentThread"FMTOBJPTR"\n", s->currentThread);
+ fprintf (stream, "\tcurrentThread = "FMTOBJPTR"\n", s->currentThread);
displayThread (s, (GC_thread)(objptrToPointer (s->currentThread, s->heap.start)),
stream);
fprintf (stream, "\tgenerational\n");
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/world.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/world.c 2005-11-09 02:10:07 UTC (rev 4182)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/world.c 2005-11-09 02:41:58 UTC (rev 4183)
@@ -27,7 +27,7 @@
s->heap.oldGenSize);
createCardMapAndCrossMap (s);
read_safe (fd, s->heap.start, s->heap.oldGenSize);
- (*s->loadGlobals) (fd);
+ (*(s->loadGlobals)) (fd);
// unless (EOF == fgetc (file))
// die ("Invalid world: junk at end of file.");
/* translateHeap must occur after loading the heap and globals,
@@ -72,7 +72,7 @@
writeObjptr (fd, s->currentThread);
writeObjptr (fd, s->signalHandlerThread);
write_safe (fd, s->heap.start, s->heap.oldGenSize);
- (*s->saveGlobals) (fd);
+ (*(s->saveGlobals)) (fd);
}
void GC_saveWorld (GC_state s, int fd) {
|
|
From: Matthew F. <fl...@ml...> - 2005-11-08 18:10:12
|
Cleanup
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/mlton/backend/ssa-to-rssa.fun
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/mlton/backend/ssa-to-rssa.fun
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/backend/ssa-to-rssa.fun 2005-11-09 02:09:08 UTC (rev 4181)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/backend/ssa-to-rssa.fun 2005-11-09 02:10:07 UTC (rev 4182)
@@ -1352,9 +1352,9 @@
CFunction.weakCanGet
{arg = Operand.ty (a 0)}
in
- ccall {args = (Vector.concat
- [Vector.new1 GCState,
- vos args]),
+ ccall {args = (Vector.new2
+ (GCState,
+ Vector.sub (vos args, 0))),
func = func}
end,
fn () => move (Operand.bool false))
@@ -1368,9 +1368,9 @@
{arg = Operand.ty (a 0),
return = t}
in
- ccall {args = (Vector.concat
- [Vector.new1 GCState,
- vos args]),
+ ccall {args = (Vector.new2
+ (GCState,
+ Vector.sub (vos args, 0))),
func = func}
end,
none)
|
|
From: Matthew F. <fl...@ml...> - 2005-11-08 18:09:10
|
Bad imports
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/basis-library/misc/primitive.sml
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/misc/primitive.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/misc/primitive.sml 2005-11-09 02:02:01 UTC (rev 4180)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/misc/primitive.sml 2005-11-09 02:09:08 UTC (rev 4181)
@@ -398,10 +398,10 @@
val collect = _prim "GC_collect": unit -> unit;
val pack = _import "MLton_GC_pack": unit -> unit;
val setHashConsDuringGC =
- _import "GC_setHashConsDuringGC": bool -> unit;
- val setMessages = _import "GC_setMessages": bool -> unit;
- val setRusageMeasureGC = _import "GC_setRusageMeasureGC": bool -> unit;
- val setSummary = _import "GC_setSummary": bool -> unit;
+ _import "MLton_GC_setHashConsDuringGC": bool -> unit;
+ val setMessages = _import "MLton_GC_setMessages": bool -> unit;
+ val setRusageMeasureGC = _import "MLton_GC_setRusageMeasureGC": bool -> unit;
+ val setSummary = _import "MLton_GC_setSummary": bool -> unit;
val unpack = _import "MLton_GC_unpack": unit -> unit;
end
|
|
From: Stephen W. <sw...@ml...> - 2005-11-08 18:02:04
|
Improved regression script for MinGW. For some reason, MinGW sed
doesn't do the right thing with \r, so I hardwired Cygwin sed for
now.
----------------------------------------------------------------------
U mlton/trunk/bin/regression
----------------------------------------------------------------------
Modified: mlton/trunk/bin/regression
===================================================================
--- mlton/trunk/bin/regression 2005-11-09 02:01:22 UTC (rev 4179)
+++ mlton/trunk/bin/regression 2005-11-09 02:02:01 UTC (rev 4180)
@@ -90,6 +90,16 @@
exit 0
fi
+forMinGW='false'
+if [ `host-os` = mingw ]; then
+ forMinGW='true'
+fi
+case $crossTarget in
+*mingw)
+ forMinGW='true'
+;;
+esac
+
for f in `ls *.sml`; do
f=`basename $f .sml`
case `host-os` in
@@ -174,23 +184,19 @@
esac
if [ ! -r $f.nonterm -a $cross = 'no' -a -x $f ]; then
nonZeroMsg='Nonzero exit status.'
- case $crossTarget in
- *mingw)
- nonZeroMsg="$nonZeroMsg"'\r'
- ;;
- esac
+ if $forMinGW; then
+ nonZeroMsg="$nonZeroMsg"'\r'
+ fi
( ./$f || echo -e "$nonZeroMsg" ) >$tmp 2>&1
if [ -r $f.ok ]; then
compare="$f.$HOST_ARCH-$HOST_OS.ok"
if [ ! -r $compare ]; then
compare="$f.ok"
fi
- case $crossTarget in
- *mingw)
+ if $forMinGW; then
compare="$f.sed.ok"
- sed 's/$/\r/' <"$f.ok" >"$compare"
- ;;
- esac
+ /c/cygwin/bin/sed 's/$/\r/' <"$f.ok" >"$compare"
+ fi
if ! diff $compare $tmp; then
echo "difference with $flags"
fi
|
|
From: Stephen W. <sw...@ml...> - 2005-11-08 18:01:23
|
Set PREFIX for MinGW. ---------------------------------------------------------------------- U mlton/trunk/Makefile ---------------------------------------------------------------------- Modified: mlton/trunk/Makefile =================================================================== --- mlton/trunk/Makefile 2005-11-08 23:01:51 UTC (rev 4178) +++ mlton/trunk/Makefile 2005-11-09 02:01:22 UTC (rev 4179) @@ -349,6 +349,9 @@ ifeq ($(TARGET_OS), darwin) PREFIX = /usr/local endif +ifeq ($(TARGET_OS), mingw) +PREFIX = /mingw +endif ifeq ($(TARGET_OS), solaris) PREFIX = /usr/local endif |
|
From: Stephen W. <sw...@ml...> - 2005-11-08 15:01:54
|
With mlton -stop f, always use forward / for path separator. That
allows all our Makefiles (which use mlton -stop f) to work without
having to do sed hackery.
----------------------------------------------------------------------
U mlton/trunk/mlton/main/main.fun
----------------------------------------------------------------------
Modified: mlton/trunk/mlton/main/main.fun
===================================================================
--- mlton/trunk/mlton/main/main.fun 2005-11-08 22:58:45 UTC (rev 4177)
+++ mlton/trunk/mlton/main/main.fun 2005-11-08 23:01:51 UTC (rev 4178)
@@ -901,6 +901,13 @@
(MLton.GC.pack ()
; compileCSO (List.concat [!outputs, csoFiles]))
end
+ fun showFiles (fs: File.t vector) =
+ Vector.foreach
+ (fs, fn f =>
+ print (concat [String.translate
+ (f, fn #"\\" => "/"
+ | c => str c),
+ "\n"]))
fun compileCM input =
let
val files = CM.cm {cmfile = input}
@@ -916,8 +923,7 @@
in
case stop of
Place.Files =>
- List.foreach
- (files, fn f => print (concat [f, "\n"]))
+ showFiles (Vector.fromList files)
| Place.SML => saveSML (maybeOut ".sml")
| _ =>
(if !keepSML
@@ -970,9 +976,8 @@
val _ =
case stop of
Place.Files =>
- Vector.foreach
- (Compile.sourceFilesMLB {input = file}, fn f =>
- print (concat [f, "\n"]))
+ showFiles
+ (Compile.sourceFilesMLB {input = file})
| Place.SML => saveSML (maybeOut ".sml")
| Place.TypeCheck =>
trace (Top, "Type Check SML")
|
|
From: Stephen W. <sw...@ml...> - 2005-11-08 14:58:47
|
Use "0" instead of "start" as the first argument to VirtualAlloc
because it is more stable on MinGW.
----------------------------------------------------------------------
U mlton/trunk/runtime/platform/windows.c
----------------------------------------------------------------------
Modified: mlton/trunk/runtime/platform/windows.c
===================================================================
--- mlton/trunk/runtime/platform/windows.c 2005-11-08 22:48:34 UTC (rev 4176)
+++ mlton/trunk/runtime/platform/windows.c 2005-11-08 22:58:45 UTC (rev 4177)
@@ -110,7 +110,10 @@
static inline void *Windows_mmapAnon (void *start, size_t length) {
void *res;
- res = VirtualAlloc ((LPVOID)start, length, MEM_COMMIT, PAGE_READWRITE);
+ /* Use "0" instead of "start" as the first argument to VirtualAlloc
+ * because it is more stable on MinGW (at least).
+ */
+ res = VirtualAlloc ((LPVOID)0/*start*/, length, MEM_COMMIT, PAGE_READWRITE);
if (NULL == res)
res = (void*)-1;
return res;
|
|
From: Matthew F. <fl...@ml...> - 2005-11-08 14:48:37
|
Fixed bug in triggering GC signal
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state_exports.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state_exports.h
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal.c 2005-11-08 22:05:22 UTC (rev 4175)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal.c 2005-11-08 22:48:34 UTC (rev 4176)
@@ -27,7 +27,7 @@
bool Posix_Signal_isGCPending () {
Bool res;
- res = GC_getSignalIsPending (&gcState);
+ res = GC_getGCSignalPending (&gcState);
if (DEBUG_SIGNALS)
fprintf (stderr, "%s = Posix_Signal_isGCPending ()\n",
boolToString (res));
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state_exports.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state_exports.c 2005-11-08 22:05:22 UTC (rev 4175)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state_exports.c 2005-11-08 22:48:34 UTC (rev 4176)
@@ -37,10 +37,6 @@
return &(s->signalsInfo.signalsHandled);
}
-bool GC_getSignalIsPending (GC_state s) {
- return (s->signalsInfo.signalIsPending);
-}
-
sigset_t* GC_getSignalsPendingAddr (GC_state s) {
return &(s->signalsInfo.signalsPending);
}
@@ -49,6 +45,10 @@
s->signalsInfo.gcSignalHandled = b;
}
+bool GC_getGCSignalPending (GC_state s) {
+ return (s->signalsInfo.gcSignalPending);
+}
+
void GC_setGCSignalPending (GC_state s, bool b) {
s->signalsInfo.gcSignalPending = b;
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state_exports.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state_exports.h 2005-11-08 22:05:22 UTC (rev 4175)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state_exports.h 2005-11-08 22:48:34 UTC (rev 4176)
@@ -21,8 +21,8 @@
void GC_setSignalHandlerThread (GC_state s, GC_thread thread);
sigset_t* GC_getSignalsHandledAddr (GC_state s);
-bool GC_getSignalIsPending (GC_state s);
sigset_t* GC_getSignalsPendingAddr (GC_state s);
void GC_setGCSignalHandled (GC_state s, bool b);
+bool GC_getGCSignalPending (GC_state s);
void GC_setGCSignalPending (GC_state s, bool b);
|
|
From: Matthew F. <fl...@ml...> - 2005-11-08 14:05:25
|
Open/Create files with appropriate permission
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2005-11-08 21:27:52 UTC (rev 4174)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2005-11-08 22:05:22 UTC (rev 4175)
@@ -165,7 +165,6 @@
rm -f types.h
$(CC) $(CFLAGS) $(WARNFLAGS) -o gen-types gen/gen-types.c $(UTILOFILES)
./gen-types
- chmod a+r types.h
rm -f gen-types
gc-gdb.o: gc.c $(GCCFILES) $(HFILES)
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c 2005-11-08 21:27:52 UTC (rev 4174)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c 2005-11-08 22:05:22 UTC (rev 4175)
@@ -328,12 +328,12 @@
if (s->controls.messages)
fprintf (stderr, "Paging heap from "FMTPTR" to %s.\n",
(uintptr_t)orig, template);
- fd = open_safe (template, O_WRONLY, 0);
+ fd = open_safe (template, O_WRONLY, S_IRUSR | S_IWUSR);
write_safe (fd, orig, size);
close_safe (fd);
releaseHeap (s, curHeapp);
if (createHeap (s, curHeapp, desiredSize, minSize)) {
- fd = open_safe (template, O_RDONLY, 0);
+ fd = open_safe (template, O_RDONLY, S_IRUSR | S_IWUSR);
read_safe (fd, curHeapp->start, size);
close_safe (fd);
unlink_safe (template);
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c 2005-11-08 21:27:52 UTC (rev 4174)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c 2005-11-08 22:05:22 UTC (rev 4175)
@@ -82,7 +82,7 @@
int main (int argc, char* argv[]) {
int fd;
- fd = open_safe ("types.h", O_RDWR | O_CREAT, 0);
+ fd = open_safe ("types.h", O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
for (int i = 0; i < prefixLines; i++) {
writeString (fd, prefix[i]);
writeNewline (fd);
|
|
From: Stephen W. <sw...@ml...> - 2005-11-08 13:27:56
|
Added some missing EXE's. ---------------------------------------------------------------------- U mlton/trunk/Makefile ---------------------------------------------------------------------- Modified: mlton/trunk/Makefile =================================================================== --- mlton/trunk/Makefile 2005-11-08 20:30:37 UTC (rev 4173) +++ mlton/trunk/Makefile 2005-11-08 21:27:52 UTC (rev 4174) @@ -387,7 +387,8 @@ sed "/^lib=/s;.*;lib='$(prefix)/$(ULIB)';" \ <$(SRC)/bin/mlton-script >$(TBIN)/mlton chmod a+x $(TBIN)/mlton - cd $(BIN) && $(CP) $(LEX) $(NLFFIGEN) $(PROF) $(YACC) $(TBIN)/ + cd $(BIN) && $(CP) $(LEX)$(EXE) $(NLFFIGEN)$(EXE) \ + $(PROF)$(EXE) $(YACC)$(EXE) $(TBIN)/ ( cd $(SRC)/man && tar cf - $(MAN_PAGES)) | \ ( cd $(TMAN)/ && tar xf - ) if $(GZIP_MAN); then \ @@ -397,9 +398,9 @@ cygwin|darwin|solaris) \ ;; \ *) \ - for f in $(TLIB)/$(AOUT) $(TBIN)/$(LEX) \ - $(TBIN)/$(NLFFIGEN) $(TBIN)/$(PROF) \ - $(TBIN)/$(YACC); do \ + for f in $(TLIB)/$(AOUT)$(EXE) $(TBIN)/$(LEX)$(EXE) \ + $(TBIN)/$(NLFFIGEN)$(EXE) $(TBIN)/$(PROF)$(EXE) \ + $(TBIN)/$(YACC)$(EXE); do \ strip --remove-section=.comment \ --remove-section=.note $$f; \ done \ |
|
From: Stephen W. <sw...@ml...> - 2005-11-08 12:30:40
|
Added .exe suffix on MinGW.
----------------------------------------------------------------------
U mlton/trunk/bin/mlton-script
----------------------------------------------------------------------
Modified: mlton/trunk/bin/mlton-script
===================================================================
--- mlton/trunk/bin/mlton-script 2005-11-08 20:22:55 UTC (rev 4172)
+++ mlton/trunk/bin/mlton-script 2005-11-08 20:30:37 UTC (rev 4173)
@@ -6,11 +6,19 @@
dir=`dirname $0`
lib=`cd $dir/../lib && pwd`
+eval `$lib/platform`
gcc='gcc'
-mlton="$lib/mlton-compile"
+case "$HOST_OS" in
+mingw)
+ exe='.exe'
+;;
+*)
+ exe=''
+;;
+esac
+mlton="$lib/mlton-compile$exe"
world="$lib/world.mlton"
nj='sml'
-eval `$lib/platform`
# Try to use the SML/NJ .arch-n-opsys
if .arch-n-opsys >/dev/null 2>&1; then
eval `.arch-n-opsys`
|
|
From: Stephen W. <sw...@ml...> - 2005-11-08 12:22:57
|
Extended upgrade-basis with an "arch" and "os" argument so it can be
used correctly to upgrade the basis when cross compiling.
----------------------------------------------------------------------
U mlton/trunk/bin/upgrade-basis
U mlton/trunk/mlton/Makefile
----------------------------------------------------------------------
Modified: mlton/trunk/bin/upgrade-basis
===================================================================
--- mlton/trunk/bin/upgrade-basis 2005-11-08 02:59:15 UTC (rev 4171)
+++ mlton/trunk/bin/upgrade-basis 2005-11-08 20:22:55 UTC (rev 4172)
@@ -11,12 +11,14 @@
name=`basename $0`
usage () {
- die "usage: $name <PATH>"
+ die "usage: $name <PATH> <ARCH> <OS>"
}
case "$#" in
-1)
+3)
PATH="$1"
+ ARCH="$2"
+ OS="$3"
;;
*)
usage
@@ -94,7 +96,7 @@
structure LargeWord = Word'
eval `$bin/platform`
-case $HOST_ARCH in
+case "$ARCH" in
alpha)
arch='Alpha'
;;
@@ -132,7 +134,7 @@
die "strange HOST_ARCH: $HOST_ARCH"
esac
-case $HOST_OS in
+case "$OS" in
cygwin)
os='Cygwin'
;;
Modified: mlton/trunk/mlton/Makefile
===================================================================
--- mlton/trunk/mlton/Makefile 2005-11-08 02:59:15 UTC (rev 4171)
+++ mlton/trunk/mlton/Makefile 2005-11-08 20:22:55 UTC (rev 4172)
@@ -9,6 +9,7 @@
SRC = $(shell cd .. && pwd)
BUILD = $(SRC)/build
BIN = $(BUILD)/bin
+HOST_ARCH = $(shell $(SRC)/bin/host-arch)
HOST_OS = $(shell $(SRC)/bin/host-os)
LIB = $(BUILD)/lib
MLTON = mlton
@@ -85,7 +86,7 @@
#! Pass $(PATH) to upgrade-basis because it is run via #!/usr/bin/env
# bash, which resets the path.
$(UP):
- $(SRC)/bin/upgrade-basis "$(PATH)" >$(UP)
+ $(SRC)/bin/upgrade-basis "$(PATH)" "$(HOST_ARCH)" "$(HOST_OS)" >$(UP)
mlton.sml: $(SOURCES)
rm -f mlton.sml && mlton -stop sml mlton.cm && chmod -w mlton.sml
|
|
From: Matthew F. <fl...@ml...> - 2005-11-07 18:59:44
|
Working towards reintegration of revised GC.
Somewhat working. Still seems to be some issues with signals and with
pack-real.
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/Makefile
U mlton/branches/on-20050822-x86_64-branch/basis-library/misc/primitive.sml
U mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/signal.sml
U mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/thread.sig
U mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/thread.sml
U mlton/branches/on-20050822-x86_64-branch/bytecode/interpret.c
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/main.h
U mlton/branches/on-20050822-x86_64-branch/include/x86-main.h
U mlton/branches/on-20050822-x86_64-branch/mlton/backend/ssa-to-rssa.fun
U mlton/branches/on-20050822-x86_64-branch/mlton/codegen/c-codegen/c-codegen.fun
U mlton/branches/on-20050822-x86_64-branch/mlton/main/compile.fun
U mlton/branches/on-20050822-x86_64-branch/mlton/main/lookup-constant.fun
U mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Error.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Stat.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Utimbuf.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/access.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chdir.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chmod.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chown.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/link.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/mkdir.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/mkfifo.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/pathconf.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/readlink.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/rename.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/rmdir.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/symlink.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/unlink.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getenv.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setenv.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setgroups.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/exece.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/execp.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/SysDB/Group.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Date.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/spawne.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/spawnp.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/thread.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/Math.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/frexp.c
U mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/TODO
A mlton/branches/on-20050822-x86_64-branch/runtime/gc/align.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.c
D mlton/branches/on-20050822-x86_64-branch/runtime/gc/debug.c
A mlton/branches/on-20050822-x86_64-branch/runtime/gc/debug.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/exports.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/foreach.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/forward.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/garbage-collection.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/generational.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/handler.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/handler.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/init-world.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/init.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/init.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/int-inf.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/new-object.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h
A mlton/branches/on-20050822-x86_64-branch/runtime/gc/platform.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/profiling.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/profiling.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/signals.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/sources.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/switch-thread.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/thread.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/virtual-memory.c
D mlton/branches/on-20050822-x86_64-branch/runtime/gc/virtual-memory.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/weak.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/world.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/world.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc.h
A mlton/branches/on-20050822-x86_64-branch/runtime/gen/
A mlton/branches/on-20050822-x86_64-branch/runtime/gen/gen-types.c
A mlton/branches/on-20050822-x86_64-branch/runtime/platform/displayMem.linux.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/getText.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/linux.c
A mlton/branches/on-20050822-x86_64-branch/runtime/platform/mmap-protect.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/mmap.c
D mlton/branches/on-20050822-x86_64-branch/runtime/platform/ssmmap.c
A mlton/branches/on-20050822-x86_64-branch/runtime/platform/sysconf.c
D mlton/branches/on-20050822-x86_64-branch/runtime/platform/totalRam.sysconf.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform/use-mmap.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform.h
D mlton/branches/on-20050822-x86_64-branch/runtime/types.h
U mlton/branches/on-20050822-x86_64-branch/runtime/util.h
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/Makefile 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/Makefile 2005-11-08 02:59:15 UTC (rev 4171)
@@ -276,8 +276,12 @@
$(MAKE) -C runtime
$(CP) $(RUN)/*.a $(LIB)/$(TARGET)/
$(CP) runtime/*.h include/*.h $(INC)/
+ mkdir -p $(INC)/gc
+ mkdir -p $(INC)/util
mkdir -p $(INC)/platform
$(CP) bytecode/interpret.h $(INC)
+ $(CP) runtime/gc/*.h $(INC)/gc
+ $(CP) runtime/util/*.h $(INC)/util
$(CP) runtime/platform/*.h $(INC)/platform
$(MAKE) -C bytecode
bytecode/print-opcodes >$(LIB)/opcodes
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/misc/primitive.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/misc/primitive.sml 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/misc/primitive.sml 2005-11-08 02:59:15 UTC (rev 4171)
@@ -1705,15 +1705,15 @@
*)
val copyCurrent = _prim "Thread_copyCurrent": unit -> unit;
val current = _import "Thread_current": unit -> thread;
- val finishHandler = _import "Thread_finishHandler": unit -> unit;
+ val finishSignalHandler = _import "Thread_finishSignalHandler": unit -> unit;
val returnToC = _prim "Thread_returnToC": unit -> unit;
val saved = _import "Thread_saved": unit -> thread;
val savedPre = _import "Thread_saved": unit -> preThread;
val setCallFromCHandler =
_import "Thread_setCallFromCHandler": thread -> unit;
- val setHandler = _import "Thread_setHandler": thread -> unit;
+ val setSignalHandler = _import "Thread_setSignalHandler": thread -> unit;
val setSaved = _import "Thread_setSaved": thread -> unit;
- val startHandler = _import "Thread_startHandler": unit -> unit;
+ val startSignalHandler = _import "Thread_startSignalHandler": unit -> unit;
val switchTo = _prim "Thread_switchTo": thread -> unit;
end
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/signal.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/signal.sml 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/signal.sml 2005-11-08 02:59:15 UTC (rev 4171)
@@ -172,7 +172,7 @@
end)
val () =
- MLtonThread.setHandler
+ MLtonThread.setSignalHandler
(fn t =>
let
val mask = Mask.getBlocked ()
@@ -221,7 +221,7 @@
fun suspend m =
(Mask.write m
; Prim.suspend ()
- ; MLtonThread.switchToHandler ())
+ ; MLtonThread.switchToSignalHandler ())
fun handleGC f =
(Prim.handleGC ()
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/thread.sig
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/thread.sig 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/thread.sig 2005-11-08 02:59:15 UTC (rev 4171)
@@ -63,6 +63,6 @@
val amInSignalHandler: unit -> bool
val register: int * (unit -> unit) -> unit
- val setHandler: (Runnable.t -> Runnable.t) -> unit
- val switchToHandler: unit -> unit
+ val setSignalHandler: (Runnable.t -> Runnable.t) -> unit
+ val switchToSignalHandler: unit -> unit
end
Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/thread.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/thread.sml 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/mlton/thread.sml 2005-11-08 02:59:15 UTC (rev 4171)
@@ -163,7 +163,7 @@
in
fun amInSignalHandler () = InHandler = !state
- fun setHandler (f: Runnable.t -> Runnable.t): unit =
+ fun setSignalHandler (f: Runnable.t -> Runnable.t): unit =
let
val _ = Primitive.installSignalHandler ()
fun loop (): unit =
@@ -172,7 +172,7 @@
val _ = state := InHandler
val t = f (fromPrimitive (Prim.saved ()))
val _ = state := Normal
- val _ = Prim.finishHandler ()
+ val _ = Prim.finishSignalHandler ()
val _ =
atomicSwitch
(fn (T r) =>
@@ -180,7 +180,7 @@
val _ =
case !r of
Paused (f, _) => f (fn () => ())
- | _ => raise die "Thread.setHandler saw strange thread"
+ | _ => raise die "Thread.setSignalHandler saw strange thread"
in
t
end) (* implicit atomicEnd () *)
@@ -192,15 +192,15 @@
(new (fn () => loop () handle e => MLtonExn.topLevelHandler e))
val _ = signalHandler := SOME p
in
- Prim.setHandler p
+ Prim.setSignalHandler p
end
- fun switchToHandler () =
+ fun switchToSignalHandler () =
let
(* Atomic 0 *)
val () = atomicBegin ()
(* Atomic 1 *)
- val () = Prim.startHandler () (* implicit atomicBegin () *)
+ val () = Prim.startSignalHandler () (* implicit atomicBegin () *)
(* Atomic 2 *)
in
case !signalHandler of
Modified: mlton/branches/on-20050822-x86_64-branch/bytecode/interpret.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/bytecode/interpret.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/bytecode/interpret.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -5,14 +5,17 @@
* See the file MLton-LICENSE for details.
*/
+#define MLTON_GC_INTERNAL
#include "platform.h"
+#undef MLTON_GC_INTERNAL
+
#include "interpret.h"
#include "c-chunk.h" // c-chunk.h must come before opcode.h because it
// redefines some opcode symbols
#include "opcode.h"
enum {
- DEBUG = FALSE,
+ DEBUG_BYTECODE = FALSE,
};
typedef Word32 ArrayIndex;
@@ -75,7 +78,7 @@
#define Fetch(t, z) \
do { \
z = *(t*)pc; \
- if (DEBUG or disassemble) { \
+ if (DEBUG or DEBUG_BYTECODE or disassemble) { \
if (#z == "label") \
fprintf (stderr, " %s", offsetToLabel[z]); \
else if (#z != "opc") \
@@ -318,10 +321,10 @@
assertRegsEmpty (); \
while (pc < lastCase) { \
Word##size caseWord; \
- if (DEBUG or disassemble) \
+ if (DEBUG or DEBUG_BYTECODE or disassemble) \
fprintf (stderr, "\n\t "); \
Fetch (Word##size, caseWord); \
- if (DEBUG or disassemble) \
+ if (DEBUG or DEBUG_BYTECODE or disassemble) \
fprintf (stderr, " =>"); \
Fetch (Label, label); \
if (not disassemble and test == caseWord) \
@@ -376,8 +379,9 @@
code = b->code;
pcMax = b->code + b->codeSize;
- if (DEBUG or disassemble) {
- ARRAY (String*, offsetToLabel, b->codeSize);
+ if (DEBUG or DEBUG_BYTECODE or disassemble) {
+ offsetToLabel =
+ (String*)(calloc_safe (b->codeSize, sizeof(*offsetToLabel)));
for (i = 0; i < b->nameOffsetsSize; ++i)
offsetToLabel [b->nameOffsets[i].codeOffset] =
b->addressNames + b->nameOffsets[i].nameOffset;
@@ -391,7 +395,7 @@
mainLoop:
if (FALSE)
displayRegs ();
- if (DEBUG or disassemble) {
+ if (DEBUG or DEBUG_BYTECODE or disassemble) {
if (pc == pcMax)
goto done;
name = offsetToLabel [pc - b->code];
@@ -401,8 +405,8 @@
}
assert (code <= pc and pc < pcMax);
Fetch (Opcode, opc);
- assert (opc < cardof (opcodeStrings));
- if (DEBUG or disassemble)
+ assert (opc < (cardof (opcodeStrings)));
+ if (DEBUG or DEBUG_BYTECODE or disassemble)
fprintf (stderr, "%s", opcodeStrings[opc]);
switch (opc) {
prims ();
@@ -456,7 +460,7 @@
}
assert (FALSE);
done:
- if (DEBUG or disassemble)
+ if (DEBUG or DEBUG_BYTECODE or disassemble)
free (offsetToLabel);
return;
}
@@ -467,7 +471,7 @@
}
void MLton_Bytecode_interpret (Bytecode b, Word32 codeOffset) {
- if (DEBUG) {
+ if (DEBUG or DEBUG_BYTECODE) {
fprintf (stderr, "MLton_Bytecode_interpret (0x%08x, %u)\n",
(uint)b,
(uint)codeOffset);
Modified: mlton/branches/on-20050822-x86_64-branch/include/bytecode-main.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/include/bytecode-main.h 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/include/bytecode-main.h 2005-11-08 02:59:15 UTC (rev 4171)
@@ -33,7 +33,7 @@
s->canHandle += 3; \
/* Switch to the C Handler thread. */ \
GC_switchToThread (s, s->callFromCHandler, 0); \
- nextFun = *(int*)(s->stackTop - WORD_SIZE); \
+ nextFun = *(int*)(s->stackTop - GC_RETURNADDRESS_SIZE); \
MLton_Bytecode_interpret (&MLton_bytecode, nextFun); \
GC_switchToThread (s, s->savedThread, 0); \
s->savedThread = BOGUS_THREAD; \
@@ -48,7 +48,7 @@
nextFun = ml; \
} else { \
/* Return to the saved world */ \
- nextFun = *(int*)(gcState.stackTop - WORD_SIZE); \
+ nextFun = *(int*)(gcState.stackTop - GC_RETURNADDRESS_SIZE); \
} \
MLton_Bytecode_interpret (&MLton_bytecode, nextFun); \
}
Modified: mlton/branches/on-20050822-x86_64-branch/include/c-main.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/include/c-main.h 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/include/c-main.h 2005-11-08 02:59:15 UTC (rev 4171)
@@ -28,29 +28,29 @@
fprintf (stderr, "MLton_callFromC() starting\n"); \
s = &gcState; \
s->savedThread = s->currentThread; \
- s->canHandle += 3; \
+ s->atomicState += 3; \
/* Switch to the C Handler thread. */ \
- GC_switchToThread (s, s->callFromCHandler, 0); \
- nextFun = *(int*)(s->stackTop - WORD_SIZE); \
+ GC_switchToThread (s, s->callFromCHandlerThread, 0); \
+ nextFun = *(int*)(s->stackTop - GC_RETURNADDRESS_SIZE); \
cont.nextChunk = nextChunks[nextFun]; \
returnToC = FALSE; \
do { \
cont=(*(struct cont(*)(void))cont.nextChunk)(); \
} while (not returnToC); \
GC_switchToThread (s, s->savedThread, 0); \
- s->savedThread = BOGUS_THREAD; \
+ s->savedThread = BOGUS_OBJPTR; \
if (DEBUG_CCODEGEN) \
fprintf (stderr, "MLton_callFromC done\n"); \
} \
int main (int argc, char **argv) { \
struct cont cont; \
Initialize (al, mg, mfs, mmc, pk, ps); \
- if (gcState.isOriginal) { \
+ if (gcState.amOriginal) { \
real_Init(); \
PrepFarJump(mc, ml); \
} else { \
/* Return to the saved world */ \
- nextFun = *(int*)(gcState.stackTop - WORD_SIZE); \
+ nextFun = *(int*)(gcState.stackTop - GC_RETURNADDRESS_SIZE); \
cont.nextChunk = nextChunks[nextFun]; \
} \
/* Trampoline */ \
Modified: mlton/branches/on-20050822-x86_64-branch/include/main.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/include/main.h 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/include/main.h 2005-11-08 02:59:15 UTC (rev 4171)
@@ -9,7 +9,9 @@
#ifndef _MAIN_H_
#define _MAIN_H_
+#define MLTON_GC_INTERNAL
#include "platform.h"
+#undef MLTON_GC_INTERNAL
/* The label must be declared as weak because gcc's optimizer may prove that
* the code that declares the label is dead and hence eliminate the declaration.
@@ -25,8 +27,8 @@
#define Vector(a, b, c, d) { a, b, c, d },
#define EndVectors };
-#define LoadArray(a, f) sfread (a, sizeof(*a), cardof(a), f)
-#define SaveArray(a, fd) swrite (fd, a, sizeof(*a) * cardof(a))
+#define LoadArray(a, fd) read_safe (fd, a, sizeof(*a) * cardof(a))
+#define SaveArray(a, fd) write_safe (fd, a, sizeof(*a) * cardof(a))
Pointer gcStateAddress;
@@ -34,35 +36,35 @@
gcStateAddress = &gcState; \
gcState.alignment = al; \
gcState.atMLtons = atMLtons; \
- gcState.atMLtonsSize = cardof(atMLtons); \
+ gcState.atMLtonsLength = cardof(atMLtons); \
gcState.frameLayouts = frameLayouts; \
- gcState.frameLayoutsSize = cardof(frameLayouts); \
- gcState.frameSources = frameSources; \
- gcState.frameSourcesSize = cardof(frameSources); \
+ gcState.frameLayoutsLength = cardof(frameLayouts); \
gcState.globals = globalPointer; \
- gcState.globalsSize = cardof(globalPointer); \
+ gcState.globalsLength = cardof(globalPointer); \
gcState.intInfInits = intInfInits; \
- gcState.intInfInitsSize = cardof(intInfInits); \
+ gcState.intInfInitsLength = cardof(intInfInits); \
gcState.loadGlobals = loadGlobals; \
gcState.magic = mg; \
gcState.maxFrameSize = mfs; \
gcState.mutatorMarksCards = mmc; \
gcState.objectTypes = objectTypes; \
- gcState.objectTypesSize = cardof(objectTypes); \
- gcState.profileKind = pk; \
- gcState.profileStack = ps; \
+ gcState.objectTypesLength = cardof(objectTypes); \
gcState.returnAddressToFrameIndex = returnAddressToFrameIndex; \
gcState.saveGlobals = saveGlobals; \
- gcState.sourceLabels = sourceLabels; \
- gcState.sourceLabelsSize = cardof(sourceLabels); \
- gcState.sourceNames = sourceNames; \
- gcState.sourceNamesSize = cardof(sourceNames); \
- gcState.sourceSeqs = sourceSeqs; \
- gcState.sourceSeqsSize = cardof(sourceSeqs); \
- gcState.sources = sources; \
- gcState.sourcesSize = cardof(sources); \
gcState.vectorInits = vectorInits; \
- gcState.vectorInitsSize = cardof(vectorInits); \
+ gcState.vectorInitsLength = cardof(vectorInits); \
+ gcState.sourceMaps.frameSources = frameSources; \
+ gcState.sourceMaps.frameSourcesLength = cardof(frameSources); \
+ gcState.sourceMaps.sourceLabels = sourceLabels; \
+ gcState.sourceMaps.sourceLabelsLength = cardof(sourceLabels); \
+ gcState.sourceMaps.sourceNames = sourceNames; \
+ gcState.sourceMaps.sourceNamesLength = cardof(sourceNames); \
+ gcState.sourceMaps.sourceSeqs = sourceSeqs; \
+ gcState.sourceMaps.sourceSeqsLength = cardof(sourceSeqs); \
+ gcState.sourceMaps.sources = sources; \
+ gcState.sourceMaps.sourcesLength = cardof(sources); \
+ gcState.profiling.kind = pk; \
+ gcState.profiling.stack = ps; \
MLton_init (argc, argv, &gcState); \
void MLton_callFromC ();
Modified: mlton/branches/on-20050822-x86_64-branch/include/x86-main.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/include/x86-main.h 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/include/x86-main.h 2005-11-08 02:59:15 UTC (rev 4171)
@@ -93,13 +93,13 @@
fprintf (stderr, "MLton_callFromC() starting\n"); \
s = &gcState; \
s->savedThread = s->currentThread; \
- s->canHandle += 3; \
+ s->atomicState += 3; \
/* Return to the C Handler thread. */ \
- GC_switchToThread (s, s->callFromCHandler, 0); \
- jump = *(pointer*)(s->stackTop - WORD_SIZE); \
+ GC_switchToThread (s, s->callFromCHandlerThread, 0); \
+ jump = *(pointer*)(s->stackTop - GC_RETURNADDRESS_SIZE); \
MLton_jumpToSML(jump); \
GC_switchToThread (s, s->savedThread, 0); \
- s->savedThread = BOGUS_THREAD; \
+ s->savedThread = BOGUS_OBJPTR; \
if (DEBUG_X86CODEGEN) \
fprintf (stderr, "MLton_callFromC() done\n"); \
return; \
@@ -109,11 +109,11 @@
extern pointer ml; \
\
Initialize (al, mg, mfs, mmc, pk, ps); \
- if (gcState.isOriginal) { \
+ if (gcState.amOriginal) { \
real_Init(); \
jump = (pointer)&ml; \
} else { \
- jump = *(pointer*)(gcState.stackTop - WORD_SIZE); \
+ jump = *(pointer*)(gcState.stackTop - GC_RETURNADDRESS_SIZE); \
} \
MLton_jumpToSML(jump); \
return 1; \
Modified: mlton/branches/on-20050822-x86_64-branch/mlton/backend/ssa-to-rssa.fun
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/backend/ssa-to-rssa.fun 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/backend/ssa-to-rssa.fun 2005-11-08 02:59:15 UTC (rev 4171)
@@ -163,25 +163,41 @@
target = Direct "Thread_switchTo",
writesStackTop = true}
- fun weakCanGet t =
- vanilla {args = Vector.new1 t,
- name = "GC_weakCanGet",
- prototype = let
- open CType
- in
- (Vector.new1 Pointer, SOME bool)
- end,
- return = Type.bool}
+ fun weakCanGet {arg} =
+ T {args = Vector.new2 (gcState, arg),
+ bytesNeeded = NONE,
+ convention = Cdecl,
+ ensuresBytesFree = false,
+ mayGC = false,
+ maySwitchThreads = false,
+ modifiesFrontier = false,
+ prototype = let
+ open CType
+ in
+ (Vector.new2 (Pointer, Pointer), SOME bool)
+ end,
+ readsStackTop = false,
+ return = Type.bool,
+ target = Direct "GC_weakCanGet",
+ writesStackTop = false}
fun weakGet {arg, return} =
- vanilla {args = Vector.new1 arg,
- name = "GC_weakGet",
- prototype = let
- open CType
- in
- (Vector.new1 Pointer, SOME Pointer)
- end,
- return = return}
+ T {args = Vector.new2 (gcState, arg),
+ bytesNeeded = NONE,
+ convention = Cdecl,
+ ensuresBytesFree = false,
+ mayGC = false,
+ maySwitchThreads = false,
+ modifiesFrontier = false,
+ prototype = let
+ open CType
+ in
+ (Vector.new2 (Pointer, Pointer), SOME Pointer)
+ end,
+ readsStackTop = false,
+ return = return,
+ target = Direct "GC_weakGet",
+ writesStackTop = false}
fun weakNew {arg, return} =
T {args = Vector.new3 (gcState, Word32, arg),
@@ -1330,16 +1346,33 @@
| Weak_canGet =>
ifIsWeakPointer
(varType (arg 0),
- fn _ => simpleCCall (CFunction.weakCanGet
- (Operand.ty (a 0))),
+ fn _ =>
+ let
+ val func =
+ CFunction.weakCanGet
+ {arg = Operand.ty (a 0)}
+ in
+ ccall {args = (Vector.concat
+ [Vector.new1 GCState,
+ vos args]),
+ func = func}
+ end,
fn () => move (Operand.bool false))
| Weak_get =>
ifIsWeakPointer
(varType (arg 0),
- fn t => (simpleCCall
- (CFunction.weakGet
- {arg = Operand.ty (a 0),
- return = t})),
+ fn t =>
+ let
+ val func =
+ CFunction.weakGet
+ {arg = Operand.ty (a 0),
+ return = t}
+ in
+ ccall {args = (Vector.concat
+ [Vector.new1 GCState,
+ vos args]),
+ func = func}
+ end,
none)
| Weak_new =>
ifIsWeakPointer
Modified: mlton/branches/on-20050822-x86_64-branch/mlton/codegen/c-codegen/c-codegen.fun
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/codegen/c-codegen/c-codegen.fun 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/codegen/c-codegen/c-codegen.fun 2005-11-08 02:59:15 UTC (rev 4171)
@@ -253,11 +253,11 @@
CType.toString t, ", fd);\n"])))
; print "}\n")
val _ =
- (print "static void loadGlobals (FILE *file) {\n"
+ (print "static void loadGlobals (int fd) {\n"
; (List.foreach
(CType.all, fn t =>
print (concat ["\tLoadArray (global",
- CType.toString t, ", file);\n"])))
+ CType.toString t, ", fd);\n"])))
; print "}\n")
in
()
@@ -296,7 +296,7 @@
fun declareFrameOffsets () =
Vector.foreachi
(frameOffsets, fn (i, v) =>
- (print (concat ["static ushort frameOffsets", C.int i, "[] = {"])
+ (print (concat ["static uint16_t frameOffsets", C.int i, "[] = {"])
; print (C.int (Vector.length v))
; Vector.foreach (v, fn i => (print ","; print (C.bytes i)))
; print "};\n"))
@@ -309,18 +309,18 @@
print (concat ["\t", toString (i, x), ",\n"]))
; print "};\n")
fun declareFrameLayouts () =
- declareArray ("GC_frameLayout", "frameLayouts", frameLayouts,
+ declareArray ("struct GC_frameLayout", "frameLayouts", frameLayouts,
fn (_, {frameOffsetsIndex, isC, size}) =>
concat ["{",
C.bool isC,
+ ", frameOffsets", C.int frameOffsetsIndex,
", ", C.bytes size,
- ", frameOffsets", C.int frameOffsetsIndex,
"}"])
fun declareAtMLtons () =
- declareArray ("string", "atMLtons", !Control.atMLtons, C.string o #2)
+ declareArray ("char*", "atMLtons", !Control.atMLtons, C.string o #2)
fun declareObjectTypes () =
declareArray
- ("GC_ObjectType", "objectTypes", objectTypes,
+ ("struct GC_objectType", "objectTypes", objectTypes,
fn (_, ty) =>
let
datatype z = datatype Runtime.RObjectType.t
@@ -380,22 +380,22 @@
declareProfileLabel (label, print))
; (Vector.foreachi
(sourceSeqs, fn (i, v) =>
- (print (concat ["static int sourceSeq",
+ (print (concat ["static uint32_t sourceSeq",
Int.toString i,
"[] = {"])
; print (C.int (Vector.length v))
; Vector.foreach (v, fn i =>
(print (concat [",", C.int i])))
; print "};\n")))
- ; declareArray ("uint", "*sourceSeqs", sourceSeqs, fn (i, _) =>
+ ; declareArray ("uint32_t*", "sourceSeqs", sourceSeqs, fn (i, _) =>
concat ["sourceSeq", Int.toString i])
- ; declareArray ("uint", "frameSources", frameSources, C.int o #2)
+ ; declareArray ("GC_sourceSeqIndex", "frameSources", frameSources, C.int o #2)
; (declareArray
("struct GC_sourceLabel", "sourceLabels", labels,
fn (_, {label, sourceSeqsIndex}) =>
concat ["{(pointer)&", ProfileLabel.toString label, ", ",
C.int sourceSeqsIndex, "}"]))
- ; declareArray ("string", "sourceNames", names, C.string o #2)
+ ; declareArray ("char*", "sourceNames", names, C.string o #2)
; declareArray ("struct GC_source", "sources", sources,
fn (_, {nameIndex, successorsIndex}) =>
concat ["{ ", Int.toString nameIndex, ", ",
Modified: mlton/branches/on-20050822-x86_64-branch/mlton/main/compile.fun
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/main/compile.fun 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/main/compile.fun 2005-11-08 02:59:15 UTC (rev 4171)
@@ -451,15 +451,15 @@
in
Runtime.GCField.setOffsets
{
- canHandle = get "canHandle",
- cardMap = get "cardMapForMutator",
+ canHandle = get "atomicState",
+ cardMap = get "generationalMaps.cardMapAbsolute",
currentThread = get "currentThread",
exnStack = get "exnStack",
frontier = get "frontier",
limit = get "limit",
limitPlusSlop = get "limitPlusSlop",
maxFrameSize = get "maxFrameSize",
- signalIsPending = get "signalIsPending",
+ signalIsPending = get "signalsInfo.signalIsPending",
stackBottom = get "stackBottom",
stackLimit = get "stackLimit",
stackTop = get "stackTop"
Modified: mlton/branches/on-20050822-x86_64-branch/mlton/main/lookup-constant.fun
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/mlton/main/lookup-constant.fun 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/mlton/main/lookup-constant.fun 2005-11-08 02:59:15 UTC (rev 4171)
@@ -42,15 +42,15 @@
val gcFields =
[
- "canHandle",
+ "atomicState",
"currentThread",
"exnStack",
"frontier",
- "cardMapForMutator",
+ "generationalMaps.cardMapAbsolute",
"limit",
"limitPlusSlop",
"maxFrameSize",
- "signalIsPending",
+ "signalsInfo.signalIsPending",
"stackBottom",
"stackLimit",
"stackTop"
@@ -73,7 +73,8 @@
in
List.foreach
(List.concat
- [["#include \"platform.h\"",
+ [["#define MLTON_GC_INTERNAL",
+ "#include \"platform.h\"",
"struct GC_state gcState;",
"",
"int main (int argc, char **argv) {"],
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2005-11-08 02:59:15 UTC (rev 4171)
@@ -68,18 +68,29 @@
# -Winline -Wdisabled-optimization
DEBUGWARNFLAGS = $(DEBUGFLAGS) $(WARNFLAGS) -Wunused
+UTILCFILES = \
+ $(shell find util -type f | grep '\.c$$')
+UTILHFILES = \
+ $(shell find util -type f | grep '\.h$$')
+UTILOFILES = $(foreach f, $(UTILCFILES), $(basename $(f)).o)
+
+GCCFILES = \
+ $(shell find gc -type f | grep '\.c$$')
+GCHFILES = \
+ $(shell find gc -type f | grep '\.h$$')
+
CFILES = \
- $(shell find util -type f | grep '\.c$$') \
+ $(UTILCFILES) \
$(shell find basis -type f | grep '\.c$$' | grep -v Real/) \
$(shell find Posix -type f | grep '\.c$$') \
gc.c \
platform.c
HFILES = \
+ $(UTILHFILES) \
util.h \
- $(shell find util -type f | grep '\.h$$') \
+ $(GCHFILES) \
gc.h \
- $(shell find gc -type f | grep '\.h$$') \
types.h \
platform.h \
platform/$(TARGET_OS).h
@@ -143,18 +154,26 @@
runtime.c: $(CFILES)
cat $(CFILES) >runtime.c
-gc.o: gc.c $(shell find gc -type f | grep '\.c$$') $(HFILES)
- $(CC) $(CFLAGS) $(WARNFLAGS) -c -o $@ $<
-gc-gdb.o: gc.c $(shell find gc -type f | grep '\.c$$') $(HFILES)
+util/%-gdb.o: util/%.c util.h $(UTILHFILES)
$(CC) $(DEBUGFLAGS) $(DEBUGWARNFLAGS) -O1 -DASSERT=1 -c -o $@ $<
-util/%.o: util/%.c $(HFILES)
+util/%.o: util/%.c util.h $(UTILHFILES)
$(CC) $(CFLAGS) $(WARNFLAGS) -c -o $@ $<
-util/%-gdb.o: util/%.c $(HFILES)
+types.h: gen/gen-types.c util.h $(UTILOFILES)
+ rm -f types.h
+ $(CC) $(CFLAGS) $(WARNFLAGS) -o gen-types gen/gen-types.c $(UTILOFILES)
+ ./gen-types
+ chmod a+r types.h
+ rm -f gen-types
+
+gc-gdb.o: gc.c $(GCCFILES) $(HFILES)
$(CC) $(DEBUGFLAGS) $(DEBUGWARNFLAGS) -O1 -DASSERT=1 -c -o $@ $<
+gc.o: gc.c $(GCCFILES) $(HFILES)
+ $(CC) $(CFLAGS) $(WARNFLAGS) -c -o $@ $<
+
# It looks like we don't follow the C spec w.r.t. aliasing. And gcc
# -O2 catches us on the code in Real/*.c where we treat a double as a
# chunk of two words. Files that have been known to cause problems
@@ -162,9 +181,9 @@
# with -fno-strict-aliasing to prevent gcc from taking advantage of
# this aspect of the C spec.
basis/Real/%-gdb.o: basis/Real/%.c gdtoa/arith.h
- $(CC) $(DEBUGFLAGS) -O1 -DASSERT=1 -c -o $@ $<
+ $(CC) $(DEBUGFLAGS) $(WARNFLAGS) -O1 -DASSERT=1 -c -o $@ $<
basis/Real/%.o: basis/Real/%.c gdtoa/arith.h
- $(CC) $(CFLAGS) -O1 -fno-strict-aliasing -c -o $@ $<
+ $(CC) $(CFLAGS) $(DEBUGWARNFLAGS) -O1 -fno-strict-aliasing -c -o $@ $<
%-gdb.o: %.c $(HFILES)
$(CC) $(DEBUGFLAGS) -O1 -DASSERT=1 -c -o $@ $<
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Error.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Error.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Error.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -8,6 +8,6 @@
return errno;
}
-Cstring Posix_Error_strerror (Syserror n) {
+Cstring Posix_Error_strerror (Int n) {
return (Cstring)(strerror (n));
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Stat.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Stat.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Stat.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -50,10 +50,10 @@
return fstat (f, &statbuf);
}
-Int Posix_FileSys_Stat_lstat (NullString f) {
+Int Posix_FileSys_Stat_lstat (Pointer f) {
return lstat ((char*)f, &statbuf);
}
-Int Posix_FileSys_Stat_stat (NullString f) {
+Int Posix_FileSys_Stat_stat (Pointer f) {
return stat ((char*)f, &statbuf);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Utimbuf.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Utimbuf.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Utimbuf.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -10,6 +10,6 @@
utimbuf.modtime = i;
}
-Int Posix_FileSys_Utimbuf_utime (NullString s) {
+Int Posix_FileSys_Utimbuf_utime (Pointer s) {
return (Int)utime((char *)s, &utimbuf);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/access.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/access.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/access.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_access (NullString f, Word w) {
+Int Posix_FileSys_access (Pointer f, Word w) {
return access ((char *) f, w);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chdir.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chdir.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chdir.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_chdir(Cpointer p) {
+Int Posix_FileSys_chdir(Pointer p) {
return chdir((char *) p);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chmod.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chmod.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chmod.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_chmod (NullString p, Mode m) {
+Int Posix_FileSys_chmod (Pointer p, Mode m) {
return chmod ((char *) p, m);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chown.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chown.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/chown.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_chown (NullString p, Uid u, Gid g) {
+Int Posix_FileSys_chown (Pointer p, Uid u, Gid g) {
return chown ((char *) p, u, g);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/link.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/link.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/link.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_link (NullString p1, NullString p2) {
+Int Posix_FileSys_link (Pointer p1, Pointer p2) {
return link ((char *) p1, (char *) p2);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/mkdir.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/mkdir.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/mkdir.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_mkdir (NullString p, Word w) {
+Int Posix_FileSys_mkdir (Pointer p, Word w) {
return mkdir2 ((char *) p, w);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/mkfifo.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/mkfifo.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/mkfifo.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_mkfifo (NullString p, Word w) {
+Int Posix_FileSys_mkfifo (Pointer p, Word w) {
return mkfifo ((char *) p, w);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/open.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -4,7 +4,7 @@
#define DEBUG FALSE
#endif
-Int Posix_FileSys_open (NullString p, Word w, Mode m) {
+Int Posix_FileSys_open (Pointer p, Word w, Mode m) {
Int res;
res = open ((char *) p, w, m);
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/pathconf.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/pathconf.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/pathconf.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_pathconf (NullString p, Int n) {
+Int Posix_FileSys_pathconf (Pointer p, Int n) {
return pathconf ((char *)p, n);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/readlink.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/readlink.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/readlink.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_readlink (NullString p, Pointer b, Int n) {
+Int Posix_FileSys_readlink (Pointer p, Pointer b, Int n) {
return readlink ((char*)p, (char*)b, n);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/rename.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/rename.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/rename.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_rename (NullString p1, NullString p2) {
+Int Posix_FileSys_rename (Pointer p1, Pointer p2) {
return rename ((char *) p1, (char *) p2);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/rmdir.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/rmdir.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/rmdir.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_rmdir (NullString p) {
+Int Posix_FileSys_rmdir (Pointer p) {
return rmdir ((char *) p);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/symlink.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/symlink.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/symlink.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_FileSys_symlink (NullString p1, NullString p2) {
+Int Posix_FileSys_symlink (Pointer p1, Pointer p2) {
return symlink ((char *) p1, (char *) p2);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/unlink.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/unlink.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/unlink.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -1,5 +1,5 @@
#include "platform.h"
-Word Posix_FileSys_unlink (NullString p) {
+Word Posix_FileSys_unlink (Pointer p) {
return unlink ((char *) p);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getenv.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getenv.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/getenv.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -1,5 +1,5 @@
#include "platform.h"
-Cstring Posix_ProcEnv_getenv(NullString s) {
+Cstring Posix_ProcEnv_getenv(Pointer s) {
return (Cstring)getenv((char *)s);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setenv.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setenv.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setenv.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -1,5 +1,5 @@
#include "platform.h"
-Int Posix_ProcEnv_setenv (NullString s, NullString v) {
- return setenv ((char *)s, (char *)v, 1);
+Int Posix_ProcEnv_setenv (Pointer s, Pointer v) {
+ return setenv ((char*)s, (char*)v, 1);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setgroups.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setgroups.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setgroups.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -8,7 +8,7 @@
size = GC_getArrayLength (groups);
list = (gid_t*)(calloc_safe (size, sizeof(*list)));
- assert (size <= (sizeof(list) / sizeof(*list)));
+ assert (size <= cardof(list));
for (i = 0; i < size; ++i)
list[i] = ((Word*)groups)[i];
res = setgroups (size, list);
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/exece.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/exece.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/exece.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -1,6 +1,6 @@
#include "platform.h"
-Int Posix_Process_exece (NullString p, Pointer a, Pointer e) {
+Int Posix_Process_exece (Pointer p, Pointer a, Pointer e) {
char *path;
char *asaved;
char *esaved;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/execp.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/execp.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/execp.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -1,6 +1,6 @@
#include "platform.h"
-Int Posix_Process_execp (NullString f, Pointer a) {
+Int Posix_Process_execp (Pointer f, Pointer a) {
char *file;
char *saved;
char **args;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/SysDB/Group.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/SysDB/Group.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/SysDB/Group.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -18,6 +18,6 @@
return NULL != (group = getgrgid ((gid_t)g));
}
-Bool Posix_SysDB_getgrnam(NullString s) {
+Bool Posix_SysDB_getgrnam(Pointer s) {
return NULL != (group = getgrnam ((char*)s));
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Date.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Date.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Date.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -103,6 +103,6 @@
return mktime(&tm);
}
-Int Date_strfTime(Pointer buf, Int n, NullString fmt) {
+Int Date_strfTime(Pointer buf, Int n, Pointer fmt) {
return strftime((char*)(buf), n, (char*)(fmt), &tm);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -8,6 +8,7 @@
#define MLTON_GC_INTERNAL
#include "platform.h"
+#undef MLTON_GC_INTERNAL
enum {
DEBUG_INT_INF = FALSE,
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/spawne.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/spawne.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/spawne.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -28,7 +28,7 @@
return result;
}
#else
-Int MLton_Process_spawne (NullString p, Pointer a, Pointer e) {
+Int MLton_Process_spawne (Pointer p, Pointer a, Pointer e) {
die ("MLton_Process_spawne not implemented");
}
#endif
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/spawnp.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/spawnp.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/spawnp.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -18,7 +18,7 @@
return result;
}
#else
-Int MLton_Process_spawnp (NullString p, Pointer a) {
+Int MLton_Process_spawnp (Pointer p, Pointer a) {
die ("MLton_Process_spawnp not implemented");
}
#endif
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/thread.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/thread.c 2005-11-07 22:23:36 UTC (rev 4170)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/thread.c 2005-11-08 02:59:15 UTC (rev 4171)
@@ -6,49 +6,49 @@
DEBUG_THREAD = FALSE,
};
-Thread Thread_current () {
- Thread t;
+Pointer Thread_current () {
+ Pointer t;
- t = (Thread)(GC_getCurrentThread (&gcState));
+ t = (Pointer)(GC_getCurrentThread (&gcState));
if (DEBUG_THREAD)
fprintf (stderr, "0x%08x = Thread_current ()\n", (uint)t);
return t;
}
-void Thread_finishHandler () {
- GC_finishHandler (&gcState);
+void Thread_finishSignalHandler () {
+ GC_finishSignalHandler (&gcState);
}
-Thread Thread_saved () {
- Thread t;
+Pointer Thread_saved () {
+ Pointer t;
- t = (Thread)(GC_getSavedThread (&gcState));
+ t = (Pointer)(GC_getSavedThread (&gcState));
if (DEBUG_THREAD)
fprintf (stderr, "0x%08x = Thread_saved ()\n", (uint)t);
return t;
}
-void Thread_setCallFromCHandler (Thread t) {
+void Thread_setCallFromCHandler (Pointer t) {
GC_setCallFromCHandlerThread (&gcState, (GC_thread)t);
}
-void Thread_setSaved (Thread t) {
+void Thread_setSaved (Pointer t) {
if (DEBUG_THREAD)
fprintf (stderr, "Thread_setSaved (0x%08x)\n", (uint)t);
GC_setSavedThread (&gcState, (GC_thread)t);
}
-void Thread_setSignalHandler (Thread t) {
+void Thread_setSignalHandler (Pointer t) {
GC_setSignalHandlerThread (&gcState, (GC_thread)t);
}
-void Thread_startHandler () {
- GC_startHandler (&gcState);
+void Thread_startSignalHandler () {
+ GC_startSignalHandler (&gc...
[truncated message content] |
|
From: Stephen W. <sw...@ml...> - 2005-11-07 14:23:38
|
Added MLNLFFI MinGW platform memory file. ---------------------------------------------------------------------- A mlton/trunk/lib/mlnlffi/memory/platform/memory.x86-mingw.mlb ---------------------------------------------------------------------- Added: mlton/trunk/lib/mlnlffi/memory/platform/memory.x86-mingw.mlb =================================================================== --- mlton/trunk/lib/mlnlffi/memory/platform/memory.x86-mingw.mlb 2005-11-07 02:43:45 UTC (rev 4169) +++ mlton/trunk/lib/mlnlffi/memory/platform/memory.x86-mingw.mlb 2005-11-07 22:23:36 UTC (rev 4170) @@ -0,0 +1 @@ +../memory.32bit-unix.mlb |
|
From: Matthew F. <fl...@ml...> - 2005-11-06 18:43:47
|
No more ignore ---------------------------------------------------------------------- _U mlton/branches/on-20050822-x86_64-branch/runtime/gc/ ---------------------------------------------------------------------- Property changes on: mlton/branches/on-20050822-x86_64-branch/runtime/gc ___________________________________________________________________ Name: svn:ignore - gc.h gc.c |
|
From: Matthew F. <fl...@ml...> - 2005-11-06 18:39:09
|
No more ignore ---------------------------------------------------------------------- D mlton/branches/on-20050822-x86_64-branch/runtime/gc/.ignore ---------------------------------------------------------------------- Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/gc/.ignore =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/.ignore 2005-11-07 02:34:33 UTC (rev 4167) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/.ignore 2005-11-07 02:39:08 UTC (rev 4168) @@ -1,2 +0,0 @@ -gc.h -gc.c |
|
From: Matthew F. <fl...@ml...> - 2005-11-06 18:34:38
|
Missing files ---------------------------------------------------------------------- A mlton/branches/on-20050822-x86_64-branch/runtime/gc/exports.h D mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_prefix.c D mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_prefix.h D mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_suffix.c D mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_suffix.h D mlton/branches/on-20050822-x86_64-branch/runtime/gc/read_write.h D mlton/branches/on-20050822-x86_64-branch/runtime/gc/safe.h ---------------------------------------------------------------------- Added: mlton/branches/on-20050822-x86_64-branch/runtime/gc/exports.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/exports.h 2005-11-07 02:30:53 UTC (rev 4166) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/exports.h 2005-11-07 02:34:33 UTC (rev 4167) @@ -0,0 +1,36 @@ +/* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh + * Jagannathan, and Stephen Weeks. + * Copyright (C) 1997-2000 NEC Research Institute. + * + * MLton is released under a BSD-style license. + * See the file MLton-LICENSE for details. + */ + +uint32_t GC_getArrayLength (pointer a); + +void GC_handler (GC_state s, int signum); + +void GC_pack (GC_state s); +void GC_unpack (GC_state s); + +void GC_share (GC_state s, pointer object); + +size_t GC_size (GC_state s, pointer root); + +void GC_startHandler (GC_state s); +void GC_finishHandler (GC_state s); + +void GC_switchToThread (GC_state s, GC_thread t, size_t ensureBytesFree); + + +GC_profileData GC_getProfileCurrent (GC_state s); +void GC_setProfileCurrent (GC_state s, GC_profileData p); + +void GC_profileFree (GC_state s, GC_profileData p); +GC_profileData GC_profileNew (GC_state s); +void GC_profileWrite (GC_state s, GC_profileData p, int fd); + +void GC_profileDone (GC_state s); + +void GC_done (GC_state s); + Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_prefix.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_prefix.c 2005-11-07 02:30:53 UTC (rev 4166) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_prefix.c 2005-11-07 02:34:33 UTC (rev 4167) @@ -1,2 +0,0 @@ -#include "libgc.h" - Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_prefix.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_prefix.h 2005-11-07 02:30:53 UTC (rev 4166) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_prefix.h 2005-11-07 02:34:33 UTC (rev 4167) @@ -1,5 +0,0 @@ -#ifndef _MLTON_GC_H_ -#define _MLTON_GC_H_ - -struct GC_state; -typedef struct GC_state *GC_state; Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_suffix.c =================================================================== Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_suffix.h =================================================================== Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/gc/read_write.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/read_write.h 2005-11-07 02:30:53 UTC (rev 4166) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/read_write.h 2005-11-07 02:34:33 UTC (rev 4167) @@ -1,26 +0,0 @@ -/* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh - * Jagannathan, and Stephen Weeks. - * Copyright (C) 1997-2000 NEC Research Institute. - * - * MLton is released under a BSD-style license. - * See the file MLton-LICENSE for details. - */ - -char readChar (int fd); -pointer readPointer (int fd); -objptr readObjptr (int fd); -size_t readSize (int fd); -uint32_t readUint32 (int fd); -uintptr_t readUintptr (int fd); -void writeChar (int fd, char c); -void writePointer (int fd, pointer p); -void writeObjptr (int fd, objptr op); -void writeSize (int fd, size_t z); -void writeUint32 (int fd, uint32_t u); -void writeUintptr (int fd, uintptr_t u); -void writeString (int fd, char* s); -void writeUint32U (int fd, uint32_t u); -void writeUintmaxU (int fd, uintmax_t u); -void writeUint32X (int fd, uint32_t u); -void writeUintmaxX (int fd, uintmax_t u); -void writeNewline (int fd); Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/gc/safe.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/safe.h 2005-11-07 02:30:53 UTC (rev 4166) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/safe.h 2005-11-07 02:34:33 UTC (rev 4167) @@ -1,16 +0,0 @@ -/* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh - * Jagannathan, and Stephen Weeks. - * Copyright (C) 1997-2000 NEC Research Institute. - * - * MLton is released under a BSD-style license. - * See the file MLton-LICENSE for details. - */ - -void *calloc_safe (size_t count, size_t size); -void close_safe (int fd); -void *malloc_safe (size_t size); -int mkstemp_safe (char *template); -int open_safe (const char *fileName, int flags, mode_t mode); -void read_safe (int fd, void *buf, size_t size); -void unlink_safe (const char *pathname); -void write_safe (int fd, const void *buf, size_t size); |
|
From: Matthew F. <fl...@ml...> - 2005-11-06 18:31:38
|
Working on reintegration of gc
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/getcwd.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/readlink.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setgroups.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/exece.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/execp.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal.c
D mlton/branches/on-20050822-x86_64-branch/runtime/assert.h
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Array/numElements.c
D mlton/branches/on-20050822-x86_64-branch/runtime/basis/GC.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Int/Word8Array.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Int/Word8Vector.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c
A mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/gc.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/profile.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/rusage.c
A mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/thread.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/world.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetHostDB.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/PackReal.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Stdio.c
D mlton/branches/on-20050822-x86_64-branch/runtime/basis/Thread.c
A mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile
D mlton/branches/on-20050822-x86_64-branch/runtime/gc/align.c
A mlton/branches/on-20050822-x86_64-branch/runtime/gc/align.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/done.c
D mlton/branches/on-20050822-x86_64-branch/runtime/gc/done.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_prefix.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.h
A mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state_exports.c
A mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state_exports.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_suffix.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/handler.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/int-inf.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/invariant.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/mark-compact.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h
D mlton/branches/on-20050822-x86_64-branch/runtime/gc/model_predicates.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h
D mlton/branches/on-20050822-x86_64-branch/runtime/gc/object_predicates.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/objptr.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/objptr.h
D mlton/branches/on-20050822-x86_64-branch/runtime/gc/pack.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/pointer.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/pointer.h
D mlton/branches/on-20050822-x86_64-branch/runtime/gc/pointer_predicates.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/profiling.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/profiling.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/read_write.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/rusage.h
D mlton/branches/on-20050822-x86_64-branch/runtime/gc/safe.c
D mlton/branches/on-20050822-x86_64-branch/runtime/gc/share.h
D mlton/branches/on-20050822-x86_64-branch/runtime/gc/size.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.c
D mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack_predicates.c
A mlton/branches/on-20050822-x86_64-branch/runtime/gc/statistics.c
A mlton/branches/on-20050822-x86_64-branch/runtime/gc/string.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/switch-thread.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/thread.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/util.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc/world.h
U mlton/branches/on-20050822-x86_64-branch/runtime/gc.c
U mlton/branches/on-20050822-x86_64-branch/runtime/gc.h
U mlton/branches/on-20050822-x86_64-branch/runtime/platform.c
U mlton/branches/on-20050822-x86_64-branch/runtime/platform.h
U mlton/branches/on-20050822-x86_64-branch/runtime/types.h
A mlton/branches/on-20050822-x86_64-branch/runtime/util/
A mlton/branches/on-20050822-x86_64-branch/runtime/util/Makefile
A mlton/branches/on-20050822-x86_64-branch/runtime/util/align.h
A mlton/branches/on-20050822-x86_64-branch/runtime/util/assert.c
A mlton/branches/on-20050822-x86_64-branch/runtime/util/assert.h
A mlton/branches/on-20050822-x86_64-branch/runtime/util/die.c
A mlton/branches/on-20050822-x86_64-branch/runtime/util/die.h
A mlton/branches/on-20050822-x86_64-branch/runtime/util/endian.h
A mlton/branches/on-20050822-x86_64-branch/runtime/util/pointer.h
A mlton/branches/on-20050822-x86_64-branch/runtime/util/read_write.h
A mlton/branches/on-20050822-x86_64-branch/runtime/util/safe.h
A mlton/branches/on-20050822-x86_64-branch/runtime/util/to-string.c
A mlton/branches/on-20050822-x86_64-branch/runtime/util/to-string.h
A mlton/branches/on-20050822-x86_64-branch/runtime/util.h
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Makefile 2005-11-07 02:30:53 UTC (rev 4166)
@@ -11,7 +11,8 @@
TARGET = self
TARGET_ARCH = $(shell ../bin/host-arch)
TARGET_OS = $(shell ../bin/host-os)
-GCC_VERSION = $(shell gcc -v 2>&1 | grep 'gcc version' | sed 's/.*gcc version \(.\).*/\1/')
+GCC_VERSION = \
+ $(shell gcc -v 2>&1 | grep 'gcc version' | sed 's/.*gcc version \(.\).*/\1/')
FLAGS = -fomit-frame-pointer
@@ -47,17 +48,40 @@
CC = gcc -std=gnu99
CFLAGS = -O2 -Wall -I. -Iplatform -D_FILE_OFFSET_BITS=64 $(FLAGS)
DEBUGFLAGS = $(CFLAGS) -gstabs+ -g2
+WARNFLAGS = -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function \
+ -Wformat-nonliteral \
+ -Wuninitialized -Winit-self \
+ -Wstrict-aliasing=2 \
+ -Wfloat-equal \
+ -Wpointer-arith \
+ -Wbad-function-cast -Wcast-qual -Wcast-align \
+ -Waggregate-return \
+ -Wstrict-prototypes \
+ -Wmissing-noreturn -Wmissing-format-attribute \
+ -Wpacked \
+ -Wredundant-decls \
+ -Wnested-externs
+# -Wshadow \
+# -Wconversion \
+# -Wmissing-prototypes \
+# -Wmissing-declarations \
+# -Winline -Wdisabled-optimization
+DEBUGWARNFLAGS = $(DEBUGFLAGS) $(WARNFLAGS) -Wunused
CFILES = \
+ $(shell find util -type f | grep '\.c$$') \
$(shell find basis -type f | grep '\.c$$' | grep -v Real/) \
$(shell find Posix -type f | grep '\.c$$') \
gc.c \
platform.c
-HFILES = \
- gc.h \
- types.h \
- platform.h \
+HFILES = \
+ util.h \
+ $(shell find util -type f | grep '\.h$$') \
+ gc.h \
+ $(shell find gc -type f | grep '\.h$$') \
+ types.h \
+ platform.h \
platform/$(TARGET_OS).h
FILES = $(basename $(CFILES))
@@ -119,6 +143,18 @@
runtime.c: $(CFILES)
cat $(CFILES) >runtime.c
+gc.o: gc.c $(shell find gc -type f | grep '\.c$$') $(HFILES)
+ $(CC) $(CFLAGS) $(WARNFLAGS) -c -o $@ $<
+
+gc-gdb.o: gc.c $(shell find gc -type f | grep '\.c$$') $(HFILES)
+ $(CC) $(DEBUGFLAGS) $(DEBUGWARNFLAGS) -O1 -DASSERT=1 -c -o $@ $<
+
+util/%.o: util/%.c $(HFILES)
+ $(CC) $(CFLAGS) $(WARNFLAGS) -c -o $@ $<
+
+util/%-gdb.o: util/%.c $(HFILES)
+ $(CC) $(DEBUGFLAGS) $(DEBUGWARNFLAGS) -O1 -DASSERT=1 -c -o $@ $<
+
# It looks like we don't follow the C spec w.r.t. aliasing. And gcc
# -O2 catches us on the code in Real/*.c where we treat a double as a
# chunk of two words. Files that have been known to cause problems
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/getcwd.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/getcwd.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/getcwd.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -1,5 +1,5 @@
#include "platform.h"
Cstring Posix_FileSys_getcwd (Pointer buf, Size n) {
- return (Cstring)(getcwd (buf, n));
+ return (Cstring)(getcwd ((char*)buf, n));
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/readlink.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/readlink.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/readlink.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -1,5 +1,5 @@
#include "platform.h"
Int Posix_FileSys_readlink (NullString p, Pointer b, Int n) {
- return readlink ((char *) p, b, n);
+ return readlink ((char*)p, (char*)b, n);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setgroups.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setgroups.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/ProcEnv/setgroups.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -6,9 +6,9 @@
int res;
int size;
- size = GC_arrayNumElements (groups);
- ARRAY (gid_t*, list, size);
- assert (size <= cardof (list));
+ size = GC_getArrayLength (groups);
+ list = (gid_t*)(calloc_safe (size, sizeof(*list)));
+ assert (size <= (sizeof(list) / sizeof(*list)));
for (i = 0; i < size; ++i)
list[i] = ((Word*)groups)[i];
res = setgroups (size, list);
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/exece.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/exece.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/exece.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -13,9 +13,9 @@
path = (char *) p;
args = (char **) a;
env = (char **) e;
- an = GC_arrayNumElements (a) - 1;
+ an = GC_getArrayLength (a) - 1;
asaved = args[an];
- en = GC_arrayNumElements (e) - 1;
+ en = GC_getArrayLength (e) - 1;
esaved = env[en];
args[an] = (char *) NULL;
env[en] = (char *) NULL;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/execp.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/execp.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Process/execp.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -9,7 +9,7 @@
file = (char *) f;
args = (char **) a;
- n = GC_arrayNumElements (a) - 1;
+ n = GC_getArrayLength (a) - 1;
saved = args[n];
args[n] = (char *) NULL;
result = EXECVP (file, args);
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/Signal.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -17,7 +17,7 @@
Int Posix_Signal_default (Int signum) {
struct sigaction sa;
- sigdelset (&gcState.signalsHandled, signum);
+ sigdelset (GC_getSignalsHandledAddr (&gcState), signum);
memset (&sa, 0, sizeof(sa));
sa.sa_handler = SIG_DFL;
sa.sa_flags = SA_FLAGS;
@@ -27,7 +27,7 @@
bool Posix_Signal_isGCPending () {
Bool res;
- res = gcState.gcSignalIsPending;
+ res = GC_getSignalIsPending (&gcState);
if (DEBUG_SIGNALS)
fprintf (stderr, "%s = Posix_Signal_isGCPending ()\n",
boolToString (res));
@@ -35,13 +35,13 @@
}
Bool Posix_Signal_isPending (Int signum) {
- return sigismember (&gcState.signalsPending, signum);
+ return sigismember (GC_getSignalsPendingAddr (&gcState), signum);
}
Int Posix_Signal_handle (Int signum) {
static struct sigaction sa;
- sigaddset (&gcState.signalsHandled, signum);
+ sigaddset (GC_getSignalsHandledAddr (&gcState), signum);
memset (&sa, 0, sizeof(sa));
/* The mask must be full because GC_handler reads and writes
* s->signalsPending (else there is a race condition).
@@ -53,13 +53,13 @@
}
void Posix_Signal_handleGC () {
- gcState.handleGCSignal = TRUE;
+ GC_setGCSignalHandled (&gcState, TRUE);
}
Int Posix_Signal_ignore (Int signum) {
struct sigaction sa;
- sigdelset (&gcState.signalsHandled, signum);
+ sigdelset (GC_getSignalsHandledAddr (&gcState), signum);
memset (&sa, 0, sizeof(sa));
sa.sa_handler = SIG_IGN;
sa.sa_flags = SA_FLAGS;
@@ -79,8 +79,8 @@
void Posix_Signal_resetPending () {
if (DEBUG_SIGNALS)
fprintf (stderr, "Posix_Signal_resetPending ()\n");
- sigemptyset (&gcState.signalsPending);
- gcState.gcSignalIsPending = FALSE;
+ sigemptyset (GC_getSignalsPendingAddr (&gcState));
+ GC_setGCSignalPending (&gcState, FALSE);
}
static sigset_t set;
Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/assert.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/assert.h 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/assert.h 2005-11-07 02:30:53 UTC (rev 4166)
@@ -1,20 +0,0 @@
-/* Copyright (C) 2004-2005 Henry Cejtin, Matthew Fluet, Suresh
- * Jagannathan, and Stephen Weeks.
- *
- * MLton is released under a BSD-style license.
- * See the file MLton-LICENSE for details.
- */
-
-#ifndef ASSERT
-#define ASSERT 0
-#endif
-
-/* Assertion failure routine */
-extern void asfail (char *file, int line, char *prop);
-
-/* Assertion verifier */
-#if ASSERT
-#define assert(p) ((p) ? (void)0 : asfail(__FILE__, __LINE__, #p))
-#else
-#define assert(p) ((void)0)
-#endif
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Array/numElements.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Array/numElements.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Array/numElements.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -1,5 +1,5 @@
#include "platform.h"
Int Array_numElements (Pointer p) {
- return GC_arrayNumElements (p);
+ return GC_getArrayLength (p);
}
Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/basis/GC.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/GC.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/GC.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -1,29 +0,0 @@
-#define _ISOC99_SOURCE
-
-#include "platform.h"
-
-extern struct GC_state gcState;
-
-void GC_setHashConsDuringGC (Int b) {
- gcState.hashConsDuringGC = b;
-}
-
-void GC_setMessages (Int b) {
- gcState.messages = b;
-}
-
-void GC_setSummary (Int b) {
- gcState.summary = b;
-}
-
-void GC_setRusageMeasureGC (Int b) {
- gcState.rusageMeasureGC = b;
-}
-
-void MLton_GC_pack () {
- GC_pack (&gcState);
-}
-
-void MLton_GC_unpack () {
- GC_unpack (&gcState);
-}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Int/Word8Array.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Int/Word8Array.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Int/Word8Array.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -2,11 +2,11 @@
Word32 Word8Array_subWord32Rev (Pointer v, Int offset) {
Word32 w;
- char *p;
- char *s;
+ pointer p;
+ pointer s;
int i;
- p = (char*)&w;
+ p = (pointer )&w;
s = v + (offset * 4);
for (i = 0; i < 4; ++i)
p[i] = s[3 - i];
@@ -14,11 +14,11 @@
}
void Word8Array_updateWord32Rev (Pointer a, Int offset, Word32 w) {
- char *p;
- char *s;
+ pointer p;
+ pointer s;
int i;
- p = (char*)&w;
+ p = (pointer)&w;
s = a + (offset * 4);
for (i = 0; i < 4; ++i) {
s[i] = p[3 - i];
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Int/Word8Vector.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Int/Word8Vector.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Int/Word8Vector.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -2,11 +2,11 @@
Word32 Word8Vector_subWord32Rev (Pointer v, Int offset) {
Word32 w;
- char *p;
- char *s;
+ pointer p;
+ pointer s;
int i;
- p = (char*)&w;
+ p = (pointer)&w;
s = v + (offset * 4);
for (i = 0; i < 4; ++i)
p[i] = s[3 - i];
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/IntInf.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -6,27 +6,17 @@
* See the file MLton-LICENSE for details.
*/
+#define MLTON_GC_INTERNAL
#include "platform.h"
enum {
- DEBUG_INT_INF = FALSE,
+ DEBUG_INT_INF = FALSE,
};
/* Import the global gcState so we can get and set the frontier. */
extern struct GC_state gcState;
/*
- * Layout of strings. Note, the value passed around is a pointer to
- * the chars member.
- */
-typedef struct strng {
- uint counter, /* used by GC. */
- card, /* number of chars */
- magic; /* STRMAGIC */
- char chars[0]; /* actual chars */
-} strng;
-
-/*
* Test if a intInf is a fixnum.
*/
static inline uint isSmall (pointer arg) {
@@ -44,14 +34,14 @@
/*
* Convert a bignum intInf to a bignum pointer.
*/
-static inline bignum * toBignum (pointer arg) {
- bignum *bp;
+static inline GC_intInf toBignum (pointer arg) {
+ GC_intInf bp;
assert(not isSmall(arg));
- bp = (bignum *)((uint)arg - offsetof(struct bignum, isneg));
+ bp = (GC_intInf)((uint)arg - offsetof(struct GC_intInf, isneg));
if (DEBUG_INT_INF)
- fprintf (stderr, "bp->magic = 0x%08x\n", bp->magic);
- assert (bp->magic == BIGMAGIC);
+ fprintf (stderr, "bp->header = 0x%08x\n", bp->header);
+ assert (bp->header == GC_INTINF_HEADER);
return bp;
}
@@ -60,7 +50,7 @@
* to contain 2 limbs, fill in the __mpz_struct.
*/
static inline void fill (pointer arg, __mpz_struct *res, mp_limb_t space[2]) {
- bignum *bp;
+ GC_intInf bp;
if (DEBUG_INT_INF)
fprintf (stderr, "fill (0x%08x, 0x%08x, 0x%08x)\n",
@@ -78,8 +68,8 @@
res->_mp_size = 0;
} else {
bp = toBignum(arg);
- res->_mp_alloc = bp->card - 1;
- res->_mp_d = bp->limbs;
+ res->_mp_alloc = bp->length - 1;
+ res->_mp_d = (mp_limb_t*)(bp->limbs);
res->_mp_size = bp->isneg ? - res->_mp_alloc
: res->_mp_alloc;
}
@@ -89,16 +79,16 @@
* Initialize an __mpz_struct to use the space provided by an ML array.
*/
static inline void initRes (__mpz_struct *mpzp, uint bytes) {
- struct bignum *bp;
+ GC_intInf bp;
assert (bytes <= gcState.limitPlusSlop - gcState.frontier);
- bp = (bignum*)gcState.frontier;
+ bp = (GC_intInf)gcState.frontier;
/* We have as much space for the limbs as there is to the end of the
* heap. Divide by 4 to get number of words.
*/
mpzp->_mp_alloc = (gcState.limitPlusSlop - (pointer)bp->limbs) / 4;
mpzp->_mp_size = 0; /* is this necessary? */
- mpzp->_mp_d = bp->limbs;
+ mpzp->_mp_d = (mp_limb_t*)(bp->limbs);
}
/*
@@ -118,7 +108,7 @@
}
static inline void setFrontier (pointer p, uint bytes) {
- p = GC_alignFrontier (&gcState, p);
+ p = alignFrontier (&gcState, p);
assert (p - gcState.frontier <= bytes);
GC_profileAllocInc (&gcState, p - gcState.frontier);
gcState.frontier = p;
@@ -134,11 +124,11 @@
* the array size and roll the frontier slightly back.
*/
static pointer answer (__mpz_struct *ans, uint bytes) {
- bignum *bp;
+ GC_intInf bp;
int size;
- bp = (bignum *)((pointer)ans->_mp_d - offsetof(struct bignum, limbs));
- assert(ans->_mp_d == bp->limbs);
+ bp = (GC_intInf)((pointer)ans->_mp_d - offsetof(struct GC_intInf, limbs));
+ assert(ans->_mp_d == (mp_limb_t*)(bp->limbs));
size = ans->_mp_size;
if (size < 0) {
bp->isneg = TRUE;
@@ -168,10 +158,10 @@
return (pointer)(ans<<1 | 1);
}
}
- setFrontier ((pointer)&bp->limbs[size], bytes);
+ setFrontier ((pointer)(&bp->limbs[size]), bytes);
bp->counter = 0;
- bp->card = size + 1; /* +1 for isNeg word */
- bp->magic = BIGMAGIC;
+ bp->length = size + 1; /* +1 for isNeg word */
+ bp->header = GC_INTINF_HEADER;
return (pointer)&bp->isneg;
}
@@ -303,11 +293,11 @@
Word
IntInf_smallMul(Word lhs, Word rhs, pointer carry)
{
- llong prod;
+ intmax_t prod;
- prod = (llong)(int)lhs * (int)rhs;
- *(uint *)carry = (ullong)prod >> 32;
- return ((uint)(ullong)prod);
+ prod = (intmax_t)(int)lhs * (int)rhs;
+ *(uint *)carry = (uintmax_t)prod >> 32;
+ return ((uint)(uintmax_t)prod);
}
/*
@@ -346,7 +336,7 @@
* string (mutable) which is large enough.
*/
pointer IntInf_toString (pointer arg, int base, uint bytes) {
- strng *sp;
+ GC_string sp;
__mpz_struct argmpz;
mp_limb_t argspace[2];
char *str;
@@ -359,7 +349,7 @@
(uint)arg, base, bytes);
assert (base == 2 || base == 8 || base == 10 || base == 16);
fill (arg, &argmpz, argspace);
- sp = (strng*)gcState.frontier;
+ sp = (GC_string)gcState.frontier;
str = mpz_get_str(sp->chars, base, &argmpz);
assert(str == sp->chars);
size = strlen(str);
@@ -372,9 +362,9 @@
sp->chars[i] = c + ('A' - 'a');
}
sp->counter = 0;
- sp->card = size;
- sp->magic = STRMAGIC;
- setFrontier (&sp->chars[wordAlign(size)], bytes);
+ sp->length = size;
+ sp->header = GC_STRING_HEADER;
+ setFrontier ((pointer)(&sp->chars[align(size, 4)]), bytes);
return (pointer)str;
}
Copied: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/gc.c (from rev 4165, mlton/branches/on-20050822-x86_64-branch/runtime/basis/GC.c)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/GC.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/gc.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -0,0 +1,29 @@
+#define _ISOC99_SOURCE
+
+#include "platform.h"
+
+extern struct GC_state gcState;
+
+void MLton_GC_setHashConsDuringGC (Int b) {
+ GC_setHashConsDuringGC (&gcState, b);
+}
+
+void MLton_GC_setMessages (Int b) {
+ GC_setMessages (&gcState, b);
+}
+
+void MLton_GC_setSummary (Int b) {
+ GC_setSummary (&gcState, b);
+}
+
+void MLton_GC_setRusageMeasureGC (Int b) {
+ GC_setRusageMeasureGC (&gcState, b);
+}
+
+void MLton_GC_pack () {
+ GC_pack (&gcState);
+}
+
+void MLton_GC_unpack () {
+ GC_unpack (&gcState);
+}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/profile.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/profile.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/profile.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -7,7 +7,7 @@
extern struct GC_state gcState;
void MLton_Profile_Data_free (Pointer p) {
- GC_profileFree (&gcState, (GC_profile)p);
+ GC_profileFree (&gcState, (GC_profileData)p);
}
Pointer MLton_Profile_Data_malloc (void) {
@@ -17,30 +17,25 @@
void MLton_Profile_Data_write (Pointer p, Word fd) {
if (DEBUG_PROFILE)
fprintf (stderr, "MLton_Profile_Data_write (0x%08x)\n", (uint)p);
- GC_profileWrite (&gcState, (GC_profile)p, (int)fd);
+ GC_profileWrite (&gcState, (GC_profileData)p, (int)fd);
}
Pointer MLton_Profile_current (void) {
- GC_state s;
Pointer res;
- s = &gcState;
- res = (Pointer)s->profile;
+ res = (Pointer)(GC_getProfileCurrent (&gcState));
if (DEBUG_PROFILE)
fprintf (stderr, "0x%08x = MLton_Profile_current ()\n",
(uint)res);
return res;
}
-void MLton_Profile_done () {
- GC_profileDone (&gcState);
-}
-
void MLton_Profile_setCurrent (Pointer d) {
- GC_state s;
-
- s = &gcState;
if (DEBUG_PROFILE)
fprintf (stderr, "MLton_Profile_setCurrent (0x%08x)\n", (uint)d);
- s->profile = (GC_profile)d;
+ GC_setProfileCurrent (&gcState, (GC_profileData)d);
}
+
+void MLton_Profile_done () {
+ GC_profileDone (&gcState);
+}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/rusage.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/rusage.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/rusage.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -55,7 +55,7 @@
}
void MLton_Rusage_ru () {
- gc = gcState.ru_gc;
- fixedGetrusage (RUSAGE_SELF, &self);
- fixedGetrusage (RUSAGE_CHILDREN, &children);
+ gc = *(GC_getRusageGCAddr (&gcState));
+ getrusage (RUSAGE_SELF, &self);
+ getrusage (RUSAGE_CHILDREN, &children);
}
Copied: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/thread.c (from rev 4164, mlton/branches/on-20050822-x86_64-branch/runtime/basis/Thread.c)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Thread.c 2005-11-06 21:12:46 UTC (rev 4164)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/thread.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -0,0 +1,54 @@
+#include "platform.h"
+
+extern struct GC_state gcState;
+
+enum {
+ DEBUG_THREAD = FALSE,
+};
+
+Thread Thread_current () {
+ Thread t;
+
+ t = (Thread)(GC_getCurrentThread (&gcState));
+ if (DEBUG_THREAD)
+ fprintf (stderr, "0x%08x = Thread_current ()\n", (uint)t);
+ return t;
+}
+
+void Thread_finishHandler () {
+ GC_finishHandler (&gcState);
+}
+
+Thread Thread_saved () {
+ Thread t;
+
+ t = (Thread)(GC_getSavedThread (&gcState));
+ if (DEBUG_THREAD)
+ fprintf (stderr, "0x%08x = Thread_saved ()\n", (uint)t);
+ return t;
+}
+
+void Thread_setCallFromCHandler (Thread t) {
+ GC_setCallFromCHandlerThread (&gcState, (GC_thread)t);
+}
+
+void Thread_setSaved (Thread t) {
+ if (DEBUG_THREAD)
+ fprintf (stderr, "Thread_setSaved (0x%08x)\n", (uint)t);
+ GC_setSavedThread (&gcState, (GC_thread)t);
+}
+
+void Thread_setSignalHandler (Thread t) {
+ GC_setSignalHandlerThread (&gcState, (GC_thread)t);
+}
+
+void Thread_startHandler () {
+ GC_startHandler (&gcState);
+}
+
+void Thread_switchTo (Thread thread, Word ensureBytesFree) {
+ if (DEBUG_THREAD)
+ fprintf (stderr, "Thread_switchTo (0x%08x, %u)\n",
+ (uint)thread, (uint)ensureBytesFree);
+ GC_switchToThread (&gcState, (GC_thread)thread, ensureBytesFree);
+}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/world.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/world.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/world.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -3,10 +3,9 @@
extern struct GC_state gcState;
Bool World_isOriginal() {
- return gcState.isOriginal;
+ return (Bool)(GC_getAmOriginal (&gcState));
}
-
void World_makeOriginal() {
- gcState.isOriginal = TRUE;
+ GC_setAmOriginal (&gcState, TRUE);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetHostDB.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetHostDB.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetHostDB.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -49,5 +49,5 @@
}
Int NetHostDB_getHostName(Pointer buf, Int len) {
- return (gethostname (buf, len));
+ return (gethostname ((char*) buf, len));
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/PackReal.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/PackReal.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/PackReal.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -2,8 +2,8 @@
Real32 PackReal32_subVec (Pointer v, Int offset) {
Real32 r;
- char *p = (char*)&r;
- char *s = v + offset;
+ pointer p = (pointer)&r;
+ pointer s = v + offset;
int i;
for (i = 0; i < 4; ++i)
@@ -13,8 +13,8 @@
Real32 PackReal32_subVecRev (Pointer v, Int offset) {
Real32 r;
- char *p = (char*)&r;
- char *s = v + offset;
+ pointer p = (pointer)&r;
+ pointer s = v + offset;
int i;
for (i = 0; i < 4; ++i)
@@ -24,8 +24,8 @@
Real64 PackReal64_subVec (Pointer v, Int offset) {
Real64 r;
- char *p = (char*)&r;
- char *s = v + offset;
+ pointer p = (pointer)&r;
+ pointer s = v + offset;
int i;
for (i = 0; i < 8; ++i)
@@ -35,8 +35,8 @@
Real64 PackReal64_subVecRev (Pointer v, Int offset) {
Real64 r;
- char *p = (char*)&r;
- char *s = v + offset;
+ pointer p = (pointer)&r;
+ pointer s = v + offset;
int i;
for (i = 0; i < 8; ++i)
@@ -45,8 +45,8 @@
}
void PackReal32_update (Pointer a, Int offset, Real32 r) {
- char *p = (char*)&r;
- char *s = a + offset;
+ pointer p = (pointer)&r;
+ pointer s = a + offset;
int i;
for (i = 0; i < 4; ++i) {
@@ -55,8 +55,8 @@
}
void PackReal32_updateRev (Pointer a, Int offset, Real32 r) {
- char *p = (char*)&r;
- char *s = a + offset;
+ pointer p = (pointer)&r;
+ pointer s = a + offset;
int i;
for (i = 0; i < 4; ++i) {
@@ -65,8 +65,8 @@
}
void PackReal64_update (Pointer a, Int offset, Real64 r) {
- char *p = (char*)&r;
- char *s = a + offset;
+ pointer p = (pointer)&r;
+ pointer s = a + offset;
int i;
for (i = 0; i < 8; ++i) {
@@ -75,8 +75,8 @@
}
void PackReal64_updateRev (Pointer a, Int offset, Real64 r) {
- char *p = (char*)&r;
- char *s = a + offset;
+ pointer p = (pointer)&r;
+ pointer s = a + offset;
int i;
for (i = 0; i < 8; ++i) {
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Stdio.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Stdio.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Stdio.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -8,5 +8,5 @@
}
Int Stdio_sprintf (Pointer buf, Pointer fmt, Real x) {
- return sprintf (buf, (char*) fmt, x);
+ return sprintf ((char*) buf, (char*) fmt, x);
}
Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Thread.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Thread.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Thread.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -1,55 +0,0 @@
-#include "platform.h"
-
-extern struct GC_state gcState;
-
-enum {
- DEBUG_THREAD = FALSE,
-};
-
-Thread Thread_current () {
- Thread t;
-
- t = (Thread)gcState.currentThread;
- if (DEBUG_THREAD)
- fprintf (stderr, "0x%08x = Thread_current ()\n", (uint)t);
- return t;
-}
-
-void Thread_finishHandler () {
- GC_finishHandler (&gcState);
-}
-
-Thread Thread_saved () {
- Thread t;
-
- t = (Thread)gcState.savedThread;
- gcState.savedThread = (GC_thread)0x1;
- if (DEBUG_THREAD)
- fprintf (stderr, "0x%08x = Thread_saved ()\n", (uint)t);
- return t;
-}
-
-void Thread_setCallFromCHandler (Thread t) {
- gcState.callFromCHandler = (GC_thread)t;
-}
-
-void Thread_setSaved (Thread t) {
- if (DEBUG_THREAD)
- fprintf (stderr, "Thread_setSaved (0x%08x)\n", (uint)t);
- gcState.savedThread = (GC_thread)t;
-}
-
-void Thread_setHandler (Thread t) {
- gcState.signalHandler = (GC_thread)t;
-}
-
-void Thread_startHandler () {
- GC_startHandler (&gcState);
-}
-
-void Thread_switchTo (Thread thread, Word ensureBytesFree) {
- if (DEBUG_THREAD)
- fprintf (stderr, "Thread_switchTo (0x%08x, %u)\n",
- (uint)thread, (uint)ensureBytesFree);
- GC_switchToThread (&gcState, (GC_thread)thread, ensureBytesFree);
-}
Copied: mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h (from rev 4165, mlton/branches/on-20050822-x86_64-branch/runtime/platform.h)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/platform.h 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h 2005-11-07 02:30:53 UTC (rev 4166)
@@ -0,0 +1,50 @@
+/* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
+ * Jagannathan, and Stephen Weeks.
+ * Copyright (C) 1997-2000 NEC Research Institute.
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ */
+
+#ifndef _MLTON_CENV_H_
+#define _MLTON_CENV_H_
+
+#define _ISOC99_SOURCE
+#define _BSD_SOURCE
+
+/* Only enable _POSIX_C_SOURCE on platforms that don't have broken system
+ * headers.
+ */
+#if (defined (__linux__))
+#define _POSIX_C_SOURCE 200112L
+#endif
+
+/* C99-specific headers */
+#include <stddef.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <iso646.h>
+#include <stdint.h>
+#include <inttypes.h>
+#include <limits.h>
+#include <string.h>
+#include <stdio.h>
+#include <math.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include <dirent.h>
+#include <signal.h>
+#include <time.h>
+#include <utime.h>
+#include <sys/resource.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+
+
+#include "gmp.h"
+
+#endif /* _MLTON_CENV_H_ */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile 2005-11-07 02:30:53 UTC (rev 4166)
@@ -6,219 +6,8 @@
# See the file MLton-LICENSE for details.
##
-PATH = ../../bin:$(shell echo $$PATH)
+all:
-TARGET = self
-TARGET_ARCH = $(shell ../../bin/host-arch)
-TARGET_OS = $(shell ../../bin/host-os)
-GCC_VERSION = $(shell gcc -v 2>&1 | grep 'gcc version' | sed 's/.*gcc version \(.\).*/\1/')
-
-FLAGS = -fomit-frame-pointer
-
-ifeq ($(TARGET_ARCH), x86)
-ifneq ($(findstring $(GCC_VERSION), 3 4),)
-FLAGS += -falign-loops=2 -falign-jumps=2 -falign-functions=5
-else
-FLAGS += -malign-loops=2 -malign-jumps=2 -malign-functions=5
-endif
-DEFAULT_MODEL = A
-ALL_MODELS = A
-endif
-
-ifeq ($(TARGET_ARCH), amd64)
-FLAGS += -mtune=opteron
-DEFAULT_MODEL = BX
-ALL_MODELS = A AX B BX C CX G
-endif
-
-ifeq ($(TARGET_ARCH), sparc)
-FLAGS += -mv8 -m32
-endif
-
-ifeq ($(TARGET_OS), solaris)
-FLAGS += -Wa,-xarch=v8plusa -fcall-used-g5 -fcall-used-g7 -funroll-all-loops -mcpu=ultrasparc
-endif
-
-ifeq ($(TARGET), self)
-AR = ar rc
-RANLIB = ranlib
-else
-AR = $(TARGET)-ar rc
-RANLIB = $(TARGET)-ranlib
-FLAGS += -b $(TARGET)
-endif
-
-CC = gcc -std=gnu99
-CWFLAGS = -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function \
- -Wformat-nonliteral \
- -Wuninitialized -Winit-self \
- -Wstrict-aliasing=2 \
- -Wfloat-equal \
- -Wpointer-arith \
- -Wbad-function-cast -Wcast-qual -Wcast-align \
- -Waggregate-return \
- -Wstrict-prototypes \
- -Wmissing-noreturn -Wmissing-format-attribute \
- -Wpacked \
- -Wredundant-decls \
- -Wnested-externs
-# -Wshadow \
-# -Wconversion \
-# -Wmissing-prototypes \
-# -Wmissing-declarations \
-# -Winline -Wdisabled-optimization
-CFLAGS = -O2 $(CWFLAGS) -I. -D_FILE_OFFSET_BITS=64 $(FLAGS)
-DEBUGFLAGS = $(CFLAGS) -Wunused -gstabs+ -g2
-
-## Order matters, as these are concatenated together to form "libgc.c".
-CFILES = \
- gc_prefix.c \
- util.c \
- safe.c \
- read_write.c \
- rusage.c \
- debug.c \
- align.c \
- virtual-memory.c \
- array-allocate.c \
- array.c \
- atomic.c \
- call-stack.c \
- cheney-copy.c \
- controls.c \
- copy-thread.c \
- current.c \
- dfs-mark.c \
- done.c \
- enter_leave.c \
- foreach.c \
- forward.c \
- frame.c \
- garbage-collection.c \
- gc_state.c \
- generational.c \
- handler.c \
- hash-cons.c \
- heap.c \
- heap_predicates.c \
- init-world.c \
- init.c \
- invariant.c \
- mark-compact.c \
- model.c \
- model_predicates.c \
- new-object.c \
- object-size.c \
- object.c \
- object_predicates.c \
- pack.c \
- pointer.c \
- pointer_predicates.c \
- profiling.c \
- share.c \
- signals.c \
- size.c \
- sources.c \
- stack.c \
- stack_predicates.c \
- switch-thread.c \
- thread.c \
- translate.c \
- weak.c \
- world.c \
- assumptions.c \
- gc_suffix.c
-
-## Order matters, as these are concatenated together to form "libgc.h".
-HFILES = \
- gc_prefix.h \
- util.h \
- safe.h \
- rusage.h \
- virtual-memory.h \
- model.h \
- pointer.h \
- objptr.h \
- object.h \
- array.h \
- frame.h \
- stack.h \
- thread.h \
- weak.h \
- int-inf.h \
- object-size.h \
- generational.h \
- heap.h \
- current.h \
- foreach.h \
- translate.h \
- sysvals.h \
- controls.h \
- major.h \
- statistics.h \
- forward.h \
- cheney-copy.h \
- hash-cons.h \
- dfs-mark.h \
- mark-compact.h \
- invariant.h \
- atomic.h \
- enter_leave.h \
- signals.h \
- handler.h \
- switch-thread.h \
- garbage-collection.h \
- new-object.h \
- array-allocate.h \
- sources.h \
- call-stack.h \
- profiling.h \
- init-world.h \
- world.h \
- init.h \
- done.h \
- copy-thread.h \
- pack.h \
- share.h \
- size.h \
- gc_state.h \
- gc_suffix.h
-
-all: libgc.o libgc-gdb.o
-
-libgc-gdb.o: libgc.c libgc.h
- $(CC) $(DEBUGFLAGS) -DGC_MODEL_$(DEFAULT_MODEL) -O1 -DASSERT=1 -c -o $@ libgc.c
-
-libgc.o: libgc.c libgc.h
- $(CC) $(CFLAGS) -DGC_MODEL_$(DEFAULT_MODEL) -c -o $@ libgc.c
-
-libgc.c: $(CFILES)
- rm -f libgc.c
- ( \
- for f in $(CFILES); do \
- echo "#line 1 \"$$f\""; \
- cat $$f; \
- done; \
- ) > libgc.c
-
-libgc.h: $(HFILES)
- rm -f libgc.h
- ( \
- for f in $(HFILES); do \
- echo "#line 1 \"$$f\""; \
- cat $$f; \
- done; \
- ) > libgc.h
-
-.PHONY: models
-models: libgc.c libgc.h
- ( \
- for m in $(ALL_MODELS); do \
- $(CC) $(CFLAGS) -DGC_MODEL_$$m -c -o libgc.$$m.o libgc.c; \
- $(CC) $(DEBUGFLAGS) -O1 -DASSERT=1 -DGC_MODEL_$$m -c -o libgc-gdb.$$m.o libgc.c; \
- done; \
- )
-
-.PHONY: clean
+.PHONY:
clean:
../../bin/clean
Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/gc/align.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/align.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/align.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -1,49 +0,0 @@
-/* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
- * Jagannathan, and Stephen Weeks.
- * Copyright (C) 1997-2000 NEC Research Institute.
- *
- * MLton is released under a BSD-style license.
- * See the file MLton-LICENSE for details.
- */
-
-static inline bool isAligned (size_t a, size_t b) {
- return 0 == a % b;
-}
-
-static inline bool isAlignedMax (uintmax_t a, uintmax_t b) {
- return 0 == a % b;
-}
-
-static inline size_t alignDown (size_t a, size_t b) {
- assert (b >= 1);
- a -= a % b;
- assert (isAligned (a, b));
- return a;
-}
-
-static inline uintmax_t alignMaxDown (uintmax_t a, uintmax_t b) {
- assert (b >= 1);
- a -= a % b;
- assert (isAlignedMax (a, b));
- return a;
-}
-
-static inline size_t align (size_t a, size_t b) {
- assert (b >= 1);
- a += b - 1;
- a -= a % b;
- assert (isAligned (a, b));
- return a;
-}
-
-static inline uintmax_t alignMax (uintmax_t a, uintmax_t b) {
- assert (b >= 1);
- a += b - 1;
- a -= a % b;
- assert (isAligned (a, b));
- return a;
-}
-
-static inline size_t pad (GC_state s, size_t bytes, size_t extra) {
- return align (bytes + extra, s->alignment) - extra;
-}
Added: mlton/branches/on-20050822-x86_64-branch/runtime/gc/align.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/align.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/align.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -0,0 +1,27 @@
+/* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
+ * Jagannathan, and Stephen Weeks.
+ * Copyright (C) 1997-2000 NEC Research Institute.
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ */
+
+static inline size_t pad (GC_state s, size_t bytes, size_t extra) {
+ return align (bytes + extra, s->alignment) - extra;
+}
+
+
+#if ASSERT
+bool isFrontierAligned (GC_state s, pointer p) {
+ return isAligned ((size_t)p + GC_NORMAL_HEADER_SIZE,
+ s->alignment);
+}
+#endif
+
+pointer alignFrontier (GC_state s, pointer p) {
+ size_t res;
+
+ res = pad (s, (size_t)p, GC_NORMAL_HEADER_SIZE);
+ assert (isFrontierAligned (s, (pointer)res));
+ return (pointer)res;
+}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -66,3 +66,8 @@
+ nonObjptrBytesPerElement
+ pointerIndex * OBJPTR_SIZE;
}
+
+
+GC_arrayLength GC_getArrayLength (pointer a) {
+ return getArrayLength (a);
+}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/done.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/done.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/done.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -64,7 +64,7 @@
&s->cumulativeStatistics.ru_gcMinor,
s->cumulativeStatistics.numMinorGCs,
s->cumulativeStatistics.bytesCopiedMinor);
- time = currentTime () - s->startTime;
+ time = getCurrentTime () - s->startTime;
fprintf (out, "total GC time: %s ms (%.1f%%)\n",
uintmaxToCommaString (gcTime),
(0 == time)
Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/gc/done.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/done.h 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/done.h 2005-11-07 02:30:53 UTC (rev 4166)
@@ -1,9 +0,0 @@
-/* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
- * Jagannathan, and Stephen Weeks.
- * Copyright (C) 1997-2000 NEC Research Institute.
- *
- * MLton is released under a BSD-style license.
- * See the file MLton-LICENSE for details.
- */
-
-void GC_done (GC_state s);
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_prefix.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_prefix.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_prefix.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -1,5 +1,2 @@
#include "libgc.h"
-static inline size_t meg (size_t n) {
- return n / (1024ul * 1024ul);
-}
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 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.h 2005-11-07 02:30:53 UTC (rev 4166)
@@ -6,6 +6,7 @@
* See the file MLton-LICENSE for details.
*/
+#ifdef MLTON_GC_INTERNAL
struct GC_state {
size_t alignment; /* */
bool amInGC;
@@ -60,6 +61,7 @@
uint32_t vectorInitsLength;
GC_weak weaks; /* Linked list of (live) weak pointers */
};
+#endif
void displayGCState (GC_state s, FILE *stream);
Copied: mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state_exports.c (from rev 4164, mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.c)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.c 2005-11-06 21:12:46 UTC (rev 4164)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state_exports.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -0,0 +1,80 @@
+/* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
+ * Jagannathan, and Stephen Weeks.
+ * Copyright (C) 1997-2000 NEC Research Institute.
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ */
+
+bool GC_getAmOriginal (GC_state s) {
+ return s->amOriginal;
+}
+void GC_setAmOriginal (GC_state s, bool b) {
+ s->amOriginal = b;
+}
+
+void GC_setMessages (GC_state s, bool b) {
+ s->controls.messages = b;
+}
+
+void GC_setSummary (GC_state s, bool b) {
+ s->controls.summary = b;
+}
+
+void GC_setRusageMeasureGC (GC_state s, bool b) {
+ s->controls.rusageMeasureGC = b;
+}
+
+void GC_setHashConsDuringGC (GC_state s, bool b) {
+ s->hashConsDuringGC = b;
+}
+
+struct rusage* GC_getRusageGCAddr (GC_state s) {
+ return &(s->cumulativeStatistics.ru_gc);
+}
+
+sigset_t* GC_getSignalsHandledAddr (GC_state s) {
+ return &(s->signalsInfo.signalsHandled);
+}
+
+bool GC_getSignalIsPending (GC_state s) {
+ return (s->signalsInfo.signalIsPending);
+}
+
+sigset_t* GC_getSignalsPendingAddr (GC_state s) {
+ return &(s->signalsInfo.signalsPending);
+}
+
+void GC_setGCSignalHandled (GC_state s, bool b) {
+ s->signalsInfo.gcSignalHandled = b;
+}
+
+void GC_setGCSignalPending (GC_state s, bool b) {
+ s->signalsInfo.gcSignalPending = b;
+}
+
+void GC_setCallFromCHandlerThread (GC_state s, GC_thread t) {
+ objptr op = pointerToObjptr ((pointer)t, s->heap.start);
+ s->callFromCHandlerThread = op;
+}
+
+GC_thread GC_getCurrentThread (GC_state s) {
+ pointer p = objptrToPointer (s->currentThread, s->heap.start);
+ return (GC_thread)p;
+}
+
+GC_thread GC_getSavedThread (GC_state s) {
+ pointer p = objptrToPointer (s->savedThread, s->heap.start);
+ s->savedThread = BOGUS_OBJPTR;
+ return (GC_thread)p;
+}
+
+void GC_setSavedThread (GC_state s, GC_thread t) {
+ objptr op = pointerToObjptr ((pointer)t, s->heap.start);
+ s->savedThread = op;
+}
+
+void GC_setSignalHandlerThread (GC_state s, GC_thread t) {
+ objptr op = pointerToObjptr ((pointer)t, s->heap.start);
+ s->signalHandlerThread = op;
+}
Copied: mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state_exports.h (from rev 4164, mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.h)
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.h 2005-11-06 21:12:46 UTC (rev 4164)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state_exports.h 2005-11-07 02:30:53 UTC (rev 4166)
@@ -0,0 +1,28 @@
+/* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
+ * Jagannathan, and Stephen Weeks.
+ * Copyright (C) 1997-2000 NEC Research Institute.
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ */
+
+bool GC_getAmOriginal (GC_state s);
+void GC_setAmOriginal (GC_state s, bool b);
+void GC_setMessages (GC_state s, bool b);
+void GC_setSummary (GC_state s, bool b);
+void GC_setRusageMeasureGC (GC_state s, bool b);
+void GC_setHashConsDuringGC (GC_state s, bool b);
+struct rusage* GC_getRusageGCAddr (GC_state s);
+
+GC_thread GC_getCurrentThread (GC_state s);
+GC_thread GC_getSavedThread (GC_state s);
+void GC_setCallFromCHandlerThread (GC_state s, GC_thread thread);
+void GC_setSavedThread (GC_state s, GC_thread thread);
+void GC_setSignalHandlerThread (GC_state s, GC_thread thread);
+
+sigset_t* GC_getSignalsHandledAddr (GC_state s);
+bool GC_getSignalIsPending (GC_state s);
+sigset_t* GC_getSignalsPendingAddr (GC_state s);
+void GC_setGCSignalHandled (GC_state s, bool b);
+void GC_setGCSignalPending (GC_state s, bool b);
+
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_suffix.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_suffix.h 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_suffix.h 2005-11-07 02:30:53 UTC (rev 4166)
@@ -1 +0,0 @@
-#endif /* _MLTON_GC_H_ */
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/handler.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/handler.h 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/handler.h 2005-11-07 02:30:53 UTC (rev 4166)
@@ -6,7 +6,4 @@
* See the file MLton-LICENSE for details.
*/
-void GC_startHandler (GC_state s);
-void GC_finishHandler (GC_state s);
void switchToHandlerThreadIfNonAtomicAndSignalPending (GC_state s);
-void GC_handler (GC_state s, int signum);
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -198,9 +198,11 @@
}
if (s->controls.messages)
fprintf(stderr,
- "[Requested %zuM cannot be satisfied, "
- "backing off by %zuM (min size = %zuM).\n",
- meg (h->size), meg (backoff), meg (minSize));
+ "[Requested %s cannot be satisfied, "
+ "backing off by %s (min size = %s).\n",
+ sizeToBytesApproxString (h->size),
+ sizeToBytesApproxString (backoff),
+ sizeToBytesApproxString (minSize));
}
h->size = 0;
return FALSE;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/int-inf.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/int-inf.h 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/int-inf.h 2005-11-07 02:30:53 UTC (rev 4166)
@@ -6,6 +6,9 @@
* See the file MLton-LICENSE for details.
*/
+/* Layout of intInfs.
+ * Note, the value passed around is a pointer to the isneg member.
+ */
typedef struct GC_intInf {
GC_arrayCounter counter;
GC_arrayLength length;
@@ -13,3 +16,5 @@
uint32_t isneg;
uint32_t *limbs;
} *GC_intInf;
+
+#define GC_INTINF_HEADER GC_WORD32_VECTOR_HEADER
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/invariant.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/invariant.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/invariant.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -65,7 +65,7 @@
foreachObjptrInRange (s, s->heap.nursery, &s->frontier,
assertIsObjptrInFromSpace, FALSE);
/* Current thread. */
- GC_stack stack = getStackCurrent(s);
+ __attribute__ ((unused)) GC_stack stack = getStackCurrent(s);
assert (isStackReservedAligned (s, stack->reserved));
assert (s->stackBottom == getStackBottom (s, stack));
assert (s->stackTop == getStackTop (s, stack));
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/mark-compact.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/mark-compact.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/mark-compact.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -10,19 +10,35 @@
/* Jonkers Mark-compact Collection */
/* ---------------------------------------------------------------- */
-/* An object pointer might be larger than a header.
- */
void copyForThreadInternal (pointer dst, pointer src) {
- size_t count;
- assert (0 == (OBJPTR_SIZE % GC_HEADER_SIZE));
- count = (OBJPTR_SIZE - GC_HEADER_SIZE) / GC_HEADER_SIZE;
- src = src + GC_HEADER_SIZE * count;
+ if (OBJPTR_SIZE > GC_HEADER_SIZE) {
+ size_t count;
- for (size_t i = 0; i <= count; i++) {
+ assert (0 == (OBJPTR_SIZE % GC_HEADER_SIZE));
+ count = (OBJPTR_SIZE - GC_HEADER_SIZE) / GC_HEADER_SIZE;
+ src = src + GC_HEADER_SIZE * count;
+
+ for (size_t i = 0; i <= count; i++) {
+ *((GC_header*)dst) = *((GC_header*)src);
+ dst += GC_HEADER_SIZE;
+ src -= GC_HEADER_SIZE;
+ }
+ } else if (GC_HEADER_SIZE > OBJPTR_SIZE) {
+ size_t count;
+
+ assert (0 == (GC_HEADER_SIZE % OBJPTR_SIZE));
+ count = (GC_HEADER_SIZE - OBJPTR_SIZE) / OBJPTR_SIZE;
+ dst = dst + OBJPTR_SIZE * count;
+
+ for (size_t i = 0; i <= count; i++) {
+ *((objptr*)dst) = *((objptr*)src);
+ dst -= OBJPTR_SIZE;
+ src += OBJPTR_SIZE;
+ }
+
+ } else /* (GC_HEADER_SIZE == OBJPTR_SIZE) */ {
*((GC_header*)dst) = *((GC_header*)src);
- dst += GC_HEADER_SIZE;
- src -= GC_HEADER_SIZE;
}
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h 2005-11-07 02:30:53 UTC (rev 4166)
@@ -135,7 +135,9 @@
manageable set for users.
*/
-#if (defined (GC_MODEL_A))
+#if (defined (MLTON_GC_INTERNAL))
+
+#if (defined (GC_MODEL_A) || defined (GC_MODEL_NATIVE32))
#define GC_MODEL_BITSIZE 32
#define GC_MODEL_SHIFT 0
#define GC_MODEL_USEBASE FALSE
@@ -195,7 +197,7 @@
#define GC_MODEL_SHIFT 0
#define GC_MODEL_USEBASE TRUE
#define GC_MODEL_MINALIGN_SHIFT 2
-#elif (defined (GC_MODEL_G))
+#elif (defined (GC_MODEL_G) || defined (GC_MODEL_NATIVE64))
#define GC_MODEL_BITSIZE 64
#define GC_MODEL_SHIFT 0
#define GC_MODEL_USEBASE FALSE
@@ -205,3 +207,5 @@
#endif
#define GC_MODEL_NONOBJPTR ((GC_MODEL_MINALIGN_SHIFT - GC_MODEL_SHIFT) > 0)
#define GC_MODEL_MINALIGN TWOPOWER(GC_MODEL_MINALIGN_SHIFT)
+
+#endif /* (defined (MLTON_GC_INTERNAL)) */
Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/gc/model_predicates.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/model_predicates.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/model_predicates.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -1,18 +0,0 @@
-/* Copyright (C) 2005-2005 Henry Cejtin, Matthew Fluet, Suresh
- * Jagannathan, and Stephen Weeks.
- *
- * MLton is released under a BSD-style license.
- * See the file MLton-LICENSE for details.
- */
-
-/* isObjptr returns true if p looks like an object pointer. */
-bool isObjptr (objptr p) {
- if GC_MODEL_NONOBJPTR {
- unsigned int shift = GC_MODEL_MINALIGN_SHIFT - GC_MODEL_SHIFT;
- objptr mask = ~((~((objptr)0)) << shift);
- return (0 == (p & mask));
- } else {
- return TRUE;
- }
-}
-
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.c 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.c 2005-11-07 02:30:53 UTC (rev 4166)
@@ -86,17 +86,6 @@
*numObjptrsRet = numObjptrs;
}
-pointer alignFrontier (GC_state s, pointer p) {
- size_t res;
-
- res = pad (s, (size_t)p, GC_NORMAL_HEADER_SIZE);
- if (DEBUG_STACKS)
- fprintf (stderr, FMTPTR" = alignFrontier ("FMTPTR")\n",
- (uintptr_t)p, (uintptr_t)res);
- assert (isFrontierAligned (s, (pointer)res));
- return (pointer)res;
-}
-
/* advanceToObjectData (s, p)
*
* If p points at the beginning of an object, then advanceToObjectData
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h 2005-11-06 21:26:45 UTC (rev 4165)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h 2005-11-07 02:30:53 UTC (rev 4166)
@@ -122,7 +122,6 @@
uint16_t *numNonObjptrsRet, uint16_t *numObjptrsRet);
bool isFr...
[truncated message content] |