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
|
Oct
|
Nov
|
Dec
|
From: Matthew F. <fl...@ml...> - 2005-09-09 16:29:52
|
(Mostly) converted cheneyCopy; missing rusage and card/cross map stuff ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile U mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.c U mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.h A mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c A mlton/branches/on-20050822-x86_64-branch/runtime/gc/major.h A mlton/branches/on-20050822-x86_64-branch/runtime/gc/statistics.h ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile 2005-09-09 22:48:09 UTC (rev 4084) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile 2005-09-09 23:29:50 UTC (rev 4085) @@ -89,6 +89,8 @@ stack.h \ thread.h \ weak.h \ + major.h \ + statistics.h \ heap.h \ gc_state.h \ gc_suffix.h Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.c 2005-09-09 22:48:09 UTC (rev 4084) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.c 2005-09-09 23:29:50 UTC (rev 4085) @@ -183,7 +183,7 @@ s->weaks = NULL; } -static inline void swapSemis (GC_state s) { +static inline void swapHeaps (GC_state s) { struct GC_heap tempHeap; tempHeap = s->secondaryHeap; @@ -196,46 +196,47 @@ /* return s->summary; */ /* } */ -/* static void cheneyCopy (GC_state s) { */ -/* struct rusage ru_start; */ -/* pointer toStart; */ +static void majorCheneyCopyGC (GC_state s) { + // struct rusage ru_start; + pointer toStart; -/* assert (s->heap2.size >= s->oldGenSize); */ -/* if (detailedGCTime (s)) */ -/* startTiming (&ru_start); */ -/* s->numCopyingGCs++; */ -/* s->toSpace = s->secondaryHeap.start; */ -/* s->toLimit = s->secondaryHeap.start + s->secondaryHeap.size; */ -/* if (DEBUG or s->messages) { */ -/* fprintf (stderr, "Major copying GC.\n"); */ -/* fprintf (stderr, "fromSpace = 0x%08x of size %s\n", */ -/* (uint) s->heap.start, */ -/* uintToCommaString (s->heap.size)); */ -/* fprintf (stderr, "toSpace = 0x%08x of size %s\n", */ -/* (uint) s->heap2.start, */ -/* uintToCommaString (s->heap2.size)); */ -/* } */ -/* assert (s->heap2.start != (void*)NULL); */ -/* /\* The next assert ensures there is enough space for the copy to succeed. */ -/* * It does not assert (s->heap2.size >= s->heap.size) because that */ -/* * is too strong. */ -/* *\/ */ -/* assert (s->heap2.size >= s->oldGenSize); */ -/* toStart = alignFrontier (s, s->heap2.start); */ -/* s->back = toStart; */ -/* foreachGlobal (s, forward); */ -/* foreachPointerInRange (s, toStart, &s->back, TRUE, forward); */ -/* updateWeaks (s); */ -/* s->oldGenSize = s->back - s->heap2.start; */ -/* s->bytesCopied += s->oldGenSize; */ -/* if (DEBUG) */ -/* fprintf (stderr, "%s bytes live.\n", */ -/* uintToCommaString (s->oldGenSize)); */ -/* swapSemis (s); */ -/* clearCrossMap (s); */ -/* s->lastMajor = GC_COPYING; */ -/* if (detailedGCTime (s)) */ -/* stopTiming (&ru_start, &s->ru_gcCopy); */ -/* if (DEBUG or s->messages) */ -/* fprintf (stderr, "Major copying GC done.\n"); */ -/* } */ + assert (s->secondaryHeap.totalBytes >= s->heap.oldGenBytes); +/* if (detailedGCTime (s)) */ +/* startTiming (&ru_start); */ + s->cumulative.numCopyingGCs++; + forwardState.toStart = s->secondaryHeap.start; + forwardState.toLimit = s->secondaryHeap.start + s->secondaryHeap.totalBytes; + if (DEBUG or s->messages) { + fprintf (stderr, "Major copying GC.\n"); + fprintf (stderr, "fromSpace = "FMTPTR" of size %zd\n", + (uintptr_t) s->heap.start, + /*uintToCommaString*/(s->heap.totalBytes)); + fprintf (stderr, "toSpace = "FMTPTR" of size %zd\n", + (uintptr_t) s->secondaryHeap.start, + /*uintToCommaString*/(s->secondaryHeap.totalBytes)); + } + assert (s->secondaryHeap.start != (pointer)NULL); + /* The next assert ensures there is enough space for the copy to + * succeed. It does not assert + * (s->secondaryHeap.totalBytes >= s->heap.totalByes) + * because that is too strong. + */ + assert (s->secondaryHeap.totalBytes >= s->heap.oldGenBytes); + toStart = alignFrontier (s, s->secondaryHeap.start); + forwardState.back = toStart; + foreachGlobalObjptr (s, forward); + foreachObjptrInRange (s, toStart, &forwardState.back, TRUE, forward); + updateWeaks (s); + s->secondaryHeap.oldGenBytes = forwardState.back - s->secondaryHeap.start; + s->cumulative.bytesCopied += s->secondaryHeap.oldGenBytes; + if (DEBUG) + fprintf (stderr, "%zd bytes live.\n", + /*uintToCommaString*/(s->secondaryHeap.oldGenBytes)); + swapHeaps (s); + // clearCrossMap (s); + s->lastMajor.kind = GC_COPYING; +/* if (detailedGCTime (s)) */ +/* stopTiming (&ru_start, &s->ru_gcCopy); */ + if (DEBUG or s->messages) + fprintf (stderr, "Major copying GC done.\n"); +} 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-09-09 22:48:09 UTC (rev 4084) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.h 2005-09-09 23:29:50 UTC (rev 4085) @@ -4,6 +4,7 @@ bool amInGC; bool amInMinorGC; objptr callFromCHandler; /* Handler for exported C calls (in heap). */ + struct GC_cumulativeStatistics cumulative; objptr currentThread; /* Currently executing thread (in heap). */ GC_frameLayout *frameLayouts; /* Array of frame layouts. */ uint32_t frameLayoutsSize; /* Cardinality of frameLayouts array. */ @@ -11,6 +12,7 @@ objptr *globals; uint32_t globalsSize; struct GC_heap heap; + struct GC_lastMajorStatistics lastMajor; pointer limit; /* limit = heap.start + heap.totalBytes */ uint32_t maxFrameSize; GC_objectType *objectTypes; /* Array of object types. */ @@ -24,6 +26,7 @@ pointer stackBottom; /* Bottom of stack in current thread. */ pointer stackTop; /* Top of stack in current thread. */ /*Bool*/bool summary; /* Print a summary of gc info when program exits. */ + /*Bool*/bool messages; /* Print a message at the start and end of each gc. */ float threadShrinkRatio; GC_weak weaks; /* Linked list of (live) weak pointers */ } *GC_state; Added: mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c 2005-09-09 22:48:09 UTC (rev 4084) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.c 2005-09-09 23:29:50 UTC (rev 4085) @@ -0,0 +1,47 @@ +/* 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. + */ + +static inline bool pointerIsInHeap (GC_state s, pointer p) { + return (not (isPointer (p)) + or (s->heap.start <= p + and p < s->frontier)); +} + +static inline bool objptrIsInHeap (GC_state s, objptr op) { + pointer p; + if (not (isObjptr(op))) + return TRUE; + p = objptrToPointer (op, s->heap.start); + return pointerIsInHeap (s, p); +} + +static inline bool pointerIsInOldGen (GC_state s, pointer p) { + return (not (isPointer (p)) + or (s->heap.start <= p + and p < s->heap.start + s->heap.oldGenBytes)); +} + +static inline bool objptrIsInOldGen (GC_state s, objptr op) { + pointer p; + if (not (isObjptr(op))) + return TRUE; + p = objptrToPointer (op, s->heap.start); + return pointerIsInOldGen (s, p); +} + +static inline bool pointerIsInNursery (GC_state s, pointer p) { + return (not (isPointer (p)) + or (s->heap.nursery <= p and p < s->frontier)); +} + +static inline bool objptrIsInNursery (GC_state s, objptr op) { + pointer p; + if (not (isObjptr(op))) + return TRUE; + p = objptrToPointer (op, s->heap.start); + return pointerIsInNursery (s, p); +} Copied: mlton/branches/on-20050822-x86_64-branch/runtime/gc/major.h (from rev 4078, mlton/branches/on-20050822-x86_64-branch/runtime/gc.h) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc.h 2005-09-07 00:47:05 UTC (rev 4078) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/major.h 2005-09-09 23:29:50 UTC (rev 4085) @@ -0,0 +1,12 @@ +/* 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. + */ + +typedef enum { + GC_COPYING, + GC_MARK_COMPACT, +} GC_MajorKind; Copied: mlton/branches/on-20050822-x86_64-branch/runtime/gc/statistics.h (from rev 4078, mlton/branches/on-20050822-x86_64-branch/runtime/gc.h) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc.h 2005-09-07 00:47:05 UTC (rev 4078) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/statistics.h 2005-09-09 23:29:50 UTC (rev 4085) @@ -0,0 +1,40 @@ +/* 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. + */ + +struct GC_cumulativeStatistics { + uintmax_t bytesAllocated; + uintmax_t bytesCopied; + uintmax_t bytesCopiedMinor; + uintmax_t bytesHashConsed; + uintmax_t bytesMarkCompacted; + + size_t maxBytesLive; + size_t maxHeapSizeSeen; + size_t maxStackSizeSeen; + + uintmax_t minorBytesScanned; + uintmax_t minorBytesSkipped; + + uintmax_t numLimitChecks; + + unsigned int numCopyingGCs; + unsigned int numHashConsGCs; + unsigned int numMarkCompactGCs; + unsigned int numMinorGCs; + +/* struct rusage ru_gc; /\* total resource usage spent in gc *\/ */ +/* struct rusage ru_gcCopy; /\* resource usage in major copying gcs. *\/ */ +/* struct rusage ru_gcMarkCompact; /\* resource usage in mark-compact gcs. *\/ */ +/* struct rusage ru_gcMinor; /\* resource usage in minor gcs. *\/ */ +}; + +struct GC_lastMajorStatistics { + size_t bytesLive; /* Number of bytes live at most recent major GC. */ + GC_MajorKind kind; + unsigned int numMinorsGCs; +}; |
From: Matthew F. <fl...@ml...> - 2005-09-09 15:48:11
|
Filling in forward assertion predicates ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile U mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.c U mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.h U mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.h U mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.h ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile 2005-09-09 21:56:06 UTC (rev 4083) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile 2005-09-09 22:48:09 UTC (rev 4084) @@ -71,6 +71,7 @@ frame.c \ stack.c \ thread.c \ + heap.c \ foreach.c \ cheney-copy.c \ assumptions.c \ Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.c 2005-09-09 21:56:06 UTC (rev 4083) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.c 2005-09-09 22:48:09 UTC (rev 4084) @@ -19,12 +19,33 @@ */ struct forwardState { pointer back; - pointer fromBase; - pointer toBase; + pointer toStart; pointer toLimit; }; static struct forwardState forwardState; +static inline bool pointerIsInFromSpace (GC_state s, pointer p) { + return (pointerIsInOldGen (s, p) or pointerIsInNursery (s, p)); +} + +static inline bool objptrIsInFromSpace (GC_state s, objptr op) { + return (objptrIsInOldGen (s, op) or objptrIsInNursery (s, op)); +} + +static inline bool pointerIsInToSpace (pointer p) { + return (not (isPointer (p)) + or (forwardState.toStart <= p and p < forwardState.toLimit)); +} + +static inline bool objptrIsInToSpace (objptr op) { + pointer p; + + if (not (isObjptr (op))) + return TRUE; + p = objptrToPointer (op, forwardState.toStart); + return pointerIsInToSpace (p); +} + static inline void forward (GC_state s, objptr *opp) { objptr op; pointer p; @@ -32,12 +53,12 @@ GC_objectTypeTag tag; op = *opp; - p = objptrToPointer (op, forwardState.fromBase); + p = objptrToPointer (op, s->heap.start); if (DEBUG_DETAILED) fprintf (stderr, "forward opp = "FMTPTR" op = "FMTOBJPTR" p = "FMTPTR"\n", (uintptr_t)opp, op, (uintptr_t)p); - // assert (isInFromSpace (s, *pp)); + assert (objptrIsInFromSpace (s, *opp)); header = getHeader (p); if (DEBUG_DETAILED and header == GC_FORWARDED) fprintf (stderr, " already FORWARDED\n"); @@ -82,18 +103,17 @@ if (new <= stack->reserved) { stack->reserved = new; if (DEBUG_STACKS) - fprintf (stderr, "Shrinking stack to size %"PRId32".\n", + fprintf (stderr, "Shrinking stack to size %zd.\n", /*uintToCommaString*/(stack->reserved)); } } } else { - /* Shrink heap stacks. - */ + /* Shrink heap stacks. */ stack->reserved = stackReserved (s, maxZ((size_t)(s->threadShrinkRatio * stack->reserved), stack->used)); if (DEBUG_STACKS) - fprintf (stderr, "Shrinking stack to size %"PRId32".\n", + fprintf (stderr, "Shrinking stack to size %zd.\n", /*uintToCommaString*/(stack->reserved)); } objectBytes = sizeof (struct GC_stack) + stack->used; @@ -115,7 +135,7 @@ (uintptr_t)w); if (isObjptr (w->objptr) and (not s->amInMinorGC - or isInNursery (s, w->objptr))) { + or objptrIsInNursery (s, w->objptr))) { if (DEBUG_WEAK) fprintf (stderr, "linking\n"); w->link = s->weaks; @@ -127,14 +147,14 @@ } /* Store the forwarding pointer in the old object. */ *(GC_header*)(p - GC_HEADER_SIZE) = GC_FORWARDED; - *(objptr*)p = pointerToObjptr(forwardState.back + headerBytes, forwardState.toBase); + *(objptr*)p = pointerToObjptr(forwardState.back + headerBytes, forwardState.toStart); /* Update the back of the queue. */ forwardState.back += size + skip; assert (isAligned ((uintptr_t)forwardState.back + GC_NORMAL_HEADER_SIZE, s->alignment)); } *opp = *(objptr*)p; - // assert (isInToSpace (s, *opp)); + assert (objptrIsInToSpace (*opp)); } static inline void updateWeaks (GC_state s) { @@ -146,7 +166,7 @@ if (DEBUG_WEAK) fprintf (stderr, "updateWeaks w = "FMTPTR" ", (uintptr_t)w); - p = objptrToPointer (w->objptr, forwardState.fromBase); + p = objptrToPointer (w->objptr, s->heap.start); if (GC_FORWARDED == getHeader (p)) { if (DEBUG_WEAK) fprintf (stderr, "forwarded from "FMTOBJPTR" to "FMTOBJPTR"\n", 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-09-09 21:56:06 UTC (rev 4083) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.h 2005-09-09 22:48:09 UTC (rev 4084) @@ -7,9 +7,11 @@ objptr currentThread; /* Currently executing thread (in heap). */ GC_frameLayout *frameLayouts; /* Array of frame layouts. */ uint32_t frameLayoutsSize; /* Cardinality of frameLayouts array. */ + pointer frontier; /* heap.start <= frontier < limit */ objptr *globals; uint32_t globalsSize; struct GC_heap heap; + pointer limit; /* limit = heap.start + heap.totalBytes */ uint32_t maxFrameSize; GC_objectType *objectTypes; /* Array of object types. */ uint32_t objectTypesSize; /* Cardinality of objectTypes array. */ Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.h 2005-09-09 21:56:06 UTC (rev 4083) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.h 2005-09-09 22:48:09 UTC (rev 4084) @@ -10,14 +10,16 @@ * All ML objects (including ML execution stacks) are allocated in a * contiguous heap. The heap has the following general layout: * - * --------------------------------------------------- - * | | - * --------------------------------------------------- - * ^ - * start + * --------------------------------------------------- + * | old generation | | nursery | + * --------------------------------------------------- + * ^ ^ + * start nursery */ typedef struct GC_heap { - size_t numBytes; /* size of heap */ - pointer start; /* start of heap */ + pointer nursery; /* start of nursery */ + size_t oldGenBytes; /* size of old generation */ + pointer start; /* start of heap (and old generation) */ + size_t totalBytes; /* size of heap */ } *GC_heap; Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.h 2005-09-09 21:56:06 UTC (rev 4083) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.h 2005-09-09 22:48:09 UTC (rev 4084) @@ -37,11 +37,11 @@ /* reserved is the number of bytes reserved for stack, * i.e. its maximum size. */ - uint32_t reserved; + size_t reserved; /* used is the number of bytes used by the stack. * Stacks with used == reserved are continuations. */ - uint32_t used; + size_t used; /* The next address is the bottom of the stack, and the following * reserved bytes hold space for the stack. */ |
From: Matthew F. <fl...@ml...> - 2005-09-09 14:56:13
|
Include more gcc warnings ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile U 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/assumptions.c U mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.c U mlton/branches/on-20050822-x86_64-branch/runtime/gc/foreach.c U mlton/branches/on-20050822-x86_64-branch/runtime/gc/frame.c U mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.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 U mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.c ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile 2005-09-09 05:50:10 UTC (rev 4082) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile 2005-09-09 21:56:06 UTC (rev 4083) @@ -49,8 +49,15 @@ endif CC = gcc -std=gnu99 -CFLAGS = -O2 -Wall -I. -D_FILE_OFFSET_BITS=64 $(FLAGS) -DEBUGFLAGS = $(CFLAGS) -gstabs+ -g2 +CWFLAGS = -Wall -pedantic -Wextra -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wconversion -Wsign-compare -Wstrict-prototypes -Wredundant-decls -Winline +CWFLAGS = -pedantic -Wall -Wextra -Wno-unused \ + -Wshadow -Wredundant-decls \ + -Wpointer-arith -Wcast-qual -Wcast-align \ +## -Wconversion \ + -Wstrict-prototypes \ + -Winline +CFLAGS = -O2 $(CWFLAGS) -I. -D_FILE_OFFSET_BITS=64 $(FLAGS) +DEBUGFLAGS = $(CFLAGS) -Wunused -gstabs+ -g2 ## Order matters, as these are concatenated together to form "gc.c". CFILES = \ Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/align.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/align.c 2005-09-09 05:50:10 UTC (rev 4082) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/align.c 2005-09-09 21:56:06 UTC (rev 4083) @@ -7,7 +7,6 @@ */ static inline size_t align (size_t a, size_t b) { - assert (a >= 0); assert (b >= 1); a += b - 1; a -= a % b; Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.c 2005-09-09 05:50:10 UTC (rev 4082) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.c 2005-09-09 21:56:06 UTC (rev 4083) @@ -21,13 +21,15 @@ SPLIT_HEADER(); assert (tag == ARRAY_TAG); + size_t nonObjptrBytesPerElement = + numNonObjptrsToBytes(numNonObjptrs, ARRAY_TAG); size_t bytesPerElement = - numNonObjptrsToBytes(numNonObjptrs, ARRAY_TAG) + nonObjptrBytesPerElement + (numObjptrs * OBJPTR_SIZE); return a + arrayIndex * bytesPerElement - + numNonObjptrsToBytes(numNonObjptrs, tag) + + nonObjptrBytesPerElement + pointerIndex * OBJPTR_SIZE; } #endif Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/assumptions.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/assumptions.c 2005-09-09 05:50:10 UTC (rev 4082) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/assumptions.c 2005-09-09 21:56:06 UTC (rev 4083) @@ -11,7 +11,7 @@ * but which are reasonable to assume on a wide variety of target * platforms. Working around these assumptions would be difficult. */ -void checkAssumptions () { +void checkAssumptions (void) { assert(CHAR_BIT == 8); /* assert(repof(uintptr_t) == TWOS); */ } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.c 2005-09-09 05:50:10 UTC (rev 4082) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.c 2005-09-09 21:56:06 UTC (rev 4083) @@ -90,7 +90,7 @@ /* Shrink heap stacks. */ stack->reserved = - stackReserved (s, maxZ(s->threadShrinkRatio * stack->reserved, + stackReserved (s, maxZ((size_t)(s->threadShrinkRatio * stack->reserved), stack->used)); if (DEBUG_STACKS) fprintf (stderr, "Shrinking stack to size %"PRId32".\n", @@ -106,7 +106,7 @@ /* If the object has a valid weak pointer, link it into the weaks * for update after the copying GC is done. */ - if (WEAK_TAG == tag and numObjptrs == 1) { + if ((WEAK_TAG == tag) and (numObjptrs == 1)) { GC_weak w; w = (GC_weak)(forwardState.back + GC_NORMAL_HEADER_SIZE); Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/foreach.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/foreach.c 2005-09-09 05:50:10 UTC (rev 4082) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/foreach.c 2005-09-09 21:56:06 UTC (rev 4083) @@ -153,7 +153,7 @@ fprintf (stderr, " top = "FMTPTR" return address = "FMTPTR"\n", (uintptr_t)top, returnAddress); } - frameLayout = getFrameLayout (s, returnAddress); + frameLayout = getFrameLayoutFromReturnAddress (s, returnAddress); frameOffsets = frameLayout->offsets; top -= frameLayout->numBytes; for (i = 0 ; i < frameOffsets[0] ; ++i) { Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/frame.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/frame.c 2005-09-09 05:50:10 UTC (rev 4082) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/frame.c 2005-09-09 21:56:06 UTC (rev 4083) @@ -6,7 +6,8 @@ * See the file MLton-LICENSE for details. */ -static inline uint32_t getFrameIndex (GC_state s, GC_returnAddress ra) { +static inline uint32_t +getFrameIndexFromReturnAddress (GC_state s, GC_returnAddress ra) { uint32_t res; res = s->returnAddressToFrameIndex (ra); @@ -16,19 +17,27 @@ return res; } -static inline GC_frameLayout * getFrameLayout (GC_state s, GC_returnAddress ra) { +static inline GC_frameLayout * +getFrameLayoutFromFrameIndex (GC_state s, uint32_t index) { GC_frameLayout *layout; - uint32_t index; - index = getFrameIndex (s, ra); if (DEBUG_DETAILED) fprintf (stderr, - "returnAddress = "FMTRA - " index = %"PRIx32 + "index = %"PRIx32 " frameLayoutsSize = %"PRIu16"\n", - ra, index, s->frameLayoutsSize); - assert (0 <= index and index < s->frameLayoutsSize); + index, s->frameLayoutsSize); + assert (index < s->frameLayoutsSize); layout = &(s->frameLayouts[index]); assert (layout->numBytes > 0); return layout; } + +static inline GC_frameLayout * +getFrameLayoutFromReturnAddress (GC_state s, GC_returnAddress ra) { + GC_frameLayout *layout; + uint32_t index; + + index = getFrameIndexFromReturnAddress (s, ra); + layout = getFrameLayoutFromFrameIndex(s, index); + return layout; +} Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.c 2005-09-09 05:50:10 UTC (rev 4082) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.c 2005-09-09 21:56:06 UTC (rev 4083) @@ -73,6 +73,6 @@ static inline void storeObjptrFromPointer (pointer OP, pointer P, pointer B) { *((objptr*)OP) = pointerToObjptr (P, B); } -static inline size_t objptrSize () { +static inline size_t objptrSize (void) { return OBJPTR_SIZE; } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.c 2005-09-09 05:50:10 UTC (rev 4082) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.c 2005-09-09 21:56:06 UTC (rev 4083) @@ -22,13 +22,12 @@ #define SPLIT_HEADER() \ do { \ - int objectTypeIndex; \ + unsigned int objectTypeIndex; \ GC_objectType *t; \ \ - assert (1 == (header & 1)); \ + assert (1 == (header & GC_VALID_HEADER_MASK)); \ objectTypeIndex = (header & TYPE_INDEX_MASK) >> TYPE_INDEX_SHIFT; \ - assert (0 <= objectTypeIndex \ - and objectTypeIndex < s->objectTypesSize); \ + assert (objectTypeIndex < s->objectTypesSize); \ t = &s->objectTypes [objectTypeIndex]; \ tag = t->tag; \ hasIdentity = t->hasIdentity; \ Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h 2005-09-09 05:50:10 UTC (rev 4082) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h 2005-09-09 21:56:06 UTC (rev 4083) @@ -30,18 +30,18 @@ #define GC_HEADER_SIZE sizeof(GC_header) #define PRIxHDR PRIx32 #define FMTHDR "0x%08"PRIxHDR -enum { - TYPE_INDEX_BITS = 19, - TYPE_INDEX_MASK = 0x000FFFFE, - TYPE_INDEX_SHIFT = 1, - COUNTER_BITS = 10, - COUNTER_MASK = 0x7FF00000, - COUNTER_SHIFT = 20, - MARK_BITS = 1, - MARK_MASK = 0x80000000, - MARK_SHIFT = 31 -}; +#define GC_VALID_HEADER_MASK ((GC_header)0x1) +#define TYPE_INDEX_BITS 19 +#define TYPE_INDEX_MASK 0x000FFFFE +#define TYPE_INDEX_SHIFT 1 +#define COUNTER_BITS 10 +#define COUNTER_MASK 0x7FF00000 +#define COUNTER_SHIFT 20 +#define MARK_BITS 1 +#define MARK_MASK 0x80000000 +#define MARK_SHIFT 3 + /* getHeaderp (p) * * Returns a pointer to the header for the object pointed to by p. Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.c 2005-09-09 05:50:10 UTC (rev 4082) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.c 2005-09-09 21:56:06 UTC (rev 4083) @@ -47,9 +47,9 @@ static inline uint32_t topFrameIndex (GC_state s, GC_stack stack) { uint32_t res; - res = getFrameIndex (s, - *(GC_returnAddress*) - (stackTop (s, stack) - GC_RETURNADDRESS_SIZE)); + res = + getFrameIndexFromReturnAddress + (s, *(GC_returnAddress*)(stackTop (s, stack) - GC_RETURNADDRESS_SIZE)); if (DEBUG_PROFILE) fprintf (stderr, "topFrameIndex = %"PRIu32"\n", res); return res; @@ -58,7 +58,7 @@ static inline GC_frameLayout * topFrameLayout (GC_state s, GC_stack stack) { GC_frameLayout *layout; - layout = getFrameLayout (s, topFrameIndex (s, stack)); + layout = getFrameLayoutFromFrameIndex (s, topFrameIndex (s, stack)); return layout; } |
From: Stephen W. <sw...@ml...> - 2005-09-08 22:50:17
|
MAIL fixed bug in flexible record type inference The bug was tickled by the following program. val g = fn {...} => () and h = fn () => () val () = (h (); g {a = 13}) The bug showed as an IL type error indicating that "h" was applied to the wrong number of type arguments. The problem was that the declaration of "h" expected one type argument but the application had none. The extra type variable arises because of the generalized flexrecord in the type of g (note that the bug goes away without the "and"). The bug was that type variable was not instantiated at the use of "h" because the genflex did not occur in the type of h. Prior to r3799, this would have raised an internal bug message ("missing flexInst"), and indeed this is what happens if you run MLton 20041109 on the example. However, in r3799, we removed the bug message and replaced it with code that would silently continue, under the mistaken impression that any genflexrecord must have had an instance, or the user code must have already shown a type error. This fix missed exactly the case above. The correct fix is to instantiate *all* genflexrecords that occur in any type in the declaration, whether or not they actually occur in the type of the function. In the simple case above, that means that h does get the extra type argument (unit) corresponding to the flexible record field "a" in the argument to "g". This fix also handles the problem that led to r3799, because the missing flexinst will still be silently instantiated. As a side note, only Poly/ML and MLton are able to infer the simple example above. Hamlet, Moscow ML, ML Kit, and SML/NJ all report unresolved flexible record types. ---------------------------------------------------------------------- U mlton/trunk/doc/changelog U mlton/trunk/mlton/elaborate/type-env.fun U mlton/trunk/regression/flexrecord.sml ---------------------------------------------------------------------- Modified: mlton/trunk/doc/changelog =================================================================== --- mlton/trunk/doc/changelog 2005-09-09 05:27:33 UTC (rev 4081) +++ mlton/trunk/doc/changelog 2005-09-09 05:50:10 UTC (rev 4082) @@ -1,5 +1,9 @@ Here are the changes since version 20041109. +* 2005-09-08 + - Fixed bug in type inference of flexible records that would show up + as "Type error: variable applied to wrong number of type args" + * 2005-09-06 - Fixed bug in Real.signBit, which had assumed that the underlying C signbit returned 0 or 1, when in fact any nonzero value is Modified: mlton/trunk/mlton/elaborate/type-env.fun =================================================================== --- mlton/trunk/mlton/elaborate/type-env.fun 2005-09-09 05:27:33 UTC (rev 4081) +++ mlton/trunk/mlton/elaborate/type-env.fun 2005-09-09 05:50:10 UTC (rev 4082) @@ -1488,42 +1488,46 @@ (List.fold (flexes, Vector.toList types, fn ({fields, spine, ...}, ac) => - Exn.withEscape (fn escape => let - val flex = - case List.peek (flexInsts, - fn {spine = spine', ...} => - Spine.equals (spine, spine')) of - NONE => escape ac (* Error.bug "missing flexInst" *) - | SOME {flex, ...} => flex - fun peekFields (fields, f) = - Option.map - (List.peek (fields, fn (f', _) => - Field.equals (f, f')), - #2) - val peek = - case Type.toType flex of - FlexRecord {fields, ...} => - (fn f => peekFields (fields, f)) - | GenFlexRecord {extra, fields, ...} => - (fn f => - case peekFields (fields, f) of - NONE => - Option.map - (List.peek - (extra (), fn {field, ...} => - Field.equals (f, field)), - Type.var o #tyvar) - | SOME t => SOME t) - | Record r => (fn f => Srecord.peek (r, f)) - | _ => Error.bug "TypeEnv.instantiate': General:strange flexInst" + fun done peek = + Spine.foldOverNew + (spine, fields, ac, fn (f, ac) => + (case peek f of + NONE => Type.unit + | SOME t => t) :: ac) in - Spine.foldOverNew - (spine, fields, ac, fn (f, ac) => - (case peek f of - NONE => Type.unit - | SOME t => t) :: ac) - end))) + case List.peek (flexInsts, + fn {spine = spine', ...} => + Spine.equals (spine, spine')) of + NONE => done (fn _ => NONE) + | SOME {flex, ...} => + let + fun peekFields (fields, f) = + Option.map + (List.peek (fields, fn (f', _) => + Field.equals (f, f')), + #2) + in + done + (case Type.toType flex of + FlexRecord {fields, ...} => + (fn f => peekFields (fields, f)) + | GenFlexRecord {extra, fields, ...} => + (fn f => + case peekFields (fields, f) of + NONE => + Option.map + (List.peek + (extra (), + fn {field, ...} => + Field.equals (f, field)), + Type.var o #tyvar) + | SOME t => SOME t) + | Record r => + (fn f => Srecord.peek (r, f)) + | _ => Error.bug "TypeEnv.instantiate': General:strange flexInst") + end + end)) in {args = args, instance = ty} Modified: mlton/trunk/regression/flexrecord.sml =================================================================== --- mlton/trunk/regression/flexrecord.sml 2005-09-09 05:27:33 UTC (rev 4081) +++ mlton/trunk/regression/flexrecord.sml 2005-09-09 05:50:10 UTC (rev 4082) @@ -93,3 +93,9 @@ () end (* flexrecord8 *) + +(* flexrecord9 *) +val g = fn {...} => () +and h = fn () => () +val () = (h (); g {a = 13}) +(* flexrecord9 *) |
From: Stephen W. <sw...@ml...> - 2005-09-08 22:27:34
|
Added mlton-flags. ---------------------------------------------------------------------- U mlton/trunk/ide/emacs/mlton.el ---------------------------------------------------------------------- Modified: mlton/trunk/ide/emacs/mlton.el =================================================================== --- mlton/trunk/ide/emacs/mlton.el 2005-09-09 02:56:17 UTC (rev 4080) +++ mlton/trunk/ide/emacs/mlton.el 2005-09-09 05:27:33 UTC (rev 4081) @@ -10,6 +10,7 @@ ;; markers so that file edits don't interfere with locating subsequent errros. (setq mlton-command "mlton") +(setq mlton-flags "") (setq mlton-main-file "mlton-main-file undefined") (setq mlton-output-buffer "*mlton-output*") (setq mlton-errors nil) @@ -95,6 +96,7 @@ (kill-buffer mlton-output-buffer)) (find-file mlton-main-file) (shell-command (concat mlton-command + " " mlton-flags " " " -stop tc " (file-name-nondirectory mlton-main-file)) mlton-output-buffer) |
From: Matthew F. <fl...@ml...> - 2005-09-08 19:56:22
|
Converted forward and updateWeaks ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile U mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.c U mlton/branches/on-20050822-x86_64-branch/runtime/gc/foreach.c 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 U mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h U mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.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 U mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.c U mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.h A mlton/branches/on-20050822-x86_64-branch/runtime/gc/thread.c U mlton/branches/on-20050822-x86_64-branch/runtime/gc/util.h U mlton/branches/on-20050822-x86_64-branch/runtime/gc/weak.h ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile 2005-09-09 01:04:14 UTC (rev 4079) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile 2005-09-09 02:56:17 UTC (rev 4080) @@ -56,14 +56,16 @@ CFILES = \ gc_prefix.c \ debug.c \ + align.c \ pointer.c \ - align.c \ model.c \ object.c \ array.c \ frame.c \ stack.c \ + thread.c \ foreach.c \ + cheney-copy.c \ assumptions.c \ gc_suffix.c Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.c 2005-09-09 01:04:14 UTC (rev 4079) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.c 2005-09-09 02:56:17 UTC (rev 4080) @@ -10,200 +10,212 @@ /* Cheney Copying Collection */ /* ---------------------------------------------------------------- */ -/* forward (s, pp) forwards the object pointed to by *pp and updates *pp to - * point to the new object. +#define GC_FORWARDED ~((GC_header)0) + +/* forward (s, opp) + * Forwards the object pointed to by *opp and updates *opp to point to + * the new object. * It also updates the crossMap. */ -static inline void forward (GC_state s, pointer *pp) { +struct forwardState { + pointer back; + pointer fromBase; + pointer toBase; + pointer toLimit; +}; +static struct forwardState forwardState; + +static inline void forward (GC_state s, objptr *opp) { + objptr op; pointer p; - GC_ObjectHeader header; - GC_ObjectTypeTag tag; + GC_header header; + GC_objectTypeTag tag; + op = *opp; + p = objptrToPointer (op, forwardState.fromBase); if (DEBUG_DETAILED) - fprintf (stderr, - "forward pp = 0x"PRIxPTR" *pp = 0x"PRIxPTR"\n", - pp, *pp); - assert (isInFromSpace (s, *pp)); - p = *pp; - header = GC_getHeader (p); - if (DEBUG_DETAILED and FORWARDED == header) - fprintf (stderr, "already FORWARDED\n"); - if (header != FORWARDED) { /* forward the object */ - Bool hasIdentity; - uint headerBytes, objectBytes, size, skip; - uint numPointers, numNonPointers; + fprintf (stderr, + "forward opp = "FMTPTR" op = "FMTOBJPTR" p = "FMTPTR"\n", + (uintptr_t)opp, op, (uintptr_t)p); + // assert (isInFromSpace (s, *pp)); + header = getHeader (p); + if (DEBUG_DETAILED and header == GC_FORWARDED) + fprintf (stderr, " already FORWARDED\n"); + if (header != GC_FORWARDED) { /* forward the object */ + bool hasIdentity; + uint16_t numNonObjptrs, numObjptrs; + size_t headerBytes, objectBytes, size, skip; - /* Compute the space taken by the header and object body. */ - SPLIT_HEADER(); - if (NORMAL_TAG == tag) { /* Fixed size object. */ - headerBytes = GC_NORMAL_HEADER_SIZE; - objectBytes = toBytes (numPointers + numNonPointers); - skip = 0; - } else if (ARRAY_TAG == tag) { - headerBytes = GC_ARRAY_HEADER_SIZE; - objectBytes = arrayNumBytes (s, p, numPointers, - numNonPointers); - skip = 0; - } else if (WEAK_TAG == tag) { - headerBytes = GC_NORMAL_HEADER_SIZE; - objectBytes = sizeof (struct GC_weak); - skip = 0; - } else { /* Stack. */ - GC_stack stack; + /* Compute the space taken by the header and object body. */ + SPLIT_HEADER(); + if ((NORMAL_TAG == tag) or (WEAK_TAG == tag)) { /* Fixed size object. */ + headerBytes = GC_NORMAL_HEADER_SIZE; + objectBytes = + numNonObjptrsToBytes(numNonObjptrs, NORMAL_TAG) + + (numObjptrs * OBJPTR_SIZE); + skip = 0; + } else if (ARRAY_TAG == tag) { + headerBytes = GC_ARRAY_HEADER_SIZE; + objectBytes = arrayNumBytes (s, p, numObjptrs, numNonObjptrs); + skip = 0; + } else { /* Stack. */ + GC_stack stack; - assert (STACK_TAG == tag); - headerBytes = STACK_HEADER_SIZE; - stack = (GC_stack)p; + assert (STACK_TAG == tag); + headerBytes = GC_STACK_HEADER_SIZE; + stack = (GC_stack)p; - if (s->currentThread->stack == stack) { - /* Shrink stacks that don't use a lot - * of their reserved space; - * but don't violate the stack invariant. - */ - if (stack->used <= stack->reserved / 4) { - uint new = stackReserved (s, max (stack->reserved / 2, - stackNeedsReserved (s, stack))); - /* It's possible that new > stack->reserved if - * the stack invariant is violated. In that case, - * we want to leave the stack alone, because some - * other part of the gc will grow the stack. We - * cannot do any growing here because we may run - * out of to space. - */ - if (new <= stack->reserved) { - stack->reserved = new; - if (DEBUG_STACKS) - fprintf (stderr, "Shrinking stack to size %s.\n", - uintToCommaString (stack->reserved)); - } - } - } else { - /* Shrink heap stacks. - */ - stack->reserved = stackReserved (s, max(s->threadShrinkRatio * stack->reserved, - stack->used)); - if (DEBUG_STACKS) - fprintf (stderr, "Shrinking stack to size %s.\n", - uintToCommaString (stack->reserved)); - } - objectBytes = sizeof (struct GC_stack) + stack->used; - skip = stack->reserved - stack->used; - } - size = headerBytes + objectBytes; - assert (s->back + size + skip <= s->toLimit); - /* Copy the object. */ - copy (p - headerBytes, s->back, size); - /* If the object has a valid weak pointer, link it into the weaks - * for update after the copying GC is done. - */ - if (WEAK_TAG == tag and 1 == numPointers) { - GC_weak w; - - w = (GC_weak)(s->back + GC_NORMAL_HEADER_SIZE); - if (DEBUG_WEAK) - fprintf (stderr, "forwarding weak 0x%08x ", - (uint)w); - if (GC_isPointer (w->object) - and (not s->amInMinorGC - or isInNursery (s, w->object))) { - if (DEBUG_WEAK) - fprintf (stderr, "linking\n"); - w->link = s->weaks; - s->weaks = w; - } else { - if (DEBUG_WEAK) - fprintf (stderr, "not linking\n"); - } - } - /* Store the forwarding pointer in the old object. */ - *(word*)(p - WORD_SIZE) = FORWARDED; - *(pointer*)p = s->back + headerBytes; - /* Update the back of the queue. */ - s->back += size + skip; - assert (isAligned ((uint)s->back + GC_NORMAL_HEADER_SIZE, - s->alignment)); + if (currentThreadStack(s) == op) { + /* Shrink stacks that don't use a lot of their reserved space; + * but don't violate the stack invariant. + */ + if (stack->used <= stack->reserved / 4) { + size_t new = + stackReserved (s, maxZ (stack->reserved / 2, + stackNeedsReserved (s, stack))); + /* It's possible that new > stack->reserved if the stack + * invariant is violated. In that case, we want to leave the + * stack alone, because some other part of the gc will grow + * the stack. We cannot do any growing here because we may + * run out of to space. + */ + if (new <= stack->reserved) { + stack->reserved = new; + if (DEBUG_STACKS) + fprintf (stderr, "Shrinking stack to size %"PRId32".\n", + /*uintToCommaString*/(stack->reserved)); + } } - *pp = *(pointer*)p; - assert (isInToSpace (s, *pp)); + } else { + /* Shrink heap stacks. + */ + stack->reserved = + stackReserved (s, maxZ(s->threadShrinkRatio * stack->reserved, + stack->used)); + if (DEBUG_STACKS) + fprintf (stderr, "Shrinking stack to size %"PRId32".\n", + /*uintToCommaString*/(stack->reserved)); + } + objectBytes = sizeof (struct GC_stack) + stack->used; + skip = stack->reserved - stack->used; + } + size = headerBytes + objectBytes; + assert (forwardState.back + size + skip <= forwardState.toLimit); + /* Copy the object. */ + copy (p - headerBytes, forwardState.back, size); + /* If the object has a valid weak pointer, link it into the weaks + * for update after the copying GC is done. + */ + if (WEAK_TAG == tag and numObjptrs == 1) { + GC_weak w; + + w = (GC_weak)(forwardState.back + GC_NORMAL_HEADER_SIZE); + if (DEBUG_WEAK) + fprintf (stderr, "forwarding weak "FMTPTR" ", + (uintptr_t)w); + if (isObjptr (w->objptr) + and (not s->amInMinorGC + or isInNursery (s, w->objptr))) { + if (DEBUG_WEAK) + fprintf (stderr, "linking\n"); + w->link = s->weaks; + s->weaks = w; + } else { + if (DEBUG_WEAK) + fprintf (stderr, "not linking\n"); + } + } + /* Store the forwarding pointer in the old object. */ + *(GC_header*)(p - GC_HEADER_SIZE) = GC_FORWARDED; + *(objptr*)p = pointerToObjptr(forwardState.back + headerBytes, forwardState.toBase); + /* Update the back of the queue. */ + forwardState.back += size + skip; + assert (isAligned ((uintptr_t)forwardState.back + GC_NORMAL_HEADER_SIZE, + s->alignment)); + } + *opp = *(objptr*)p; + // assert (isInToSpace (s, *opp)); } -static void updateWeaks (GC_state s) { - GC_weak w; +static inline void updateWeaks (GC_state s) { + pointer p; + GC_weak w; - for (w = s->weaks; w != NULL; w = w->link) { - assert ((pointer)BOGUS_POINTER != w->object); + for (w = s->weaks; w != NULL; w = w->link) { + assert (BOGUS_OBJPTR != w->objptr); - if (DEBUG_WEAK) - fprintf (stderr, "updateWeaks w = 0x%08x ", (uint)w); - if (FORWARDED == GC_getHeader ((pointer)w->object)) { - if (DEBUG_WEAK) - fprintf (stderr, "forwarded from 0x%08x to 0x%08x\n", - (uint)w->object, - (uint)*(pointer*)w->object); - w->object = *(pointer*)w->object; - } else { - if (DEBUG_WEAK) - fprintf (stderr, "cleared\n"); - *(GC_getHeaderp((pointer)w)) = WEAK_GONE_HEADER; - w->object = (pointer)BOGUS_POINTER; - } - } - s->weaks = NULL; + if (DEBUG_WEAK) + fprintf (stderr, "updateWeaks w = "FMTPTR" ", (uintptr_t)w); + p = objptrToPointer (w->objptr, forwardState.fromBase); + if (GC_FORWARDED == getHeader (p)) { + if (DEBUG_WEAK) + fprintf (stderr, "forwarded from "FMTOBJPTR" to "FMTOBJPTR"\n", + w->objptr, + *(objptr*)p); + w->objptr = *(objptr*)p; + } else { + if (DEBUG_WEAK) + fprintf (stderr, "cleared\n"); + *(getHeaderp(p)) = WEAK_GONE_HEADER; + w->objptr = BOGUS_OBJPTR; + } + } + s->weaks = NULL; } -static void swapSemis (GC_state s) { +static inline void swapSemis (GC_state s) { struct GC_heap tempHeap; tempHeap = s->secondaryHeap; s->secondaryHeap = s->heap; s->heap = tempHeap; - setCardMapForMutator (s); + // setCardMapForMutator (s); } -static inline bool detailedGCTime (GC_state s) { - return s->summary; -} +/* static inline bool detailedGCTime (GC_state s) { */ +/* return s->summary; */ +/* } */ -static void cheneyCopy (GC_state s) { - struct rusage ru_start; - pointer toStart; +/* static void cheneyCopy (GC_state s) { */ +/* struct rusage ru_start; */ +/* pointer toStart; */ - assert (s->heap2.size >= s->oldGenSize); - if (detailedGCTime (s)) - startTiming (&ru_start); - s->numCopyingGCs++; - s->toSpace = s->secondaryHeap.start; - s->toLimit = s->secondaryHeap.start + s->secondaryHeap.size; - if (DEBUG or s->messages) { - fprintf (stderr, "Major copying GC.\n"); - fprintf (stderr, "fromSpace = 0x%08x of size %s\n", - (uint) s->heap.start, - uintToCommaString (s->heap.size)); - fprintf (stderr, "toSpace = 0x%08x of size %s\n", - (uint) s->heap2.start, - uintToCommaString (s->heap2.size)); - } - assert (s->heap2.start != (void*)NULL); - /* The next assert ensures there is enough space for the copy to succeed. - * It does not assert (s->heap2.size >= s->heap.size) because that - * is too strong. - */ - assert (s->heap2.size >= s->oldGenSize); - toStart = alignFrontier (s, s->heap2.start); - s->back = toStart; - foreachGlobal (s, forward); - foreachPointerInRange (s, toStart, &s->back, TRUE, forward); - updateWeaks (s); - s->oldGenSize = s->back - s->heap2.start; - s->bytesCopied += s->oldGenSize; - if (DEBUG) - fprintf (stderr, "%s bytes live.\n", - uintToCommaString (s->oldGenSize)); - swapSemis (s); - clearCrossMap (s); - s->lastMajor = GC_COPYING; - if (detailedGCTime (s)) - stopTiming (&ru_start, &s->ru_gcCopy); - if (DEBUG or s->messages) - fprintf (stderr, "Major copying GC done.\n"); -} +/* assert (s->heap2.size >= s->oldGenSize); */ +/* if (detailedGCTime (s)) */ +/* startTiming (&ru_start); */ +/* s->numCopyingGCs++; */ +/* s->toSpace = s->secondaryHeap.start; */ +/* s->toLimit = s->secondaryHeap.start + s->secondaryHeap.size; */ +/* if (DEBUG or s->messages) { */ +/* fprintf (stderr, "Major copying GC.\n"); */ +/* fprintf (stderr, "fromSpace = 0x%08x of size %s\n", */ +/* (uint) s->heap.start, */ +/* uintToCommaString (s->heap.size)); */ +/* fprintf (stderr, "toSpace = 0x%08x of size %s\n", */ +/* (uint) s->heap2.start, */ +/* uintToCommaString (s->heap2.size)); */ +/* } */ +/* assert (s->heap2.start != (void*)NULL); */ +/* /\* The next assert ensures there is enough space for the copy to succeed. */ +/* * It does not assert (s->heap2.size >= s->heap.size) because that */ +/* * is too strong. */ +/* *\/ */ +/* assert (s->heap2.size >= s->oldGenSize); */ +/* toStart = alignFrontier (s, s->heap2.start); */ +/* s->back = toStart; */ +/* foreachGlobal (s, forward); */ +/* foreachPointerInRange (s, toStart, &s->back, TRUE, forward); */ +/* updateWeaks (s); */ +/* s->oldGenSize = s->back - s->heap2.start; */ +/* s->bytesCopied += s->oldGenSize; */ +/* if (DEBUG) */ +/* fprintf (stderr, "%s bytes live.\n", */ +/* uintToCommaString (s->oldGenSize)); */ +/* swapSemis (s); */ +/* clearCrossMap (s); */ +/* s->lastMajor = GC_COPYING; */ +/* if (detailedGCTime (s)) */ +/* stopTiming (&ru_start, &s->ru_gcCopy); */ +/* if (DEBUG or s->messages) */ +/* fprintf (stderr, "Major copying GC done.\n"); */ +/* } */ Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/foreach.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/foreach.c 2005-09-09 01:04:14 UTC (rev 4079) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/foreach.c 2005-09-09 02:56:17 UTC (rev 4080) @@ -6,18 +6,20 @@ * See the file MLton-LICENSE for details. */ -typedef void (*GC_pointerFun) (GC_state s, objptr *pp); +typedef void (*GC_foreachObjptrFun) (GC_state s, objptr *opp); -static inline void maybeCall (GC_pointerFun f, GC_state s, objptr *pp) { - if (isObjptr (*pp)) - f (s, pp); +static inline void maybeCall (GC_foreachObjptrFun f, + GC_state s, objptr *opp) { + if (isObjptr (*opp)) + f (s, opp); } /* foreachGlobalObjptr (s, f) * * Apply f to each global object pointer into the heap. */ -static inline void foreachGlobalObjptr (GC_state s, GC_pointerFun f) { +static inline void foreachGlobalObjptr (GC_state s, + GC_foreachObjptrFun f) { for (unsigned int i = 0; i < s->globalsSize; ++i) { if (DEBUG_DETAILED) fprintf (stderr, "foreachGlobal %u\n", i); @@ -42,7 +44,7 @@ static inline pointer foreachObjptrInObject (GC_state s, pointer p, bool skipWeaks, - GC_pointerFun f) { + GC_foreachObjptrFun f) { bool hasIdentity; GC_header header; uint16_t numNonObjptrs; @@ -183,7 +185,7 @@ pointer front, pointer *back, bool skipWeaks, - GC_pointerFun f) { + GC_foreachObjptrFun f) { pointer b; assert (isAlignedFrontier (s, front)); 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-09-09 01:04:14 UTC (rev 4079) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_prefix.c 2005-09-09 02:56:17 UTC (rev 4080) @@ -1 +1,5 @@ #include "gc.h" + +static inline size_t maxZ (size_t x, size_t y) { + return ((x < y) ? x : y); +} 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-09-09 01:04:14 UTC (rev 4079) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.h 2005-09-09 02:56:17 UTC (rev 4080) @@ -1,6 +1,8 @@ typedef struct GC_state { size_t alignment; /* */ + bool amInGC; + bool amInMinorGC; objptr callFromCHandler; /* Handler for exported C calls (in heap). */ objptr currentThread; /* Currently executing thread (in heap). */ GC_frameLayout *frameLayouts; /* Array of frame layouts. */ @@ -8,6 +10,7 @@ objptr *globals; uint32_t globalsSize; struct GC_heap heap; + uint32_t maxFrameSize; GC_objectType *objectTypes; /* Array of object types. */ uint32_t objectTypesSize; /* Cardinality of objectTypes array. */ uint32_t (*returnAddressToFrameIndex) (GC_returnAddress ra); @@ -16,6 +19,9 @@ */ struct GC_heap secondaryHeap; /* Used for major copying collection. */ objptr signalHandler; /* Handler for signals (in heap). */ + pointer stackBottom; /* Bottom of stack in current thread. */ + pointer stackTop; /* Top of stack in current thread. */ /*Bool*/bool summary; /* Print a summary of gc info when program exits. */ + float threadShrinkRatio; GC_weak weaks; /* Linked list of (live) weak pointers */ } *GC_state; Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h 2005-09-09 01:04:14 UTC (rev 4079) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h 2005-09-09 02:56:17 UTC (rev 4080) @@ -217,7 +217,7 @@ #define FMTOBJPTR "0x%016"PRIxOBJPTR #if GC_MODEL_NONPTR -#define BOGUS_OBJPTR 0x1 +#define BOGUS_OBJPTR (objptr)0x1 #else #error gc model does not admit bogus object pointer #endif Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h 2005-09-09 01:04:14 UTC (rev 4079) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h 2005-09-09 02:56:17 UTC (rev 4080) @@ -50,7 +50,7 @@ return (GC_header*)(p - GC_HEADER_SIZE); } -/* GC_getHeader (p) +/* getHeader (p) * * Returns the header for the object pointed to by p. */ Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/pointer.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/pointer.c 2005-09-09 01:04:14 UTC (rev 4079) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/pointer.c 2005-09-09 02:56:17 UTC (rev 4080) @@ -11,3 +11,22 @@ uintptr_t mask = ~((~((uintptr_t)0)) << GC_MODEL_MINALIGN_SHIFT); return (0 == ((uintptr_t)p & mask)); } + +static inline void copy (pointer src, pointer dst, size_t size) { + unsigned int *to, *from, *limit; + + if (DEBUG_DETAILED) + fprintf (stderr, "copy ("FMTPTR", "FMTPTR", %zu)\n", + (uintptr_t)src, (uintptr_t)dst, size); + assert (isAligned ((uintptr_t)src, sizeof(unsigned int))); + assert (isAligned ((uintptr_t)dst, sizeof(unsigned int))); + assert (isAligned (size, sizeof(unsigned int))); + assert (dst <= src or src + size <= dst); + if (src == dst) + return; + from = (unsigned int*)src; + to = (unsigned int*)dst; + limit = (unsigned int*)(src + size); + until (from == limit) + *to++ = *from++; +} Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/pointer.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/pointer.h 2005-09-09 01:04:14 UTC (rev 4079) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/pointer.h 2005-09-09 02:56:17 UTC (rev 4080) @@ -9,4 +9,4 @@ typedef unsigned char* pointer; #define POINTER_SIZE sizeof(pointer); #define FMTPTR "0x%016"PRIxPTR -#define BOGUS_POINTER 0x1 +#define BOGUS_POINTER (pointer)0x1 Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.c 2005-09-09 01:04:14 UTC (rev 4079) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.c 2005-09-09 02:56:17 UTC (rev 4080) @@ -6,6 +6,31 @@ * See the file MLton-LICENSE for details. */ +static inline bool stackIsEmpty (GC_stack stack) { + return 0 == stack->used; +} + +/* stackSlop returns the amount of "slop" space needed between the top + * of the stack and the end of the stack space. + */ +static inline size_t stackSlop (GC_state s) { + return (size_t)(2 * s->maxFrameSize); +} + +static inline size_t initialStackSize (GC_state s) { + return stackSlop (s); +} + +static inline size_t stackBytes (GC_state s, size_t size) { + size_t res; + + res = align (GC_STACK_HEADER_SIZE + sizeof (struct GC_stack) + size, + s->alignment); + if (DEBUG_STACKS) + fprintf (stderr, "%zu = stackBytes (%zu)\n", res, size); + return res; +} + static inline pointer stackBottom (GC_state s, GC_stack stack) { pointer res; @@ -18,3 +43,42 @@ static inline pointer stackTop (GC_state s, GC_stack stack) { return stackBottom (s, stack) + stack->used; } + +static inline uint32_t topFrameIndex (GC_state s, GC_stack stack) { + uint32_t res; + + res = getFrameIndex (s, + *(GC_returnAddress*) + (stackTop (s, stack) - GC_RETURNADDRESS_SIZE)); + if (DEBUG_PROFILE) + fprintf (stderr, "topFrameIndex = %"PRIu32"\n", res); + return res; +} + +static inline GC_frameLayout * topFrameLayout (GC_state s, GC_stack stack) { + GC_frameLayout *layout; + + layout = getFrameLayout (s, topFrameIndex (s, stack)); + return layout; +} + +static inline uint16_t topFrameSize (GC_state s, GC_stack stack) { + GC_frameLayout *layout; + + assert (not (stackIsEmpty (stack))); + layout = topFrameLayout (s, stack); + return layout->numBytes; +} + +static inline size_t stackReserved (GC_state s, size_t r) { + size_t res; + + res = pad (s, r, GC_STACK_HEADER_SIZE + sizeof (struct GC_stack)); + if (DEBUG_STACKS) + fprintf (stderr, "%zu = stackReserved (%zu)\n", res, r); + return res; +} + +static inline size_t stackNeedsReserved (GC_state s, GC_stack stack) { + return stack->used + stackSlop (s) - topFrameSize(s, stack); +} Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.h 2005-09-09 01:04:14 UTC (rev 4079) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.h 2005-09-09 02:56:17 UTC (rev 4080) @@ -46,4 +46,5 @@ * reserved bytes hold space for the stack. */ } *GC_stack; +#define GC_STACK_HEADER_SIZE GC_HEADER_SIZE #define GC_STACK_SIZE sizeof(struct GC_stack); Copied: mlton/branches/on-20050822-x86_64-branch/runtime/gc/thread.c (from rev 4078, mlton/branches/on-20050822-x86_64-branch/runtime/gc.c) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc.c 2005-09-07 00:47:05 UTC (rev 4078) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/thread.c 2005-09-09 02:56:17 UTC (rev 4080) @@ -0,0 +1,17 @@ +/* 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 GC_thread currentThread (GC_state s) { + pointer p = objptrToPointer(s->currentThread, s->heap.start); + return (GC_thread)p; +} + +static inline objptr currentThreadStack (GC_state s) { + GC_thread ct = currentThread (s); + return ct->stack; +} Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/util.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/util.h 2005-09-09 01:04:14 UTC (rev 4079) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/util.h 2005-09-09 02:56:17 UTC (rev 4080) @@ -36,6 +36,7 @@ #define FALSE (not TRUE) #endif #define unless(p) if (not (p)) +#define until(p) while (not (p)) /* issue error message and exit */ extern void die (char *fmt, ...) Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/weak.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/weak.h 2005-09-09 01:04:14 UTC (rev 4079) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/weak.h 2005-09-09 02:56:17 UTC (rev 4080) @@ -29,5 +29,5 @@ typedef struct GC_weak { uint32_t unused; struct GC_weak *link; - objptr object; + objptr objptr; } *GC_weak; |
From: Matthew F. <fl...@ml...> - 2005-09-08 18:04:19
|
Through foreachObjptrInObject ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile U mlton/branches/on-20050822-x86_64-branch/runtime/gc/TODO U 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/array.h U mlton/branches/on-20050822-x86_64-branch/runtime/gc/foreach.c A mlton/branches/on-20050822-x86_64-branch/runtime/gc/frame.c U mlton/branches/on-20050822-x86_64-branch/runtime/gc/frame.h U mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.h U mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.h U mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.c U mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.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 A mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.c U mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.h ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile 2005-09-07 00:47:05 UTC (rev 4078) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile 2005-09-09 01:04:14 UTC (rev 4079) @@ -61,6 +61,8 @@ model.c \ object.c \ array.c \ + frame.c \ + stack.c \ foreach.c \ assumptions.c \ gc_suffix.c @@ -73,8 +75,8 @@ model.h \ object.h \ array.h \ + frame.h \ stack.h \ - frame.h \ thread.h \ weak.h \ heap.h \ Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/TODO =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/TODO 2005-09-07 00:47:05 UTC (rev 4078) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/TODO 2005-09-09 01:04:14 UTC (rev 4079) @@ -11,3 +11,7 @@ the word after the header to get GC_weak to overlay properly. * what type should be used for the size field in GC_heap? I'm using size_t currently, since that is the type needed by malloc. +* I don't believe the comment concerning exnStack and the native + codegen in thread.h is still true; it used to be the case when + GC_switchToThread was implemented in codegens. Now it should + be implemented in Backend. Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/align.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/align.c 2005-09-07 00:47:05 UTC (rev 4078) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/align.c 2005-09-09 01:04:14 UTC (rev 4079) @@ -6,7 +6,7 @@ * See the file MLton-LICENSE for details. */ -static inline uintptr_t align (uintptr_t a, uintptr_t b) { +static inline size_t align (size_t a, size_t b) { assert (a >= 0); assert (b >= 1); a += b - 1; @@ -28,12 +28,12 @@ } */ -static bool isAligned (uintptr_t a, size_t b) { +static inline bool isAligned (uintptr_t a, size_t b) { return 0 == a % b; } #if ASSERT -static bool isAlignedFrontier (GC_state s, pointer p) { +static inline bool isAlignedFrontier (GC_state s, pointer p) { return isAligned ((uintptr_t)p + GC_NORMAL_HEADER_SIZE, s->alignment); } @@ -49,15 +49,15 @@ return align (bytes + extra, s->alignment) - extra; } -/* static inline pointer alignFrontier (GC_state s, pointer p) { - return (pointer) pad (s, (uintptr_t)p, GC_NORMAL_HEADER_SIZE); + return (pointer) pad (s, (size_t)p, GC_NORMAL_HEADER_SIZE); } pointer GC_alignFrontier (GC_state s, pointer p) { return alignFrontier (s, p); } +/* static inline uint stackReserved (GC_state s, uint r) { uint 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-09-07 00:47:05 UTC (rev 4078) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.c 2005-09-09 01:04:14 UTC (rev 4079) @@ -7,17 +7,17 @@ */ #if ASSERT -static pointer arrayPointer (GC_state s, - pointer a, - uint32_t arrayIndex, - uint32_t pointerIndex) { +static inline pointer arrayIndexAtPointer (GC_state s, + pointer a, + uint32_t arrayIndex, + uint32_t pointerIndex) { bool hasIdentity; GC_header header; uint16_t numNonObjptrs; uint16_t numObjptrs; GC_objectTypeTag tag; - header = GC_getHeader (a); + header = getHeader (a); SPLIT_HEADER(); assert (tag == ARRAY_TAG); @@ -41,7 +41,7 @@ GC_arrayLength numElements; size_t result; - numElements = GC_arrayNumElements (p); + numElements = arrayNumElements (p); bytesPerElement = numNonObjptrsToBytes(numNonObjptrs, ARRAY_TAG) + (numObjptrs * OBJPTR_SIZE); Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.h 2005-09-07 00:47:05 UTC (rev 4078) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.h 2005-09-09 01:04:14 UTC (rev 4079) @@ -19,16 +19,14 @@ * individual layout as normal objects, omitting the header word. */ typedef uint32_t GC_arrayLength; -enum { - GC_ARRAY_LENGTH_SIZE = sizeof(GC_arrayLength), - GC_ARRAY_COUNTER_SIZE = GC_ARRAY_LENGTH_SIZE, - GC_ARRAY_HEADER_SIZE = GC_ARRAY_COUNTER_SIZE + GC_ARRAY_LENGTH_SIZE + GC_HEADER_SIZE, -}; +#define GC_ARRAY_LENGTH_SIZE sizeof(GC_arrayLength) +#define GC_ARRAY_COUNTER_SIZE GC_ARRAY_LENGTH_SIZE +#define GC_ARRAY_HEADER_SIZE (GC_ARRAY_COUNTER_SIZE + GC_ARRAY_LENGTH_SIZE + GC_HEADER_SIZE) -static inline GC_arrayLength* GC_arrayNumElementsp (pointer a) { +static inline GC_arrayLength* arrayNumElementsp (pointer a) { return (GC_arrayLength*)(a - GC_HEADER_SIZE - GC_ARRAY_LENGTH_SIZE); } -static inline GC_arrayLength GC_arrayNumElements (pointer a) { - return *(GC_arrayNumElementsp (a)); +static inline GC_arrayLength arrayNumElements (pointer a) { + return *(arrayNumElementsp (a)); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/foreach.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/foreach.c 2005-09-07 00:47:05 UTC (rev 4078) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/foreach.c 2005-09-09 01:04:14 UTC (rev 4079) @@ -9,16 +9,16 @@ typedef void (*GC_pointerFun) (GC_state s, objptr *pp); static inline void maybeCall (GC_pointerFun f, GC_state s, objptr *pp) { - if (GC_isObjptr (*pp)) + if (isObjptr (*pp)) f (s, pp); } -/* foreachGlobal (s, f) +/* foreachGlobalObjptr (s, f) * * Apply f to each global object pointer into the heap. */ -static inline void foreachGlobal (GC_state s, GC_pointerFun f) { - for (int i = 0; i < s->globalsSize; ++i) { +static inline void foreachGlobalObjptr (GC_state s, GC_pointerFun f) { + for (unsigned int i = 0; i < s->globalsSize; ++i) { if (DEBUG_DETAILED) fprintf (stderr, "foreachGlobal %u\n", i); maybeCall (f, s, &s->globals [i]); @@ -32,33 +32,33 @@ } -/* foreachPointerInObject (s, p, skipWeaks, f) +/* foreachObjptrInObject (s, p, skipWeaks, f) * * Applies f to each object pointer in the object pointed to by p. * Returns pointer to the end of object, i.e. just past object. * * If skipWeaks, then the object pointer in weak objects is skipped. */ -static inline pointer foreachPointerInObject (GC_state s, - pointer p, - bool skipWeaks, - GC_pointerFun f) { +static inline pointer foreachObjptrInObject (GC_state s, + pointer p, + bool skipWeaks, + GC_pointerFun f) { bool hasIdentity; GC_header header; uint16_t numNonObjptrs; uint16_t numObjptrs; GC_objectTypeTag tag; - header = GC_getHeader (p); + header = getHeader (p); SPLIT_HEADER(); if (DEBUG_DETAILED) fprintf (stderr, - "foreachPointerInObject ("FMTPTR")" + "foreachObjptrInObject ("FMTPTR")" " header = "FMTHDR " tag = %s" " numNonObjptrs = %d" " numObjptrs = %d\n", - (intptr_t)p, header, tagToString (tag), + (uintptr_t)p, header, tagToString (tag), numNonObjptrs, numObjptrs); if (NORMAL_TAG == tag) { p += numNonObjptrsToBytes(numNonObjptrs, NORMAL_TAG); @@ -67,8 +67,8 @@ for ( ; p < max; p += OBJPTR_SIZE) { if (DEBUG_DETAILED) fprintf (stderr, - "p = "FMTPTR" *p = "FMTOBJPTR"\n", - (intptr_t)p, *(objptr*)p); + " p = "FMTPTR" *p = "FMTOBJPTR"\n", + (uintptr_t)p, *(objptr*)p); maybeCall (f, s, (objptr*)p); } } else if (WEAK_TAG == tag) { @@ -83,7 +83,7 @@ pointer max; GC_arrayLength numElements; - numElements = GC_arrayNumElements (p); + numElements = arrayNumElements (p); bytesPerElement = numNonObjptrsToBytes(numNonObjptrs, ARRAY_TAG) + (numObjptrs * OBJPTR_SIZE); @@ -101,7 +101,7 @@ max = p + dataBytes; if (0 == numNonObjptrs) /* Array with only pointers. */ - for (; p < max; p += OBJPTR_SIZE) + for ( ; p < max; p += OBJPTR_SIZE) maybeCall (f, s, (objptr*)p); else { /* Array with a mix of pointers and non-pointers. */ @@ -128,70 +128,69 @@ } p += pad (s, dataBytes, GC_ARRAY_HEADER_SIZE); } else { /* stack */ -/* GC_stack stack; */ -/* pointer top, bottom; */ -/* int i; */ -/* word returnAddress; */ -/* GC_frameLayout *layout; */ -/* GC_offsets frameOffsets; */ - -/* assert (STACK_TAG == tag); */ -/* stack = (GC_stack)p; */ -/* bottom = stackBottom (s, stack); */ -/* top = stackTop (s, stack); */ -/* assert (stack->used <= stack->reserved); */ -/* while (top > bottom) { */ -/* /\* Invariant: top points just past a "return address". *\/ */ -/* returnAddress = *(word*) (top - WORD_SIZE); */ -/* if (DEBUG) { */ -/* fprintf (stderr, " top = %d return address = ", */ -/* top - bottom); */ -/* fprintf (stderr, "0x%08x.\n", returnAddress); */ -/* } */ -/* layout = getFrameLayout (s, returnAddress); */ -/* frameOffsets = layout->offsets; */ -/* top -= layout->numBytes; */ -/* for (i = 0 ; i < frameOffsets[0] ; ++i) { */ -/* if (DEBUG) */ -/* fprintf(stderr, */ -/* " offset %u address 0x%08x\n", */ -/* frameOffsets[i + 1], */ -/* (uint)(*(pointer*)(top + frameOffsets[i + 1]))); */ -/* maybeCall(f, s, */ -/* (pointer*) */ -/* (top + frameOffsets[i + 1])); */ -/* } */ -/* } */ -/* assert(top == bottom); */ -/* p += sizeof (struct GC_stack) + stack->reserved; */ + GC_stack stack; + pointer top, bottom; + unsigned int i; + GC_returnAddress returnAddress; + GC_frameLayout *frameLayout; + GC_frameOffsets frameOffsets; + + assert (STACK_TAG == tag); + stack = (GC_stack)p; + bottom = stackBottom (s, stack); + top = stackTop (s, stack); + if (DEBUG) { + fprintf (stderr, " bottom = "FMTPTR" top = "FMTPTR"\n", + (uintptr_t)bottom, (uintptr_t)top); + } + assert (stack->used <= stack->reserved); + while (top > bottom) { + /* Invariant: top points just past a "return address". */ + returnAddress = *(GC_returnAddress*) (top - GC_RETURNADDRESS_SIZE); + if (DEBUG) { + fprintf (stderr, " top = "FMTPTR" return address = "FMTPTR"\n", + (uintptr_t)top, returnAddress); + } + frameLayout = getFrameLayout (s, returnAddress); + frameOffsets = frameLayout->offsets; + top -= frameLayout->numBytes; + for (i = 0 ; i < frameOffsets[0] ; ++i) { + if (DEBUG) + fprintf(stderr, " offset %"PRIx16" address "FMTOBJPTR"\n", + frameOffsets[i + 1], *(objptr*)(top + frameOffsets[i + 1])); + maybeCall(f, s, (objptr*)(top + frameOffsets[i + 1])); + } + } + assert(top == bottom); + p += sizeof (struct GC_stack) + stack->reserved; } return p; } -/* foreachPointerInRange (s, front, back, skipWeaks, f) +/* foreachObjptrInRange (s, front, back, skipWeaks, f) * * Apply f to each pointer between front and *back, which should be a * contiguous sequence of objects, where front points at the beginning * of the first object and *back points just past the end of the last * object. f may increase *back (for example, this is done by - * forward). foreachPointerInRange returns a pointer to the end of + * forward). foreachObjptrInRange returns a pointer to the end of * the last object it visits. * * If skipWeaks, then the object pointer in weak objects is skipped. */ -static inline pointer foreachPointerInRange (GC_state s, - pointer front, - pointer *back, - bool skipWeaks, - GC_pointerFun f) { +static inline pointer foreachObjptrInRange (GC_state s, + pointer front, + pointer *back, + bool skipWeaks, + GC_pointerFun f) { pointer b; assert (isAlignedFrontier (s, front)); if (DEBUG_DETAILED) fprintf (stderr, - "foreachPointerInRange front = "FMTPTR" *back = "FMTPTR"\n", - (intptr_t)front, (intptr_t)(*back)); + "foreachObjptrInRange front = "FMTPTR" *back = "FMTPTR"\n", + (uintptr_t)front, (uintptr_t)(*back)); b = *back; assert (front <= b); while (front < b) { @@ -199,9 +198,9 @@ assert (isAligned ((uintptr_t)front, GC_MODEL_MINALIGN)); if (DEBUG_DETAILED) fprintf (stderr, - "front = "FMTPTR" *back = "FMTPTR"\n", - (intptr_t)front, (intptr_t)(*back)); - front = foreachPointerInObject (s, toData (s, front), skipWeaks, f); + " front = "FMTPTR" *back = "FMTPTR"\n", + (uintptr_t)front, (uintptr_t)(*back)); + front = foreachObjptrInObject (s, toData (s, front), skipWeaks, f); } b = *back; } Copied: mlton/branches/on-20050822-x86_64-branch/runtime/gc/frame.c (from rev 4078, mlton/branches/on-20050822-x86_64-branch/runtime/gc.c) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc.c 2005-09-07 00:47:05 UTC (rev 4078) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/frame.c 2005-09-09 01:04:14 UTC (rev 4079) @@ -0,0 +1,34 @@ +/* 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 uint32_t getFrameIndex (GC_state s, GC_returnAddress ra) { + uint32_t res; + + res = s->returnAddressToFrameIndex (ra); + if (DEBUG_DETAILED) + fprintf (stderr, "%"PRIu32" = getFrameIndex ("FMTRA")\n", + res, ra); + return res; +} + +static inline GC_frameLayout * getFrameLayout (GC_state s, GC_returnAddress ra) { + GC_frameLayout *layout; + uint32_t index; + + index = getFrameIndex (s, ra); + if (DEBUG_DETAILED) + fprintf (stderr, + "returnAddress = "FMTRA + " index = %"PRIx32 + " frameLayoutsSize = %"PRIu16"\n", + ra, index, s->frameLayoutsSize); + assert (0 <= index and index < s->frameLayoutsSize); + layout = &(s->frameLayouts[index]); + assert (layout->numBytes > 0); + return layout; +} Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/frame.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/frame.h 2005-09-07 00:47:05 UTC (rev 4078) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/frame.h 2005-09-09 01:04:14 UTC (rev 4079) @@ -25,15 +25,14 @@ * array) whose elements record byte offsets from the bottom of the * frame at which live heap pointers are located. */ -typedef uint16_t *GC_offsets; +typedef uint16_t *GC_frameOffsets; typedef struct GC_frameLayout { - /* Identifies whether or not the frame is for a C call. */ bool isC; - /* Number of bytes in frame, including space for return address. */ uint16_t numBytes; - /* Offsets from stackTop pointing at bottom of frame at which - * pointers are located. - */ - GC_offsets offsets; + GC_frameOffsets offsets; } GC_frameLayout; + +typedef uintptr_t GC_returnAddress; +#define GC_RETURNADDRESS_SIZE sizeof(GC_returnAddress) +#define FMTRA "0x%016"PRIxPTR 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-09-07 00:47:05 UTC (rev 4078) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.h 2005-09-09 01:04:14 UTC (rev 4079) @@ -3,11 +3,14 @@ size_t alignment; /* */ objptr callFromCHandler; /* Handler for exported C calls (in heap). */ objptr currentThread; /* Currently executing thread (in heap). */ + GC_frameLayout *frameLayouts; /* Array of frame layouts. */ + uint32_t frameLayoutsSize; /* Cardinality of frameLayouts array. */ objptr *globals; uint32_t globalsSize; struct GC_heap heap; GC_objectType *objectTypes; /* Array of object types. */ uint32_t objectTypesSize; /* Cardinality of objectTypes array. */ + uint32_t (*returnAddressToFrameIndex) (GC_returnAddress ra); objptr savedThread; /* Result of GC_copyCurrentThread. * Thread interrupted by arrival of signal. */ Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.h 2005-09-07 00:47:05 UTC (rev 4078) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.h 2005-09-09 01:04:14 UTC (rev 4079) @@ -18,6 +18,6 @@ */ typedef struct GC_heap { - size_t size; - pointer start; /* start of memory area */ + size_t numBytes; /* size of heap */ + pointer start; /* start of heap */ } *GC_heap; Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.c 2005-09-07 00:47:05 UTC (rev 4078) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.c 2005-09-09 01:04:14 UTC (rev 4079) @@ -21,7 +21,7 @@ P_ = ((O_ << S_) + B_); P = (pointer)P_; if (DEBUG_DETAILED) - fprintf (stderr, "objptrToPointer ("FMTOBJPTR") = "FMTPTR"\n", O, (intptr_t)P); + fprintf (stderr, "objptrToPointer ("FMTOBJPTR") = "FMTPTR"\n", O, (uintptr_t)P); return P; } @@ -42,13 +42,13 @@ O_ = ((P_ - B_) >> S_); O = (objptr)O_; if (DEBUG_DETAILED) - fprintf (stderr, "pointerToObjptr ("FMTPTR") = "FMTOBJPTR"\n", (intptr_t)P, O); + fprintf (stderr, "pointerToObjptr ("FMTPTR") = "FMTOBJPTR"\n", (uintptr_t)P, O); return O; } -/* GC_isObjptr returns true if p looks like an object pointer. */ -static inline bool GC_isObjptr (objptr p) { +/* isObjptr returns true if p looks like an object pointer. */ +static inline bool isObjptr (objptr p) { if GC_MODEL_NONPTR { unsigned int shift = GC_MODEL_MINALIGN_SHIFT - GC_MODEL_SHIFT; objptr mask = ~((~((objptr)0)) << shift); Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h 2005-09-07 00:47:05 UTC (rev 4078) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h 2005-09-09 01:04:14 UTC (rev 4079) @@ -27,10 +27,10 @@ * 31 : mark bit, used by mark compact GC (initially 0) */ typedef uint32_t GC_header; +#define GC_HEADER_SIZE sizeof(GC_header) #define PRIxHDR PRIx32 #define FMTHDR "0x%08"PRIxHDR enum { - GC_HEADER_SIZE = sizeof(GC_header), TYPE_INDEX_BITS = 19, TYPE_INDEX_MASK = 0x000FFFFE, TYPE_INDEX_SHIFT = 1, @@ -42,11 +42,11 @@ MARK_SHIFT = 31 }; -/* GC_getHeaderp (p) +/* getHeaderp (p) * * Returns a pointer to the header for the object pointed to by p. */ -static inline GC_header* GC_getHeaderp (pointer p) { +static inline GC_header* getHeaderp (pointer p) { return (GC_header*)(p - GC_HEADER_SIZE); } @@ -54,8 +54,8 @@ * * Returns the header for the object pointed to by p. */ -static inline GC_header GC_getHeader (pointer p) { - return *(GC_getHeaderp(p)); +static inline GC_header getHeader (pointer p) { + return *(getHeaderp(p)); } /* @@ -72,9 +72,7 @@ * Likewise, a primitive value may span multiple native words (e.g., * Word64.word). */ -enum { - GC_NORMAL_HEADER_SIZE = GC_HEADER_SIZE, -}; +#define GC_NORMAL_HEADER_SIZE GC_HEADER_SIZE /* Array objects are described in "array.h" */ Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/pointer.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/pointer.c 2005-09-07 00:47:05 UTC (rev 4078) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/pointer.c 2005-09-09 01:04:14 UTC (rev 4079) @@ -6,8 +6,8 @@ * See the file MLton-LICENSE for details. */ -/* GC_isPointer returns true if p looks like a pointer. */ -static inline bool GC_isPointer (pointer p) { +/* isPointer returns true if p looks like a pointer. */ +static inline bool isPointer (pointer p) { uintptr_t mask = ~((~((uintptr_t)0)) << GC_MODEL_MINALIGN_SHIFT); return (0 == ((uintptr_t)p & mask)); } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/pointer.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/pointer.h 2005-09-07 00:47:05 UTC (rev 4078) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/pointer.h 2005-09-09 01:04:14 UTC (rev 4079) @@ -7,5 +7,6 @@ */ typedef unsigned char* pointer; +#define POINTER_SIZE sizeof(pointer); #define FMTPTR "0x%016"PRIxPTR #define BOGUS_POINTER 0x1 Copied: mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.c (from rev 4078, mlton/branches/on-20050822-x86_64-branch/runtime/gc.c) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc.c 2005-09-07 00:47:05 UTC (rev 4078) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.c 2005-09-09 01:04:14 UTC (rev 4079) @@ -0,0 +1,20 @@ +/* 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 pointer stackBottom (GC_state s, GC_stack stack) { + pointer res; + + res = ((pointer)stack) + sizeof (struct GC_stack); + assert (isAligned ((uintptr_t)res, s->alignment)); + return res; +} + +/* Pointer to the topmost word in use on the stack. */ +static inline pointer stackTop (GC_state s, GC_stack stack) { + return stackBottom (s, stack) + stack->used; +} Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.h 2005-09-07 00:47:05 UTC (rev 4078) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.h 2005-09-09 01:04:14 UTC (rev 4079) @@ -46,3 +46,4 @@ * reserved bytes hold space for the stack. */ } *GC_stack; +#define GC_STACK_SIZE sizeof(struct GC_stack); |
From: Stephen W. <sw...@ml...> - 2005-09-06 17:47:08
|
Fixed bug in Real.signBit, which had assumed that the underlying C signbit returned 0 or 1, when in fact any nonzero value is allowed to indicate the signbit is set. ---------------------------------------------------------------------- U mlton/trunk/basis-library/misc/primitive.sml U mlton/trunk/basis-library/real/real.fun U mlton/trunk/basis-library/real/real.sig U mlton/trunk/doc/changelog ---------------------------------------------------------------------- Modified: mlton/trunk/basis-library/misc/primitive.sml =================================================================== --- mlton/trunk/basis-library/misc/primitive.sml 2005-09-06 23:31:48 UTC (rev 4077) +++ mlton/trunk/basis-library/misc/primitive.sml 2005-09-07 00:47:05 UTC (rev 4078) @@ -1350,7 +1350,7 @@ val modf = _import "Real64_modf": real * real ref -> real; val nextAfter = _import "Real64_nextAfter": real * real -> real; val round = _prim "Real64_round": real -> real; - val signBit = _import "Real64_signBit": real -> bool; + val signBit = _import "Real64_signBit": real -> int; val strto = _import "Real64_strto": NullString.t -> real; val toInt = _prim "Real64_toWordS32": real -> int; val ~ = _prim "Real64_neg": real -> real; @@ -1423,7 +1423,7 @@ val minNormalPos = #1 _symbol "Real32_minNormalPos": real GetSet.t; () val minPos = #1 _symbol "Real32_minPos": real GetSet.t; () val modf = _import "Real32_modf": real * real ref -> real; - val signBit = _import "Real32_signBit": real -> bool; + val signBit = _import "Real32_signBit": real -> int; val strto = _import "Real32_strto": NullString.t -> real; val toInt = _prim "Real32_toWordS32": real -> int; val ~ = _prim "Real32_neg": real -> real; Modified: mlton/trunk/basis-library/real/real.fun =================================================================== --- mlton/trunk/basis-library/real/real.fun 2005-09-06 23:31:48 UTC (rev 4077) +++ mlton/trunk/basis-library/real/real.fun 2005-09-07 00:47:05 UTC (rev 4078) @@ -48,7 +48,7 @@ val minPos = minPos val precision = precision val radix = radix - val signBit = signBit + val signBit = fn r => signBit r <> 0 val toLarge = toLarge end Modified: mlton/trunk/basis-library/real/real.sig =================================================================== --- mlton/trunk/basis-library/real/real.sig 2005-09-06 23:31:48 UTC (rev 4077) +++ mlton/trunk/basis-library/real/real.sig 2005-09-07 00:47:05 UTC (rev 4078) @@ -41,7 +41,7 @@ val nextAfterUp: real -> real val precision: int val radix: int - val signBit: real -> bool + val signBit: real -> int val strto: NullString.t -> real val toInt: real -> int val toLarge: real -> LargeReal.real Modified: mlton/trunk/doc/changelog =================================================================== --- mlton/trunk/doc/changelog 2005-09-06 23:31:48 UTC (rev 4077) +++ mlton/trunk/doc/changelog 2005-09-07 00:47:05 UTC (rev 4078) @@ -1,5 +1,10 @@ Here are the changes since version 20041109. +* 2005-09-06 + - Fixed bug in Real.signBit, which had assumed that the underlying + C signbit returned 0 or 1, when in fact any nonzero value is + allowed to indicate the signbit is set. + * 2005-09-05 - Added -mlb-path-map switch. |
From: Matthew F. <fl...@ml...> - 2005-09-06 16:31:50
|
grab news img ---------------------------------------------------------------------- U mlton/trunk/bin/grab-wiki ---------------------------------------------------------------------- Modified: mlton/trunk/bin/grab-wiki =================================================================== --- mlton/trunk/bin/grab-wiki 2005-09-06 23:25:52 UTC (rev 4076) +++ mlton/trunk/bin/grab-wiki 2005-09-06 23:31:48 UTC (rev 4077) @@ -52,7 +52,7 @@ done echo "Getting images:" -for f in bottom email ftp top www; do +for f in bottom email ftp news top www; do wget -c $base/wiki/mlton/img/moin-$f.png done #fi |
From: Stephen W. <sw...@ml...> - 2005-09-06 16:25:52
|
Debian packaging fix. ---------------------------------------------------------------------- U mlton/trunk/Makefile ---------------------------------------------------------------------- Modified: mlton/trunk/Makefile =================================================================== --- mlton/trunk/Makefile 2005-09-06 22:08:30 UTC (rev 4075) +++ mlton/trunk/Makefile 2005-09-06 23:25:52 UTC (rev 4076) @@ -431,7 +431,7 @@ $(CP) $(SRC)/debian/copyright $(SRC)/debian/README.Debian $(TDOC)/ $(CP) $(SRC)/debian/changelog $(TDOC)/changelog.Debian mkdir -p $(TDOCBASE) - for f in mllex mlyacc; do \ + for f in mllex mlton mlyacc; do \ $(CP) $(SRC)/debian/$$f.doc-base $(TDOCBASE)/$$f; \ done cd $(TDOC)/ && $(GZIP) changelog changelog.Debian |
From: Stephen W. <sw...@ml...> - 2005-09-06 15:08:31
|
New Debian package. ---------------------------------------------------------------------- U mlton/trunk/package/debian/changelog ---------------------------------------------------------------------- Modified: mlton/trunk/package/debian/changelog =================================================================== --- mlton/trunk/package/debian/changelog 2005-09-06 22:00:52 UTC (rev 4074) +++ mlton/trunk/package/debian/changelog 2005-09-06 22:08:30 UTC (rev 4075) @@ -1,3 +1,9 @@ +mlton (20050906-1) unstable; urgency=low + + * Replaces -mv8 with -mcpu=v8 for Sparc. + + -- Stephen Weeks <sw...@sw...> Tue, 06 Sep 2005 14:57:46 -0700 + mlton (20050901-1) unstable; urgency=low * remaking package, linking normally with libgmp. Thus, the package |
From: Stephen W. <sw...@ml...> - 2005-09-06 15:00:53
|
Added support for platform-specific regression outputs, and used them to quell some of the noise in Cygwin regressions. ---------------------------------------------------------------------- U mlton/trunk/bin/regression A mlton/trunk/regression/filesys.x86-cygwin.ok A mlton/trunk/regression/unixpath.x86-cygwin.ok ---------------------------------------------------------------------- Modified: mlton/trunk/bin/regression =================================================================== --- mlton/trunk/bin/regression 2005-09-06 21:14:53 UTC (rev 4073) +++ mlton/trunk/bin/regression 2005-09-06 22:00:52 UTC (rev 4074) @@ -54,6 +54,7 @@ dir=`dirname $0` src=`cd $dir/.. && pwd` bin="$src/build/bin" +lib="$src/build/lib" mlton="$bin/mlton" flags="-type-check true $flags" if [ $cross = 'yes' ]; then @@ -68,6 +69,8 @@ tmp=/tmp/z.regression.$$ PATH=$bin:$src/bin/.:$PATH +eval `$lib/platform` + compFail () { echo "compilation of $f failed with $flags" } @@ -178,14 +181,15 @@ esac ( ./$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) compare="$f.sed.ok" sed 's/$/\r/' <"$f.ok" >"$compare" ;; - *) - compare="$f.ok" - ;; esac if ! diff $compare $tmp; then echo "difference with $flags" Added: mlton/trunk/regression/filesys.x86-cygwin.ok =================================================================== --- mlton/trunk/regression/filesys.x86-cygwin.ok 2005-09-06 21:14:53 UTC (rev 4073) +++ mlton/trunk/regression/filesys.x86-cygwin.ok 2005-09-06 22:00:52 UTC (rev 4074) @@ -0,0 +1,63 @@ + +File filesys.sml: Testing structure FileSys... +test1a OK +test1b OK +test2 OK +test3a OK +test4a OK +test4b OK +test4c OK +test4d OK +test5 OK +test6a OK +test6b OK +test6c OK +test6d OK +test6e OK +test6f OK +test6g OK +test6h OK +test6i OK +test6j OK +test6k OK +test6l OK +test7a OK +test7b OK +test7c OK +test7d OK +test7e OK +test8a EXN +test8b EXN +test8c OK +test8d OK +test8e EXN +test8f EXN +test8g OK +test8h OK +test9a OK +test9b OK +test10a OK +test10b OK +test10c OK +test11a OK +test11b OK +test11c OK +test12a OK +test12b OK +test12c OK +test13a OK +test13b OK +test13c OK +test13d OK +test13e OK +test14 OK +test15a OK +test15b OK +test15b1 OK +test15b2 OK +test15b3 OK +test15c OK +test15d OK +test15e OK +test15f OK +test15g OK Added: mlton/trunk/regression/unixpath.x86-cygwin.ok =================================================================== --- mlton/trunk/regression/unixpath.x86-cygwin.ok 2005-09-06 21:14:53 UTC (rev 4073) +++ mlton/trunk/regression/unixpath.x86-cygwin.ok 2005-09-06 22:00:52 UTC (rev 4074) @@ -0,0 +1,61 @@ + +File unixpath.sml: Testing structure Path... +test1a OK +test1b WRONG +test1c WRONG +test1d OK +test1e WRONG +test1f WRONG +test1g OK +test1h OK +test1i OK +test1j OK +test1k OK +test1l OK +test1m OK +test1n OK +test2a OK +test2b EXN +test2c EXN +test2d OK +test2e EXN +test2f EXN +test2g WRONG +test2h WRONG +test2i WRONG +test2j WRONG +test2k WRONG +test2l WRONG +test2m WRONG +test2n EXN +test2o OK +test2p WRONG +test3b WRONG +test3c WRONG +test3d OK +test3e OK +test3f OK +test3g OK +test3h WRONG +test4a OK +test4b OK +test5a WRONG +test6a WRONG +test6b OK +test7a WRONG +test7b OK +test7c OK +test8a WRONG +test8b OK +test8c OK +test9a WRONG +test10a OK +test11a WRONG +test12 WRONG +test13 WRONG +test14 OK +test15 WRONG +test16 OK +test17 OK +test18 WRONG +test19 WRONG |
From: Stephen W. <sw...@ml...> - 2005-09-06 14:14:55
|
Added guide to install-docs target. ---------------------------------------------------------------------- U mlton/trunk/Makefile U mlton/trunk/doc/README A mlton/trunk/package/debian/mlton.doc-base U mlton/trunk/package/debian/mlton.postinst ---------------------------------------------------------------------- Modified: mlton/trunk/Makefile =================================================================== --- mlton/trunk/Makefile 2005-09-06 19:36:07 UTC (rev 4072) +++ mlton/trunk/Makefile 2005-09-06 21:14:53 UTC (rev 4073) @@ -403,15 +403,14 @@ .PHONY: install-docs install-docs: mkdir -p $(TDOC) - ( \ - cd $(SRC)/doc && \ - $(CP) changelog examples license README $(TDOC)/ \ + ( \ + cd $(SRC)/doc && \ + $(CP) changelog examples guide license README $(TDOC)/ \ ) - ( \ - cd $(SRC)/util && \ - $(CP) cmcat cm2mlb $(TDOC)/ \ + ( \ + cd $(SRC)/util && \ + $(CP) cmcat cm2mlb $(TDOC)/ \ ) - rm -rf $(TDOC)/user-guide for f in callcc command-line hello-world same-fringe signals \ size taut thread1 thread2 thread-switch timeout \ ; do \ Modified: mlton/trunk/doc/README =================================================================== --- mlton/trunk/doc/README 2005-09-06 19:36:07 UTC (rev 4072) +++ mlton/trunk/doc/README 2005-09-06 21:14:53 UTC (rev 4073) @@ -2,8 +2,9 @@ programming language. MLton has the following features. + Runs on a variety of platforms. - o X86: Linux, Cygwin/Windows, FreeBSD, and NetBSD. - o Sparc: Solaris. + o PowerPC: Debian, Mac OSX + o X86: Linux, Cygwin/Windows, FreeBSD, NetBSD, OpenBSD + o Sparc: Debian, Solaris. + Generates standalone executables with excellent running times. + Supports the full SML 97 language. + A complete basis library matching the latest specification. @@ -34,8 +35,8 @@ cm2mlb/ a utility for producing ML Basis programs in SML/NJ cmcat/ a utility for producing whole programs in SML/NJ examples/ example SML programs + guide/ MLton guide license/ license information mllex.ps.gz user guide for mllex lexer generator mlyacc.ps.gz user guide for mlyacc parser generator - user-guide/ html user guide - user-guide.ps.gz user guide for MLton + Added: mlton/trunk/package/debian/mlton.doc-base =================================================================== --- mlton/trunk/package/debian/mlton.doc-base 2005-09-06 19:36:07 UTC (rev 4072) +++ mlton/trunk/package/debian/mlton.doc-base 2005-09-06 21:14:53 UTC (rev 4073) @@ -0,0 +1,10 @@ +Document: mlton +Title: MLton Guide +Author: The MLton Team +Abstract: This document describes how to use MLton, a whole-program + optimizing compiler for the Standard ML Programming language. +Section: Apps/Programming + +Format: HTML +Index: /usr/share/doc/mlton/user-guide/Home +Files: /usr/share/doc/mlton/user-guide/*.html Modified: mlton/trunk/package/debian/mlton.postinst =================================================================== --- mlton/trunk/package/debian/mlton.postinst 2005-09-06 19:36:07 UTC (rev 4072) +++ mlton/trunk/package/debian/mlton.postinst 2005-09-06 21:14:53 UTC (rev 4073) @@ -3,7 +3,7 @@ set -e if [ "$1" = configure ] && which install-docs >/dev/null 2>&1; then - for f in mllex mlyacc; do + for f in mllex mlton mlyacc; do install-docs -i /usr/share/doc-base/$f done fi |
From: Stephen W. <sw...@ml...> - 2005-09-06 12:36:13
|
Grab wiki script now adds moin-www.png before links to mlton.org. ---------------------------------------------------------------------- U mlton/trunk/bin/grab-wiki U mlton/trunk/doc/guide/AST U mlton/trunk/doc/guide/AccessControl U mlton/trunk/doc/guide/AllocateRegisters U mlton/trunk/doc/guide/BasisLibrary U mlton/trunk/doc/guide/Bug U mlton/trunk/doc/guide/CKitLibrary U mlton/trunk/doc/guide/CallingFromCToSML U mlton/trunk/doc/guide/CallingFromSMLToC U mlton/trunk/doc/guide/CallingFromSMLToCFunctionPointer U mlton/trunk/doc/guide/Chunkify U mlton/trunk/doc/guide/ClosureConvert U mlton/trunk/doc/guide/CommonArg U mlton/trunk/doc/guide/CommonBlock U mlton/trunk/doc/guide/CommonSubexp U mlton/trunk/doc/guide/CompilerOverview U mlton/trunk/doc/guide/CompilerPassTemplate U mlton/trunk/doc/guide/ConcurrentMLImplementation U mlton/trunk/doc/guide/ConstantPropagation U mlton/trunk/doc/guide/Contact U mlton/trunk/doc/guide/Contify U mlton/trunk/doc/guide/CoreML U mlton/trunk/doc/guide/CoreMLSimplify U mlton/trunk/doc/guide/CreatingPages U mlton/trunk/doc/guide/DeadCode U mlton/trunk/doc/guide/DeepFlatten U mlton/trunk/doc/guide/Defunctorize U mlton/trunk/doc/guide/Documentation U mlton/trunk/doc/guide/EditingPages U mlton/trunk/doc/guide/Elaborate U mlton/trunk/doc/guide/Emacs U mlton/trunk/doc/guide/Enscript U mlton/trunk/doc/guide/Experimental U mlton/trunk/doc/guide/FAQ U mlton/trunk/doc/guide/Flatten U mlton/trunk/doc/guide/FrontEnd U mlton/trunk/doc/guide/FunctionalRecordUpdate U mlton/trunk/doc/guide/GarbageCollection U mlton/trunk/doc/guide/Globalize U mlton/trunk/doc/guide/Home U mlton/trunk/doc/guide/HowProfilingWorks U mlton/trunk/doc/guide/ImplementExceptions U mlton/trunk/doc/guide/ImplementHandlers U mlton/trunk/doc/guide/ImplementProfiling U mlton/trunk/doc/guide/ImplementSuffix U mlton/trunk/doc/guide/Inline U mlton/trunk/doc/guide/InsertLimitChecks U mlton/trunk/doc/guide/InsertSignalChecks U mlton/trunk/doc/guide/IntroduceLoops U mlton/trunk/doc/guide/KnownCase U mlton/trunk/doc/guide/LambdaFree U mlton/trunk/doc/guide/LanguageChanges U mlton/trunk/doc/guide/Libraries U mlton/trunk/doc/guide/LocalFlatten U mlton/trunk/doc/guide/LocalRef U mlton/trunk/doc/guide/LoopInvariant U mlton/trunk/doc/guide/MLBasis U mlton/trunk/doc/guide/MLtonFinalizable U mlton/trunk/doc/guide/Machine U mlton/trunk/doc/guide/MatchCompile U mlton/trunk/doc/guide/Monomorphise U mlton/trunk/doc/guide/Multi U mlton/trunk/doc/guide/OpenGL U mlton/trunk/doc/guide/OptionalArguments U mlton/trunk/doc/guide/OrphanedPages U mlton/trunk/doc/guide/PackedRepresentation U mlton/trunk/doc/guide/PageSize U mlton/trunk/doc/guide/ParallelMove U mlton/trunk/doc/guide/Performance U mlton/trunk/doc/guide/PolyEqual U mlton/trunk/doc/guide/PolymorphicEquality U mlton/trunk/doc/guide/Polyvariance U mlton/trunk/doc/guide/PortingMLton U mlton/trunk/doc/guide/PrecedenceParse U mlton/trunk/doc/guide/Printf U mlton/trunk/doc/guide/Pronounce U mlton/trunk/doc/guide/PropertyList U mlton/trunk/doc/guide/RSSA U mlton/trunk/doc/guide/RSSAShrink U mlton/trunk/doc/guide/RSSASimplify U mlton/trunk/doc/guide/Redundant U mlton/trunk/doc/guide/RedundantTests U mlton/trunk/doc/guide/RefFlatten U mlton/trunk/doc/guide/References U mlton/trunk/doc/guide/ReleaseChecklist U mlton/trunk/doc/guide/RemoveUnused U mlton/trunk/doc/guide/Restore U mlton/trunk/doc/guide/SMLNJLibrary U mlton/trunk/doc/guide/SSA U mlton/trunk/doc/guide/SSA2 U mlton/trunk/doc/guide/SSA2Simplify U mlton/trunk/doc/guide/SSASimplify U mlton/trunk/doc/guide/SXML U mlton/trunk/doc/guide/SXMLShrink U mlton/trunk/doc/guide/SXMLSimplify U mlton/trunk/doc/guide/ScopeInference U mlton/trunk/doc/guide/Shrink U mlton/trunk/doc/guide/SimplifyTypes U mlton/trunk/doc/guide/Sources U mlton/trunk/doc/guide/Swerve U mlton/trunk/doc/guide/SystemInfo U mlton/trunk/doc/guide/TalkDiveIn U mlton/trunk/doc/guide/ToMachine U mlton/trunk/doc/guide/ToRSSA U mlton/trunk/doc/guide/ToSSA2 U mlton/trunk/doc/guide/Useless U mlton/trunk/doc/guide/WebSite U mlton/trunk/doc/guide/WikiMacros U mlton/trunk/doc/guide/XML U mlton/trunk/doc/guide/XMLShrink U mlton/trunk/doc/guide/XMLSimplify U mlton/trunk/doc/guide/XMLSimplifyTypes U mlton/trunk/doc/guide/Zone U mlton/trunk/doc/guide/index.html ---------------------------------------------------------------------- Modified: mlton/trunk/bin/grab-wiki =================================================================== --- mlton/trunk/bin/grab-wiki 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/bin/grab-wiki 2005-09-06 19:36:07 UTC (rev 4072) @@ -1,7 +1,6 @@ #!/bin/bash set -e -set -x name=`basename $0` dir=`dirname $0` @@ -39,6 +38,7 @@ drop='\(Download\|.*MoinEditorBackup\|OldPages\|Preferences\|RecentChanges\|TemporaryBugExamples\|TemporaryUpload\|WikiSandBox\)' +#if true; then (cd $HOME/mlton/guide-in && tar.write .) | tar.read; else echo "Getting index:" lynx -dump "$base/Index?action=titleindex" | \ grep -v >$index -e '^$' -e "^$drop$" @@ -55,6 +55,7 @@ for f in bottom email ftp top www; do wget -c $base/wiki/mlton/img/moin-$f.png done +#fi echo "Fixing pages:" @@ -62,6 +63,8 @@ grep -v "$drop" Index >$tmp mv $tmp Index +wwwImg='<img src="moin-www.png" alt="[WWW]" height="11" width="11">' + # Write sed script to file. cat >$script <<EOF # Delete search box. @@ -83,6 +86,7 @@ s; href *= *"/"; href="Home";g s; href *= *"$drop"; href="$base/\1";g s; \(href\|src\) *= *"wiki/mlton/[^/]\+/\([^"]*\)"; \1="\2";g +s;\(<a href *= *"http://mlton.org[^>]*>\);\1$wwwImg;g EOF for f in $(cat $index); do Modified: mlton/trunk/doc/guide/AST =================================================================== --- mlton/trunk/doc/guide/AST 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/AST 2005-09-06 19:36:07 UTC (rev 4072) @@ -55,22 +55,22 @@ </p> <h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast/ast-programs.sig?view=markup">ast-programs.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast/ast-programs.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ast-programs.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast/ast-programs.fun?view=markup">ast-programs.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast/ast-programs.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ast-programs.fun</a> <br> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast/ast-modules.sig?view=markup">ast-modules.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast/ast-modules.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ast-modules.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast/ast-modules.fun?view=markup">ast-modules.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast/ast-modules.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ast-modules.fun</a> <br> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast/ast-core.sig?view=markup">ast-core.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast/ast-core.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ast-core.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast/ast-core.fun?view=markup">ast-core.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast/ast-core.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ast-core.fun</a> <br> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast">ast</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ast</a> <h2 id="head-a6de4b535fedeaa8890bd890b60fe09f87b5f96a">Type Checking</h2> <p> The AST <a href="IntermediateLanguage">IntermediateLanguage</a> has no independent type checker. Type inference is performed on an AST program as part of <a href="Elaborate">Elaborate</a>. Modified: mlton/trunk/doc/guide/AccessControl =================================================================== --- mlton/trunk/doc/guide/AccessControl 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/AccessControl 2005-09-06 19:36:07 UTC (rev 4072) @@ -50,7 +50,7 @@ </table> <div id="content" lang="en" dir="ltr"> <a href="MoinMoin">MoinMoin</a> supports a lot of <a class="external" href="http://moinmaster.wikiwikiweb.de/HelpOnAccessControlLists"><img src="moin-www.png" alt="[WWW]" height="11" width="11">access control features</a>. <p> -Because people download binaries from the MLton web site, and we are worried about malicious users either changing those binaries, or changing the links that should point at those binaries, we only allow editing of some pages (in particular, <a href="http://mlton.org/Download">Download</a>, <a href="Home">Home</a>, and <a href="Experimental">Experimental</a>) by <a href="TrustedGroup">TrustedGroup</a> members. +Because people download binaries from the MLton web site, and we are worried about malicious users either changing those binaries, or changing the links that should point at those binaries, we only allow editing of some pages (in particular, <a href="http://mlton.org/Download"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Download</a>, <a href="Home">Home</a>, and <a href="Experimental">Experimental</a>) by <a href="TrustedGroup">TrustedGroup</a> members. </p> <p> All other pages are freely editable by any user with an account. Modified: mlton/trunk/doc/guide/AllocateRegisters =================================================================== --- mlton/trunk/doc/guide/AllocateRegisters 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/AllocateRegisters 2005-09-06 19:36:07 UTC (rev 4072) @@ -55,9 +55,9 @@ </p> <h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ZZZ.sig?view=markup">ZZZ.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ZZZ.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ZZZ.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ZZZ.fun?view=markup">ZZZ.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ZZZ.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ZZZ.fun</a> <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2> </div> Modified: mlton/trunk/doc/guide/BasisLibrary =================================================================== --- mlton/trunk/doc/guide/BasisLibrary 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/BasisLibrary 2005-09-06 19:36:07 UTC (rev 4072) @@ -49,7 +49,7 @@ </table> <div id="content" lang="en" dir="ltr"> -The <a href="StandardML">Standard ML</a> Basis Library is a collection of modules dealing with basic types, input/output, OS interfaces, and simple datatypes. It is intended as a portable library usable across all implementations of SML. The official online version of the Basis Library specification is at <a href="http://www.standardml.org/Basis/">http://www.standardml.org/Basis/</a>. We keep a copy at <a href="http://mlton.org/basis/">http://mlton.org/basis/</a>. There is a <a href = "References#GansnerReppy04"> book</a> that includes all of the online version and more. For a reverse chronological list of changes to the specification, see <a href="http://www.standardml.org/Basis/history.html">http://www.standardml.org/Basis/history.html</a>. <p> +The <a href="StandardML">Standard ML</a> Basis Library is a collection of modules dealing with basic types, input/output, OS interfaces, and simple datatypes. It is intended as a portable library usable across all implementations of SML. The official online version of the Basis Library specification is at <a href="http://www.standardml.org/Basis/">http://www.standardml.org/Basis/</a>. We keep a copy at <a href="http://mlton.org/basis/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">http://mlton.org/basis/</a>. There is a <a href = "References#GansnerReppy04"> book</a> that includes all of the online version and more. For a reverse chronological list of changes to the specification, see <a href="http://www.standardml.org/Basis/history.html">http://www.standardml.org/Basis/history.html</a>. <p> MLton implements all of the required portions of the Basis Library. MLton also implements many of the optional structures. You can obtain a complete and current list of what's available using <tt>mlton -show-basis</tt> (see <a href="ShowBasis">ShowBasis</a>). By default, MLton makes the Basis Library available to user programs. You can also <a href="MLBasisAvailableLibraries">access the Basis Library</a> from <a href="MLBasis"> ML Basis</a> files. </p> <p> Modified: mlton/trunk/doc/guide/Bug =================================================================== --- mlton/trunk/doc/guide/Bug 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/Bug 2005-09-06 19:36:07 UTC (rev 4072) @@ -49,7 +49,7 @@ </table> <div id="content" lang="en" dir="ltr"> -To report a bug, please send mail to <a class="external" href="mailto:ML...@ml..."><img src="moin-email.png" alt="[MAILTO]" height="10" width="14">ML...@ml...</a>. Please include the complete SML program that caused the problem and a log of a compile of the program with <tt>-verbose 2</tt>. For large messages (over 512K), please send an email containing the discussion text and a link to any large files. You may use our <a href="http://mlton.org/TemporaryUpload">TemporaryUpload</a> page for uploading large files. <p> +To report a bug, please send mail to <a class="external" href="mailto:ML...@ml..."><img src="moin-email.png" alt="[MAILTO]" height="10" width="14">ML...@ml...</a>. Please include the complete SML program that caused the problem and a log of a compile of the program with <tt>-verbose 2</tt>. For large messages (over 512K), please send an email containing the discussion text and a link to any large files. You may use our <a href="http://mlton.org/TemporaryUpload"><img src="moin-www.png" alt="[WWW]" height="11" width="11">TemporaryUpload</a> page for uploading large files. <p> There are some <a href="UnresolvedBugs">UnresolvedBugs</a> that we don't plan to fix. </p> <p> Modified: mlton/trunk/doc/guide/CKitLibrary =================================================================== --- mlton/trunk/doc/guide/CKitLibrary 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/CKitLibrary 2005-09-06 19:36:07 UTC (rev 4072) @@ -167,7 +167,7 @@ <li> <p> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/lib/ckit-lib/ckit.patch?view=markup">ckit.patch</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/lib/ckit-lib/ckit.patch?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ckit.patch</a> </p> </li> Modified: mlton/trunk/doc/guide/CallingFromCToSML =================================================================== --- mlton/trunk/doc/guide/CallingFromCToSML 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/CallingFromCToSML 2005-09-06 19:36:07 UTC (rev 4072) @@ -195,14 +195,14 @@ <li> <p> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/*checkout*/mlton/trunk/doc/examples/ffi/export.sml">export.sml</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/*checkout*/mlton/trunk/doc/examples/ffi/export.sml"><img src="moin-www.png" alt="[WWW]" height="11" width="11">export.sml</a> </p> </li> <li> <p> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/*checkout*/mlton/trunk/doc/examples/ffi/ffi-export.c">ffi-export.c</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/*checkout*/mlton/trunk/doc/examples/ffi/ffi-export.c"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ffi-export.c</a> </p> </li> Modified: mlton/trunk/doc/guide/CallingFromSMLToC =================================================================== --- mlton/trunk/doc/guide/CallingFromSMLToC 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/CallingFromSMLToC 2005-09-06 19:36:07 UTC (rev 4072) @@ -134,14 +134,14 @@ <li> <p> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/*checkout*/mlton/trunk/doc/examples/ffi/import.sml">import.sml</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/*checkout*/mlton/trunk/doc/examples/ffi/import.sml"><img src="moin-www.png" alt="[WWW]" height="11" width="11">import.sml</a> </p> </li> <li> <p> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/*checkout*/mlton/trunk/doc/examples/ffi/ffi-import.c">ffi-import.c</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/*checkout*/mlton/trunk/doc/examples/ffi/ffi-import.c"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ffi-import.c</a> </p> </li> Modified: mlton/trunk/doc/guide/CallingFromSMLToCFunctionPointer =================================================================== --- mlton/trunk/doc/guide/CallingFromSMLToCFunctionPointer 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/CallingFromSMLToCFunctionPointer 2005-09-06 19:36:07 UTC (rev 4072) @@ -210,7 +210,7 @@ <li> <p> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/*checkout*/mlton/trunk/doc/examples/ffi/iimport.sml">iimport.sml</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/*checkout*/mlton/trunk/doc/examples/ffi/iimport.sml"><img src="moin-www.png" alt="[WWW]" height="11" width="11">iimport.sml</a> </p> </li> Modified: mlton/trunk/doc/guide/Chunkify =================================================================== --- mlton/trunk/doc/guide/Chunkify 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/Chunkify 2005-09-06 19:36:07 UTC (rev 4072) @@ -55,9 +55,9 @@ </p> <h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/chunkify.sig?view=markup">chunkify.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/chunkify.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">chunkify.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/chunkify.fun?view=markup">chunkify.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/chunkify.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">chunkify.fun</a> <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2> <p> Breaking large <a href="RSSA">RSSA</a> functions into chunks is necessary for reasonable <tt>gcc</tt> compile times with the <a class="nonexistent" href="CCodegen">CCodegen</a>. Modified: mlton/trunk/doc/guide/ClosureConvert =================================================================== --- mlton/trunk/doc/guide/ClosureConvert 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/ClosureConvert 2005-09-06 19:36:07 UTC (rev 4072) @@ -61,9 +61,9 @@ </p> <h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/closure-convert/closure-convert.sig?view=markup">closure-convert.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/closure-convert/closure-convert.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">closure-convert.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/closure-convert/closure-convert.fun?view=markup">closure-convert.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/closure-convert/closure-convert.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">closure-convert.fun</a> <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2> </div> Modified: mlton/trunk/doc/guide/CommonArg =================================================================== --- mlton/trunk/doc/guide/CommonArg 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/CommonArg 2005-09-06 19:36:07 UTC (rev 4072) @@ -82,9 +82,9 @@ </p> <h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/common-arg.sig?view=markup">common-arg.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/common-arg.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">common-arg.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/common-arg.fun?view=markup">common-arg.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/common-arg.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">common-arg.fun</a> <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2> <p> Three analyses were originally proposed to drive the optimization transformation. Only the <em>Dominator Analysis</em> is currently implemented. (Implementations of the other analyses are available in the Subversion repository.) Modified: mlton/trunk/doc/guide/CommonBlock =================================================================== --- mlton/trunk/doc/guide/CommonBlock 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/CommonBlock 2005-09-06 19:36:07 UTC (rev 4072) @@ -58,9 +58,9 @@ </p> <h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/common-block.sig?view=markup">common-block.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/common-block.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">common-block.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/common-block.fun?view=markup">common-block.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/common-block.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">common-block.fun</a> <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2> <ul> Modified: mlton/trunk/doc/guide/CommonSubexp =================================================================== --- mlton/trunk/doc/guide/CommonSubexp 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/CommonSubexp 2005-09-06 19:36:07 UTC (rev 4072) @@ -58,9 +58,9 @@ </p> <h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/common-subexp.sig?view=markup">common-subexp.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/common-subexp.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">common-subexp.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/common-subexp.fun?view=markup">common-subexp.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/common-subexp.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">common-subexp.fun</a> <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2> <p> In addition to getting the usual sorts of things like Modified: mlton/trunk/doc/guide/CompilerOverview =================================================================== --- mlton/trunk/doc/guide/CompilerOverview 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/CompilerOverview 2005-09-06 19:36:07 UTC (rev 4072) @@ -259,9 +259,9 @@ <p> The <tt>Compile</tt> functor ( -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/main/compile.sig?view=markup">compile.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/main/compile.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">compile.sig</a> , -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/main/compile.fun?view=markup">compile.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/main/compile.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">compile.fun</a> ), controls the high-level view of the compiler passes, from <a href="FrontEnd">FrontEnd</a> to code generation. </p> </div> Modified: mlton/trunk/doc/guide/CompilerPassTemplate =================================================================== --- mlton/trunk/doc/guide/CompilerPassTemplate 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/CompilerPassTemplate 2005-09-06 19:36:07 UTC (rev 4072) @@ -55,9 +55,9 @@ </p> <h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ZZZ.sig?view=markup">ZZZ.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ZZZ.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ZZZ.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ZZZ.fun?view=markup">ZZZ.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ZZZ.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ZZZ.fun</a> <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2> <p> Relevant details and notes. Modified: mlton/trunk/doc/guide/ConcurrentMLImplementation =================================================================== --- mlton/trunk/doc/guide/ConcurrentMLImplementation 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/ConcurrentMLImplementation 2005-09-06 19:36:07 UTC (rev 4072) @@ -269,7 +269,7 @@ <ul> - <a href="http://mlton.org/pipermail/mlton/2004-May/">http://mlton.org/pipermail/mlton/2004-May/</a> + <a href="http://mlton.org/pipermail/mlton/2004-May/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">http://mlton.org/pipermail/mlton/2004-May/</a> </ul> Modified: mlton/trunk/doc/guide/ConstantPropagation =================================================================== --- mlton/trunk/doc/guide/ConstantPropagation 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/ConstantPropagation 2005-09-06 19:36:07 UTC (rev 4072) @@ -61,9 +61,9 @@ </p> <h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/constant-propagation.sig?view=markup">constant-propagation.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/constant-propagation.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">constant-propagation.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/constant-propagation.fun?view=markup">constant-propagation.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/constant-propagation.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">constant-propagation.fun</a> <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2> </div> Modified: mlton/trunk/doc/guide/Contact =================================================================== --- mlton/trunk/doc/guide/Contact 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/Contact 2005-09-06 19:36:07 UTC (rev 4072) @@ -84,7 +84,7 @@ </li> <li class="gap"> <p> - Large messages (over 512K) should not be sent. Rather, please send an email containing the discussion text and a link to any large files. You may use our <a href="http://mlton.org/TemporaryUpload">TemporaryUpload</a> page for uploading these files. + Large messages (over 512K) should not be sent. Rather, please send an email containing the discussion text and a link to any large files. You may use our <a href="http://mlton.org/TemporaryUpload"><img src="moin-www.png" alt="[WWW]" height="11" width="11">TemporaryUpload</a> page for uploading these files. </p> </li> <li class="gap"> Modified: mlton/trunk/doc/guide/Contify =================================================================== --- mlton/trunk/doc/guide/Contify 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/Contify 2005-09-06 19:36:07 UTC (rev 4072) @@ -55,9 +55,9 @@ </p> <h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/contify.sig?view=markup">contify.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/contify.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">contify.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/contify.fun?view=markup">contify.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/contify.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">contify.fun</a> <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2> <p> See <a href = "References#FluetWeeks01">Contification Using Dominators</a>. The intermediate language described in that paper has since evolved to the <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>; hence, the complication described in Section 6.1 is no longer relevant. Modified: mlton/trunk/doc/guide/CoreML =================================================================== --- mlton/trunk/doc/guide/CoreML 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/CoreML 2005-09-06 19:36:07 UTC (rev 4072) @@ -55,9 +55,9 @@ </p> <h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/core-ml/core-ml.sig?view=markup">core-ml.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/core-ml/core-ml.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">core-ml.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/core-ml/core-ml.fun?view=markup">core-ml.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/core-ml/core-ml.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">core-ml.fun</a> <h2 id="head-a6de4b535fedeaa8890bd890b60fe09f87b5f96a">Type Checking</h2> <p> The CoreML <a href="IntermediateLanguage">IntermediateLanguage</a> has no independent type checker. Modified: mlton/trunk/doc/guide/CoreMLSimplify =================================================================== --- mlton/trunk/doc/guide/CoreMLSimplify 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/CoreMLSimplify 2005-09-06 19:36:07 UTC (rev 4072) @@ -50,7 +50,7 @@ </table> <div id="content" lang="en" dir="ltr"> The single optimization pass for the <a href="CoreML">CoreML</a> <a href="IntermediateLanguage">IntermediateLanguage</a> is controlled by the <tt>Compile</tt> functor ( -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/main/compile.fun?view=markup">compile.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/main/compile.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">compile.fun</a> ). <p> The following optimization pass is implemented: </p> Modified: mlton/trunk/doc/guide/CreatingPages =================================================================== --- mlton/trunk/doc/guide/CreatingPages 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/CreatingPages 2005-09-06 19:36:07 UTC (rev 4072) @@ -50,7 +50,7 @@ </table> <div id="content" lang="en" dir="ltr"> To create a page, edit an existing page, and add the name of the new page, like <tt>FooBar</tt>, to the page contents. When you view the new version of the existing page, a link will have been automatically created, and if you click on it, you will be given the option to create the new page. <p> -You can also go directly to a new page by entering the page name as a URL into your browser, like <tt>http://www.mlton.org/FooBar</tt>. +You can also go directly to a new page by entering the page name as a URL into your browser, like <tt>http://mlton.org/FooBar</tt>. </p> <p> You can also type in the page name here to go directly to that page. @@ -66,5 +66,5 @@ <p> <hr> -Last edited on 2004-10-28 22:37:02 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>. +Last edited on 2005-09-06 17:36:53 by <span title="adsl-64-166-225-193.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>. </body></html> Modified: mlton/trunk/doc/guide/DeadCode =================================================================== --- mlton/trunk/doc/guide/DeadCode 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/DeadCode 2005-09-06 19:36:07 UTC (rev 4072) @@ -55,9 +55,9 @@ </p> <h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/core-ml/dead-code.sig?view=markup">dead-code.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/core-ml/dead-code.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">dead-code.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/core-ml/dead-code.fun?view=markup">dead-code.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/core-ml/dead-code.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">dead-code.fun</a> <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2> <p> In order to compile small programs rapidly, a pass of dead code elimination is run in order to eliminate as much of the Basis Library as possible. The dead code elimination algorithm used is not safe in general, and only works because the Basis Library implementation has special properties: Modified: mlton/trunk/doc/guide/DeepFlatten =================================================================== --- mlton/trunk/doc/guide/DeepFlatten 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/DeepFlatten 2005-09-06 19:36:07 UTC (rev 4072) @@ -61,9 +61,9 @@ </p> <h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/deep-flatten.sig?view=markup">deep-flatten.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/deep-flatten.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">deep-flatten.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/deep-flatten.fun?view=markup">deep-flatten.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/deep-flatten.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">deep-flatten.fun</a> <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2> </div> Modified: mlton/trunk/doc/guide/Defunctorize =================================================================== --- mlton/trunk/doc/guide/Defunctorize 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/Defunctorize 2005-09-06 19:36:07 UTC (rev 4072) @@ -87,9 +87,9 @@ <h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/defunctorize/defunctorize.sig?view=markup">defunctorize.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/defunctorize/defunctorize.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">defunctorize.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/defunctorize/defunctorize.fun?view=markup">defunctorize.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/defunctorize/defunctorize.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">defunctorize.fun</a> <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2> <p> This pass is grossly misnamed (a consequence of the implementation of an <a href="Elaborate">Elaborate</a> pass that follows the <a href="DefinitionOfStandardML"> Definition</a> and produces readable error messages). Modified: mlton/trunk/doc/guide/Documentation =================================================================== --- mlton/trunk/doc/guide/Documentation 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/Documentation 2005-09-06 19:36:07 UTC (rev 4072) @@ -174,12 +174,12 @@ <li> <p> - <a class="nonexistent" href="MLLex">MLLex</a> <a href="http://mlton.org/pages/Documentation/attachments/mllex.pdf">pdf</a> + <a class="nonexistent" href="MLLex">MLLex</a> <a href="http://mlton.org/pages/Documentation/attachments/mllex.pdf"><img src="moin-www.png" alt="[WWW]" height="11" width="11">pdf</a> </p> </li> <li> <p> - <a class="nonexistent" href="MLYacc">MLYacc</a> <a href="http://mlton.org/pages/Documentation/attachments/mlyacc.pdf">pdf</a> + <a class="nonexistent" href="MLYacc">MLYacc</a> <a href="http://mlton.org/pages/Documentation/attachments/mlyacc.pdf"><img src="moin-www.png" alt="[WWW]" height="11" width="11">pdf</a> </p> </li> <li> Modified: mlton/trunk/doc/guide/EditingPages =================================================================== --- mlton/trunk/doc/guide/EditingPages 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/EditingPages 2005-09-06 19:36:07 UTC (rev 4072) @@ -49,8 +49,8 @@ </table> <div id="content" lang="en" dir="ltr"> -You can help maintain the site and improve a page's contents by using the "Edit" link found at the bottom of that page. Pages are written using <a href="MoinMoin">MoinMoin</a>'s <a class="external" href="http://moinmoin.wikiwikiweb.de/HelpOnEditing"><img src="moin-www.png" alt="[WWW]" height="11" width="11">wiki markup language</a>. You can practice editing in the <a href="http://mlton.org/WikiSandBox">WikiSandBox</a>. <p> -Before you begin editing, you must <a href="http://mlton.org/Preferences">create a user account</a>. When you do so, please also create a home page (like <a href="StephenWeeks">StephenWeeks</a>) so we know who you are. See our <a href="AccessControl">AccessControl</a> policy for who is allowed to edit what. +You can help maintain the site and improve a page's contents by using the "Edit" link found at the bottom of that page. Pages are written using <a href="MoinMoin">MoinMoin</a>'s <a class="external" href="http://moinmoin.wikiwikiweb.de/HelpOnEditing"><img src="moin-www.png" alt="[WWW]" height="11" width="11">wiki markup language</a>. You can practice editing in the <a href="http://mlton.org/WikiSandBox"><img src="moin-www.png" alt="[WWW]" height="11" width="11">WikiSandBox</a>. <p> +Before you begin editing, you must <a href="http://mlton.org/Preferences"><img src="moin-www.png" alt="[WWW]" height="11" width="11">create a user account</a>. When you do so, please also create a home page (like <a href="StephenWeeks">StephenWeeks</a>) so we know who you are. See our <a href="AccessControl">AccessControl</a> policy for who is allowed to edit what. </p> <p> By contributing to this web site, you agree to dedicate your contribution to the public domain. For more details, please see the <a href="License">License</a>. Modified: mlton/trunk/doc/guide/Elaborate =================================================================== --- mlton/trunk/doc/guide/Elaborate 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/Elaborate 2005-09-06 19:36:07 UTC (rev 4072) @@ -55,27 +55,27 @@ </p> <h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/elaborate.sig?view=markup">elaborate.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/elaborate.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">elaborate.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/elaborate.fun?view=markup">elaborate.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/elaborate.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">elaborate.fun</a> <br> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/elaborate-env.sig?view=markup">elaborate-env.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/elaborate-env.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">elaborate-env.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/elaborate-env.fun?view=markup">elaborate-env.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/elaborate-env.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">elaborate-env.fun</a> <br> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/elaborate-modules.sig?view=markup">elaborate-modules.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/elaborate-modules.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">elaborate-modules.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/elaborate-modules.fun?view=markup">elaborate-modules.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/elaborate-modules.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">elaborate-modules.fun</a> <br> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/elaborate-core.sig?view=markup">elaborate-core.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/elaborate-core.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">elaborate-core.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/elaborate-core.fun?view=markup">elaborate-core.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/elaborate-core.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">elaborate-core.fun</a> <br> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate">elaborate</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate"><img src="moin-www.png" alt="[WWW]" height="11" width="11">elaborate</a> <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2> <p> At the modules level, the Elaborate pass: @@ -86,9 +86,9 @@ <li> <p> elaborates signatures with interfaces (see -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/interface.sig?view=markup">interface.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/interface.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">interface.sig</a> and -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/interface.fun?view=markup">interface.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/interface.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">interface.fun</a> ). </p> </li> @@ -120,9 +120,9 @@ <ul> This is implemented by building a dummy structure realized from the signature, just as we would for a functor argument when type checking a functor. The dummy structure contains exactly the type information that is in the signature, which is what opacity requires. We then replace the variables (and constructors) in the dummy structure with the corresponding variables (and constructors) from the actual structure so that the translation to <a href="CoreML">CoreML</a> uses the right stuff. For each tycon in the dummy structure, we keep track of the corresponding type structure in the actual structure. This is used when producing the <a href="CoreML">CoreML</a> types (see <tt>expandOpaque</tt> in -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/type-env.sig?view=markup">type-env.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/type-env.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">type-env.sig</a> and -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/type-env.fun?view=markup">type-env.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/type-env.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">type-env.fun</a> ). </ul> Modified: mlton/trunk/doc/guide/Emacs =================================================================== --- mlton/trunk/doc/guide/Emacs 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/Emacs 2005-09-06 19:36:07 UTC (rev 4072) @@ -83,7 +83,7 @@ <li class="gap"> <p> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/ide/emacs/mlton.el?view=markup">mlton.el</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/ide/emacs/mlton.el?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">mlton.el</a> contains the Emacs lisp that <a href="StephenWeeks">StephenWeeks</a> uses to interact with MLton (in addition to using <tt>sml-mode</tt>). </p> </li> @@ -113,13 +113,13 @@ <li> <p> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/ide/emacs/esml-mlb-mode.el?view=markup">esml-mlb-mode.el</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/ide/emacs/esml-mlb-mode.el?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">esml-mlb-mode.el</a> </p> </li> <li> <p> - <a href="http://mlton.org/pages/Emacs/attachments/mlb.el">mlb.el</a> + <a href="http://mlton.org/pages/Emacs/attachments/mlb.el"><img src="moin-www.png" alt="[WWW]" height="11" width="11">mlb.el</a> </p> </li> Modified: mlton/trunk/doc/guide/Enscript =================================================================== --- mlton/trunk/doc/guide/Enscript 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/Enscript 2005-09-06 19:36:07 UTC (rev 4072) @@ -55,7 +55,7 @@ <li> <p> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/ide/enscript/sml_simple.st?view=markup">sml_simple.st</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/ide/enscript/sml_simple.st?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">sml_simple.st</a> -- Provides highlighting of keywords, string and character constants, and (nested) comments. <pre class=code> <I><FONT COLOR="#B22222">(* Comments (* can be nested *) *)</FONT></I> @@ -69,7 +69,7 @@ <li class="gap"> <p> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/ide/enscript/sml_verbose.st?view=markup">sml_verbose.st</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/ide/enscript/sml_verbose.st?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">sml_verbose.st</a> -- Supersedes the above, adding highlighting of numeric constants. Due to the limited parsing available, numeric record labels are highlighted as numeric constants, in all contexts. Likewise, a binding precedence separated from <tt>infix</tt> or <tt>infixr</tt> by a newline is highlighted as a numeric constant and a numeric record label selector separated from <tt>#</tt> by a newline is highlighted as a numeric constant. </p> @@ -93,7 +93,7 @@ <li class="gap"> <p> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/ide/enscript/sml_fancy.st?view=markup">sml_fancy.st</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/ide/enscript/sml_fancy.st?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">sml_fancy.st</a> -- Supersedes the above, adding highlighting of type and constructor bindings, highlighting of explicit binding of type variables at <tt>val</tt> and <tt>fun</tt> declarations, and separate highlighting of core and modules level keywords. Due to the limited parsing available, it is assumed that the input is a syntactically correct, top-level declaration. <pre class=code> <B><FONT COLOR="#0000FF">structure</FONT></B> S = <B><FONT COLOR="#0000FF">struct</FONT></B> @@ -116,7 +116,7 @@ <li class="gap"> <p> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/ide/enscript/sml_gaudy.st?view=markup">sml_gaudy.st</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/ide/enscript/sml_gaudy.st?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">sml_gaudy.st</a> -- Supersedes the above, adding highlighting of type annotations, in both expressions and signatures. Due to the limited parsing available, it is assumed that the input is a syntactically correct, top-level declaration. <pre class=code> <B><FONT COLOR="#0000FF">signature</FONT></B> S = <B><FONT COLOR="#0000FF">sig</FONT></B> @@ -175,7 +175,7 @@ <li> <p> Append -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/ide/enscript/sml_all.st?view=markup">sml_all.st</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/ide/enscript/sml_all.st?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">sml_all.st</a> to <tt>/usr/share/enscript/enscript.st</tt> </p> </li> Modified: mlton/trunk/doc/guide/Experimental =================================================================== --- mlton/trunk/doc/guide/Experimental 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/Experimental 2005-09-06 19:36:07 UTC (rev 4072) @@ -65,7 +65,7 @@ </table> <div id="content" lang="en" dir="ltr"> <p> -This page is for experimental releases of MLton. These versions are not as well tested as our <a href="http://mlton.org/Download">public releases</a>, and may not be available for our all our usual platforms. +This page is for experimental releases of MLton. These versions are not as well tested as our <a href="http://mlton.org/Download"><img src="moin-www.png" alt="[WWW]" height="11" width="11">public releases</a>, and may not be available for our all our usual platforms. </p> <h2 id="head-9fa56f6715598f7143da2e8633da0b6fa4b9cfa7">Changes since the last public release</h2> @@ -119,7 +119,7 @@ <li> <p> - <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.i386-freebsd.tgz">FreeBSD</a> 5.4 + <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.i386-freebsd.tgz"><img src="moin-www.png" alt="[WWW]" height="11" width="11">FreeBSD</a> 5.4 </p> </li> <li> @@ -132,17 +132,17 @@ <li> <p> - <a href="http://mlton.org/pages/Experimental/attachments/mlton_20050731-1_i386.deb">Debian</a> testing + <a href="http://mlton.org/pages/Experimental/attachments/mlton_20050731-1_i386.deb"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Debian</a> testing </p> </li> <li> <p> - <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.i386.rpm">RedHat</a> 7.1 + <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.i386.rpm"><img src="moin-www.png" alt="[WWW]" height="11" width="11">RedHat</a> 7.1 </p> </li> <li> <p> - <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.i386-linux.tgz">tgz</a> for other distributions (glibc 2.3) + <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.i386-linux.tgz"><img src="moin-www.png" alt="[WWW]" height="11" width="11">tgz</a> for other distributions (glibc 2.3) </p> </li> @@ -151,12 +151,12 @@ <li> <p> - <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.i386-netbsd.tgz">NetBSD</a> 2.0.2 + <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.i386-netbsd.tgz"><img src="moin-www.png" alt="[WWW]" height="11" width="11">NetBSD</a> 2.0.2 </p> </li> <li> <p> - <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.i386-openbsd.tgz">OpenBSD</a> 3.7 + <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.i386-openbsd.tgz"><img src="moin-www.png" alt="[WWW]" height="11" width="11">OpenBSD</a> 3.7 </p> </li> @@ -173,7 +173,7 @@ <li> <p> - <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.powerpc-darwin.tgz">Darwin</a> 7.0.0 (Mac OS X) + <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.powerpc-darwin.tgz"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Darwin</a> 7.0.0 (Mac OS X) </p> </li> @@ -190,7 +190,7 @@ <li> <p> - <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.sparc-solaris.tgz">Solaris</a> 8 + <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.sparc-solaris.tgz"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Solaris</a> 8 </p> </li> @@ -207,17 +207,17 @@ <li> <p> - <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.src.tgz">source tgz</a> + <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.src.tgz"><img src="moin-www.png" alt="[WWW]" height="11" width="11">source tgz</a> </p> </li> <li> <p> - Debian <a href="http://mlton.org/pages/Experimental/attachments/mlton_20050731-1.dsc">dsc</a>, <a href="http://mlton.org/pages/Experimental/attachments/mlton_20050731-1.diff.gz">diff.gz</a>, <a href="http://mlton.org/pages/Experimental/attachments/mlton_20050731.orig.tar.gz">orig.tar.gz</a> + Debian <a href="http://mlton.org/pages/Experimental/attachments/mlton_20050731-1.dsc"><img src="moin-www.png" alt="[WWW]" height="11" width="11">dsc</a>, <a href="http://mlton.org/pages/Experimental/attachments/mlton_20050731-1.diff.gz"><img src="moin-www.png" alt="[WWW]" height="11" width="11">diff.gz</a>, <a href="http://mlton.org/pages/Experimental/attachments/mlton_20050731.orig.tar.gz"><img src="moin-www.png" alt="[WWW]" height="11" width="11">orig.tar.gz</a> </p> </li> <li> <p> - R<strong></strong>edHat <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.src.rpm">source rpm</a> + R<strong></strong>edHat <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.src.rpm"><img src="moin-www.png" alt="[WWW]" height="11" width="11">source rpm</a> </p> </li> </ul> Modified: mlton/trunk/doc/guide/FAQ =================================================================== --- mlton/trunk/doc/guide/FAQ 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/FAQ 2005-09-06 19:36:07 UTC (rev 4072) @@ -101,7 +101,7 @@ </p> <h2 id="head-5da60bc9034a764c34c1be37aa3017ce70bc131e">How do I see what has changed recently in the wiki?</h2> <p> -<a href="http://mlton.org/RecentChanges">RecentChanges</a> +<a href="http://mlton.org/RecentChanges"><img src="moin-www.png" alt="[WWW]" height="11" width="11">RecentChanges</a> </p> <h2 id="head-756d1bccf1783a78c8c7af9ff6aadb9dee01b567">How portable is SML code across SML compilers?</h2> <p> Modified: mlton/trunk/doc/guide/Flatten =================================================================== --- mlton/trunk/doc/guide/Flatten 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/Flatten 2005-09-06 19:36:07 UTC (rev 4072) @@ -103,9 +103,9 @@ <h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/flatten.sig?view=markup">flatten.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/flatten.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">flatten.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/flatten.fun?view=markup">flatten.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/flatten.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">flatten.fun</a> <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2> </div> Modified: mlton/trunk/doc/guide/FrontEnd =================================================================== --- mlton/trunk/doc/guide/FrontEnd 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/FrontEnd 2005-09-06 19:36:07 UTC (rev 4072) @@ -55,18 +55,18 @@ </p> <h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/front-end/front-end.sig?view=markup">front-end.sig</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/front-end/front-end.sig?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">front-end.sig</a> -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/front-end/front-end.fun?view=markup">front-end.fun</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/front-end/front-end.fun?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">front-end.fun</a> <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2> <p> The lexer is produced by <a class="nonexistent" href="MLLex">MLLex</a> from -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/front-end/ml.lex?view=markup">ml.lex</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/front-end/ml.lex?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ml.lex</a> . </p> <p> The parser is produced by <a class="nonexistent" href="MLYacc">MLYacc</a> from -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/front-end/ml.grm?view=markup">ml.grm</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/front-end/ml.grm?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ml.grm</a> . </p> <p> Modified: mlton/trunk/doc/guide/FunctionalRecordUpdate =================================================================== --- mlton/trunk/doc/guide/FunctionalRecordUpdate 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/FunctionalRecordUpdate 2005-09-06 19:36:07 UTC (rev 4072) @@ -217,7 +217,7 @@ </p> <p> The MLton SVN contains Emacs functions in -<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/ide/emacs/esml-gen.el?view=markup">esml-gen.el</a> +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/ide/emacs/esml-gen.el?view=markup"><img src="moin-www.png" alt="[WWW]" height="11" width="11">esml-gen.el</a> to generate functional tuple update functions and functional record update functions. For example, to generate a <tt>set</tt> function for the record <tt>{a, b, c</tt>} it is sufficient to type <tt>M x esml-gen-fru-setter a b c</tt>. </p> <h2 id="head-12c4ffe1d987164a4bedf6ab2aac597a113e181c">Efficiency</h2> Modified: mlton/trunk/doc/guide/GarbageCollection =================================================================== --- mlton/trunk/doc/guide/GarbageCollection 2005-09-06 17:51:38 UTC (rev 4071) +++ mlton/trunk/doc/guide/GarbageCollection 2005-09-06 19:36:07 UTC (rev 4072) @@ -61,7 +61,7 @@ <li> <p> - <a href="http://mlton.org/pipermail/mlton/2002-May/012420.html">http://mlton.org/pipermail/mlton/2002-May/012420.html</a> <br> + <a href="http://mlton.org/pipermail/mlton/2002-May/012420.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">http://mlton.org/pipermail/mlton/2002-May/012420.html</a> <br> object layout and header word design </p> </li> Modified: mlton/trunk/doc/guide/Globalize =================================================================== --- mlton/trunk/doc/guide/Globalize 2005-09-06 17:51:38 UTC (rev 4071) +... [truncated message content] |
From: Stephen W. <sw...@ml...> - 2005-09-06 10:51:39
|
Replaced -mv8 with -mcpu=v8 for compilation on Solaris. ---------------------------------------------------------------------- U mlton/trunk/bin/mlton-script U mlton/trunk/runtime/Makefile ---------------------------------------------------------------------- Modified: mlton/trunk/bin/mlton-script =================================================================== --- mlton/trunk/bin/mlton-script 2005-09-06 04:18:56 UTC (rev 4070) +++ mlton/trunk/bin/mlton-script 2005-09-06 17:51:38 UTC (rev 4071) @@ -80,7 +80,7 @@ -fcall-used-g5 -fcall-used-g7 -mcpu=ultrasparc' \ - -target-cc-opt sparc '-mv8 -m32' \ + -target-cc-opt sparc '-mcpu=v8 -m32' \ -target-cc-opt x86 \ '-fno-strength-reduce -fschedule-insns Modified: mlton/trunk/runtime/Makefile =================================================================== --- mlton/trunk/runtime/Makefile 2005-09-06 04:18:56 UTC (rev 4070) +++ mlton/trunk/runtime/Makefile 2005-09-06 17:51:38 UTC (rev 4071) @@ -28,7 +28,7 @@ endif ifeq ($(TARGET_ARCH), sparc) -FLAGS += -mv8 -m32 +FLAGS += -mcpu=v8 -m32 endif ifeq ($(TARGET_OS), solaris) |
From: Stephen W. <sw...@ml...> - 2005-09-05 21:19:19
|
First attempt at running grab-wiki. ---------------------------------------------------------------------- A mlton/trunk/doc/guide/ A mlton/trunk/doc/guide/AST A mlton/trunk/doc/guide/AccessControl A mlton/trunk/doc/guide/AdmitsEquality A mlton/trunk/doc/guide/Alice A mlton/trunk/doc/guide/AllocateRegisters A mlton/trunk/doc/guide/AndreiFormiga A mlton/trunk/doc/guide/BasisLibrary A mlton/trunk/doc/guide/Bug A mlton/trunk/doc/guide/Bugs20041109 A mlton/trunk/doc/guide/CKitLibrary A mlton/trunk/doc/guide/CallGraph A mlton/trunk/doc/guide/CallingFromCToSML A mlton/trunk/doc/guide/CallingFromSMLToC A mlton/trunk/doc/guide/CallingFromSMLToCFunctionPointer A mlton/trunk/doc/guide/ChrisClearwater A mlton/trunk/doc/guide/Chunkify A mlton/trunk/doc/guide/Closure A mlton/trunk/doc/guide/ClosureConvert A mlton/trunk/doc/guide/CommonArg A mlton/trunk/doc/guide/CommonBlock A mlton/trunk/doc/guide/CommonSubexp A mlton/trunk/doc/guide/CompilationManager A mlton/trunk/doc/guide/CompileTimeOptions A mlton/trunk/doc/guide/CompilerOverview A mlton/trunk/doc/guide/CompilerPassTemplate A mlton/trunk/doc/guide/ConcurrentML A mlton/trunk/doc/guide/ConcurrentMLImplementation A mlton/trunk/doc/guide/ConstantPropagation A mlton/trunk/doc/guide/Contact A mlton/trunk/doc/guide/Contify A mlton/trunk/doc/guide/CoreML A mlton/trunk/doc/guide/CoreMLSimplify A mlton/trunk/doc/guide/CreatingPages A mlton/trunk/doc/guide/Credits A mlton/trunk/doc/guide/CrossCompiling A mlton/trunk/doc/guide/DeadCode A mlton/trunk/doc/guide/DeepFlatten A mlton/trunk/doc/guide/DefineTypeBeforeUse A mlton/trunk/doc/guide/DefinitionOfStandardML A mlton/trunk/doc/guide/Defunctorize A mlton/trunk/doc/guide/Developers A mlton/trunk/doc/guide/Development A mlton/trunk/doc/guide/Documentation A mlton/trunk/doc/guide/Drawbacks A mlton/trunk/doc/guide/EXene A mlton/trunk/doc/guide/Eclipse A mlton/trunk/doc/guide/EditingPages A mlton/trunk/doc/guide/Elaborate A mlton/trunk/doc/guide/Emacs A mlton/trunk/doc/guide/Enscript A mlton/trunk/doc/guide/EqualityType A mlton/trunk/doc/guide/EqualityTypeVariable A mlton/trunk/doc/guide/Experimental A mlton/trunk/doc/guide/FAQ A mlton/trunk/doc/guide/Features A mlton/trunk/doc/guide/FirstClassPolymorphism A mlton/trunk/doc/guide/Flatten A mlton/trunk/doc/guide/ForLoops A mlton/trunk/doc/guide/ForeignFunctionInterface A mlton/trunk/doc/guide/ForeignFunctionInterfaceSyntax A mlton/trunk/doc/guide/ForeignFunctionInterfaceTypes A mlton/trunk/doc/guide/FrontEnd A mlton/trunk/doc/guide/FunctionalRecordUpdate A mlton/trunk/doc/guide/GarbageCollection A mlton/trunk/doc/guide/GenerativeDatatype A mlton/trunk/doc/guide/GenerativeException A mlton/trunk/doc/guide/Globalize A mlton/trunk/doc/guide/GnuMP A mlton/trunk/doc/guide/HaMLet A mlton/trunk/doc/guide/HenryCejtin A mlton/trunk/doc/guide/History A mlton/trunk/doc/guide/Home A mlton/trunk/doc/guide/HowProfilingWorks A mlton/trunk/doc/guide/Identifier A mlton/trunk/doc/guide/Immutable A mlton/trunk/doc/guide/ImperativeTypeVariable A mlton/trunk/doc/guide/ImplementExceptions A mlton/trunk/doc/guide/ImplementHandlers A mlton/trunk/doc/guide/ImplementProfiling A mlton/trunk/doc/guide/ImplementSuffix A mlton/trunk/doc/guide/Index A mlton/trunk/doc/guide/InfixingOperators A mlton/trunk/doc/guide/Inline A mlton/trunk/doc/guide/InsertLimitChecks A mlton/trunk/doc/guide/InsertSignalChecks A mlton/trunk/doc/guide/Installation A mlton/trunk/doc/guide/IntermediateLanguage A mlton/trunk/doc/guide/IntroduceLoops A mlton/trunk/doc/guide/JesperLouisAndersen A mlton/trunk/doc/guide/JohnnyAndersen A mlton/trunk/doc/guide/KnownCase A mlton/trunk/doc/guide/LambdaFree A mlton/trunk/doc/guide/LanguageChanges A mlton/trunk/doc/guide/Lazy A mlton/trunk/doc/guide/Libraries A mlton/trunk/doc/guide/License A mlton/trunk/doc/guide/LineDirective A mlton/trunk/doc/guide/LocalFlatten A mlton/trunk/doc/guide/LocalRef A mlton/trunk/doc/guide/LoopInvariant A mlton/trunk/doc/guide/ML A mlton/trunk/doc/guide/MLBasis A mlton/trunk/doc/guide/MLBasisAnnotationExamples A mlton/trunk/doc/guide/MLBasisAnnotations A mlton/trunk/doc/guide/MLBasisAvailableLibraries A mlton/trunk/doc/guide/MLBasisExamples A mlton/trunk/doc/guide/MLBasisPathMap A mlton/trunk/doc/guide/MLBasisSyntaxAndSemantics A mlton/trunk/doc/guide/MLKit A mlton/trunk/doc/guide/MLNLFFI A mlton/trunk/doc/guide/MLNLFFIImplementation A mlton/trunk/doc/guide/MLj A mlton/trunk/doc/guide/MLtonArray A mlton/trunk/doc/guide/MLtonBinIO A mlton/trunk/doc/guide/MLtonCont A mlton/trunk/doc/guide/MLtonExn A mlton/trunk/doc/guide/MLtonFinalizable A mlton/trunk/doc/guide/MLtonGC A mlton/trunk/doc/guide/MLtonIO A mlton/trunk/doc/guide/MLtonIntInf A mlton/trunk/doc/guide/MLtonItimer A mlton/trunk/doc/guide/MLtonPlatform A mlton/trunk/doc/guide/MLtonPointer A mlton/trunk/doc/guide/MLtonProcEnv A mlton/trunk/doc/guide/MLtonProcess A mlton/trunk/doc/guide/MLtonProfile A mlton/trunk/doc/guide/MLtonRandom A mlton/trunk/doc/guide/MLtonRlimit A mlton/trunk/doc/guide/MLtonRusage A mlton/trunk/doc/guide/MLtonSignal A mlton/trunk/doc/guide/MLtonSocket A mlton/trunk/doc/guide/MLtonStructure A mlton/trunk/doc/guide/MLtonSyslog A mlton/trunk/doc/guide/MLtonTextIO A mlton/trunk/doc/guide/MLtonThread A mlton/trunk/doc/guide/MLtonVector A mlton/trunk/doc/guide/MLtonWeak A mlton/trunk/doc/guide/MLtonWord A mlton/trunk/doc/guide/MLtonWorld A mlton/trunk/doc/guide/Machine A mlton/trunk/doc/guide/ManualPage A mlton/trunk/doc/guide/MatchCompilation A mlton/trunk/doc/guide/MatchCompile A mlton/trunk/doc/guide/MatthewFluet A mlton/trunk/doc/guide/MichaelNorrish A mlton/trunk/doc/guide/MikeThomas A mlton/trunk/doc/guide/MoinMoin A mlton/trunk/doc/guide/Monomorphise A mlton/trunk/doc/guide/MoscowML A mlton/trunk/doc/guide/Multi A mlton/trunk/doc/guide/Mutable A mlton/trunk/doc/guide/OCaml A mlton/trunk/doc/guide/ObjectOrientedProgramming A mlton/trunk/doc/guide/OpenGL A mlton/trunk/doc/guide/OperatorPrecedence A mlton/trunk/doc/guide/OptionalArguments A mlton/trunk/doc/guide/OrphanedPages A mlton/trunk/doc/guide/OtherSites A mlton/trunk/doc/guide/Overloading A mlton/trunk/doc/guide/PackedRepresentation A mlton/trunk/doc/guide/PageSize A mlton/trunk/doc/guide/Papers A mlton/trunk/doc/guide/ParallelMove A mlton/trunk/doc/guide/Performance A mlton/trunk/doc/guide/PhantomType A mlton/trunk/doc/guide/PlatformSpecificNotes A mlton/trunk/doc/guide/PolyEqual A mlton/trunk/doc/guide/PolyML A mlton/trunk/doc/guide/PolymorphicEquality A mlton/trunk/doc/guide/Polyvariance A mlton/trunk/doc/guide/PortingMLton A mlton/trunk/doc/guide/PrecedenceParse A mlton/trunk/doc/guide/Printf A mlton/trunk/doc/guide/PrintfGentle A mlton/trunk/doc/guide/ProductType A mlton/trunk/doc/guide/Profiling A mlton/trunk/doc/guide/ProfilingAllocation A mlton/trunk/doc/guide/ProfilingCounts A mlton/trunk/doc/guide/ProfilingTheStack A mlton/trunk/doc/guide/ProfilingTime A mlton/trunk/doc/guide/Projects A mlton/trunk/doc/guide/Pronounce A mlton/trunk/doc/guide/PropertyList A mlton/trunk/doc/guide/RSSA A mlton/trunk/doc/guide/RSSAShrink A mlton/trunk/doc/guide/RSSASimplify A mlton/trunk/doc/guide/RayRacine A mlton/trunk/doc/guide/Redundant A mlton/trunk/doc/guide/RedundantTests A mlton/trunk/doc/guide/RefFlatten A mlton/trunk/doc/guide/References A mlton/trunk/doc/guide/Regions A mlton/trunk/doc/guide/ReleaseChecklist A mlton/trunk/doc/guide/RemoveUnused A mlton/trunk/doc/guide/Restore A mlton/trunk/doc/guide/RunTimeOptions A mlton/trunk/doc/guide/RunningOnCygwin A mlton/trunk/doc/guide/RunningOnDarwin A mlton/trunk/doc/guide/RunningOnFreeBSD A mlton/trunk/doc/guide/RunningOnLinux A mlton/trunk/doc/guide/RunningOnMinGW A mlton/trunk/doc/guide/RunningOnNetBSD A mlton/trunk/doc/guide/RunningOnOpenBSD A mlton/trunk/doc/guide/RunningOnPowerPC A mlton/trunk/doc/guide/RunningOnSolaris A mlton/trunk/doc/guide/RunningOnSparc A mlton/trunk/doc/guide/SMLNET A mlton/trunk/doc/guide/SMLNJ A mlton/trunk/doc/guide/SMLNJDeviations A mlton/trunk/doc/guide/SMLNJLibrary A mlton/trunk/doc/guide/SMLofNJStructure A mlton/trunk/doc/guide/SSA A mlton/trunk/doc/guide/SSA2 A mlton/trunk/doc/guide/SSA2Simplify A mlton/trunk/doc/guide/SSASimplify A mlton/trunk/doc/guide/SXML A mlton/trunk/doc/guide/SXMLShrink A mlton/trunk/doc/guide/SXMLSimplify A mlton/trunk/doc/guide/ScopeInference A mlton/trunk/doc/guide/SelfCompiling A mlton/trunk/doc/guide/Serialization A mlton/trunk/doc/guide/ShowBasis A mlton/trunk/doc/guide/Shrink A mlton/trunk/doc/guide/SimplifyTypes A mlton/trunk/doc/guide/Sources A mlton/trunk/doc/guide/SpaceSafety A mlton/trunk/doc/guide/StandardML A mlton/trunk/doc/guide/StandardMLBooks A mlton/trunk/doc/guide/StandardMLHistory A mlton/trunk/doc/guide/StandardMLImplementations A mlton/trunk/doc/guide/StandardMLPortability A mlton/trunk/doc/guide/StandardMLTutorials A mlton/trunk/doc/guide/StephenWeeks A mlton/trunk/doc/guide/StyleGuide A mlton/trunk/doc/guide/Subversion A mlton/trunk/doc/guide/SureshJagannathan A mlton/trunk/doc/guide/Survey A mlton/trunk/doc/guide/SurveyDone A mlton/trunk/doc/guide/Swerve A mlton/trunk/doc/guide/SyntacticConventions A mlton/trunk/doc/guide/SystemInfo A mlton/trunk/doc/guide/TILT A mlton/trunk/doc/guide/Talk A mlton/trunk/doc/guide/TalkDiveIn A mlton/trunk/doc/guide/TalkFolkLore A mlton/trunk/doc/guide/TalkFromSMLTo A mlton/trunk/doc/guide/TalkHowHigherOrder A mlton/trunk/doc/guide/TalkHowModules A mlton/trunk/doc/guide/TalkHowPolymorphism A mlton/trunk/doc/guide/TalkMLtonApproach A mlton/trunk/doc/guide/TalkMLtonFeatures A mlton/trunk/doc/guide/TalkMLtonHistory A mlton/trunk/doc/guide/TalkStandardML A mlton/trunk/doc/guide/TalkTemplate A mlton/trunk/doc/guide/TalkWholeProgram A mlton/trunk/doc/guide/ToMachine A mlton/trunk/doc/guide/ToRSSA A mlton/trunk/doc/guide/ToSSA2 A mlton/trunk/doc/guide/TrustedGroup A mlton/trunk/doc/guide/TypeChecking A mlton/trunk/doc/guide/TypeConstructor A mlton/trunk/doc/guide/TypeVariableScope A mlton/trunk/doc/guide/Unicode A mlton/trunk/doc/guide/UniversalType A mlton/trunk/doc/guide/UnresolvedBugs A mlton/trunk/doc/guide/UnsafeStructure A mlton/trunk/doc/guide/Useless A mlton/trunk/doc/guide/UserGuide A mlton/trunk/doc/guide/Users A mlton/trunk/doc/guide/ValueRestriction A mlton/trunk/doc/guide/Variant A mlton/trunk/doc/guide/VesaKarvonen A mlton/trunk/doc/guide/WantedPages A mlton/trunk/doc/guide/WebSite A mlton/trunk/doc/guide/WesleyTerpstra A mlton/trunk/doc/guide/WholeProgramOptimization A mlton/trunk/doc/guide/WikiMacros A mlton/trunk/doc/guide/WikiName A mlton/trunk/doc/guide/WikiTool A mlton/trunk/doc/guide/XML A mlton/trunk/doc/guide/XMLShrink A mlton/trunk/doc/guide/XMLSimplify A mlton/trunk/doc/guide/XMLSimplifyTypes A mlton/trunk/doc/guide/ZZZOrphanedPages A mlton/trunk/doc/guide/Zone A mlton/trunk/doc/guide/common.css A mlton/trunk/doc/guide/index.html A mlton/trunk/doc/guide/mGTK A mlton/trunk/doc/guide/moin-bottom.png A mlton/trunk/doc/guide/moin-email.png A mlton/trunk/doc/guide/moin-ftp.png A mlton/trunk/doc/guide/moin-top.png A mlton/trunk/doc/guide/moin-www.png A mlton/trunk/doc/guide/print.css A mlton/trunk/doc/guide/screen.css ---------------------------------------------------------------------- Added: mlton/trunk/doc/guide/AST =================================================================== --- mlton/trunk/doc/guide/AST 2005-09-06 04:17:48 UTC (rev 4069) +++ mlton/trunk/doc/guide/AST 2005-09-06 04:18:56 UTC (rev 4070) @@ -0,0 +1,86 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> +<meta name="robots" content="index,nofollow"> + + + +<title>AST - MLton Standard ML Compiler (SML Compiler)</title> +<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="all" href="common.css"> +<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="screen" href="screen.css"> +<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="print" href="print.css"> + + +<link rel="Start" href="Home"> + + +</head> + +<body lang="en" dir="ltr"> + +<table bgcolor = lightblue cellspacing = 0 style = "border: 0px;" width = 100%> + <tr> + <td style = " + border: 0px; + color: darkblue; + font-size: 150%; + text-align: left;"> + <a class = mltona href="Home">MLton 20050905</a> + <td style = " + border: 0px; + font-size: 150%; + text-align: center; + width: 50%;"> + AST + <td style = " + border: 0px; + text-align: right;"> + <table cellspacing = 0 style = "border: 0px"> + <tr style = "vertical-align: middle;"> + </table> + <tr style = "background-color: white;"> + <td colspan = 3 + style = " + border: 0px; + font-size:70%; + text-align: right;"> + <a href = "Home">Home</a> + <a href = "Index">Index</a> + +</table> +<div id="content" lang="en" dir="ltr"> +An <a href="IntermediateLanguage">IntermediateLanguage</a>, produced by the <a href="FrontEnd">FrontEnd</a> and translated by <a href="Elaborate">Elaborate</a> to <a href="CoreML">CoreML</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2> +<p> +The abstract syntax tree produced by the <a href="FrontEnd">FrontEnd</a>. +</p> +<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2> + +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast/ast-programs.sig?view=markup">ast-programs.sig</a> + +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast/ast-programs.fun?view=markup">ast-programs.fun</a> +<br> + +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast/ast-modules.sig?view=markup">ast-modules.sig</a> + +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast/ast-modules.fun?view=markup">ast-modules.fun</a> +<br> + +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast/ast-core.sig?view=markup">ast-core.sig</a> + +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast/ast-core.fun?view=markup">ast-core.fun</a> +<br> + +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast">ast</a> + <h2 id="head-a6de4b535fedeaa8890bd890b60fe09f87b5f96a">Type Checking</h2> +<p> +The AST <a href="IntermediateLanguage">IntermediateLanguage</a> has no independent type checker. Type inference is performed on an AST program as part of <a href="Elaborate">Elaborate</a>. +</p> +<h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2> +</div> + + + +<p> +<hr> +Last edited on 2005-08-19 15:43:32 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>. +</body></html> Added: mlton/trunk/doc/guide/AccessControl =================================================================== --- mlton/trunk/doc/guide/AccessControl 2005-09-06 04:17:48 UTC (rev 4069) +++ mlton/trunk/doc/guide/AccessControl 2005-09-06 04:18:56 UTC (rev 4070) @@ -0,0 +1,65 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> +<meta name="robots" content="index,nofollow"> + + + +<title>AccessControl - MLton Standard ML Compiler (SML Compiler)</title> +<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="all" href="common.css"> +<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="screen" href="screen.css"> +<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="print" href="print.css"> + + +<link rel="Start" href="Home"> + + +</head> + +<body lang="en" dir="ltr"> + +<table bgcolor = lightblue cellspacing = 0 style = "border: 0px;" width = 100%> + <tr> + <td style = " + border: 0px; + color: darkblue; + font-size: 150%; + text-align: left;"> + <a class = mltona href="Home">MLton 20050905</a> + <td style = " + border: 0px; + font-size: 150%; + text-align: center; + width: 50%;"> + AccessControl + <td style = " + border: 0px; + text-align: right;"> + <table cellspacing = 0 style = "border: 0px"> + <tr style = "vertical-align: middle;"> + </table> + <tr style = "background-color: white;"> + <td colspan = 3 + style = " + border: 0px; + font-size:70%; + text-align: right;"> + <a href = "Home">Home</a> + <a href = "Index">Index</a> + +</table> +<div id="content" lang="en" dir="ltr"> +<a href="MoinMoin">MoinMoin</a> supports a lot of <a class="external" href="http://moinmaster.wikiwikiweb.de/HelpOnAccessControlLists"><img src="moin-www.png" alt="[WWW]" height="11" width="11">access control features</a>. <p> +Because people download binaries from the MLton web site, and we are worried about malicious users either changing those binaries, or changing the links that should point at those binaries, we only allow editing of some pages (in particular, <a href="http://mlton.org/Download">Download</a>, <a href="Home">Home</a>, and <a href="Experimental">Experimental</a>) by <a href="TrustedGroup">TrustedGroup</a> members. +</p> +<p> +All other pages are freely editable by any user with an account. +</p> +</div> + + + +<p> +<hr> +Last edited on 2004-10-29 22:30:46 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>. +</body></html> Added: mlton/trunk/doc/guide/AdmitsEquality =================================================================== --- mlton/trunk/doc/guide/AdmitsEquality 2005-09-06 04:17:48 UTC (rev 4069) +++ mlton/trunk/doc/guide/AdmitsEquality 2005-09-06 04:18:56 UTC (rev 4070) @@ -0,0 +1,289 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> +<meta name="robots" content="index,nofollow"> + + + +<title>AdmitsEquality - MLton Standard ML Compiler (SML Compiler)</title> +<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="all" href="common.css"> +<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="screen" href="screen.css"> +<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="print" href="print.css"> + + +<link rel="Start" href="Home"> + + +</head> + +<body lang="en" dir="ltr"> + +<table bgcolor = lightblue cellspacing = 0 style = "border: 0px;" width = 100%> + <tr> + <td style = " + border: 0px; + color: darkblue; + font-size: 150%; + text-align: left;"> + <a class = mltona href="Home">MLton 20050905</a> + <td style = " + border: 0px; + font-size: 150%; + text-align: center; + width: 50%;"> + AdmitsEquality + <td style = " + border: 0px; + text-align: right;"> + <table cellspacing = 0 style = "border: 0px"> + <tr style = "vertical-align: middle;"> + </table> + <tr style = "background-color: white;"> + <td colspan = 3 + style = " + border: 0px; + font-size:70%; + text-align: right;"> + <a href = "Home">Home</a> + <a href = "Index">Index</a> + +</table> +<div id="content" lang="en" dir="ltr"> +A <a href="TypeConstructor">TypeConstructor</a> admits equality if whenever it is applied to equality types, the result is an <a href="EqualityType">EqualityType</a>. This notion enables one to determine whether a type constructor application yields an equality type solely from the application, without looking at the definition of the type constructor. It helps to ensure that <a href="PolymorphicEquality">PolymorphicEquality</a> is only applied to sensible values. <p> +The definition of admits equality depends on whether the type constructor was declared by a <tt>type</tt> definition or a <tt>datatype</tt> declaration. +</p> +<h2 id="head-67921ac307a0edfd915b53407b84c8c0457981a2">Type definitions</h2> +<p> +For type definition +</p> + +<pre class=code> +<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> ('a1, ..., 'an) t </FONT></B>=<FONT COLOR="#228B22"><B> </FONT></B>... +</PRE> +<p> + +</p> +<p> +type constructor <tt>t</tt> admits equality if the right-hand side of the definition is an equality type after replacing <tt>'a1</tt>, ..., <tt>'an</tt> by equality types (it doesn't matter which equality types are chosen). +</p> +<p> +For a nullary type definition, this amounts to the right-hand side being an equality type. For example, after the definition +</p> + +<pre class=code> +<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> bool * int +</FONT></B></PRE> +<p> + +</p> +<p> +type constructor <tt>t</tt> admits equality because <tt>bool * int</tt> is an equality type. On the other hand, after the definition +</p> + +<pre class=code> +<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> bool * int * real +</FONT></B></PRE> +<p> + +</p> +<p> +type constructor <tt>t</tt> does not admit equality, because <tt>real</tt> is not an equality type. +</p> +<p> +For another example, after the definition +</p> + +<pre class=code> +<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B>=<FONT COLOR="#228B22"><B> bool * 'a +</FONT></B></PRE> +<p> + +</p> +<p> +type constructor <tt>t</tt> admits equality because <tt>bool * int</tt> is an equality type (we could have chosen any equality type other than <tt>int</tt>). +</p> +<p> +On the other hand, after the definition +</p> + +<pre class=code> +<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B>=<FONT COLOR="#228B22"><B> real * 'a +</FONT></B></PRE> +<p> + +</p> +<p> +type constructor <tt>t</tt> does not admit equality becuase <tt>real * int</tt> is not equality type. +</p> +<p> +We can check that a type constructor admits equality using an <tt>eqtype</tt> specification. +</p> + +<pre class=code> +<B><FONT COLOR="#0000FF">structure</FONT></B> Ok: <B><FONT COLOR="#0000FF">sig</FONT></B> <B><FONT COLOR="#A020F0">eqtype</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B> = + <B><FONT COLOR="#0000FF">struct</FONT></B> + <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B>=<FONT COLOR="#228B22"><B> bool * 'a + </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B> +</PRE> +<p> + +</p> + +<pre class=code> +<B><FONT COLOR="#0000FF">structure</FONT></B> Bad: <B><FONT COLOR="#0000FF">sig</FONT></B> <B><FONT COLOR="#A020F0">eqtype</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B> = + <B><FONT COLOR="#0000FF">struct</FONT></B> + <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B>=<FONT COLOR="#228B22"><B> real * int * 'a + </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B> +</PRE> +<p> + +</p> +<p> +On <tt>structure Bad</tt>, MLton reports the following error. +<pre>Type t admits equality in signature but not in structure. + not equality: real * _ * _ +</pre>The <tt>not equality</tt> section provides an explanation of why the type did not admit equality, highlighting the problematic component (<tt>real</tt>). +</p> +<h2 id="head-c494234542affd2943bc7247d524477b03bc18bc">Datatype declarations</h2> +<p> +For a type constructor declared by a datatype declaration to admit equality, every variant of the datatype must admit equality. For example, the following datatype admits equality because <tt>bool</tt> and <tt>char * int</tt> are equality types. +</p> + +<pre class=code> +<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> bool </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> char * int +</FONT></B></PRE> +<p> + +</p> +<p> +Nullary constructors trivially admit equality, so that the following datatype admits equality. +<pre class=code> +<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">C</FONT> +</FONT></B></PRE> + +</p> +<p> +For a parameterized datatype constructor to admit equality, we consider each variant as a type definition, and require that the definition admit equality. For example, for the datatype +</p> + +<pre class=code> +<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> bool * 'a </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'a +</FONT></B></PRE> +<p> + +</p> +<p> +the type definitions +</p> + +<pre class=code> +<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a tA </FONT></B>=<FONT COLOR="#228B22"><B> bool * 'a +</FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a tB </FONT></B>=<FONT COLOR="#228B22"><B> 'a +</FONT></B></PRE> +<p> + +</p> +<p> +both admit equality. Thus, type constructor <tt>t</tt> admits equality. +</p> +<p> +On the other hand, the following datatype does not admit equality. +</p> + +<pre class=code> +<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> bool * 'a </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> real * 'a +</FONT></B></PRE> +<p> + +</p> +<p> +As with type definitions, we can check using an <tt>eqtype</tt> specification. +</p> + +<pre class=code> +<B><FONT COLOR="#0000FF">structure</FONT></B> Bad: <B><FONT COLOR="#0000FF">sig</FONT></B> <B><FONT COLOR="#A020F0">eqtype</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B> = + <B><FONT COLOR="#0000FF">struct</FONT></B> + <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> bool * 'a </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> real * 'a + </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B> +</PRE> +<p> + +</p> +<p> +MLton reports the following error. +</p> + +<pre>Type t admits equality in signature but not in structure. + not equality: B of real * _ +</pre><p> +MLton indicates the problematic constructor (<tt>B</tt>), as well as the problematic component of the constructor's argument. +</p> +<h3 id="head-c549e40c38aec54d5abd4cedb1559a45a15f6a81">Recursive datatypes</h3> +<p> +A recursive datatype like +</p> + +<pre class=code> +<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> int * t +</FONT></B></PRE> +<p> + +</p> +<p> +introduces a new problem, since in order to decide whether <tt>t</tt> admits equality, we need to know for the <tt>B</tt> variant whether <tt>t</tt> admits equality. The <a href="DefinitionOfStandardML">Definition</a> answers this question by requiring a type constructor to admit equality if it is consistent to do so. So, in our above example, if we assume that <tt>t</tt> admits equality, then the variant <tt>B of int * t</tt> admits equality. Then, since the <tt>A</tt> variant trivially admits equality, so does the type constructor <tt>t</tt>. Thus, it was consistent to assume that <tt>t</tt> admits equality, and so, <tt>t</tt> does admit equality. +</p> +<p> +On the other hand, in the following declaration +<pre class=code> +<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> real * t +</FONT></B></PRE> + if we assume that <tt>t</tt> admits equality, then the <tt>B</tt> variant does not admit equality. Hence, the type constructor <tt>t</tt> does not admit equality, and our assumption was inconsistent. Hence, <tt>t</tt> does not admit equality. +</p> +<p> +The same kind of reasoning applies to mutually recursive datatypes as well. For example, the following defines both <tt>t</tt> and <tt>u</tt> to admit equality. +<pre class=code> +<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> u +</FONT></B><B><FONT COLOR="#A020F0">and</FONT></B><FONT COLOR="#228B22"><B> u </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">C</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">D</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> t +</FONT></B></PRE> + +</p> +<p> +But the following defines neither <tt>t</tt> nor <tt>u</tt> to admit equality. +<pre class=code> +<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> u * real +</FONT></B><B><FONT COLOR="#A020F0">and</FONT></B><FONT COLOR="#228B22"><B> u </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">C</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">D</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> t +</FONT></B></PRE> + +</p> +<p> +As always, we can check whether a type admits equality using an <tt>eqtype</tt> specification. +</p> + +<pre class=code> +<B><FONT COLOR="#0000FF">structure</FONT></B> Bad: <B><FONT COLOR="#0000FF">sig</FONT></B> <B><FONT COLOR="#A020F0">eqtype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B><B><FONT COLOR="#A020F0">eqtype</FONT></B><FONT COLOR="#228B22"><B> u </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B> = + <B><FONT COLOR="#0000FF">struct</FONT></B> + <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> u * real + </FONT></B><B><FONT COLOR="#A020F0">and</FONT></B><FONT COLOR="#228B22"><B> u </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">C</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">D</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> t + </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B> +</PRE> +<p> + +</p> +<p> +Unfortunately, due to a bug in error reporting, MLton 20041109 prints an obscure internal bug message (<tt>Type.deArrow</tt>) and exits. The problem has been fixed, and MLton now reports +</p> + +<pre>Error: z.sml 1.16. + Type t admits equality in signature but not in structure. + not equality: B of u * real +Error: z.sml 1.16. + Type u admits equality in signature but not in structure. + not equality: D of t +</pre></div> + + + +<p> +<hr> +Last edited on 2005-01-26 20:48:53 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>. +</body></html> Added: mlton/trunk/doc/guide/Alice =================================================================== --- mlton/trunk/doc/guide/Alice 2005-09-06 04:17:48 UTC (rev 4069) +++ mlton/trunk/doc/guide/Alice 2005-09-06 04:18:56 UTC (rev 4070) @@ -0,0 +1,59 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> +<meta name="robots" content="index,nofollow"> + + + +<title>Alice - MLton Standard ML Compiler (SML Compiler)</title> +<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="all" href="common.css"> +<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="screen" href="screen.css"> +<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="print" href="print.css"> + + +<link rel="Start" href="Home"> + + +</head> + +<body lang="en" dir="ltr"> + +<table bgcolor = lightblue cellspacing = 0 style = "border: 0px;" width = 100%> + <tr> + <td style = " + border: 0px; + color: darkblue; + font-size: 150%; + text-align: left;"> + <a class = mltona href="Home">MLton 20050905</a> + <td style = " + border: 0px; + font-size: 150%; + text-align: center; + width: 50%;"> + Alice + <td style = " + border: 0px; + text-align: right;"> + <table cellspacing = 0 style = "border: 0px"> + <tr style = "vertical-align: middle;"> + </table> + <tr style = "background-color: white;"> + <td colspan = 3 + style = " + border: 0px; + font-size:70%; + text-align: right;"> + <a href = "Home">Home</a> + <a href = "Index">Index</a> + +</table> +<div id="content" lang="en" dir="ltr"> +<a class="external" href="http://www.ps.uni-sb.de/alice/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Alice</a> is an extension of SML with concurrency, distribution, and constraint solving. </div> + + + +<p> +<hr> +Last edited on 2004-12-28 19:46:32 by <span title="adsl-64-166-225-13.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>. +</body></html> Added: mlton/trunk/doc/guide/AllocateRegisters =================================================================== --- mlton/trunk/doc/guide/AllocateRegisters 2005-09-06 04:17:48 UTC (rev 4069) +++ mlton/trunk/doc/guide/AllocateRegisters 2005-09-06 04:18:56 UTC (rev 4070) @@ -0,0 +1,69 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> +<meta name="robots" content="index,nofollow"> + + + +<title>AllocateRegisters - MLton Standard ML Compiler (SML Compiler)</title> +<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="all" href="common.css"> +<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="screen" href="screen.css"> +<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="print" href="print.css"> + + +<link rel="Start" href="Home"> + + +</head> + +<body lang="en" dir="ltr"> + +<table bgcolor = lightblue cellspacing = 0 style = "border: 0px;" width = 100%> + <tr> + <td style = " + border: 0px; + color: darkblue; + font-size: 150%; + text-align: left;"> + <a class = mltona href="Home">MLton 20050905</a> + <td style = " + border: 0px; + font-size: 150%; + text-align: center; + width: 50%;"> + AllocateRegisters + <td style = " + border: 0px; + text-align: right;"> + <table cellspacing = 0 style = "border: 0px"> + <tr style = "vertical-align: middle;"> + </table> + <tr style = "background-color: white;"> + <td colspan = 3 + style = " + border: 0px; + font-size:70%; + text-align: right;"> + <a href = "Home">Home</a> + <a href = "Index">Index</a> + +</table> +<div id="content" lang="en" dir="ltr"> +An analysis pass for the <a href="RSSA">RSSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="ToMachine">ToMachine</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2> +<p> +Computes an allocation of <a href="RSSA">RSSA</a> variables as <a href="Machine">Machine</a> register or stack operands. +</p> +<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2> + +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ZZZ.sig?view=markup">ZZZ.sig</a> + +<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ZZZ.fun?view=markup">ZZZ.fun</a> + <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2> +</div> + + + +<p> +<hr> +Last edited on 2005-08-19 15:43:18 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>. +</body></html> Added: mlton/trunk/doc/guide/AndreiFormiga =================================================================== --- mlton/trunk/doc/guide/AndreiFormiga 2005-09-06 04:17:48 UTC (rev 4069) +++ mlton/trunk/doc/guide/AndreiFormiga 2005-09-06 04:18:56 UTC (rev 4070) @@ -0,0 +1,62 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> +<meta name="robots" content="index,nofollow"> + + + +<title>AndreiFormiga - MLton Standard ML Compiler (SML Compiler)</title> +<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="all" href="common.css"> +<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="screen" href="screen.css"> +<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="print" href="print.css"> + + +<link rel="Start" href="Home"> + + +</head> + +<body lang="en" dir="ltr"> + +<table bgcolor = lightblue cellspacing = 0 style = "border: 0px;" width = 100%> + <tr> + <td style = " + border: 0px; + color: darkblue; + font-size: 150%; + text-align: left;"> + <a class = mltona href="Home">MLton 20050905</a> + <td style = " + border: 0px; + font-size: 150%; + text-align: center; + width: 50%;"> + AndreiFormiga + <td style = " + border: 0px; + text-align: right;"> + <table cellspacing = 0 style = "border: 0px"> + <tr style = "vertical-align: middle;"> + </table> + <tr style = "background-color: white;"> + <td colspan = 3 + style = " + border: 0px; + font-size:70%; + text-align: right;"> + <a href = "Home">Home</a> + <a href = "Index">Index</a> + +</table> +<div id="content" lang="en" dir="ltr"> +I'm a graduate student just back in academia. I study concurrent and parallel systems, with a great deal of interest in programming languages (theory, design, implementation). I happen to like functional languages. <p> +I use the nickname tautologico on #sml and my email is andrei DOT formiga AT gmail DOT com. +</p> +</div> + + + +<p> +<hr> +Last edited on 2004-11-20 18:17:19 by <span title="PW5.neoline.com.br"><a href="AndreiFormiga">AndreiFormiga</a></span>. +</body></html> Added: mlton/trunk/doc/guide/BasisLibrary =================================================================== --- mlton/trunk/doc/guide/BasisLibrary 2005-09-06 04:17:48 UTC (rev 4069) +++ mlton/trunk/doc/guide/BasisLibrary 2005-09-06 04:18:56 UTC (rev 4070) @@ -0,0 +1,429 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> +<meta name="robots" content="index,nofollow"> + + + +<title>BasisLibrary - MLton Standard ML Compiler (SML Compiler)</title> +<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="all" href="common.css"> +<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="screen" href="screen.css"> +<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="print" href="print.css"> + + +<link rel="Start" href="Home"> + + +</head> + +<body lang="en" dir="ltr"> + +<table bgcolor = lightblue cellspacing = 0 style = "border: 0px;" width = 100%> + <tr> + <td style = " + border: 0px; + color: darkblue; + font-size: 150%; + text-align: left;"> + <a class = mltona href="Home">MLton 20050905</a> + <td style = " + border: 0px; + font-size: 150%; + text-align: center; + width: 50%;"> + BasisLibrary + <td style = " + border: 0px; + text-align: right;"> + <table cellspacing = 0 style = "border: 0px"> + <tr style = "vertical-align: middle;"> + </table> + <tr style = "background-color: white;"> + <td colspan = 3 + style = " + border: 0px; + font-size:70%; + text-align: right;"> + <a href = "Home">Home</a> + <a href = "Index">Index</a> + +</table> +<div id="content" lang="en" dir="ltr"> +The <a href="StandardML">Standard ML</a> Basis Library is a collection of modules dealing with basic types, input/output, OS interfaces, and simple datatypes. It is intended as a portable library usable across all implementations of SML. The official online version of the Basis Library specification is at <a href="http://www.standardml.org/Basis/">http://www.standardml.org/Basis/</a>. We keep a copy at <a href="http://mlton.org/basis/">http://mlton.org/basis/</a>. There is a <a href = "References#GansnerReppy04"> book</a> that includes all of the online version and more. For a reverse chronological list of changes to the specification, see <a href="http://www.standardml.org/Basis/history.html">http://www.standardml.org/Basis/history.html</a>. <p> +MLton implements all of the required portions of the Basis Library. MLton also implements many of the optional structures. You can obtain a complete and current list of what's available using <tt>mlton -show-basis</tt> (see <a href="ShowBasis">ShowBasis</a>). By default, MLton makes the Basis Library available to user programs. You can also <a href="MLBasisAvailableLibraries">access the Basis Library</a> from <a href="MLBasis"> ML Basis</a> files. +</p> +<p> +Below is a complete list of what MLton implements. +</p> +<p> +<ol> +<li> +<a href="#head-70fc2366a62cb01199100a964219491009c92c85">Top-level types and constructors</a></li> +<li> +<a href="#head-f3c583ffa7ae975564fe862325a230f0750a322b">Top-level exception constructors</a></li> +<li> +<a href="#head-ee76afd3593ec7eebc14e2997b54ea6c04a954e4">Top-level values</a></li> +<li> +<a href="#head-e7c522e93b83af8b25a4e0082f6849c2de12c363">Overloaded identifiers</a></li> +<li> +<a href="#head-82711a51cf5a5c66b9e97529f31b2a608b0d9f96">Top-level signatures</a></li> +<li> +<a href="#head-82cd3eec71dfcc66e035e18592934036165aa125">Top-level structures</a></li> +<li> +<a href="#head-0ac17def4aced0cc961aa5b65385be04cfcf6eb5">Type equivalences</a></li> +<li> +<a href="#head-bc488aeca21efb00463538004d56839b48f23e7d">Real and Math functions</a></li> +<li> +<a href="#head-e38fb58e344e0ee67d4aa08c60df9fbd642e8e1c">Top-level functors</a></li> +</ol> + + +</p> +<h2 id="head-70fc2366a62cb01199100a964219491009c92c85">Top-level types and constructors</h2> +<p> +<tt>eqtype 'a array</tt> <br> +<tt>datatype bool = false | true</tt> <br> +<tt>eqtype char</tt> <br> +<tt>type exn</tt> <br> +<tt>eqtype int</tt> <br> +<tt>datatype 'a list = nil | :: of ('a * 'a list)</tt> <br> +<tt>datatype 'a option = NONE | SOME of 'a</tt> <br> +<tt>datatype order = EQUAL | GREATER | LESS</tt> <br> +<tt>type real</tt> <br> +<tt>datatype 'a ref = ref of 'a</tt> <br> +<tt>eqtype string</tt> <br> +<tt>type substring</tt> <br> +<tt>eqtype unit</tt> <br> +<tt>eqtype 'a vector</tt> <br> +<tt>eqtype word</tt> +</p> +<h2 id="head-f3c583ffa7ae975564fe862325a230f0750a322b">Top-level exception constructors</h2> +<p> +<tt>Bind</tt>, <tt>Chr</tt>, <tt>Div</tt>, <tt>Domain</tt>, <tt>Empty</tt>, <tt>Fail</tt>, <tt>Match</tt>, <tt>Option</tt>, <tt>Overflow</tt>, <tt>Size</tt>, <tt>Span</tt>, <tt>Subscript</tt>. +</p> +<h2 id="head-ee76afd3593ec7eebc14e2997b54ea6c04a954e4">Top-level values</h2> +<p> +MLton does not implement the optional top-level value <tt>use: string -> unit</tt>, which conflicts with whole-program compilation because it allows new code to be loaded dynamically. MLton implements all other top-level values: +</p> +<p> +<tt>!</tt>, <tt>:=</tt>, <tt><></tt>, <tt>=</tt>, <tt>@</tt>, <tt>^</tt>, <tt>app</tt>, <tt>before</tt>, <tt>ceil</tt>, <tt>chr</tt>, <tt>concat</tt>, <tt>exnMessage</tt>, <tt>exnName</tt>, <tt>explode</tt>, <tt>floor</tt>, <tt>foldl</tt>, <tt>foldr</tt>, <tt>getOpt</tt>, <tt>hd</tt>, <tt>ignore</tt>, <tt>implode</tt>, <tt>isSome</tt>, <tt>length</tt>, <tt>map</tt>, <tt>not</tt>, <tt>null</tt>, <tt>o</tt>, <tt>ord</tt>, <tt>print</tt>, <tt>real</tt>, <tt>rev</tt>, <tt>round</tt>, <tt>size</tt>, <tt>str</tt>, <tt>substring</tt>, <tt>tl</tt>, <tt>trunc</tt>, <tt>valOf</tt>, <tt>vector</tt>. +</p> +<h2 id="head-e7c522e93b83af8b25a4e0082f6849c2de12c363">Overloaded identifiers</h2> +<p> +<tt>*</tt>, <tt>+</tt>, <tt>-</tt>, <tt>/</tt>, <tt><</tt>, <tt><=</tt>, <tt>></tt>, <tt>>=</tt>, <tt>~</tt>, <tt>abs</tt>, <tt>div</tt>, <tt>mod</tt>. +</p> +<h2 id="head-82711a51cf5a5c66b9e97529f31b2a608b0d9f96">Top-level signatures</h2> +<p> +<tt>ARRAY</tt> <br> +<tt>ARRAY2</tt> <br> +<tt>ARRAY_SLICE</tt> <br> +<tt>BIN_IO</tt> <br> +<tt>BIT_FLAGS</tt> <br> +<tt>BOOL</tt> <br> +<tt>BYTE</tt> <br> +<tt>CHAR</tt> <br> +<tt>COMMAND_LINE</tt> <br> +<tt>DATE</tt> <br> +<tt>GENERAL</tt> <br> +<tt>GENERIC_SOCK</tt> <br> +<tt>IEEE_REAL</tt> <br> +<tt>IMPERATIVE_IO</tt> <br> +<tt>INET_SOCK</tt> <br> +<tt>INTEGER</tt> <br> +<tt>INT_INF</tt> <br> +<tt>IO</tt> <br> +<tt>LIST</tt> <br> +<tt>LIST_PAIR</tt> <br> +<tt>MATH</tt> <br> +<tt>MONO_ARRAY</tt> <br> +<tt>MONO_ARRAY2</tt> <br> +<tt>MONO_ARRAY_SLICE</tt> <br> +<tt>MONO_VECTOR</tt> <br> +<tt>MONO_VECTOR_SLICE</tt> <br> +<tt>NET_HOST_DB</tt> <br> +<tt>NET_PROT_DB</tt> <br> +<tt>NET_SERV_DB</tt> <br> +<tt>OPTION</tt> <br> +<tt>OS</tt> <br> +<tt>OS_FILE_SYS</tt> <br> +<tt>OS_IO</tt> <br> +<tt>OS_PATH</tt> <br> +<tt>OS_PROCESS</tt> <br> +<tt>PACK_REAL</tt> <br> +<tt>PACK_WORD</tt> <br> +<tt>POSIX</tt> <br> +<tt>POSIX_ERROR</tt> <br> +<tt>POSIX_FILE_SYS</tt> <br> +<tt>POSIX_IO</tt> <br> +<tt>POSIX_PROCESS</tt> <br> +<tt>POSIX_PROC_ENV</tt> <br> +<tt>POSIX_SIGNAL</tt> <br> +<tt>POSIX_SYS_DB</tt> <br> +<tt>POSIX_TTY</tt> <br> +<tt>PRIM_IO</tt> <br> +<tt>REAL</tt> <br> +<tt>SOCKET</tt> <br> +<tt>STREAM_IO</tt> <br> +<tt>STRING</tt> <br> +<tt>STRING_CVT</tt> <br> +<tt>SUBSTRING</tt> <br> +<tt>TEXT</tt> <br> +<tt>TEXT_IO</tt> <br> +<tt>TEXT_STREAM_IO</tt> <br> +<tt>TIME</tt> <br> +<tt>TIMER</tt> <br> +<tt>UNIX</tt> <br> +<tt>UNIX_SOCK</tt> <br> +<tt>VECTOR</tt> <br> +<tt>VECTOR_SLICE</tt> <br> +<tt>WORD</tt> +</p> +<h2 id="head-82cd3eec71dfcc66e035e18592934036165aa125">Top-level structures</h2> +<p> +<tt>structure Array: ARRAY</tt> <br> +<tt>structure Array2: ARRAY2</tt> <br> +<tt>structure ArraySlice: ARRAY_SLICE</tt> <br> +<tt>structure BinIO: BIN_IO</tt> <br> +<tt>structure BinPrimIO: PRIM_IO</tt> <br> +<tt>structure Bool: BOOL</tt> <br> +<tt>structure BoolArray: MONO_ARRAY</tt> <br> +<tt>structure BoolArray2: MONO_ARRAY2</tt> <br> +<tt>structure BoolArraySlice: MONO_ARRAY_SLICE</tt> <br> +<tt>structure BoolVector: MONO_VECTOR</tt> <br> +<tt>structure BoolVectorSlice: MONO_VECTOR_SLICE</tt> <br> +<tt>structure Byte: BYTE</tt> <br> +<tt>structure Char: CHAR</tt> +</p> + + <ul> + + <tt>Char</tt> characters correspond to ISO-8859-1. The <tt>Char</tt> functions do not depend on locale. + </ul> + + +<p> +<br> +<tt>structure CharArray: MONO_ARRAY</tt> <br> +<tt>structure CharArray2: MONO_ARRAY2</tt> <br> +<tt>structure CharArraySlice: MONO_ARRAY_SLICE</tt> <br> +<tt>structure CharVector: MONO_VECTOR</tt> <br> +<tt>structure CharVectorSlice: MONO_VECTOR_SLICE</tt> <br> +<tt>structure CommandLine: COMMAND_LINE</tt> <br> +<tt>structure Date: DATE</tt> +</p> + + <ul> + + <tt>Date.fromString</tt> and <tt>Date.scan</tt> accept a space in addition to a zero for the first character of the day of the month. The Basis Library specification only allows a zero. + </ul> + + +<p> +<tt>structure FixedInt: INTEGER</tt> <br> +<tt>structure General: GENERAL</tt> <br> +<tt>structure GenericSock: GENERIC_SOCK</tt> <br> +<tt>structure IEEEReal: IEEE_REAL</tt> <br> +<tt>structure INetSock: INET_SOCK</tt> <br> +<tt>structure IO: IO</tt> <br> +<tt>structure Int: INTEGER</tt> <br> +<tt>structure Int2: INTEGER</tt> <br> +<tt>structure Int3: INTEGER</tt> <br> +<tt>structure Int4: INTEGER</tt> <br> +... <br> +<tt>structure Int31: INTEGER</tt> <br> +<tt>structure Int32: INTEGER</tt> <br> +<tt>structure Int64: INTEGER</tt> <br> +<tt>structure IntArray: MONO_ARRAY</tt> <br> +<tt>structure IntArray2: MONO_ARRAY2</tt> <br> +<tt>structure IntArraySlice: MONO_ARRAY_SLICE</tt> <br> +<tt>structure IntVector: MONO_VECTOR</tt> <br> +<tt>structure IntVectorSlice: MONO_VECTOR_SLICE</tt> <br> +<tt>structure Int8: INTEGER</tt> <br> +<tt>structure Int8Array: MONO_ARRAY</tt> <br> +<tt>structure Int8Array2: MONO_ARRAY2</tt> <br> +<tt>structure Int8ArraySlice: MONO_ARRAY_SLICE</tt> <br> +<tt>structure Int8Vector: MONO_VECTOR</tt> <br> +<tt>structure Int8VectorSlice: MONO_VECTOR_SLICE</tt> <br> +<tt>structure Int16: INTEGER</tt> <br> +<tt>structure Int16Array: MONO_ARRAY</tt> <br> +<tt>structure Int16Array2: MONO_ARRAY2</tt> <br> +<tt>structure Int16ArraySlice: MONO_ARRAY_SLICE</tt> <br> +<tt>structure Int16Vector: MONO_VECTOR</tt> <br> +<tt>structure Int16VectorSlice: MONO_VECTOR_SLICE</tt> <br> +<tt>structure Int32: INTEGER</tt> <br> +<tt>structure Int32Array: MONO_ARRAY</tt> <br> +<tt>structure Int32Array2: MONO_ARRAY2</tt> <br> +<tt>structure Int32ArraySlice: MONO_ARRAY_SLICE</tt> <br> +<tt>structure Int32Vector: MONO_VECTOR</tt> <br> +<tt>structure Int32VectorSlice: MONO_VECTOR_SLICE</tt> <br> +<tt>structure Int64Array: MONO_ARRAY</tt> <br> +<tt>structure Int64Array2: MONO_ARRAY2</tt> <br> +<tt>structure Int64ArraySlice: MONO_ARRAY_SLICE</tt> <br> +<tt>structure Int64Vector: MONO_VECTOR</tt> <br> +<tt>structure Int64VectorSlice: MONO_VECTOR_SLICE</tt> <br> +<tt>structure IntInf: INT_INF</tt> <br> +<tt>structure LargeInt: INTEGER</tt> <br> +<tt>structure LargeIntArray: MONO_ARRAY</tt> <br> +<tt>structure LargeIntArray2: MONO_ARRAY2</tt> <br> +<tt>structure LargeIntArraySlice: MONO_ARRAY_SLICE</tt> <br> +<tt>structure LargeIntVector: MONO_VECTOR</tt> <br> +<tt>structure LargeIntVectorSlice: MONO_VECTOR_SLICE</tt> <br> +<tt>structure LargeReal: REAL</tt> <br> +<tt>structure LargeRealArray: MONO_ARRAY</tt> <br> +<tt>structure LargeRealArray2: MONO_ARRAY2</tt> <br> +<tt>structure LargeRealArraySlice: MONO_ARRAY_SLICE</tt> <br> +<tt>structure LargeRealVector: MONO_VECTOR</tt> <br> +<tt>structure LargeRealVectorSlice: MONO_VECTOR_SLICE</tt> <br> +<tt>structure LargeWord: WORD</tt> <br> +<tt>structure LargeWordArray: MONO_ARRAY</tt> <br> +<tt>structure LargeWordArray2: MONO_ARRAY2</tt> <br> +<tt>structure LargeWordArraySlice: MONO_ARRAY_SLICE</tt> <br> +<tt>structure LargeWordVector: MONO_VECTOR</tt> <br> +<tt>structure LargeWordVectorSlice: MONO_VECTOR_SLICE</tt> <br> +<tt>structure List: LIST</tt> <br> +<tt>structure ListPair: LIST_PAIR</tt> <br> +<tt>structure Math: MATH</tt> <br> +<tt>structure NetHostDB: NET_HOST_DB</tt> <br> +<tt>structure NetProtDB: NET_PROT_DB</tt> <br> +<tt>structure NetServDB: NET_SERV_DB</tt> <br> +<tt>structure OS: OS</tt> <br> +<tt>structure Option: OPTION</tt> <br> +<tt>structure PackReal32Big: PACK_REAL</tt> <br> +<tt>structure PackReal32Little: PACK_REAL</tt> <br> +<tt>structure PackReal64Big: PACK_REAL</tt> <br> +<tt>structure PackReal64Little: PACK_REAL</tt> <br> +<tt>structure PackRealBig: PACK_REAL</tt> <br> +<tt>structure PackRealLittle: PACK_REAL</tt> <br> +<tt>structure PackWord32Big: PACK_WORD</tt> <br> +<tt>structure PackWord32Little: PACK_WORD</tt> <br> +<tt>structure Position: INTEGER</tt> <br> +<tt>structure Posix: POSIX</tt> <br> +<tt>structure Real: REAL</tt> <br> +<tt>structure RealArray: MONO_ARRAY</tt> <br> +<tt>structure RealArray2: MONO_ARRAY2</tt> <br> +<tt>structure RealArraySlice: MONO_ARRAY_SLICE</tt> <br> +<tt>structure RealVector: MONO_VECTOR</tt> <br> +<tt>structure RealVectorSlice: MONO_VECTOR_SLICE</tt> <br> +<tt>structure Real32: REAL</tt> <br> +<tt>structure Real32Array: MONO_ARRAY</tt> <br> +<tt>structure Real32Array2: MONO_ARRAY2</tt> <br> +<tt>structure Real32ArraySlice: MONO_ARRAY_SLICE</tt> <br> +<tt>structure Real32Vector: MONO_VECTOR</tt> <br> +<tt>structure Real32VectorSlice: MONO_VECTOR_SLICE</tt> <br> +<tt>structure Real64: REAL</tt> <br> +<tt>structure Real64Array: MONO_ARRAY</tt> <br> +<tt>structure Real64Array2: MONO_ARRAY2</tt> <br> +<tt>structure Real64ArraySlice: MONO_ARRAY_SLICE</tt> <br> +<tt>structure Real64Vector: MONO_VECTOR</tt> <br> +<tt>structure Real64VectorSlice: MONO_VECTOR_SLICE</tt> <br> +<tt>structure Socket: SOCKET</tt> +</p> + + <ul> + + The Basis Library specification requires functions like <tt>Socket.sendVec</tt> to raise an exception if they fail. However, on some platforms, sending to a socket that hasn't yet been connected causes a <tt>SIGPIPE</tt> signal, which invokes the default signal handler for <tt>SIGPIPE</tt> and causes the program to terminate. If you want the exception to be raised, you can ignore <tt>SIGPIPE</tt> by adding the following to your program. +<pre class=code> +<B><FONT COLOR="#A020F0">let</FONT></B> + <B><FONT COLOR="#A020F0">open</FONT></B> MLton.Signal +<B><FONT COLOR="#A020F0">in</FONT></B> + setHandler (Posix.Signal.pipe, Handler.ignore) +<B><FONT COLOR="#A020F0">end</FONT></B> +</PRE> +<p> + +</p> + + </ul> + + +<p> +<br> +<tt>structure String: STRING</tt> +</p> + + <ul> + + The <tt>String</tt> functions do not depend on locale. + </ul> + + +<p> +<br> +<tt>structure StringCvt: STRING_CVT</tt> <br> +<tt>structure Substring: SUBSTRING</tt> <br> +<tt>structure SysWord: WORD</tt> <br> +<tt>structure Text: TEXT</tt> <br> +<tt>structure TextIO: TEXT_IO</tt> <br> +<tt>structure TextPrimIO: PRIM_IO</tt> <br> +<tt>structure Time: TIME</tt> <br> +<tt>structure Timer: TIMER</tt> <br> +<tt>structure Unix: UNIX</tt> <br> +<tt>structure UnixSock: UNIX_SOCK</tt> <br> +<tt>structure Vector: VECTOR</tt> <br> +<tt>structure VectorSlice: VECTOR_SLICE</tt> <br> +<tt>structure Word: WORD</tt> <br> +<tt>structure Word2: WORD</tt> <br> +<tt>structure Word3: WORD</tt> <br> +<tt>structure Word4: WORD</tt> <br> +... <br> +<tt>structure Word31: WORD</tt> <br> +<tt>structure Word32: WORD</tt> <br> +<tt>structure Word64: WORD</tt> <br> +<tt>structure WordArray: MONO_ARRAY</tt> <br> +<tt>structure WordArray2: MONO_ARRAY2</tt> <br> +<tt>structure WordArraySlice: MONO_ARRAY_SLICE</tt> <br> +<tt>structure WordVectorSlice: MONO_VECTOR_SLICE</tt> <br> +<tt>structure WordVector: MONO_VECTOR</tt> <br> +<tt>structure Word8Array: MONO_ARRAY</tt> <br> +<tt>structure Word8Array2: MONO_ARRAY2</tt> <br> +<tt>structure Word8ArraySlice: MONO_ARRAY_SLICE</tt> <br> +<tt>structure Word8Vector: MONO_VECTOR</tt> <br> +<tt>structure Word8VectorSlice: MONO_VECTOR_SLICE</tt> <br> +<tt>structure Word16Array: MONO_ARRAY</tt> <br> +<tt>structure Word16Array2: MONO_ARRAY2</tt> <br> +<tt>structure Word16ArraySlice: MONO_ARRAY_SLICE</tt> <br> +<tt>structure Word16Vector: MONO_VECTOR</tt> <br> +<tt>structure Word16VectorSlice: MONO_VECTOR_SLICE</tt> <br> +<tt>structure Word32Array: MONO_ARRAY</tt> <br> +<tt>structure Word32Array2: MONO_ARRAY2</tt> <br> +<tt>structure Word32ArraySlice: MONO_ARRAY_SLICE</tt> <br> +<tt>structure Word32Vector: MONO_VECTOR</tt> <br> +<tt>structure Word32VectorSlice: MONO_VECTOR_SLICE</tt> <br> +<tt>structure Word64Array: MONO_ARRAY</tt> <br> +<tt>structure Word64Array2: MONO_ARRAY2</tt> <br> +<tt>structure Word64ArraySlice: MONO_ARRAY_SLICE</tt> <br> +<tt>structure Word64Vector: MONO_VECTOR</tt> <br> +<tt>structure Word64VectorSlice: MONO_VECTOR_SLICE</tt> +</p> +<h2 id="head-0ac17def4aced0cc961aa5b65385be04cfcf6eb5">Type equivalences</h2> +The following types are equivalent. +<pre>Int.int = Int32.int +Int64.int = FixedInt.int = Position.int +IntInf.int = LargeInt.int +Real.real = Real64.real = LargeReal.real +Word.word = Word32.word = SysWord.word +Word64.word = LargeWord.word +</pre><h2 id="head-bc488aeca21efb00463538004d56839b48f23e7d">Real and Math functions</h2> +<p> +The <tt>Real</tt>, <tt>Real32</tt>, and <tt>Real64</tt> modules are implemented using the <tt>C</tt> math library, so the SML functions will reflect the behavior of the underlying library function. We have made some effort to unify the differences between the math libraries on different platforms, and in particular to handle exceptional cases according to the Basis Library specification. However, there will be differences due to different numerical algorithms and cases we may have missed. Please submit a <a href="Bug">bug report</a> if you encounter an error in the handling of an exceptional case. +</p> +<p> +On x86, real arithmetic is implemented internally using 80 bits of precision. Using higher precision for intermediate results in computations can lead to different results than if all the computation is done at 32 or 64 bits. If you require strict IEEE compliance, you can compile with <tt>-ieee-fp true</tt>, which will cause intermediate results to be stored after each operation. This may cause a substantial performance penalty. +</p> +<h2 id="head-e38fb58e344e0ee67d4aa08c60df9fbd642e8e1c">Top-level functors</h2> +<p> +<tt>ImperativeIO</tt> <br> +<tt>PrimIO</tt> <br> +<tt>StreamIO</tt> +</p> +<p> +MLton's <tt>StreamIO</tt> functor takes structures <tt>ArraySlice</tt> and <tt>VectorSlice</tt> in addition to the arguments specified in the Basis Library specification. +</p> +</div> + + + +<p> +<hr> +Last edited on 2005-01-28 21:49:35 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>. +</body></html> Added: mlton/trunk/doc/guide/Bug =================================================================== --- mlton/trunk/doc/guide/Bug 2005-09-06 04:17:48 UTC (rev 4069) +++ mlton/trunk/doc/guide/Bug 2005-09-06 04:18:56 UTC (rev 4070) @@ -0,0 +1,75 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> +<meta name="robots" content="index,nofollow"> + + + +<title>Bug - MLton Standard ML Compiler (SML Compiler)</title> +<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="all" href="common.css"> +<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="screen" href="screen.css"> +<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="print" href="print.css"> + + +<link rel="Start" href="Home"> + + +</head> + +<body lang="en" dir="ltr"> + +<table bgcolor = lightblue cellspacing = 0 style = "border: 0px;" width = 100%> + <tr> + <td style = " + border: 0px; + color: darkblue; + font-size: 150%; + text-align: left;"> + <a class = mltona href="Home">MLton 20050905</a> + <td style = " + border: 0px; + font-size: 150%; + text-align: center; + width: 50%;"> + Bug + <td style = " + border: 0p... [truncated message content] |
From: Stephen W. <sw...@ml...> - 2005-09-05 21:17:49
|
Added a script to grab the wiki and create a reasonably self-contained set of web pages, intended to be shipped as documentation with packages. ---------------------------------------------------------------------- A mlton/trunk/bin/grab-wiki ---------------------------------------------------------------------- Added: mlton/trunk/bin/grab-wiki =================================================================== --- mlton/trunk/bin/grab-wiki 2005-09-05 21:33:10 UTC (rev 4068) +++ mlton/trunk/bin/grab-wiki 2005-09-06 04:17:48 UTC (rev 4069) @@ -0,0 +1,99 @@ +#!/bin/bash + +set -e +set -x + +name=`basename $0` +dir=`dirname $0` +src=`cd $dir/.. && pwd` + +die () { + echo >&2 "$1" + exit 1 +} + +usage () { + die "usage: $name" +} + +case "$#" in +0) +;; +*) + usage +;; +esac + +TIMEFORMAT=' Took %lR.' + +base='http://mlton.org' +version=`date +%Y%m%d` + +index='.index' +script='.script' +tmp='.tmp' + +cd "$src/doc/guide" + +rm -f * + +drop='\(Download\|.*MoinEditorBackup\|OldPages\|Preferences\|RecentChanges\|TemporaryBugExamples\|TemporaryUpload\|WikiSandBox\)' + +echo "Getting index:" +lynx -dump "$base/Index?action=titleindex" | \ + grep -v >$index -e '^$' -e "^$drop$" + +echo "Getting pages:" +wget -B $base -c -nv -i $index + +echo "Getting CSS:" +for f in common screen print; do + wget -c $base/wiki/mlton/css/$f.css +done + +echo "Getting images:" +for f in bottom email ftp top www; do + wget -c $base/wiki/mlton/img/moin-$f.png +done + +echo "Fixing pages:" + +# Eliminate ungrabbed pages from Index. +grep -v "$drop" Index >$tmp +mv $tmp Index + +# Write sed script to file. +cat >$script <<EOF +# Delete search box. +/<form .* action = "http:\/\/www.google.com\/custom">/,+6d +# Replace highlight actions with no-op. +s;"\([^"]*\).action=highlight[^"]*";"\1";g +# Delete Index actions. +/<a href *= *"Index?.*"/d +# Delete unused link rel. +/<link rel="\(Glossary\|Help\|Index\|Search\)"/d +# Delete <a> and <link> actions. +s;<a[^>]* href *= *"[^"]*?action[^"]*">.*</a>;;g +s;<link[^>]* href *= *"[^"]*?action[^"]*">;;g +# Add version stamp in upper left. +s;<a class = mltona\(.*\)>MLton</a>;<a class = mltona\1>MLton $version</a>; +# Fix wiki hrefs and srcs +s; \(href\|src\) *= *"\(/pages/[^"]*\)"; \1="$base\2";g +s; \(href\|src\) *= *"/\([^"]\+\)"; \1="\2";g +s; href *= *"/"; href="Home";g +s; href *= *"$drop"; href="$base/\1";g +s; \(href\|src\) *= *"wiki/mlton/[^/]\+/\([^"]*\)"; \1="\2";g +EOF + +for f in $(cat $index); do + echo $f + head -n -19 <$f >$tmp + ( + sed -f $script <$tmp + echo '</body></html>' + ) >$f +done + +rm -f $tmp $index $script + +cp Home index.html Property changes on: mlton/trunk/bin/grab-wiki ___________________________________________________________________ Name: svn:executable + * |
From: Stephen W. <sw...@ml...> - 2005-09-05 14:33:13
|
Added -mlb-path-map switch. ---------------------------------------------------------------------- U mlton/trunk/doc/changelog U mlton/trunk/man/mlton.1 U mlton/trunk/mlton/control/control-flags.sig U mlton/trunk/mlton/control/control-flags.sml U mlton/trunk/mlton/front-end/mlb-front-end.fun U mlton/trunk/mlton/main/main.fun ---------------------------------------------------------------------- Modified: mlton/trunk/doc/changelog =================================================================== --- mlton/trunk/doc/changelog 2005-09-05 20:35:42 UTC (rev 4067) +++ mlton/trunk/doc/changelog 2005-09-05 21:33:10 UTC (rev 4068) @@ -1,5 +1,8 @@ Here are the changes since version 20041109. +* 2005-09-05 + - Added -mlb-path-map switch. + * 2005-08-25 - Fixed bug in MLton.Finalizable.touch, which was not keeping alive finalizable values in all cases. Modified: mlton/trunk/man/mlton.1 =================================================================== --- mlton/trunk/man/mlton.1 2005-09-05 20:35:42 UTC (rev 4067) +++ mlton/trunk/man/mlton.1 2005-09-05 21:33:10 UTC (rev 4068) @@ -129,6 +129,12 @@ syntax, e.g., \fB-link-opt '-Wl,--export-dynamic'\fP. .TP +\fB-mlb-path-map \fIfile\fR +Use file as an MLB path map to define additional MLB path variables. +Multiple uses of \fB-mlb-path-map\fP are allowed, with variable +definitions in later path maps taking precendence over earlier ones. + +.TP \fB-output \fIfile\fR Specify the name of the final output file. The default name is the input file name with its suffix removed and an Modified: mlton/trunk/mlton/control/control-flags.sig =================================================================== --- mlton/trunk/mlton/control/control-flags.sig 2005-09-05 20:35:42 UTC (rev 4067) +++ mlton/trunk/mlton/control/control-flags.sig 2005-09-05 21:33:10 UTC (rev 4068) @@ -186,6 +186,8 @@ val maxFunctionSize: int ref + val mlbPathMaps: string list ref + structure Native: sig (* whether or not to use comments in native codegen *) Modified: mlton/trunk/mlton/control/control-flags.sml =================================================================== --- mlton/trunk/mlton/control/control-flags.sml 2005-09-05 20:35:42 UTC (rev 4067) +++ mlton/trunk/mlton/control/control-flags.sml 2005-09-05 21:33:10 UTC (rev 4068) @@ -705,6 +705,10 @@ val maxFunctionSize = control {name = "max function size", default = 10000, toString = Int.toString} + +val mlbPathMaps = control {name = "mlb path maps", + default = [], + toString = List.toString (fn s => s)} structure Native = struct Modified: mlton/trunk/mlton/front-end/mlb-front-end.fun =================================================================== --- mlton/trunk/mlton/front-end/mlb-front-end.fun 2005-09-05 20:35:42 UTC (rev 4067) +++ mlton/trunk/mlton/front-end/mlb-front-end.fun 2005-09-05 21:33:10 UTC (rev 4068) @@ -85,32 +85,33 @@ HashSet.new {hash = String.hash o #1} local fun make (file: File.t) = - if File.canRead file - then - List.keepAllMap - (File.lines file, fn line => - if String.forall (line, Char.isSpace) - then NONE - else - case String.tokens (line, Char.isSpace) of - [var, path] => SOME {var = var, path = path} - | _ => Error.bug (concat ["strange mlb path mapping: ", - file, ":: ", line])) - else [] + if not (File.canRead file) then + Error.bug (concat ["can't read MLB path map file: ", file]) + else + List.keepAllMap + (File.lines file, fn line => + if String.forall (line, Char.isSpace) + then NONE + else + case String.tokens (line, Char.isSpace) of + [var, path] => SOME {var = var, path = path} + | _ => Error.bug (concat ["strange mlb path mapping: ", + file, ":: ", line])) val pathMap = - (List.rev o List.concat) - [make (concat [!Control.libDir, "/mlb-path-map"]), - case OS.Process.getEnv "HOME" of - NONE => [] - | SOME path => make (concat [path, "/.mlton/mlb-path-map"]), - [{var = "LIB_MLTON_DIR", - path = !Control.libDir}, - {var = "TARGET_ARCH", - path = (String.toLower o MLton.Platform.Arch.toString) - (!Control.targetArch)}, - {var = "TARGET_OS", - path = (String.toLower o MLton.Platform.OS.toString) - (!Control.targetOS)}]] + List.rev + (List.concat + [List.concat + (List.map (concat [!Control.libDir, "/mlb-path-map"] + :: (!Control.mlbPathMaps), + make)), + [{var = "LIB_MLTON_DIR", + path = !Control.libDir}, + {var = "TARGET_ARCH", + path = String.toLower (MLton.Platform.Arch.toString + (!Control.targetArch))}, + {var = "TARGET_OS", + path = String.toLower (MLton.Platform.OS.toString + (!Control.targetOS))}]]) fun peekPathMap var' = case List.peek (pathMap, fn {var,...} => var = var') of Modified: mlton/trunk/mlton/main/main.fun =================================================================== --- mlton/trunk/mlton/main/main.fun 2005-09-05 20:35:42 UTC (rev 4067) +++ mlton/trunk/mlton/main/main.fun 2005-09-05 21:33:10 UTC (rev 4068) @@ -282,6 +282,8 @@ boolRef markCards), (Expert, "max-function-size", " <n>", "max function size (blocks)", intRef maxFunctionSize), + (Normal, "mlb-path-map", " <file>", "additional MLB path map", + SpaceString (fn s => mlbPathMaps := !mlbPathMaps @ [s])), (Expert, "native-commented", " <n>", "level of comments (0)", intRef Native.commented), (Expert, "native-copy-prop", " {true|false}", |
From: Matthew F. <fl...@ml...> - 2005-09-05 13:35:43
|
Control model from Makefile ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile U mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile 2005-09-05 11:30:09 UTC (rev 4066) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile 2005-09-05 20:35:42 UTC (rev 4067) @@ -21,12 +21,14 @@ else FLAGS += -malign-loops=2 -malign-jumps=2 -malign-functions=5 endif -MODELS = A +DEFAULT_MODEL = A +ALL_MODELS = A endif ifeq ($(TARGET_ARCH), amd64) FLAGS += -mtune=opteron -MODELS = A AX B BX C CX G +DEFAULT_MODEL = BX +ALL_MODELS = A AX B BX C CX G endif ifeq ($(TARGET_ARCH), sparc) @@ -82,10 +84,10 @@ all: gc.o gc-gdb.o gc-gdb.o: gc.c gc.h - $(CC) $(DEBUGFLAGS) -O1 -DASSERT=1 -c -o $@ gc.c + $(CC) $(DEBUGFLAGS) -DGC_MODEL_$(DEFAULT_MODEL) -O1 -DASSERT=1 -c -o $@ gc.c gc.o: gc.c gc.h - $(CC) $(CFLAGS) -c -o $@ gc.c + $(CC) $(CFLAGS) -DGC_MODEL_$(DEFAULT_MODEL) -c -o $@ gc.c gc.c: $(CFILES) rm -f gc.c @@ -108,7 +110,7 @@ .PHONY: models models: gc.c gc.h ( \ - for m in $(MODELS); do \ + for m in $(ALL_MODELS); do \ $(CC) $(CFLAGS) -DGC_MODEL_$$m -c -o gc.$$m.o gc.c; \ $(CC) $(CFLAGS) $(DEBUGFLAGS) -O1 -DASSERT=1 -DGC_MODEL_$$m -c -o gc-gdb.$$m.o gc.c; \ done; \ @@ -116,4 +118,4 @@ .PHONY: clean clean: - ../bin/clean + ../../bin/clean Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h 2005-09-05 11:30:09 UTC (rev 4066) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h 2005-09-05 20:35:42 UTC (rev 4067) @@ -135,8 +135,6 @@ manageable set for users. */ -#define GC_MODEL_G - #if (defined (GC_MODEL_A)) #define GC_MODEL_BITSIZE 32 #define GC_MODEL_SHIFT 0 |
From: Matthew F. <fl...@ml...> - 2005-09-05 04:30:12
|
Added models target to check all models. ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile 2005-09-05 11:29:12 UTC (rev 4065) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile 2005-09-05 11:30:09 UTC (rev 4066) @@ -110,6 +110,7 @@ ( \ for m in $(MODELS); do \ $(CC) $(CFLAGS) -DGC_MODEL_$$m -c -o gc.$$m.o gc.c; \ + $(CC) $(CFLAGS) $(DEBUGFLAGS) -O1 -DASSERT=1 -DGC_MODEL_$$m -c -o gc-gdb.$$m.o gc.c; \ done; \ ) |
From: Matthew F. <fl...@ml...> - 2005-09-05 04:29:14
|
Added models target to check all models. ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile 2005-09-05 03:19:05 UTC (rev 4064) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile 2005-09-05 11:29:12 UTC (rev 4065) @@ -21,10 +21,12 @@ else FLAGS += -malign-loops=2 -malign-jumps=2 -malign-functions=5 endif +MODELS = A endif ifeq ($(TARGET_ARCH), amd64) FLAGS += -mtune=opteron +MODELS = A AX B BX C CX G endif ifeq ($(TARGET_ARCH), sparc) @@ -103,6 +105,14 @@ done; \ ) > gc.h +.PHONY: models +models: gc.c gc.h + ( \ + for m in $(MODELS); do \ + $(CC) $(CFLAGS) -DGC_MODEL_$$m -c -o gc.$$m.o gc.c; \ + done; \ + ) + .PHONY: clean clean: ../bin/clean |
From: Matthew F. <fl...@ml...> - 2005-09-04 20:19:14
|
More progress on refactoring GC. ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile U mlton/branches/on-20050822-x86_64-branch/runtime/gc/TODO A mlton/branches/on-20050822-x86_64-branch/runtime/gc/align.c A mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.c A mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.h A mlton/branches/on-20050822-x86_64-branch/runtime/gc/assumptions.c A mlton/branches/on-20050822-x86_64-branch/runtime/gc/foreach.c U mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.h U mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.h U mlton/branches/on-20050822-x86_64-branch/runtime/gc/mltongc.txt U mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.c U mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h 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/pointer.c A mlton/branches/on-20050822-x86_64-branch/runtime/gc/pointer.h U mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.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 ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile 2005-09-04 11:56:31 UTC (rev 4063) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile 2005-09-05 03:19:05 UTC (rev 4064) @@ -48,18 +48,27 @@ CFLAGS = -O2 -Wall -I. -D_FILE_OFFSET_BITS=64 $(FLAGS) DEBUGFLAGS = $(CFLAGS) -gstabs+ -g2 +## Order matters, as these are concatenated together to form "gc.c". CFILES = \ gc_prefix.c \ debug.c \ + pointer.c \ + align.c \ + model.c \ object.c \ - model.c \ + array.c \ + foreach.c \ + assumptions.c \ gc_suffix.c +## Order matters, as these are concatenated together to form "gc.h". HFILES = \ gc_prefix.h \ util.h \ + pointer.h \ model.h \ object.h \ + array.h \ stack.h \ frame.h \ thread.h \ Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/TODO =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/TODO 2005-09-04 11:56:31 UTC (rev 4063) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/TODO 2005-09-05 03:19:05 UTC (rev 4064) @@ -9,3 +9,5 @@ choosing the representation for Weaks based on the model and the alignment; also, the GC will need to bump the pointer to the word after the header to get GC_weak to overlay properly. +* what type should be used for the size field in GC_heap? I'm using + size_t currently, since that is the type needed by malloc. Copied: mlton/branches/on-20050822-x86_64-branch/runtime/gc/align.c (from rev 4025, mlton/branches/on-20050822-x86_64-branch/runtime/gc.c) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc.c 2005-08-22 22:48:34 UTC (rev 4025) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/align.c 2005-09-05 03:19:05 UTC (rev 4064) @@ -0,0 +1,71 @@ +/* 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 uintptr_t align (uintptr_t a, uintptr_t b) { + assert (a >= 0); + assert (b >= 1); + a += b - 1; + a -= a % b; + return a; +} + +/* +static inline W64 w64align (W64 a, uint b) { + W64 res; + + assert (a >= 0); + assert (b >= 1); + res = a + b - 1; + res = res - res % b; + if (FALSE) + fprintf (stderr, "%llu = w64Align (%llu, %u)\n", res, a, b); + return res; +} +*/ + +static bool isAligned (uintptr_t a, size_t b) { + return 0 == a % b; +} + +#if ASSERT +static bool isAlignedFrontier (GC_state s, pointer p) { + return isAligned ((uintptr_t)p + GC_NORMAL_HEADER_SIZE, s->alignment); +} + +/* +static bool isAlignedReserved (GC_state s, uint r) { + return isAligned (STACK_HEADER_SIZE + sizeof (struct GC_stack) + r, + s->alignment); +} +*/ +#endif + +static inline size_t pad (GC_state s, size_t bytes, size_t extra) { + return align (bytes + extra, s->alignment) - extra; +} + +/* +static inline pointer alignFrontier (GC_state s, pointer p) { + return (pointer) pad (s, (uintptr_t)p, GC_NORMAL_HEADER_SIZE); +} + +pointer GC_alignFrontier (GC_state s, pointer p) { + return alignFrontier (s, p); +} + +static inline uint stackReserved (GC_state s, uint r) { + uint res; + + res = pad (s, r, STACK_HEADER_SIZE + sizeof (struct GC_stack)); + if (DEBUG_STACKS) + fprintf (stderr, "%s = stackReserved (%s)\n", + uintToCommaString (res), + uintToCommaString (r)); + return res; +} +*/ Copied: mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.c (from rev 4025, mlton/branches/on-20050822-x86_64-branch/runtime/gc.c) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc.c 2005-08-22 22:48:34 UTC (rev 4025) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.c 2005-09-05 03:19:05 UTC (rev 4064) @@ -0,0 +1,53 @@ +/* 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. + */ + +#if ASSERT +static pointer arrayPointer (GC_state s, + pointer a, + uint32_t arrayIndex, + uint32_t pointerIndex) { + bool hasIdentity; + GC_header header; + uint16_t numNonObjptrs; + uint16_t numObjptrs; + GC_objectTypeTag tag; + + header = GC_getHeader (a); + SPLIT_HEADER(); + assert (tag == ARRAY_TAG); + + size_t bytesPerElement = + numNonObjptrsToBytes(numNonObjptrs, ARRAY_TAG) + + (numObjptrs * OBJPTR_SIZE); + + return a + + arrayIndex * bytesPerElement + + numNonObjptrsToBytes(numNonObjptrs, tag) + + pointerIndex * OBJPTR_SIZE; +} +#endif + +/* The number of bytes in an array, not including the header. */ +static inline size_t arrayNumBytes (GC_state s, + pointer p, + uint16_t numObjptrs, + uint16_t numNonObjptrs) { + size_t bytesPerElement; + GC_arrayLength numElements; + size_t result; + + numElements = GC_arrayNumElements (p); + bytesPerElement = + numNonObjptrsToBytes(numNonObjptrs, ARRAY_TAG) + + (numObjptrs * OBJPTR_SIZE); + result = numElements * bytesPerElement; + /* Empty arrays have OBJPTR_SIZE bytes for the forwarding pointer. */ + if (0 == result) + result = OBJPTR_SIZE; + return pad (s, result, GC_ARRAY_HEADER_SIZE); +} Copied: mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.h (from rev 4025, mlton/branches/on-20050822-x86_64-branch/runtime/gc.h) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc.h 2005-08-22 22:48:34 UTC (rev 4025) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/array.h 2005-09-05 03:19:05 UTC (rev 4064) @@ -0,0 +1,34 @@ +/* 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. + */ + +/* + * Array objects have the following layout: + * + * counter word32 :: + * length word32 :: + * header word32 :: + * ( (non heap-pointers)* :: (heap pointers)* )* + * + * The counter word is used by mark compact GC. The length word is + * the number of elements in the array. Array elements have the same + * individual layout as normal objects, omitting the header word. + */ +typedef uint32_t GC_arrayLength; +enum { + GC_ARRAY_LENGTH_SIZE = sizeof(GC_arrayLength), + GC_ARRAY_COUNTER_SIZE = GC_ARRAY_LENGTH_SIZE, + GC_ARRAY_HEADER_SIZE = GC_ARRAY_COUNTER_SIZE + GC_ARRAY_LENGTH_SIZE + GC_HEADER_SIZE, +}; + +static inline GC_arrayLength* GC_arrayNumElementsp (pointer a) { + return (GC_arrayLength*)(a - GC_HEADER_SIZE - GC_ARRAY_LENGTH_SIZE); +} + +static inline GC_arrayLength GC_arrayNumElements (pointer a) { + return *(GC_arrayNumElementsp (a)); +} Added: mlton/branches/on-20050822-x86_64-branch/runtime/gc/assumptions.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/assumptions.c 2005-09-04 11:56:31 UTC (rev 4063) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/assumptions.c 2005-09-05 03:19:05 UTC (rev 4064) @@ -0,0 +1,17 @@ +/* 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. + */ + +/* + * Various assumptions about the underlying C translator. This is the + * place for characteristics that are not dictated by the C standard, + * but which are reasonable to assume on a wide variety of target + * platforms. Working around these assumptions would be difficult. + */ +void checkAssumptions () { + assert(CHAR_BIT == 8); + /* assert(repof(uintptr_t) == TWOS); */ +} Copied: mlton/branches/on-20050822-x86_64-branch/runtime/gc/foreach.c (from rev 4025, mlton/branches/on-20050822-x86_64-branch/runtime/gc.c) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc.c 2005-08-22 22:48:34 UTC (rev 4025) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/foreach.c 2005-09-05 03:19:05 UTC (rev 4064) @@ -0,0 +1,209 @@ +/* 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. + */ + +typedef void (*GC_pointerFun) (GC_state s, objptr *pp); + +static inline void maybeCall (GC_pointerFun f, GC_state s, objptr *pp) { + if (GC_isObjptr (*pp)) + f (s, pp); +} + +/* foreachGlobal (s, f) + * + * Apply f to each global object pointer into the heap. + */ +static inline void foreachGlobal (GC_state s, GC_pointerFun f) { + for (int i = 0; i < s->globalsSize; ++i) { + if (DEBUG_DETAILED) + fprintf (stderr, "foreachGlobal %u\n", i); + maybeCall (f, s, &s->globals [i]); + } + if (DEBUG_DETAILED) + fprintf (stderr, "foreachGlobal threads\n"); + maybeCall (f, s, &s->callFromCHandler); + maybeCall (f, s, &s->currentThread); + maybeCall (f, s, &s->savedThread); + maybeCall (f, s, &s->signalHandler); +} + + +/* foreachPointerInObject (s, p, skipWeaks, f) + * + * Applies f to each object pointer in the object pointed to by p. + * Returns pointer to the end of object, i.e. just past object. + * + * If skipWeaks, then the object pointer in weak objects is skipped. + */ +static inline pointer foreachPointerInObject (GC_state s, + pointer p, + bool skipWeaks, + GC_pointerFun f) { + bool hasIdentity; + GC_header header; + uint16_t numNonObjptrs; + uint16_t numObjptrs; + GC_objectTypeTag tag; + + header = GC_getHeader (p); + SPLIT_HEADER(); + if (DEBUG_DETAILED) + fprintf (stderr, + "foreachPointerInObject ("FMTPTR")" + " header = "FMTHDR + " tag = %s" + " numNonObjptrs = %d" + " numObjptrs = %d\n", + (intptr_t)p, header, tagToString (tag), + numNonObjptrs, numObjptrs); + if (NORMAL_TAG == tag) { + p += numNonObjptrsToBytes(numNonObjptrs, NORMAL_TAG); + pointer max = p + (numObjptrs * OBJPTR_SIZE); + /* Apply f to all internal pointers. */ + for ( ; p < max; p += OBJPTR_SIZE) { + if (DEBUG_DETAILED) + fprintf (stderr, + "p = "FMTPTR" *p = "FMTOBJPTR"\n", + (intptr_t)p, *(objptr*)p); + maybeCall (f, s, (objptr*)p); + } + } else if (WEAK_TAG == tag) { + p += numNonObjptrsToBytes(numNonObjptrs, NORMAL_TAG); + if (not skipWeaks and 1 == numObjptrs) { + maybeCall (f, s, (objptr*)p); + p += OBJPTR_SIZE; + } + } else if (ARRAY_TAG == tag) { + size_t bytesPerElement; + size_t dataBytes; + pointer max; + GC_arrayLength numElements; + + numElements = GC_arrayNumElements (p); + bytesPerElement = + numNonObjptrsToBytes(numNonObjptrs, ARRAY_TAG) + + (numObjptrs * OBJPTR_SIZE); + dataBytes = numElements * bytesPerElement; + /* Must check 0 == dataBytes before 0 == numPointers to correctly + * handle arrays when both are true. + */ + if (0 == dataBytes) + /* Empty arrays have space for forwarding pointer. */ + dataBytes = OBJPTR_SIZE; + else if (0 == numObjptrs) + /* No pointers to process. */ + ; + else { + max = p + dataBytes; + if (0 == numNonObjptrs) + /* Array with only pointers. */ + for (; p < max; p += OBJPTR_SIZE) + maybeCall (f, s, (objptr*)p); + else { + /* Array with a mix of pointers and non-pointers. */ + size_t nonObjptrBytes; + size_t objptrBytes; + + nonObjptrBytes = numNonObjptrsToBytes(numNonObjptrs, ARRAY_TAG); + objptrBytes = numObjptrs * OBJPTR_SIZE; + + /* For each array element. */ + while (p < max) { + pointer max2; + + /* Skip the non-pointers. */ + p += nonObjptrBytes; + max2 = p + objptrBytes; + /* For each internal pointer. */ + for ( ; p < max2; p += OBJPTR_SIZE) + maybeCall (f, s, (objptr*)p); + } + } + assert (p == max); + p -= dataBytes; + } + p += pad (s, dataBytes, GC_ARRAY_HEADER_SIZE); + } else { /* stack */ +/* GC_stack stack; */ +/* pointer top, bottom; */ +/* int i; */ +/* word returnAddress; */ +/* GC_frameLayout *layout; */ +/* GC_offsets frameOffsets; */ + +/* assert (STACK_TAG == tag); */ +/* stack = (GC_stack)p; */ +/* bottom = stackBottom (s, stack); */ +/* top = stackTop (s, stack); */ +/* assert (stack->used <= stack->reserved); */ +/* while (top > bottom) { */ +/* /\* Invariant: top points just past a "return address". *\/ */ +/* returnAddress = *(word*) (top - WORD_SIZE); */ +/* if (DEBUG) { */ +/* fprintf (stderr, " top = %d return address = ", */ +/* top - bottom); */ +/* fprintf (stderr, "0x%08x.\n", returnAddress); */ +/* } */ +/* layout = getFrameLayout (s, returnAddress); */ +/* frameOffsets = layout->offsets; */ +/* top -= layout->numBytes; */ +/* for (i = 0 ; i < frameOffsets[0] ; ++i) { */ +/* if (DEBUG) */ +/* fprintf(stderr, */ +/* " offset %u address 0x%08x\n", */ +/* frameOffsets[i + 1], */ +/* (uint)(*(pointer*)(top + frameOffsets[i + 1]))); */ +/* maybeCall(f, s, */ +/* (pointer*) */ +/* (top + frameOffsets[i + 1])); */ +/* } */ +/* } */ +/* assert(top == bottom); */ +/* p += sizeof (struct GC_stack) + stack->reserved; */ + } + return p; +} + +/* foreachPointerInRange (s, front, back, skipWeaks, f) + * + * Apply f to each pointer between front and *back, which should be a + * contiguous sequence of objects, where front points at the beginning + * of the first object and *back points just past the end of the last + * object. f may increase *back (for example, this is done by + * forward). foreachPointerInRange returns a pointer to the end of + * the last object it visits. + * + * If skipWeaks, then the object pointer in weak objects is skipped. + */ + +static inline pointer foreachPointerInRange (GC_state s, + pointer front, + pointer *back, + bool skipWeaks, + GC_pointerFun f) { + pointer b; + + assert (isAlignedFrontier (s, front)); + if (DEBUG_DETAILED) + fprintf (stderr, + "foreachPointerInRange front = "FMTPTR" *back = "FMTPTR"\n", + (intptr_t)front, (intptr_t)(*back)); + b = *back; + assert (front <= b); + while (front < b) { + while (front < b) { + assert (isAligned ((uintptr_t)front, GC_MODEL_MINALIGN)); + if (DEBUG_DETAILED) + fprintf (stderr, + "front = "FMTPTR" *back = "FMTPTR"\n", + (intptr_t)front, (intptr_t)(*back)); + front = foreachPointerInObject (s, toData (s, front), skipWeaks, f); + } + b = *back; + } + return front; +} 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-09-04 11:56:31 UTC (rev 4063) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.h 2005-09-05 03:19:05 UTC (rev 4064) @@ -1,8 +1,18 @@ typedef struct GC_state { + size_t alignment; /* */ + objptr callFromCHandler; /* Handler for exported C calls (in heap). */ + objptr currentThread; /* Currently executing thread (in heap). */ + objptr *globals; + uint32_t globalsSize; struct GC_heap heap; - struct GC_heap secondaryHeap; /* Used for major copying collection. */ GC_objectType *objectTypes; /* Array of object types. */ uint32_t objectTypesSize; /* Cardinality of objectTypes array. */ + objptr savedThread; /* Result of GC_copyCurrentThread. + * Thread interrupted by arrival of signal. + */ + struct GC_heap secondaryHeap; /* Used for major copying collection. */ + objptr signalHandler; /* Handler for signals (in heap). */ + /*Bool*/bool summary; /* Print a summary of gc info when program exits. */ GC_weak weaks; /* Linked list of (live) weak pointers */ } *GC_state; Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.h 2005-09-04 11:56:31 UTC (rev 4063) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/heap.h 2005-09-05 03:19:05 UTC (rev 4064) @@ -18,6 +18,6 @@ */ typedef struct GC_heap { - uint32_t size; + size_t size; pointer start; /* start of memory area */ } *GC_heap; Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/mltongc.txt =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/mltongc.txt 2005-09-04 11:56:31 UTC (rev 4063) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/mltongc.txt 2005-09-05 03:19:05 UTC (rev 4064) @@ -284,7 +284,7 @@ programs compiled on 64-bit architectures are essentially the same as those compiled on 32-bit architectures. In particular, 2^19 object types should remain viable for some time to come. Likewise, - the 20 counter bits in the header word (used to implement the mark + the 10 counter bits in the header word (used to implement the mark stack) should continue to be sufficient for the number of heap pointers in a normal heap object. Finally, 16-bits for the numNonPointers and numPointers fields of a GC_ObjectType will Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.c 2005-09-04 11:56:31 UTC (rev 4063) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.c 2005-09-05 03:19:05 UTC (rev 4064) @@ -6,17 +6,20 @@ */ static inline pointer objptrToPointer (objptr O, pointer B) { - intptr_t O_ = (intptr_t)O; - intptr_t B_; + uintptr_t O_ = (uintptr_t)O; + uintptr_t B_; + unsigned int S_ = GC_MODEL_SHIFT; + uintptr_t P_; pointer P; if GC_MODEL_USEBASE { - B_ = (intptr_t)B; + B_ = (uintptr_t)B; } else { B_ = 0; } - P = (pointer)((O_ << GC_MODEL_SHIFT) + B_); + P_ = ((O_ << S_) + B_); + P = (pointer)P_; if (DEBUG_DETAILED) fprintf (stderr, "objptrToPointer ("FMTOBJPTR") = "FMTPTR"\n", O, (intptr_t)P); @@ -24,19 +27,52 @@ } static inline objptr pointerToObjptr (pointer P, pointer B) { - intptr_t P_ = (intptr_t)P; - intptr_t B_; + uintptr_t P_ = (uintptr_t)P; + uintptr_t B_; + unsigned int S_ = GC_MODEL_SHIFT; + uintptr_t O_; objptr O; if GC_MODEL_USEBASE { - B_ = (intptr_t)B; + B_ = (uintptr_t)B; } else { B_ = 0; } - O = (objptr)((P_ - B_) >> GC_MODEL_SHIFT); + O_ = ((P_ - B_) >> S_); + O = (objptr)O_; if (DEBUG_DETAILED) fprintf (stderr, "pointerToObjptr ("FMTPTR") = "FMTOBJPTR"\n", (intptr_t)P, O); return O; } + +/* GC_isObjptr returns true if p looks like an object pointer. */ +static inline bool GC_isObjptr (objptr p) { + if GC_MODEL_NONPTR { + unsigned int shift = GC_MODEL_MINALIGN_SHIFT - GC_MODEL_SHIFT; + objptr mask = ~((~((objptr)0)) << shift); + return (0 == (p & mask)); + } else { + return TRUE; + } +} + +/* + * Note that by indirectly fetching and storing object pointers, the + * following functions admit implementations that behave according to + * model characteristics determined at runtime. Hence, by making + * exclusive use of these functions (and adding a GC_state->model + * field set by the compiled program), we may be able to implement the + * runtime in a manner which is agnostic to the actual objptr + * representation. + */ +static inline pointer fetchObjptrToPointer (pointer OP, pointer B) { + return objptrToPointer (*((objptr*)OP), B); +} +static inline void storeObjptrFromPointer (pointer OP, pointer P, pointer B) { + *((objptr*)OP) = pointerToObjptr (P, B); +} +static inline size_t objptrSize () { + return OBJPTR_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-09-04 11:56:31 UTC (rev 4063) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h 2005-09-05 03:19:05 UTC (rev 4064) @@ -28,7 +28,7 @@ D 32 slow 16 4 E 32 slow 32 8 F 40 slow 256 4 -G 64 fast 4G 8 +G 64 fast 4G 4 Each of the (A-F) has a variant (AX-FX) in which pointers are added to some constant base address. This gives access to any region in the @@ -139,35 +139,74 @@ #if (defined (GC_MODEL_A)) #define GC_MODEL_BITSIZE 32 -#define GC_MODEL_SHIFT 0 +#define GC_MODEL_SHIFT 0 #define GC_MODEL_USEBASE FALSE +#define GC_MODEL_MINALIGN_SHIFT 2 #elif (defined (GC_MODEL_AX)) -#define GC_MODEL_BITSIZE 32 -#define GC_MODEL_SHIFT 0 -#define GC_MODEL_USEBASE TRUE +#define GC_MODEL_BITSIZE 32 +#define GC_MODEL_SHIFT 0 +#define GC_MODEL_USEBASE TRUE +#define GC_MODEL_MINALIGN_SHIFT 2 #elif (defined (GC_MODEL_B)) -#define GC_MODEL_BITSIZE 32 -#define GC_MODEL_SHIFT 1 -#define GC_MODEL_USEBASE FALSE +#define GC_MODEL_BITSIZE 32 +#define GC_MODEL_SHIFT 1 +#define GC_MODEL_USEBASE FALSE +#define GC_MODEL_MINALIGN_SHIFT 2 #elif (defined (GC_MODEL_BX)) -#define GC_MODEL_BITSIZE 32 -#define GC_MODEL_SHIFT 1 -#define GC_MODEL_USEBASE TRUE +#define GC_MODEL_BITSIZE 32 +#define GC_MODEL_SHIFT 1 +#define GC_MODEL_USEBASE TRUE +#define GC_MODEL_MINALIGN_SHIFT 2 #elif (defined (GC_MODEL_C)) -#define GC_MODEL_BITSIZE 32 -#define GC_MODEL_SHIFT 2 -#define GC_MODEL_USEBASE FALSE +#define GC_MODEL_BITSIZE 32 +#define GC_MODEL_SHIFT 2 +#define GC_MODEL_USEBASE FALSE +#define GC_MODEL_MINALIGN_SHIFT 3 #elif (defined (GC_MODEL_CX)) +#define GC_MODEL_BITSIZE 32 +#define GC_MODEL_SHIFT 2 +#define GC_MODEL_USEBASE TRUE +#define GC_MODEL_MINALIGN_SHIFT 3 +#elif (defined (GC_MODEL_D)) +#define GC_MODEL_BITSIZE 32 +#define GC_MODEL_SHIFT 2 +#define GC_MODEL_USEBASE FALSE +#define GC_MODEL_MINALIGN_SHIFT 2 +#elif (defined (GC_MODEL_DX)) +#define GC_MODEL_BITSIZE 32 +#define GC_MODEL_SHIFT 2 +#define GC_MODEL_USEBASE TRUE +#define GC_MODEL_MINALIGN_SHIFT 2 +#elif (defined (GC_MODEL_E)) +#define GC_MODEL_BITSIZE 32 +#define GC_MODEL_SHIFT 3 +#define GC_MODEL_USEBASE FALSE +#define GC_MODEL_MINALIGN_SHIFT 3 +#elif (defined (GC_MODEL_EX)) #define GC_MODEL_BITSIZE 32 -#define GC_MODEL_SHIFT 2 +#define GC_MODEL_SHIFT 3 #define GC_MODEL_USEBASE TRUE +#define GC_MODEL_MINALIGN_SHIFT 3 +#elif (defined (GC_MODEL_F)) +#define GC_MODEL_BITSIZE 40 +#define GC_MODEL_SHIFT 0 +#define GC_MODEL_USEBASE FALSE +#define GC_MODEL_MINALIGN_SHIFT 2 +#elif (defined (GC_MODEL_EX)) +#define GC_MODEL_BITSIZE 40 +#define GC_MODEL_SHIFT 0 +#define GC_MODEL_USEBASE TRUE +#define GC_MODEL_MINALIGN_SHIFT 2 #elif (defined (GC_MODEL_G)) #define GC_MODEL_BITSIZE 64 -#define GC_MODEL_SHIFT 0 +#define GC_MODEL_SHIFT 0 #define GC_MODEL_USEBASE FALSE +#define GC_MODEL_MINALIGN_SHIFT 2 #else -#error gc model undefined +#error gc model unknown #endif +#define GC_MODEL_NONPTR ((GC_MODEL_MINALIGN_SHIFT - GC_MODEL_SHIFT) > 0) +#define GC_MODEL_MINALIGN TWOPOWER(GC_MODEL_MINALIGN_SHIFT) #define OBJPTR_TYPE__(z) uint ## z ## _t #define OBJPTR_TYPE_(z) OBJPTR_TYPE__(z) @@ -178,3 +217,9 @@ #define PRIxOBJPTR_(z) PRIxOBJPTR__(z) #define PRIxOBJPTR PRIxOBJPTR_(GC_MODEL_BITSIZE) #define FMTOBJPTR "0x%016"PRIxOBJPTR + +#if GC_MODEL_NONPTR +#define BOGUS_OBJPTR 0x1 +#else +#error gc model does not admit bogus object pointer +#endif Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.c 2005-09-04 11:56:31 UTC (rev 4063) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.c 2005-09-05 03:19:05 UTC (rev 4064) @@ -32,17 +32,17 @@ t = &s->objectTypes [objectTypeIndex]; \ tag = t->tag; \ hasIdentity = t->hasIdentity; \ - numNonPointers = t->numNonPointers; \ - numPointers = t->numPointers; \ + numNonObjptrs = t->numNonObjptrs; \ + numObjptrs = t->numObjptrs; \ if (DEBUG_DETAILED) \ fprintf (stderr, \ "SPLIT_HEADER ("FMTHDR")" \ " tag = %s" \ " hasIdentity = %u" \ - " numNonPointers = %"PRIu16 \ - " numPointers = %"PRIu16"\n", \ + " numNonObjptrs = %"PRIu16 \ + " numObjptrs = %"PRIu16"\n", \ header, \ - tagToString(tag), hasIdenity, numNonPointers, numPointers); \ + tagToString(tag), hasIdentity, numNonObjptrs, numObjptrs); \ } while (0) static char* tagToString (GC_objectTypeTag tag) { @@ -59,3 +59,36 @@ die ("bad tag %u", tag); } } + +/* If p points at the beginning of an object, then toData p returns a + * pointer to the start of the object data. + */ +static inline pointer toData (GC_state s, pointer p) { + GC_header header; + pointer res; + + assert (isAlignedFrontier (s, p)); + header = *(GC_header*)p; + if (0 == header) + /* Looking at the counter word in an array. */ + res = p + GC_ARRAY_HEADER_SIZE; + else + /* Looking at a header word. */ + res = p + GC_NORMAL_HEADER_SIZE; + assert (isAligned ((uintptr_t)res, s->alignment)); + return res; +} + +static inline size_t numNonObjptrsToBytes (uint16_t numNonObjptrs, + GC_objectTypeTag tag) { + switch (tag) { + case ARRAY_TAG: + return (size_t)(numNonObjptrs); + case NORMAL_TAG: + return (size_t)(numNonObjptrs) * 4; + case WEAK_TAG: + return (size_t)(numNonObjptrs) * 4; + default: + die ("bad tag %u", tag); + } +} Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h 2005-09-04 11:56:31 UTC (rev 4063) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h 2005-09-05 03:19:05 UTC (rev 4064) @@ -42,6 +42,22 @@ MARK_SHIFT = 31 }; +/* GC_getHeaderp (p) + * + * Returns a pointer to the header for the object pointed to by p. + */ +static inline GC_header* GC_getHeaderp (pointer p) { + return (GC_header*)(p - GC_HEADER_SIZE); +} + +/* GC_getHeader (p) + * + * Returns the header for the object pointed to by p. + */ +static inline GC_header GC_getHeader (pointer p) { + return *(GC_getHeaderp(p)); +} + /* * Normal objects have the following layout: * @@ -60,23 +76,7 @@ GC_NORMAL_HEADER_SIZE = GC_HEADER_SIZE, }; -/* - * Array objects have the following layout: - * - * counter word32 :: - * length word32 :: - * header word32 :: - * ( (non heap-pointers)* :: (heap pointers)* )* - * - * The counter word is used by mark compact GC. The length word is - * the number of elements in the array. Array elements have the same - * individual layout as normal objects, omitting the header word. - */ -enum { - GC_ARRAY_LENGTH_SIZE = 4, - GC_ARRAY_COUNTER_SIZE = GC_ARRAY_LENGTH_SIZE, - GC_ARRAY_HEADER_SIZE = GC_ARRAY_COUNTER_SIZE + GC_ARRAY_LENGTH_SIZE + GC_HEADER_SIZE, -}; +/* Array objects are described in "array.h" */ /* Stack objects are described in "stack.h" */ @@ -94,22 +94,22 @@ * of object types that is emitted for each compiled program. The * hasIdentity field indicates whether or not the object has mutable * fields, in which case it may not be hash-cons-ed. In a normal - * object, the numNonPointers field indicates the number of 32-bit - * words of non heap-pointer data, while the numPointers field + * object, the numNonObjptrs field indicates the number of 32-bit + * words of non heap-pointer data, while the numObjptrs field * indicates the number of heap pointers. In an array object, the - * numNonPointers field indicates the number of bytes of non - * heap-pointer data, while the numPointers field indicates the number - * of heap pointers. In a stack object, the numNonPointers and - * numPointers fields are irrelevant. In a weak object, the - * numNonPointers and numPointers fields are interpreted as in a - * normal object (and, hence, must be (0,1) or (0,0)). + * numNonObjptrs field indicates the number of bytes of non + * heap-pointer data, while the numObjptrs field indicates the number + * of heap pointers. In a stack object, the numNonObjptrs and + * numObjptrs fields are irrelevant. In a weak object, the + * numNonObjptrs and numObjptrs fields are interpreted as in a normal + * object (and, hence, must be (2,1) or (3,0)). */ typedef struct { /* Keep tag first, at zero offset, since it is referenced most often. */ GC_objectTypeTag tag; bool hasIdentity; - uint16_t numNonPointers; - uint16_t numPointers; + uint16_t numNonObjptrs; + uint16_t numObjptrs; } GC_objectType; enum { /* The type indices here must agree with those in backend/rep-type.fun. */ Copied: mlton/branches/on-20050822-x86_64-branch/runtime/gc/pointer.c (from rev 4025, mlton/branches/on-20050822-x86_64-branch/runtime/gc.h) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc.h 2005-08-22 22:48:34 UTC (rev 4025) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/pointer.c 2005-09-05 03:19:05 UTC (rev 4064) @@ -0,0 +1,13 @@ +/* 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. + */ + +/* GC_isPointer returns true if p looks like a pointer. */ +static inline bool GC_isPointer (pointer p) { + uintptr_t mask = ~((~((uintptr_t)0)) << GC_MODEL_MINALIGN_SHIFT); + return (0 == ((uintptr_t)p & mask)); +} Copied: mlton/branches/on-20050822-x86_64-branch/runtime/gc/pointer.h (from rev 4063, mlton/branches/on-20050822-x86_64-branch/runtime/gc/util.h) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/util.h 2005-09-04 11:56:31 UTC (rev 4063) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/pointer.h 2005-09-05 03:19:05 UTC (rev 4064) @@ -0,0 +1,11 @@ +/* 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. + */ + +typedef unsigned char* pointer; +#define FMTPTR "0x%016"PRIxPTR +#define BOGUS_POINTER 0x1 Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.h 2005-09-04 11:56:31 UTC (rev 4063) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.h 2005-09-05 03:19:05 UTC (rev 4064) @@ -27,7 +27,7 @@ /* markTop and markIndex are only used during marking. They record * the current pointer in the stack that is being followed. markTop * points to the top of the stack frame containing the pointer and - * markI is the index in that frames frameOffsets of the pointer + * markIndex is the index in that frames frameOffsets of the pointer * slot. So, when the GC pointer reversal gets back to the stack, * it can continue with the next pointer (either in the current * frame or the next frame). Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/thread.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/thread.h 2005-09-04 11:56:31 UTC (rev 4063) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/thread.h 2005-09-05 03:19:05 UTC (rev 4064) @@ -21,3 +21,5 @@ */ objptr stack; /* The stack for this thread. */ } *GC_thread; + +#define BOGUS_THREAD (GC_thread)BOGUS_POINTER Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/util.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/util.h 2005-09-04 11:56:31 UTC (rev 4063) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/util.h 2005-09-05 03:19:05 UTC (rev 4064) @@ -5,10 +5,6 @@ * MLton is released under a BSD-style license. * See the file MLton-LICENSE for details. */ - -#ifndef _UTIL_H_ -#define _UTIL_H_ - #define _ISOC99_SOURCE #define _BSD_SOURCE @@ -26,6 +22,8 @@ #include <stdio.h> #include <stdint.h> #include <inttypes.h> +#include <stdlib.h> +#include <limits.h> #include "../assert.h" @@ -47,8 +45,3 @@ extern void diee (char *fmt, ...) __attribute__ ((format(printf, 1, 2))) __attribute__ ((noreturn)); - -typedef void* pointer; -#define FMTPTR "0x%016"PRIxPTR - -#endif /* _UTIL_H_ */ |
From: Matthew F. <fl...@ml...> - 2005-09-04 04:56:32
|
Better mnemonics for model. ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.c U mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.c 2005-09-04 11:44:16 UTC (rev 4062) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.c 2005-09-04 11:56:31 UTC (rev 4063) @@ -10,13 +10,13 @@ intptr_t B_; pointer P; - if GC_MODEL_B { + if GC_MODEL_USEBASE { B_ = (intptr_t)B; } else { B_ = 0; } - P = (pointer)((O_ << GC_MODEL_S) + B_); + P = (pointer)((O_ << GC_MODEL_SHIFT) + B_); if (DEBUG_DETAILED) fprintf (stderr, "objptrToPointer ("FMTOBJPTR") = "FMTPTR"\n", O, (intptr_t)P); @@ -28,13 +28,13 @@ intptr_t B_; objptr O; - if GC_MODEL_B { + if GC_MODEL_USEBASE { B_ = (intptr_t)B; } else { B_ = 0; } - O = (objptr)((P_ - B_) >> GC_MODEL_S); + O = (objptr)((P_ - B_) >> GC_MODEL_SHIFT); if (DEBUG_DETAILED) fprintf (stderr, "pointerToObjptr ("FMTPTR") = "FMTOBJPTR"\n", (intptr_t)P, O); Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h 2005-09-04 11:44:16 UTC (rev 4062) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h 2005-09-04 11:56:31 UTC (rev 4063) @@ -135,16 +135,46 @@ manageable set for users. */ -#define GC_MODEL_Z 32 -#define GC_MODEL_S 1 -#define GC_MODEL_B TRUE +#define GC_MODEL_G +#if (defined (GC_MODEL_A)) +#define GC_MODEL_BITSIZE 32 +#define GC_MODEL_SHIFT 0 +#define GC_MODEL_USEBASE FALSE +#elif (defined (GC_MODEL_AX)) +#define GC_MODEL_BITSIZE 32 +#define GC_MODEL_SHIFT 0 +#define GC_MODEL_USEBASE TRUE +#elif (defined (GC_MODEL_B)) +#define GC_MODEL_BITSIZE 32 +#define GC_MODEL_SHIFT 1 +#define GC_MODEL_USEBASE FALSE +#elif (defined (GC_MODEL_BX)) +#define GC_MODEL_BITSIZE 32 +#define GC_MODEL_SHIFT 1 +#define GC_MODEL_USEBASE TRUE +#elif (defined (GC_MODEL_C)) +#define GC_MODEL_BITSIZE 32 +#define GC_MODEL_SHIFT 2 +#define GC_MODEL_USEBASE FALSE +#elif (defined (GC_MODEL_CX)) +#define GC_MODEL_BITSIZE 32 +#define GC_MODEL_SHIFT 2 +#define GC_MODEL_USEBASE TRUE +#elif (defined (GC_MODEL_G)) +#define GC_MODEL_BITSIZE 64 +#define GC_MODEL_SHIFT 0 +#define GC_MODEL_USEBASE FALSE +#else +#error gc model undefined +#endif + #define OBJPTR_TYPE__(z) uint ## z ## _t #define OBJPTR_TYPE_(z) OBJPTR_TYPE__(z) -#define OBJPTR_TYPE OBJPTR_TYPE_(GC_MODEL_Z) +#define OBJPTR_TYPE OBJPTR_TYPE_(GC_MODEL_BITSIZE) typedef OBJPTR_TYPE objptr; #define OBJPTR_SIZE sizeof(objptr) #define PRIxOBJPTR__(z) PRIx ## z #define PRIxOBJPTR_(z) PRIxOBJPTR__(z) -#define PRIxOBJPTR PRIxOBJPTR_(GC_MODEL_Z) +#define PRIxOBJPTR PRIxOBJPTR_(GC_MODEL_BITSIZE) #define FMTOBJPTR "0x%016"PRIxOBJPTR |
From: Matthew F. <fl...@ml...> - 2005-09-04 04:44:18
|
#define-s for formatting and debugging ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile U mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.c U mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h U mlton/branches/on-20050822-x86_64-branch/runtime/gc/util.h ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile 2005-09-04 02:08:38 UTC (rev 4061) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile 2005-09-04 11:44:16 UTC (rev 4062) @@ -24,7 +24,7 @@ endif ifeq ($(TARGET_ARCH), amd64) -FLAGS += -mtune=opteron -m32 +FLAGS += -mtune=opteron endif ifeq ($(TARGET_ARCH), sparc) Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.c 2005-09-04 02:08:38 UTC (rev 4061) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.c 2005-09-04 11:44:16 UTC (rev 4062) @@ -8,22 +8,35 @@ static inline pointer objptrToPointer (objptr O, pointer B) { intptr_t O_ = (intptr_t)O; intptr_t B_; + pointer P; + if GC_MODEL_B { B_ = (intptr_t)B; } else { B_ = 0; } - return (pointer)((O_ << GC_MODEL_S) + B_); + + P = (pointer)((O_ << GC_MODEL_S) + B_); + if (DEBUG_DETAILED) + fprintf (stderr, "objptrToPointer ("FMTOBJPTR") = "FMTPTR"\n", O, (intptr_t)P); + + return P; } static inline objptr pointerToObjptr (pointer P, pointer B) { intptr_t P_ = (intptr_t)P; intptr_t B_; + objptr O; if GC_MODEL_B { B_ = (intptr_t)B; } else { B_ = 0; } - return (objptr)((P_ - B_) >> GC_MODEL_S); + + O = (objptr)((P_ - B_) >> GC_MODEL_S); + if (DEBUG_DETAILED) + fprintf (stderr, "pointerToObjptr ("FMTPTR") = "FMTOBJPTR"\n", (intptr_t)P, O); + + return O; } Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h 2005-09-04 02:08:38 UTC (rev 4061) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h 2005-09-04 11:44:16 UTC (rev 4062) @@ -14,8 +14,8 @@ C. 32 bits, with bottom bit zero, shift left by two. D. 32 bits, shift left by two. E. 32 bits, shift left by three. -F. 40 bits. -G. 64 bits. +F. 40 bits, with bottom two bits zero. +G. 64 bits, with bottom two bits zero. These schemes vary in the number of bits to represent a pointer in an object, the time to load a pointer from memory into a register, the @@ -51,9 +51,9 @@ ================================= E - ======================================== F + ======================================00 F - ================================================================ G + ==============================================================00 G Algorithmically, we can compute the native pointer (P) from the object pointer (O) (with bitsize Z), given a shift (S) and a base (B): @@ -126,7 +126,6 @@ (G) costs the most in space, but has the fastest load time for pointers of the schemes that allow access to 4G of memory. - A reasonable tradeoff in implementation complexity vs allowing our users enough flexibility might be to provide: @@ -139,8 +138,13 @@ #define GC_MODEL_Z 32 #define GC_MODEL_S 1 #define GC_MODEL_B TRUE + #define OBJPTR_TYPE__(z) uint ## z ## _t #define OBJPTR_TYPE_(z) OBJPTR_TYPE__(z) #define OBJPTR_TYPE OBJPTR_TYPE_(GC_MODEL_Z) typedef OBJPTR_TYPE objptr; #define OBJPTR_SIZE sizeof(objptr) +#define PRIxOBJPTR__(z) PRIx ## z +#define PRIxOBJPTR_(z) PRIxOBJPTR__(z) +#define PRIxOBJPTR PRIxOBJPTR_(GC_MODEL_Z) +#define FMTOBJPTR "0x%016"PRIxOBJPTR Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/util.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/util.h 2005-09-04 02:08:38 UTC (rev 4061) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/util.h 2005-09-04 11:44:16 UTC (rev 4062) @@ -49,6 +49,6 @@ __attribute__ ((noreturn)); typedef void* pointer; -#define FMTPTR "0x%08"PRIxPTR +#define FMTPTR "0x%016"PRIxPTR #endif /* _UTIL_H_ */ |
From: Matthew F. <fl...@ml...> - 2005-09-03 19:08:42
|
More framework ---------------------------------------------------------------------- U mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile U mlton/branches/on-20050822-x86_64-branch/runtime/gc/TODO U mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.c A mlton/branches/on-20050822-x86_64-branch/runtime/gc/frame.h U mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.h U mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h U mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h A mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.h A mlton/branches/on-20050822-x86_64-branch/runtime/gc/thread.h A mlton/branches/on-20050822-x86_64-branch/runtime/gc/weak.c A mlton/branches/on-20050822-x86_64-branch/runtime/gc/weak.h ---------------------------------------------------------------------- Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile 2005-09-04 00:58:04 UTC (rev 4060) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/Makefile 2005-09-04 02:08:38 UTC (rev 4061) @@ -58,8 +58,12 @@ HFILES = \ gc_prefix.h \ util.h \ + model.h \ object.h \ - model.h \ + stack.h \ + frame.h \ + thread.h \ + weak.h \ heap.h \ gc_state.h \ gc_suffix.h Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/TODO =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/TODO 2005-09-04 00:58:04 UTC (rev 4060) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/TODO 2005-09-04 02:08:38 UTC (rev 4061) @@ -3,4 +3,9 @@ * eliminate STRING_TYPE_INDEX, STRING_TYPE_HEADER in favor or WORD8. * fix semantics of numNonPointers for normal objects to mean bytes of non-pointer data, rather than number of 32-bit words of - non-pointer data. + non-pointer data. Rename to sizeNonPointers. +* the unused field in GC_weak appears to be for alignment; is there a + way to have it work well with 64-bits? Yes -- it requires + choosing the representation for Weaks based on the model and + the alignment; also, the GC will need to bump the pointer to + the word after the header to get GC_weak to overlay properly. Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.c =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.c 2005-09-04 00:58:04 UTC (rev 4060) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/cheney-copy.c 2005-09-04 02:08:38 UTC (rev 4061) @@ -152,12 +152,12 @@ } static void swapSemis (GC_state s) { - struct GC_heap h; - - h = s->heap2; - s->heap2 = s->heap; - s->heap = h; - setCardMapForMutator (s); + struct GC_heap tempHeap; + + tempHeap = s->secondaryHeap; + s->secondaryHeap = s->heap; + s->heap = tempHeap; + setCardMapForMutator (s); } static inline bool detailedGCTime (GC_state s) { @@ -172,8 +172,8 @@ if (detailedGCTime (s)) startTiming (&ru_start); s->numCopyingGCs++; - s->toSpace = s->heap2.start; - s->toLimit = s->heap2.start + s->heap2.size; + s->toSpace = s->secondaryHeap.start; + s->toLimit = s->secondaryHeap.start + s->secondaryHeap.size; if (DEBUG or s->messages) { fprintf (stderr, "Major copying GC.\n"); fprintf (stderr, "fromSpace = 0x%08x of size %s\n", Copied: mlton/branches/on-20050822-x86_64-branch/runtime/gc/frame.h (from rev 4025, mlton/branches/on-20050822-x86_64-branch/runtime/gc.h) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc.h 2005-08-22 22:48:34 UTC (rev 4025) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/frame.h 2005-09-04 02:08:38 UTC (rev 4061) @@ -0,0 +1,39 @@ +/* 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. + */ + +/* + * The "... reserved bytes ..." of a stack object constitute a linear + * sequence of frames. For the purposes of garbage collection, we + * must be able to recover the size and offsets of live heap-pointers + * for each frame. This data is declared as follows: + * + * GC_frameLayout *frameLayouts; + * + * The frameLayouts pointer is initialized to point to a static array + * of frame layouts that is emitted for each compiled program. The + * isC field identified whether or not the frame is for a C + * call. (Note: The ML stack is distinct from the system stack. A C + * call executes on the system stack. The frame left on the ML stack + * is just a marker.) The numBytes field indicates the size of the + * frame, including space for the return address. The offsets field + * points to an array (the zeroeth element recording the size of the + * array) whose elements record byte offsets from the bottom of the + * frame at which live heap pointers are located. + */ +typedef uint16_t *GC_offsets; + +typedef struct GC_frameLayout { + /* Identifies whether or not the frame is for a C call. */ + bool isC; + /* Number of bytes in frame, including space for return address. */ + uint16_t numBytes; + /* Offsets from stackTop pointing at bottom of frame at which + * pointers are located. + */ + GC_offsets offsets; +} GC_frameLayout; 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-09-04 00:58:04 UTC (rev 4060) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/gc_state.h 2005-09-04 02:08:38 UTC (rev 4061) @@ -4,4 +4,5 @@ struct GC_heap secondaryHeap; /* Used for major copying collection. */ GC_objectType *objectTypes; /* Array of object types. */ uint32_t objectTypesSize; /* Cardinality of objectTypes array. */ + GC_weak weaks; /* Linked list of (live) weak pointers */ } *GC_state; Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h 2005-09-04 00:58:04 UTC (rev 4060) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/model.h 2005-09-04 02:08:38 UTC (rev 4061) @@ -143,4 +143,4 @@ #define OBJPTR_TYPE_(z) OBJPTR_TYPE__(z) #define OBJPTR_TYPE OBJPTR_TYPE_(GC_MODEL_Z) typedef OBJPTR_TYPE objptr; -#define OBJPTR_SIZE (sizeof(objptr) / 4) +#define OBJPTR_SIZE sizeof(objptr) Modified: mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h 2005-09-04 00:58:04 UTC (rev 4060) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/object.h 2005-09-04 02:08:38 UTC (rev 4061) @@ -30,7 +30,7 @@ #define PRIxHDR PRIx32 #define FMTHDR "0x%08"PRIxHDR enum { - GC_HEADER_SIZE = 4, + GC_HEADER_SIZE = sizeof(GC_header), TYPE_INDEX_BITS = 19, TYPE_INDEX_MASK = 0x000FFFFE, TYPE_INDEX_SHIFT = 1, @@ -78,9 +78,9 @@ GC_ARRAY_HEADER_SIZE = GC_ARRAY_COUNTER_SIZE + GC_ARRAY_LENGTH_SIZE + GC_HEADER_SIZE, }; -/* Stack objects are described in stack.h */ +/* Stack objects are described in "stack.h" */ -/* Weak objects are described in weak.h */ +/* Weak objects are described in "weak.h" */ /* Copied: mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.h (from rev 4025, mlton/branches/on-20050822-x86_64-branch/runtime/gc.h) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc.h 2005-08-22 22:48:34 UTC (rev 4025) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/stack.h 2005-09-04 02:08:38 UTC (rev 4061) @@ -0,0 +1,48 @@ +/* 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. + */ + +/* + * Stack objects have the following layout: + * + * header word :: + * markTop pointer :: + * markIndex word :: + * reserved word :: + * used word :: + * ... reserved bytes ... + * + * The markTop pointer and markIndex word are used by mark compact GC. + * The reserved word gives the number of bytes for the stack (before + * the next ML object). The used word gives the number of bytes + * currently used by the stack. The sequence of reserved bytes + * correspond to ML stack frames, which will be discussed in more + * detail in "frame.h". +*/ +typedef struct GC_stack { + /* markTop and markIndex are only used during marking. They record + * the current pointer in the stack that is being followed. markTop + * points to the top of the stack frame containing the pointer and + * markI is the index in that frames frameOffsets of the pointer + * slot. So, when the GC pointer reversal gets back to the stack, + * it can continue with the next pointer (either in the current + * frame or the next frame). + */ + pointer markTop; + uint32_t markIndex; + /* reserved is the number of bytes reserved for stack, + * i.e. its maximum size. + */ + uint32_t reserved; + /* used is the number of bytes used by the stack. + * Stacks with used == reserved are continuations. + */ + uint32_t used; + /* The next address is the bottom of the stack, and the following + * reserved bytes hold space for the stack. + */ +} *GC_stack; Copied: mlton/branches/on-20050822-x86_64-branch/runtime/gc/thread.h (from rev 4025, mlton/branches/on-20050822-x86_64-branch/runtime/gc.h) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc.h 2005-08-22 22:48:34 UTC (rev 4025) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/thread.h 2005-09-04 02:08:38 UTC (rev 4061) @@ -0,0 +1,23 @@ +/* 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. + */ + +typedef struct GC_thread { + /* The order of these fields is important. The nonpointer fields + * must be first, because this object must appear to be a normal + * heap object. + * Furthermore, the exnStack field must be first, because the native + * codegen depends on this (which is bad and should be fixed). + */ + uint32_t exnStack; /* An offset added to stackBottom that specifies + * where the top of the exnStack is. + */ + uint32_t bytesNeeded; /* The number of bytes needed when returning + * to this thread. + */ + objptr stack; /* The stack for this thread. */ +} *GC_thread; Copied: mlton/branches/on-20050822-x86_64-branch/runtime/gc/weak.c (from rev 4025, mlton/branches/on-20050822-x86_64-branch/runtime/gc.c) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc.c 2005-08-22 22:48:34 UTC (rev 4025) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/weak.c 2005-09-04 02:08:38 UTC (rev 4061) @@ -0,0 +1,40 @@ +/* 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_weakCanGet (pointer p) { + Bool res; + + res = WEAK_GONE_HEADER != GC_getHeader (p); + if (DEBUG_WEAK) + fprintf (stderr, "%s = GC_weakCanGet (0x%08x)\n", + boolToString (res), (uint)p); + return res; +} + +Pointer GC_weakGet (Pointer p) { + pointer res; + + res = ((GC_weak)p)->object; + if (DEBUG_WEAK) + fprintf (stderr, "0x%08x = GC_weakGet (0x%08x)\n", + (uint)res, (uint)p); + return res; +} + +Pointer GC_weakNew (GC_state s, Word32 header, Pointer p) { + pointer res; + + res = object (s, header, GC_NORMAL_HEADER_SIZE + 3 * WORD_SIZE, + FALSE, FALSE); + ((GC_weak)res)->object = p; + if (DEBUG_WEAK) + fprintf (stderr, "0x%08x = GC_weakNew (0x%08x, 0x%08x)\n", + (uint)res, (uint)header, (uint)p); + return res; +} Copied: mlton/branches/on-20050822-x86_64-branch/runtime/gc/weak.h (from rev 4025, mlton/branches/on-20050822-x86_64-branch/runtime/gc.h) =================================================================== --- mlton/branches/on-20050822-x86_64-branch/runtime/gc.h 2005-08-22 22:48:34 UTC (rev 4025) +++ mlton/branches/on-20050822-x86_64-branch/runtime/gc/weak.h 2005-09-04 02:08:38 UTC (rev 4061) @@ -0,0 +1,33 @@ +/* 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. + */ + +/* + * Weak objects have the following layout: + * + * header word :: + * unused word :: + * link word :: + * heap-pointer + * + * The object type indexed by the header determines whether the weak + * is valid or not. If the type has numPointers == 1, then the weak + * pointer is valid. Otherwise, the type has numPointers == 0 and the + * weak pointer is not valid. + * + * The first word is unused; present for alignment purposes + * + * The second word is used to chain the live weaks together during a copying gc + * and is otherwise unused. + * + * The third word is the weak pointer. + */ +typedef struct GC_weak { + uint32_t unused; + struct GC_weak *link; + objptr object; +} *GC_weak; |