Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/HISTORY
ViewVC logotype

Diff of /sml/trunk/HISTORY

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 683, Wed Jul 5 00:42:19 2000 UTC revision 1741, Tue Dec 21 19:20:57 2004 UTC
# Line 8  Line 8 
8  The form of an entry should be:  The form of an entry should be:
9    
10  Name:  Name:
11  Date:  Date: yyyy/mm/dd
12  Tag: <post-commit CVS tag>  Tag: <post-commit CVS tag>
13  Description:  Description:
14    
15    ----------------------------------------------------------------------
16    Name: Matthias Blume (blume (at) tti - c (dot) org)
17    Date: 2004/12/21 12:50:00 CST
18    Tag: blume-20041221-memory
19    Description:
20    
21    Some cleanup in the $c/memory.cm library: separated some concerns by
22    moving allocation code and memory access code each into their own
23    files.
24    
25    ----------------------------------------------------------------------
26    Name: Allen Leung (leunga (at) reservoir (dot) com)
27    Date: 2004/12/17 16:12:00 EST
28    Tag: leunga-20041217-cygwin-smlnj-home
29    Description:
30    
31        The Unix I/O library of SML/NJ on cygwin does not understand
32    Windows style pathname, so problems arise when SMLNJ_HOME is set
33    to a Windows style pathname.  _run-sml now converts SMLNJ_HOME
34    to a POSIX pathname on cygwin.
35    
36    ----------------------------------------------------------------------
37    Name: Matthias Blume (blume (at) tti - c (dot) org)
38    Date: 2004/12/16 13:35:00 CST
39    Tag: Release_110_52
40    Description:
41    
42    Last-minute changes incorporated into 110.52.  Release tag moved.
43    
44    The changes:
45       - HashString.hashString' -> HashString.hashSubstring
46       - bug fix in UnivariateStats
47    
48    ----------------------------------------------------------------------
49    Name: Matthias Blume (blume (at) tti - c (dot) org)
50    Date: 2004/12/15 23:40:00 CST
51    Tag: blume-20041215-hashSubstring
52    Description:
53    
54    - HashString.hashString' -> HashString.hashSubstring
55    - corresponding changes in atom.sml
56    - "de-compressed" (aka. un-obfuscated) code for UnivariateStats and
57      added some comments
58    
59    ----------------------------------------------------------------------
60    Name: Matthias Blume (blume (at) tti - c (dot) org)
61    Date: 2004/12/15 15:30:00 CST
62    Tag: (Release_110_52)
63    Description:
64    
65    New working version (110.52).  NEW BOOTFILES!
66    
67    ----------------------------------------------------------------------
68    Name: Matthias Blume (blume (at) tti - c (dot) org)
69    Date: 2004/12/15 12:45:00 CST
70    Tag: blume-20041215-spaces
71    Description:
72    
73    More on the space problem (this time for Win32).
74    
75    ----------------------------------------------------------------------
76    Name: Matthias Blume (blume (at) tti - c (dot) org)
77    Date: 2004/12/14 17:30:00 CST
78    Tag: blume-20041214-spaces
79    Description:
80    
81    Hacked some of the scripts (in particular: the installer) to cope with
82    spaces in filenames a bit better.  But beware: the current "solution"
83    is likely still full of bugs and inherently incomplete.  (We need to
84    do away with those shell scripts for a comprehensive solution.)
85    
86    ----------------------------------------------------------------------
87    Name: Matthias Blume (blume (at) tti - c (dot) org)
88    Date: 2004/12/13 14:45:00 CST
89    Tag: blume-20041213-ml-makedepend
90    Description:
91    
92    Fixed bug in code for ml-makedepend.
93    
94    ----------------------------------------------------------------------
95    Name: Matthias Blume (blume (at) tti - c (dot) org)
96    Date: 2004/12/09 16:30:00 CST
97    Tag: blume-20041209-statistics
98    Description:
99    
100    Added two simple but potentially useful statistics modules to SML/NJ Library.
101    (See CHANGES file there.)
102    
103    ----------------------------------------------------------------------
104    Name: Matthias Blume (blume (at) tti - c (dot) org)
105    Date: 2004/12/01 16:50:00 CST
106    Tag: blume-20041201-atom
107    Description:
108    
109    smlnj-lib:
110    
111      Added function HashString.hashString' for substrings.
112      Hand-inlined CharVector.foldl into HashString (for speed).
113      Modified implementation of structure Atom to avoid extracting
114      strings from substrings unless necessary.
115      (Also see CHANGES file for smlnj-lib.)
116    
117    ----------------------------------------------------------------------
118    Name: Matthias Blume (blume (at) tti - c (dot) org)
119    Date: 2004/11/24 22:15:00 CST
120    Tag: blume-20041124-cml
121    Description:
122    
123    Made sure CML compiles when Position = Int64.
124    
125    ----------------------------------------------------------------------
126    Name: Matthias Blume (blume (at) tti - c (dot) org)
127    Date: 2004/11/24 14:30:00 CST
128    Tag: blume-20041124-position
129    Description:
130    
131    The compiler can now be compiled in a mode that makes structure Position
132    equal to Int64.  The default, however, is unchanged (Position = Int31)
133    for the time being.
134    
135    To enable 64-bit positions, use the following procedure:
136    
137    1. Start sml
138    2. Autoload $smlnj/cmb.cm (if not already autoloaded)
139    3. Type
140          #set (CMB.symval "USE_64_BIT_POSITIONS") (SOME 1);
141    4. Run CMB.make() as usual.
142    
143    This is barely tested.  The only test so far was a little SML program
144    counting the number of characters in an 8-gigabyte file by
145    reading it character-by-character.  That test was successful.
146    
147    In support of 64-bit positions, a number of new functions have been
148    added to the runtime system.
149    
150    ----------------------------------------------------------------------
151    Name: Matthias Blume (blume (at) tti - c (dot) org)
152    Date: 2004/11/23 14:45:00 CST
153    Tag: blume-20041123-useFile
154    Description:
155    
156    Fixed a problem with unhelpful error messages related to problems with
157    .cm- or .sml files that appear as part of the sml command line.
158    
159    ----------------------------------------------------------------------
160    Name: Matthias Blume (blume (at) tti - c (dot) org)
161    Date: 2004/11/18 15:40:00 CST
162    Tag: Release_110_51
163    Description:
164    
165    New working version (110.51).  NEW BOOTFILES!
166    
167    ----------------------------------------------------------------------
168    Name: Matthias Blume (blume (at) tti - c (dot) org)
169    Date: 2004/11/18 15:35:00 CST
170    Tag: <none>
171    Description:
172    
173    Enabled dlopen and friends for FreeBSD (as recommended by Johannes 5
174    Joemann).
175    
176    ----------------------------------------------------------------------
177    Name: Allen Leung (leunga (at) reservoir (dot) com)
178    Date: 2004/11/17 16:05:21 EST 2004
179    Tag: leunga-20041117-mlrisc-live-kill
180    Description:
181    
182       Added support for MLTree constructs LIVE and KILL
183    to all the architectures.
184    
185    ----------------------------------------------------------------------
186    Name: Matthias Blume (blume (at) tti - c (dot) org)
187    Date: 2004/11/13 00:20:00 CST
188    Tag: blume-20041113-versiontool
189    Description:
190    
191    - Stripped down the versiontool: It now only handles the version number.
192      The date string is generated at bootstrap time (during makeml).
193    
194    - In a previous commit, fixed a minor issue with how polyequal is being
195      translated.  In particular, the code now "looks through" abstractions.
196      This results in slightly fewer polyEqual warnings and hopefully slightly
197      more efficient code.  Important examples for where this matters are
198      the new int64 and word64 types.
199    
200    ----------------------------------------------------------------------
201    Name: Matthias Blume (blume (at) tti - c (dot) org)
202    Date: 2004/11/12 00:30:00 CST
203    Tag: blume-20041112-int64
204    Description:
205    
206    Structure Int64 fully hooked in.  (The implementation is not very
207    efficient, though.)
208    
209    ----------------------------------------------------------------------
210    Name: Matthias Blume (blume (at) tti - c (dot) org)
211    Date: 2004/11/11 17:30:00 CST
212    Tag: blume-20041111-more64
213    Description:
214    
215    All the pieces of Word64 are now there, with the exception of the
216    conversions from and to LargeWord. (Eventually these need to be identities,
217    but for the time being they don't even make sense because LargeWord is
218    32-bit wide.)
219    
220    Also started to add similar support for Int64, but major pieces of that
221    are still missing.
222    
223    ----------------------------------------------------------------------
224    Name: Matthias Blume (blume (at) tti - c (dot) org)
225    Date: 2004/11/11 00:15:00 CST
226    Tag: blume-20041111-word64
227    Description:
228    
229    Structure Word64 is now (almost) complete, word literals and patterns
230    seem to work.  There are a few odd pieces missing.  In particular,
231    I didn't do the {from,to}LargeWord parts because LargeWord is still Word32
232    at the moment.
233    
234    Making Word64 official would mean that LargeWord becomes Word64.  But
235    this requires extreme care because most word-word conversions have to
236    go through LargeWord, so making a mistake means loss of efficiency or
237    worse.  Eventually there will be a solution similar to (but actually
238    simpler than) what I did with IntInf.
239    
240    ----------------------------------------------------------------------
241    Name: Matthias Blume (blume (at) tti - c (dot) org)
242    Date: 2004/11/10 18:12:00 CST
243    Tag: blume-20041110-64bit
244    Description:
245    
246    More 64-bit hacking (but still not even half-way there yet).
247    Also, some assorted improvements to the handling of 8-bit words.
248    
249    ----------------------------------------------------------------------
250    Name: Matthias Blume (blume (at) tti - c (dot) org)
251    Date: 2004/11/09 17:50:00 CST
252    Tag: <none>
253    Description:
254    
255    Started adding some infrastructure for supporting 64-bit int- and
256    word-types.  (Still in its very early stages.)
257    
258    ----------------------------------------------------------------------
259    Name: Matthias Blume (blume (at) tti - c (dot) org)
260    Date: 2004/10/28 10:45:00 CDT
261    Tag: Release_110_50
262    Description:
263    
264    New working version (110.50).  NEW BOOTFILES!
265    
266                 =====================
267    
268    Also:
269    
270      - Changend config/srcarchiveurl from a file just
271        containing the URL string into a file containing
272        shell script code.  The code has access to the $VERSION variable.
273      - Made corresponding changes to config/install.sh and config/unpack.
274      - Default contents of config/srcarchiveurl uses $VERSION and
275        normally does not have to be edited to reflect a version change.
276    
277      (As a result, a version change can be done by just editing
278       config/version, the rest is now automatic.)
279    
280    ----------------------------------------------------------------------
281    Name: Matthias Blume (blume (at) tti - c (dot) org)
282    Date: 2004/10/27 17:50:00 CDT
283    Tag: blume-20041027-btrace-msg
284    Description:
285    
286    BackTrace.monitor now also reports the source of the exception that
287    triggered the trace.
288    
289    ----------------------------------------------------------------------
290    Name: Matthias Blume (blume (at) tti - c (dot) org)
291    Date: 2004/10/27 17:20:00 CDT
292    Tag: blume-20041027-x86-c-calls
293    Description:
294    
295    This is the HISTORY entry for two earlier commits, both concerning
296    the x86 c-calls code in MLRISC:
297    
298      - added a missing LOAD in the code that deals with struct arguments
299      - made sure the caller does not add the wrong number of bytes to the
300        stack pointer after a call of a function returning a struct
301        (the callee already pops the implicit argument which points to
302         the space reserved for the result)
303    
304    ----------------------------------------------------------------------
305    Name: Allen Leung (leunga (at) reservoir (dot) com)
306    Date: 2004/10/24 14:00:00 EST
307    Tag: leunga-20041024-x86-gas-fucomip
308    Description:
309    
310       John discovered a bug in the syntax of fucomip.
311       The opcodes FU?COMIP? have been changed to
312    
313           fu?comip? %st(i), %st
314    
315    ----------------------------------------------------------------------
316    Name: Matthias Blume (blume (at) tti - c (dot) org)
317    Date: 2004/10/20 15:06:00 CDT
318    Tag: blume-20041020-standalone-backtrace
319    Description:
320    
321    Added a mechanism for getting back-trace information from standalone
322    programs.  Here is how it works:
323    
324       1. The part of the program from which you want to get backtrace
325          information (usually the whole program) should be wrapped with
326          BackTrace.monitor.  This is a (unit->'a)->'a function, and your
327          main program could be modified from something like
328    
329             fun main (pgm, args) = ...
330    
331         to
332    
333            fun main (pgm, args) = BackTrace.monitor (fn () => ...)
334    
335       2. To be able to access BackTrace.monitor, you have to add
336          library $smlnj-tdp/plugins.cm to the .cm file that contains your
337          main function.
338    
339       3. Remove all compiled code (i.e., all the .cm/ subdirectories that
340          CM might have created in the past for your project).
341    
342       4. Build the system using this command line:
343    
344             ml-build -Ctdp.instrument=true \$smlnj-tdp/back-trace.cm \
345                      myprog.cm MyProg.main myprog
346    
347          instead of the usual
348    
349             ml-build myprog.cm MyProg.main myprog
350    
351    I changed a library name:
352    
353       $/trace-debug-profile.cm --> $smlnj-tdp/plugins.cm
354    
355    New libraries:
356    
357       $smlnj-tdp/back-trace.cm
358          -- when loaded causes the back-trace plugin to be installed
359       $smlnj-tdp/coverage.cm
360          -- when loaded causes the coverage plugin to be installed
361    
362    ----------------------------------------------------------------------
363    Name: Matthias Blume (blume (at) tti - c (dot) org)
364    Date: 2004/10/18 16:45:00 CDT
365    Tag: blume-20041018-groupowner
366    Description:
367    
368    Added an "obsolete" warning for the "group owner" syntax to CM's parser.
369    
370    Eliminated group owner specs from .cm files throughout the source tree.
371    
372    ----------------------------------------------------------------------
373    Name: Matthias Blume (blume (at) tti - c (dot) org)
374    Date: 2004/10/15 15:45:00 CDT
375    Tag: blume-20041015-coverage
376    Description:
377    
378    * Test coverage tool added!
379    * Further reorganization of tracing-, debugging-, and profiling support:
380    
381        - moved original BTImp -- now called BackTrace -- into a separate
382          library called $/trace-debug-profile.cm
383        - eliminated all mentions of BTrace from SMLofNJ.Internals
384        - only the instrumentation mechanism is now left in the compiler proper
385        - BackTrace module is a plugin which is NOT plugged in by default
386        - Coverage module is another such plugin
387    
388    To get the benefits of any of these plugin modules, the code in
389    question must be compiled with tdp instrumentation turned on.  This
390    can be done by setting SMLofNJ.Internals.TDP.mode to true.
391    (The ref cell is also controlled via the -Ctdp.instrument=... switch.)
392    
393    Plugins are selected at link time.  (Pre-compiled instrumented code
394    can be re-loaded with different plugins in effect.)  When an
395    instrumented module is linked, whatever plugins are at that time
396    enabled will come into effect for that module.
397    
398    To enable the back-trace plugin, load library $/trace-debug-profile.cm
399    and invoke BackTrace.install() (e.g., from the interactive prompt).
400    To enable the coverage plugin, load the same library and invoke
401    Coverage.install().
402    
403    Back-traces are generated automatically on uncaught exceptions and
404    when the code in question explicitly invokes BackTrace.trigger().
405    
406    Coverage (and execution frequency-) information must be queried
407    explicitly by calling Coverage.not_covered and Coverage.hot_spots.
408    
409    ----------------------------------------------------------------------
410    Name: Matthias Blume (blume (at) tti - c (dot) org)
411    Date: 2004/10/14 17:40:00 CDT
412    Tag: blume-20041014-tdp-core
413    Description:
414    
415    Snapshot of a significant overhaul of how the trace/debug/profile support
416    is hooked into the system (specifically: Core and SMLofNJ.Internals).
417    
418    ----------------------------------------------------------------------
419    Name: Matthias Blume (blume (at) tti - c (dot) org)
420    Date: 2004/10/13 16:34:00 CDT
421    Tag: blume-20041013-tdp
422    Description:
423    
424    Some rationalization of names:
425    
426       structure BTrace -> structure TDPInstrument
427       etc.
428    
429    This is is preparation of using the original back-trace
430    instrumentation for other purposes.  "TDP" stands for
431    Trace/Debug/Profile.
432    
433    The control flag controlling whether instrumentation is on or off is now
434    registered under a different name, so instead of running sml as
435    
436     sml -Cinstrument.btrace-mode=true
437    
438    one has to say
439    
440     sml -Ctdp.instrument=true
441    
442    ----------------------------------------------------------------------
443    Name: Matthias Blume (blume (at) tti - c (dot) org)
444    Date: 2004/10/11 16:37:00 CDT
445    Tag: blume-20041011-regions
446    Description:
447    
448    Made some minor modifications to elabcore.sml to have source regions
449    be propagated more tightly -- resulting in better (i.e., smaller)
450    regions being reported in error- and debug messages.
451    
452    ----------------------------------------------------------------------
453    Name: Matthias Blume (blume (at) tti - c (dot) org)
454    Date: 2004/10/08 22:50:00 CDT
455    Tag: blume-20041008-cmkw
456    Description:
457    
458    Fixed handling of keywords in .cm files: After seeing "is" the lexer
459    treats subsequent occurrences of "group", "library", "source", "is",
460    "*", and "-" as ordinary identifiers rather than keywords.
461    
462    Most seriously, this fixes a problem with CM's "shell" tool.  The tool
463    is supposed to accept a tool argument called "source", but this did
464    not work because of the clash with the keyword.
465    
466    ----------------------------------------------------------------------
467    Name: Matthias Blume (blume (at) tti - c (dot) org)
468    Date: 2004/10/07 16:00:00 CDT
469    Tag: blume-20041007-cleanup
470    Description:
471    
472    Assorted cleanup work:
473    
474      - got rid of intstrmap in favor of using the library's
475        hash table implementation
476      - threw out most of the pathnames stuff, as it was not used anyway
477      - simplified tokentable implementation
478      - fixed some minor spelling errors
479    
480    ----------------------------------------------------------------------
481    Name: Matthias Blume (blume (at) tti - c (dot) org)
482    Date: 2004/10/06 15:15:15 CDT
483    Tag: blume-20041006-handler
484    Description:
485    
486    Cleaned up the absyn to reflect the invariant that HANDLE always
487    carries a FNexp as part of the type definition.  This eliminates some
488    superfluous sanity checks at runtime down the road.
489    
490    Some minor cleanup of the btrace code.
491    
492    ----------------------------------------------------------------------
493    Name: Matthias Blume (blume (at) tti - c (dot) org)
494    Date: 2004/10/01 10:20:30 CDT
495    Tag: blume-20041001-slave
496    Description:
497    
498    Added hack to make slave mode work in the presence of the version
499    tool.  (Still, since the master does two passes over the code for
500    CMB.make, the release number gets bumped twice when slaves are
501    attached.  I don't know if this is worth fixing...)
502    
503    ----------------------------------------------------------------------
504    Name: Matthias Blume (blume (at) tti - c (dot) org)
505    Date: 2004/09/30 10:55:00 CDT
506    Tag: blume-20040930-version
507    Description:
508    
509    * Moved the "version" magic into its own little library under
510      src/system/smlnj/internal.  This avoids expensive reconstruction of
511      a stable src/compiler/core.cm.
512    
513    * At the same time, structure CompilerVersion is now known as
514      structure SMLNJVersion.
515    
516    * Arranged for the version tool to NOT kick in when rebuilding the system
517      (makeml -rebuild, fixpt).  Otherwise one would never reach a fixpoint.
518      Also, loading the versiontool does not work when rebuilding the system
519      because CM is not properly initialized at that time.
520    
521    ----------------------------------------------------------------------
522    Name: Matthias Blume (blume (at) tti - c (dot) org)
523    Date: 2004/09/29 14:00:00 CDT
524    Tag: blume-20040929-autoversion
525    Description:
526    
527    Implemented some CM magic to have
528        file src/compiler/TopLevel/main/version.sml
529    generated automagically.
530    The version is taken from two files: config/version and config/release.
531    The first is expected to contain a two-part version number such as 110.49.
532    The second should contain a single number, but it may be missing.
533    
534    If the environment variable VERSIONTOOL_BUMP_RELEASE is defined at the
535    time the version tool is loaded (which is the first time you say CMB.make),
536    then the tool will increment the value stored in config/release every
537    time CMB.make is invoked.
538    
539    The binfile format is now insensitive to anything beyond the first
540    two components of a version number, so bumping the release does not render
541    binfiles incompatible.  Auto-bumping can be used to keep track of versions
542    during development without invalidating existing binfiles.
543    
544    In any case, every CMB.make updates the date information in version.sml.
545    (This is the date that is printed in the banner.)
546    
547    ----------------------------------------------------------------------
548    Name: Matthias Blume (blume (at) tti - c (dot) org)
549    Date: 2004/09/28 10:53:00 CDT
550    Tag: blume-20040928-controls
551    Description:
552    
553    Some cleanup of the controls code.
554    
555    ----------------------------------------------------------------------
556    Name: Matthias Blume (blume (at) tti - c (dot) org)
557    Date: 2004/09/27 22:08:00 CDT
558    Tag: blume-20040927-controls
559    Description:
560    
561    Added two pieces of functionality to the Controls interface:
562    
563    1.   val save'restore: 'a control -> unit -> unit
564    
565       grabs the current value of the control in stage 1 and restores it
566       in stage 2.
567    
568    2.   val set' : 'a control * 'a -> unit -> unit
569    
570       stores the given value into the control in stage 2 (i.e., delayed)
571       but does all error checking in stage 1.
572       (This is for string controls that need to do parse their argument --
573        something that might fail.  In some cases, notably in CM, one
574        already knows the intended argument but wants to delay the actual
575        assignment until a time when error recovery would be more difficult.)
576    
577    Changed the handling of controls in tool arguments to classes "sml" and
578    "lazysml":
579       - use Controls.save'restore as a more robust way of restoring the
580         old value (in particular: without having to re-parse the string)
581       - use controls to handle the "overload" keyword in the init group
582         (I believe this change actually fixes a long-standing obscure bug.)
583    
584    ----------------------------------------------------------------------
585    Name: Matthias Blume (blume (at) tti - c (dot) org)
586    Date: 2004/09/27 17:00:00 CDT
587    Tag: blume-20040927-lazysml
588    Description:
589    
590    Added a new tool class called "lazysml" to CM's tool chest.  The only
591    difference to "sml" is that compilation is done with Control.lazysml
592    set to true.  A source of class "lazysml" is automatically recognized
593    by a file name suffix of ".lml".
594    
595    In addition to the above feature, the original class "sml" now also
596    supports a tool argument "lazy" which has the same effect.  As a
597    result, the following three lines are equivalent:
598    
599        foo.sml : lazysml
600        foo.sml : sml (lazy)
601        foo.sml (lazy)
602    
603    The setting goes into effect both during parsing and during
604    compilation.  The original setting is restored right after parsing and
605    after compilation, respectively.
606    
607    In addition to all the above, there is also a general mechanism to set
608    ANY of the "controls" that are available at the command line via
609    "-C..." on a per-sml-file basis.  The same rules that apply for "lazy"
610    apply as well. (In fact, "lazy" is implemented as a special case of
611    the general mechanism.)
612    
613    The .cm file syntax uses a new keyword tool argument called "with".
614    There are several ways of indicating the desired settings:
615    
616        foo.sml (with:parser.quotations=true)
617        foo.sml (with:(name:parser.quotations value:true))
618        foo.sml (with:(name:name1 value:value1 name:name2 value:value2 ...))
619        foo.sml (with:(name1=value1 name2=value2 ...))
620        foo.sml (with:(name1=value1 name:name2 value:value2 name3=value3 ...))
621    
622        etc.
623    
624    Another possible abbreviation is to leave out the =v or value:v part
625    if the name refers to a boolean control (in which case the value is
626    taken to be true).  Thus, one could get lazy sml also by saying:
627    
628        foo.sml (with:parser.lazy-keyword=true)
629        foo.sml (with:parser.lazy-keyword)
630        foo.sml (with:(name:parser.lazy-keyword value:true))
631        foo.sml (with:(name:parser.lazy-keyword))
632    
633    ----------------------------------------------------------------------
634    Name: Matthias Blume (blume (at) tti - c (dot) org)
635    Date: 2004/09/24 16:22:00 CDT
636    Tag: blume-20040924-ppc-long-branch
637    Description:
638    
639    Turned message about "emiting long form of branch" off by default.
640    Added a control flag to turn it back on when desired.
641    
642    ----------------------------------------------------------------------
643    Name: Matthias Blume (blume (at) tti - c (dot) org)
644    Date: 2004/09/24 16:05:00 CDT
645    Tag: blume-20040924-rounding
646    Description:
647    
648    Applied patch for setting rounding modes under Mac OS X.  Thanks to
649    Melissa O'Neill for providing the code!
650    
651    ----------------------------------------------------------------------
652    Name: Matthias Blume (blume (at) tti - c (dot) org)
653    Date: 2004/09/23 17:30:00 CDT
654    Tag: blume-20040923-envvars
655    Description:
656    
657    1. Changed definition of type ControlRegistry.registry_tree to
658       include control_info (i.e., the name of the controlling environment
659       variable).
660    
661    2. Added command-line flags -e and -E to print the names of environment
662       variables that can be used to control internal settings.
663       (This uses the new API mentioned in 1.)
664    
665    ----------------------------------------------------------------------
666    Name: Matthias Blume (blume (at) tti - c (dot) org)
667    Date: 2004/09/13 16:50:00 CDT
668    Tag: Release_110_49
669    Description:
670    
671    New working version (110.49).  NEW BOOTFILES!
672    
673    ----------------------------------------------------------------------
674    Name: Matthias Blume
675    Date: 2004/09/13 16:20:00 CDT
676    Tag: blume-20040913-config-mlrisc
677    Description:
678    
679    Put target "mlrisc" back into the default list.
680    (There is no harm in having it, and some users have expressed their
681    wish to have "mlrisc" included by default.)
682    
683    ----------------------------------------------------------------------
684    Name: John Reppy
685    Date: 2004/09/13
686    Tag: jhr-20040913-signals
687    Description:
688    
689    Fixed the signal masking code to properly nest mask/unmask operations
690    on a per-signal basis.
691    
692    ----------------------------------------------------------------------
693    Name: Matthias Blume (blume (at) tti - c (dot) org)
694    Date: 2004/09/08 13:20:00 CDT
695    Tag: blume-20040908-heap-magic
696    Description:
697    
698    Bumped the heap macig number to 0x09082004 to account for the changed
699    layout of the ML frame under MacOS X.
700    
701    ----------------------------------------------------------------------
702    Name: Allen Leung (leunga (at) reservoir (dot) com)
703    Date: 2004/09/03 11:26:00 EST
704    Tag: leunga-20040903-cygwin-install
705    Description:
706    
707       Added a patch to _arch-n-opsys to enable the Cygwin runtime.
708    The Cygwin runtime is turned on by setting the environment
709    variable SMLNJ_CYGWIN_RUNTIME to 1.
710    
711    ----------------------------------------------------------------------
712    Name: Matthias Blume (blume (at) tti - c (dot) org)
713    Date: 2004/08/31 17:15:00 CDT
714    Tag: blume-20040831-core
715    Description:
716    
717    Added some exports to src/compiler/core.cm upon request by J. Joemann.
718    
719    ----------------------------------------------------------------------
720    Name: Matthias Blume (blume (at) tti - c (dot) org)
721    Date: 2004/08/30 17:55:00 CDT
722    Tag: blume-20040830-installer
723    Description:
724    
725    Upon request by Johannes Joemann:
726    
727    - improved ML code of installer to fall back to coping when renaming
728      fails (i.e., when source and target are on different file systems);
729      the code compiles but has yet to be tested in anger
730    - removed mlrisc from list of default targets (config/targets)
731    
732    ----------------------------------------------------------------------
733    Name: Matthias Blume (blume (at) tti - c (dot) org)
734    Date: 2004/08/27 17:20:00 CDT
735    Tag: blume-20040827-ptreql
736    Description:
737    
738    Added ptreql primop to structure InlineT (upon request from Larry
739    Paulson).
740    
741    ----------------------------------------------------------------------
742    Name: Allen Leung (leunga (at) reservoir (dot) com)
743    Date: 2004/08/15 21:21:00 EST
744    Tag: leunga-110_48-udgraph
745    Description:
746    
747    Another bug fix from Carl Hauser:
748    
749    diff /net/niflab/smlnj48/src/MLRISC/graphs/udgraph.sml udgraph.sml
750    > 48c48
751    > <              | rmv((e as (k,_))::es,L) = rmv(es,if k = i then es else
752    > e::L)
753    > ---
754    > >              | rmv((e as (k,_))::es,L) = rmv(es,if k = i then L else e::L)
755    > Without this, any deletion of an edge in an undirected graph does severe
756    > violence to the graph.
757    
758    ----------------------------------------------------------------------
759    Name: Allen Leung (leunga (at) reservoir (dot) com)
760    Date: 2004/08/10 23:35:00 EST
761    Tag: leunga-110_48-ppc
762    Description:
763    
764       The IBM/MacOS syntax switch on PPC was incorrectly swapped.
765    
766    ----------------------------------------------------------------------
767    Name: Matthias Blume (blume (at) tti - c (dot) org)
768    Date: 2004/08/10 12:00:00 CDT
769    Tag: Release_110_48
770    Description:
771    
772    New working version (110.48).  NEW BOOTFILES!
773    
774    ----------------------------------------------------------------------
775    Name: Allen Leung (leunga (at) reservoir (dot) com)
776    Date: 2004/08/09 12:21:00 EST
777    Tag: leunga-110_47-dijsktra
778    Description:
779    
780    Bug fix from Carl Hauser:
781    
782    single_source_shortest_paths in dijkstra.sml was observed to get wrong
783    answers (by comparing to single_source_shortest_paths in bellman-ford.sml).
784    
785    The problem is that following the expression A.update(dist,s,Num.zero)
786    it is necessary to update the priority queue using Q.decreaseWeight(Q,s).
787    
788    ----------------------------------------------------------------------
789    Name: Matthias Blume (blume (at) tti - c (dot) org)
790    Date: 2004/08/06 18:10:00 CDT
791    Tag: blume-20040806-cmdline
792    Description:
793    
794    Fiddled with handling of command-line options:
795    
796      * sml now quits after processing the command line
797        if -H, -S, -h<n>, or -s<n> appears as the last
798        command-line argument
799      * a new option -q terminates the session when encountered on
800        the command line; subsequent arguments will be ignored
801      * bug fixes: short (erroneous) arguments are no longer ignored
802        completely
803    
804    ----------------------------------------------------------------------
805    Name: Allen Leung (leunga (at) reservoir (dot) com)
806    Date: 2004/08/04 18:17:00 EST
807    Tag: leunga-110_47-ppc-ibm-asm
808    Description:
809    
810      - Added minimal IBM assembly syntax support for PowerPC.
811    
812      - Cygwin: manually changed the file cygwin.def.  Some exported symbols have
813        been altered in the runtime.  We need an automatic way to keep the file
814        in sync.
815    
816    ----------------------------------------------------------------------
817    Name: Matthias Blume (blume (at) tti - c (dot) org)
818    Date: 2004/08/04 14:00:00 CDT
819    Tag: Release_110_47
820    Description:
821    
822    New working version (110.47).  NEW BOOTFILES!
823    
824    ----------------------------------------------------------------------
825    Name: Matthias Blume (blume (at) tti - c (dot) org)
826    Date: 2004/08/03 14:25:00 CDT
827    Tag: blume-20040803-callingconv
828    Description:
829    
830    Added low-level support for choosing C calling conventions by
831    twiddling the type of rawccall.  (See
832    src/compiler/Semant/types/cproto.sml for details.)
833    
834    ----------------------------------------------------------------------
835    Name: Matthias Blume (blume (at) tti - c (dot) org)
836    Date: 2004/08/02 15:55:00 CDT
837    Tag: blume-20040802-backout
838    Description:
839    
840    Backed out of change to win32-filesys.c.  The earlier patch to
841    get_file_time caused CM to produce files with the wrong time stamp.
842    
843    ----------------------------------------------------------------------
844    Name: Matthias Blume (blume (at) tti - c (dot) org)
845    Date: 2004/08/02 14:45:00 CDT
846    Tag: blume-20040802-nlffi-win32
847    Description:
848    
849    Added NLFFI support for Win32, adapted from a patch provided by David
850    Hansel.  This is currently completely untested.  Also, the issue
851    concerning stdcall vs. ccall is still unresolved.
852    
853    ----------------------------------------------------------------------
854    Name: Matthias Blume (blume (at) tti - c (dot) org)
855    Date: 2004/07/30 17:55:00 CDT
856    Tag: blume-20040730-various
857    Description:
858    
859    Gearing up towards 110.47...
860    
861    - various minor bugfixes to ml-nlffigen
862    - a beginning of a manual for nlffi
863    
864    - eliminated 'export name=value' in config/install.sh as this does
865      not work with certain versions of /bin/sh
866      (Thanks to David King at Motorola for catching this.)
867    
868    - several bugfixes provided or suggested by David Hansel at Reactive Systems:
869      - added a test for tm==NULL to gmtime.c and localtime.c
870      - applied patch for incorrect GetFileTime under win32
871      - toSeconds -> toMilliseconds in Win32/win32-process.sml
872    
873    ----------------------------------------------------------------------
874    Name: Matthias Blume (blume (at) tti - c (dot) org)
875    Date: 2004/07/21 18:20:00 CDT
876    Tag: blume-20040721-nlffigen
877    Description:
878    
879    - Fixed minor issue in ml-nlffigen: Now generate structure T_foo
880      for a typedef to an incomplete type, but leave out the "typ" member.
881      (This is just for consistency.)
882    - Started to produce what is supposed to become better (i.e., comprehensive)
883      documentation of what ml-nlffigen does and produces.
884    
885    ----------------------------------------------------------------------
886    Name: Matthias Blume (blume (at) tti - c (dot) org)
887    Date: 2004/07/14 16:25:00 CDT
888    Tag: blume-20040714-union
889    Description:
890    
891    Added C_UNION to c-calls/c-types.sml and updated the machinery
892    (ml-nlffigen, cproto.sml) that conveys C function interface
893    information to the code generator.
894    
895    However, the actual architecture-specific implementation of function
896    arguments and results that are C unions is still not implemented.
897    
898    ----------------------------------------------------------------------
899    Name: Allen Leung (leunga (at) reservoir (dot) com)
900    Date: 2004/07/14 14:38:00 EST
901    Tag: leunga-110_46_1-ppc-lwzu
902    Description:
903    
904        Added these instructions to the PowerPC architecture:
905        LBZU(X), LHZU(X), LWZU(X),
906        STWU(X), STFDU, STFSU
907    
908        etc...
909    
910        Note: I haven't added their instruction encoding into the description.
911    
912    ----------------------------------------------------------------------
913    Name: Allen Leung (leunga (at) reservoir (dot) com)
914    Date: 2004/07/13 15:04:00 EST
915    Tag: leunga-110_46_1-ppc-lwarx
916    Description:
917    
918       Added the two instructions LWARX and STWCX to the PowerPC
919    instruction set.
920    
921       A (untested) rewrite of loop-structure.sml.  The old version
922    is completely broken.
923    
924    ----------------------------------------------------------------------
925    Name: Matthias Blume (blume (at) tti - c (dot) org)
926    Date: 2004/07/13 13:50:00 CDT
927    Tag: blume-20040713-nlffi
928    Description:
929    
930    - use paramAlloc to report c-calls with too many arguments
931      (for PPC version where parameter area is pre-allocated)
932    - added ccall_maxargspace to machspec (to implement the above)
933    - made "make" commend in CM's "make" tool configurable
934    - added option (default: on) for passing the name of the SML/NJ's "bin"
935      directory to "make"; the call looks like this:
936    
937         make <options> SMLNJ_BINDIR=<dir> <target>
938    
939      This can be used by the Makefile to, e.g., pick the "right" version
940      of ml-nlffigen.
941    - minor code tweaks
942    
943    ----------------------------------------------------------------------
944    Name: Matthias Blume (blume (at) tti - c (dot) org)
945    Date: 2004/07/12 22:50:00 CDT
946    Tag: blume-110_46_1-macosx-nlffi
947    Description:
948    
949    NLFFI under Mac OS X now working (sort of).  This is largely untested,
950    though.
951    
952    Note:  1. You have to make a new, clean build of the runtime system.
953           2. There are new BOOTFILES, you have to use them!
954              (Doing the bootstrap process yourself would be *very* painful!
955               If you absolutely have to do it, build the system under
956               a different architecture and then cross-compile.)
957    
958    Version bumped to 110.46.1 to account for runtime data format changes.
959    
960    ----------------------------------------------------------------------
961    Name: Matthias Blume (blume (at) tti - c (dot) org)
962    Date: 2004/06/18 14:30:00 CDT
963    Tag: blume-20040618-unix
964    Description:
965    
966    Changed the implementation of structure Unix so that the same stream
967    is returned every time one of the {text,bin}{In,Out}streamOf functions
968    is invoked on the same proc.  This is not what the spec currently
969    says -- although IMO it arguably should.  (See discussion below.)
970    
971    ----------------------------------------------------------------------
972    Name: Matthias Blume (blume (at) tti - c (dot) org)
973    Date: 2004/06/17 18:15:00 CDT
974    Tag: Release_110_46
975    Description:
976    
977    New working version (110.46).  NEW BOOTFILES!
978    
979    ----------------------------------------------------------------------
980    Name: Matthias Blume (blume (at) tti - c (dot) org)
981    Date: 2004/06/17 17:20:00 CDT
982    Tag: blume-20040617-timer-unix
983    Description:
984    
985    Changed the interface of structures Timer and Unix to match the most
986    recent Basis spec.
987    
988    In the case of Unix there still seems to be an open/weird issue:
989    
990       The {text,bin}{In,Out}streamOf functions are supposed to create
991       fresh streams whenever they are called -- as opposed to have them
992       return the same stream every time.  This design is supposed to
993       prevent space leaks caused by proc values hanging on to streams.
994    
995       The reap function, on the other hand, is supposed to close the
996       streams.  This cannot be done without having a handle on the
997       stream in proc after all...
998    
999    I took the liberty to implement the following stopgap solution:
1000    
1001      The proc value hangs on to the most recently created stream(s).
1002      Reap closes those.  If either or both of the two streams hadn't
1003      been created at all yet, then reap will close the corresponding
1004      file descriptors directly.
1005    
1006    PS: I don't understand the original space leak argument anymore.  If
1007    a proc hangs on to the imperative stream, then I/O operations on those
1008    will advance the state of the cached stream and avoid the space leak.
1009    
1010    ----------------------------------------------------------------------
1011    Name: Matthias Blume (blume (at) tti - c (dot) org)
1012    Date: 2004/05/28 16:45:00 CDT
1013    Tag: blume-20040528-basis
1014    Description:
1015    
1016    Added signature PACK_REAL and exported functor PrimIO.
1017    
1018    ----------------------------------------------------------------------
1019    Name: Matthias Blume (blume (at) tti - c (dot) org)
1020    Date: 2004/05/25 16:00:00 CDT
1021    Tag: blume-20040525-group-owner
1022    Description:
1023    
1024    CM now ignores (but still accepts) the "owner" information in group
1025    descriptions.  The owner of a group is its next enclosing
1026    library. Each group must have a unique owner.  (There is a virtual
1027    "toplevel" library that owns groups which are not nested within a real
1028    library.)  Previously, each group had to explicitly declare its owner,
1029    and CM would check that such a declaration is correct.  The new scheme
1030    is to have CM check that for each group there is precisely one owning
1031    library.
1032    
1033    The advantage of the new scheme is that the programmer no longer needs
1034    to maintain the somewhat annoying owner information.  The downside is
1035    that CM cannot enforce the ownership rule across multiple runs of
1036    CM.make.  Fortunately, enclosing the same group in two different
1037    libraries A and B which are not part of the same program does not
1038    cause real problems.
1039    
1040    ----------------------------------------------------------------------
1041    Name: Matthias Blume (blume (at) tti - c (dot) org)
1042    Date: 2004/05/20 16:00:00 CDT
1043    Tag: blume-20040520-win32
1044    Description:
1045    
1046    Made the win32 version work again.  (Strangely, a misplaced comma had
1047    slipped into win32-process.c which prevented the runtime from being
1048    compiled correctly.)
1049    
1050    Also, included a minor addition to ml-build.bat analogous to what was
1051    done in blume-20040519-ml-build.
1052    
1053    ----------------------------------------------------------------------
1054    Name: Matthias Blume (blume (at) tti - c (dot) org)
1055    Date: 2004/05/19 22:10:00 CDT
1056    Tag: blume-20040519-ml-build
1057    Description:
1058    
1059    Arranged for ml-build to clean up after itself a little bit better.
1060    The script generates a temporary SML source file and compiles it using
1061    CM, so CM generates metadata (GUID, SKEL, objectfile) for it.  It now
1062    gets rid of those at the end, so they don't accumulate under .cm.
1063    
1064    This required a minor change to install.sh because the name of the
1065    metadata directory (default: .cm) is actually configurable at
1066    installation time.
1067    
1068    ----------------------------------------------------------------------
1069    Name: Matthias Blume (blume (at) tti - c (dot) org)
1070    Date: 2004/05/18 15:50:00 CDT
1071    Tag: blume-20040518-mkreader
1072    Description:
1073    
1074    Added Posix.IO.mk{Bin,Text}{Reader,Writer} by lifting their respective
1075    implementations from internal modules PosixBinPrimIO and PosixTextPrimIO.
1076    
1077    ----------------------------------------------------------------------
1078    Name: Matthias Blume (blume (at) tti - c (dot) org)
1079    Date: 2004/05/11 14:35:00 CDT
1080    Tag: blume-20040511-win32sock
1081    Description:
1082    
1083    Added previously missing support for many socket-related functions
1084    under win32.  Thanks to David Hansel <hansel@reactive-systems.com>
1085    for the voluminous patch!
1086    
1087    (I have not tested this patch under win32 yet.)
1088    
1089    Here is David's e-mail:
1090    
1091    Hi,
1092    
1093    Attached to this email you find a diff against sml/nj 110.45
1094    that will enable socket support under Windows.
1095    
1096    To apply the patch (using unix or cygwin)
1097    1) gunzip runtime.diff.gz
1098    2) "cd" into "src/runtime" in the source tree of a fresh
1099       110.45 installation.
1100    3) patch -p 1 < [your/path/to]runtime.diff
1101    
1102    The code compiles fine but has NOT yet been extensively tested.
1103    I only ran a few tests for basic socket client functionality
1104    (which worked fine).  Especially the functions that use ioctl
1105    are not tested at all and might not work (see below).
1106    
1107    I implemented this since we want to move to a newer version of sml/nj
1108    but need socket support in order to use it.  This is the first time I
1109    even had a look at the sml/nj source,  so please review my changes
1110    before making this part of the distribution!  Here are a few issues
1111    that I think might be better for someone to solve who is more
1112    familiar with the sml/nj source (and socket programming):
1113    
1114    - getnetbyaddr.c and getnetbyname.c will raise a "not implemented"
1115      exception since I could not figure out what the windows equivalent
1116      of these functions is
1117    
1118    - In sockets-osdep.h there are a some #include statements that are
1119      only used in a few files that include sockets-osdep.h
1120    
1121    - In smlnj-sock-lib.c, function init_fn() calls WSAStartup() but
1122      does not process its return value since I don't know how to
1123      report an error upwards.
1124    
1125    - It would probably be good to have a call to WSACleanup() when
1126      the library is unloaded (if there is such a possibility).
1127      Otherwise I think Windows will take care of this automatically
1128      when the process finishes.
1129    
1130    - I used ioctlsocket() as a replacement for ioctl() but I have
1131      no idea if that is actually the proper replacement on Windows.
1132    
1133    - All these issues are marked in the code by "FIXME" comments.
1134    
1135    We use sml/nj extensively in our products and are quite happy
1136    with it.  I hope this contribution will help you.
1137    
1138    Keep up the good work!
1139    
1140    David
1141    
1142    ----------------------------------------------------------------------
1143    Name: Matthias Blume (blume (at) tti - c (dot) org)
1144    Date: 2004/05/11 14:20:00 CDT
1145    Tag: blume-20040511-installml
1146    Description:
1147    
1148    Fixed two bugs in installml script.  (Thanks to Vesa A. Norrman for
1149    the patch.)
1150    
1151    ----------------------------------------------------------------------
1152    Name: Matthias Blume (blume (at) tti - c (dot) org)
1153    Date: 2004/05/11 14:05:00 CDT
1154    Tag: blume-20040511-nlffi-netbsd
1155    Description:
1156    
1157    Added support for nlffi under netbsd.  (Thanks to Vesa A. Norrman for
1158    the patch.)
1159    
1160    ----------------------------------------------------------------------
1161    Name: Matthias Blume (blume (at) tti - c (dot) org)
1162    Date: 2004/05/11 12:05:00 CDT
1163    Tag: blume-20040511-exports
1164    Description:
1165    
1166    As per request by Adam Chlipala <adam@hcoop.net>, extended various
1167    export lists in compiler-related .cm-files.
1168    
1169    ----------------------------------------------------------------------
1170    Name: Matthias Blume (blume (at) tti - c (dot) org)
1171    Date: 2004/05/11 11:35:00 CDT
1172    Tag: blume-20040511-allsource
1173    Description:
1174    
1175    The installer now honors the "src-smlnj" target again, although its meaning
1176    has changed from "all sources required for the compiler" to "all sources
1177    the installer knows about".  In other words, if you enable "src-smlnj"
1178    in the "targets" file, then the installer will pull in sources for
1179    everything.  (Notice that this refers to source code only.  Compiled
1180    code is still only installed for modules that were requested explicitly
1181    or which are required for other modules that were requested explicitly.)
1182    
1183    ----------------------------------------------------------------------
1184    Name: Matthias Blume (blume (at) tti - c (dot) org)
1185    Date: 2004/04/23 17:40:00 CDT
1186    Tag: blume-20040423-ieee-scan
1187    Description:
1188    
1189    Fixed IEEEReal.scan (and .fromString) so that if there is an overflow
1190    in the exponent calculation we get INF or ZERO (depending on the mantissa
1191    and the sign of the exponent).
1192    
1193    ----------------------------------------------------------------------
1194    Name: Matthias Blume (blume (at) tti - c (dot) org)
1195    Date: 2004/04/23 10:40:00 CDT
1196    Tag: blume-20040423-ml-build
1197    Description:
1198    
1199    The ml-build script now terminates with a non-0 status when something
1200    goes wrong.
1201    
1202    ----------------------------------------------------------------------
1203    Name: Matthias Blume (blume (at) tti - c (dot) org)
1204    Date: 2004/04/22 16:35:00 CDT
1205    Tag: blume-20040422-Option
1206    Description:
1207    
1208    Made exception Option to be the same as exception Option.Option
1209    (as it should be).
1210    
1211    ----------------------------------------------------------------------
1212    Name: Allen Leung (leunga (at) reservoir (dot) com)
1213    Date: 2004/03/19 14:40:00 EST
1214    Tag: leunga-20040319-cygwin-nlffi
1215    Description:
1216    
1217    Fixed the runtime so that ml-nlffi-lib runs on the cygwin version
1218    of SML/NJ.  The problem is that
1219    
1220       lib = dlopen(NULL, ...)
1221       f   = dlsym(lib, "malloc");
1222    
1223    does not work on Windows unless we explicitly export symbols
1224    such as 'malloc' during linking.  We fixed this by explicitly
1225    exporting the required symbols with the magic gcc incantation:
1226    
1227        -Wl,--export-all cygwin.def
1228    
1229    where cygwin.def is a file containing all the symbols that
1230    we wish to export.
1231    
1232    I suspect this is a Windows problem and we'll have to
1233    do the same (somehow with windows compilers) when
1234    we build the native win32 version with the system
1235    calls LoadLibrary/GetProcAddress.
1236    
1237    ----------------------------------------------------------------------
1238    Name: Matthias Blume (blume (at) tti - c (dot) org)
1239    Date: 2004/03/04 16:35:00 CST
1240    Tag: blume-20040304-intinf-fmt
1241    Description:
1242    
1243    Fixed problem with IntInf.fmt (sign would show up on the right instead
1244    of on the left for BIN, OCT, and HEX).
1245    
1246    ----------------------------------------------------------------------
1247    Name: Matthias Blume (blume (at) tti - c (dot) org)
1248    Date: 2004/03/04 11:25:00 CST
1249    Tag: blume-20040304-symlinks
1250    Description:
1251    
1252    Fixed problem with installer script (unix only) where bin/ml-yacc and
1253    friends pointed (via symlinks) to absolute locations instead of just
1254    .run-sml.  This was reported by Vesa A Norrman.
1255    
1256    ----------------------------------------------------------------------
1257    Name: Matthias Blume (blume (at) tti - c (dot) org)
1258    Date: 2004/02/13 14:50:00 CST
1259    Tag: Release_110_45
1260    Description:
1261    
1262    New working version (110.45). New bootfiles.
1263    
1264    ----------------------------------------------------------------------
1265    Name: Matthias Blume (blume (at) tti - c (dot) org)
1266    Date: 2004/01/26 15:15:15 CST
1267    Tag: blume-20040126-toplevel
1268    Description:
1269    
1270    Improved handling of exceptions at the interactive toplevel.
1271    
1272    ----------------------------------------------------------------------
1273    Name: Matthias Blume (blume (at) tti - c (dot) org)
1274    Date: 2004/01/26 11:25:00
1275    Tag: blume-20040126-app
1276    Description:
1277    
1278    Type of top-level "app" corrected.
1279    Added code for setting vp_limitPtrMask to Win32-specific runtime.
1280    
1281    ----------------------------------------------------------------------
1282    Name: Matthias Blume (blume (at) tti - c (dot) org)
1283    Date: 2003/11/18 17:10 CST
1284    Tag: blume-20031118-basis-fiddle
1285    Description:
1286    
1287    - changed Timer interface to what might become the spec
1288    - POSIX_FLAGS -> BIT_FLAGS according to spec
1289    - some other minor discrepancies wrt. spec eliminated
1290    
1291    ----------------------------------------------------------------------
1292    Name: Matthias Blume (blume (at) tti - c (dot) org)
1293    Date: 2003/11/06 12:00:00 CST
1294    Tag: Release_110_44
1295    Description:
1296    
1297    New working version (110.44). New bootfiles.
1298    
1299    ----------------------------------------------------------------------
1300    Name: Matthias Blume (blume (at) tti - c (dot) org)
1301    Date: 2003/11/04 11:50:00 CST
1302    Tag: blume-20031104-move-libraries
1303    Description:
1304    
1305    Eliminated the "dont_move_libraries" directive in config/targets.
1306    (The mechanism was broken and could not be fixed easily.  Moreover,
1307    there does not seem to be any reason not to move all libraries into
1308    lib during installation.  I originally implemented this directive as a
1309    backward-compatibility feature when I first introduced the new CM.
1310    Now that things have been stable for a long time and going back to the
1311    old CM is not an option, there is no reason to keep it around.)
1312    
1313    ----------------------------------------------------------------------
1314    Name: Matthias Blume (blume (at) tti - c (dot) org)
1315    Date: 2003/11/03 16:00:00 CST
1316    Tag: blume-20031103-installdir
1317    Description:
1318    
1319    Made installer honor INSTALLDIR variable again.  (Thanks to Chris
1320    Richards for pointing out the problem and providing the solution.)
1321    
1322    ----------------------------------------------------------------------
1323    Name: Matthias Blume (blume (at) tti - c (dot) org)
1324    Date: 2003/10/01 17:05:00 CDT
1325    Tag: blume-20031001-lal-mlrisc
1326    Description:
1327    
1328    MLRISC bug fix from Lal.
1329    
1330    ----------------------------------------------------------------------
1331    Name: Matthias Blume (blume (at) tti - c (dot) org)
1332    Date: 2003/09/30 16:10:00 CDT
1333    Tag: blume-20030930-primio-bat
1334    Description:
1335    
1336    1. Added openVector, nullRd, and nullWr to PRIM_IO.
1337    2. Improved .bat files (for Win32 port) to make things work under Win95.
1338       (thanks to Aaron S. Hawley for this one)
1339    
1340    ----------------------------------------------------------------------
1341    Name: Matthias Blume (blume (at) tti - c (dot) org)
1342    Date: 2003/09/26 16:05:00 CDT
1343    Tag: blume-20030926-wrappriv
1344    Description:
1345    
1346    Added missing wrapper for privilege "primitive" in $smlnj/viscomp/core.cm.
1347    
1348    ----------------------------------------------------------------------
1349    Name: Matthias Blume (blume (at) tti - c (dot) org)
1350    Date: 2003/09/26 15:00:00 CDT
1351    Tag: blume-20030926-110_43_3
1352    Description:
1353    
1354    - additional cleanup
1355    - version number bump, NEW BOOTFILES
1356    
1357    ----------------------------------------------------------------------
1358    Name: Matthias Blume (blume (at) tti - c (dot) org)
1359    Date: 2003/09/26 12:00:00 CDT
1360    Tag: blume-20030926-ppautoload
1361    Description:
1362    
1363    I modified the read-eval-print loop so that the autoloader gets
1364    invoked whenever the prettyprinter tries to look up a symbol that
1365    is not currently defined in the toplevel environment but which
1366    appears in CM's autoload registry.  As a result, we see far fewer of
1367    those ?.Foo.Bar.xxx names in the prettyprinter's output.
1368    
1369    In addition to this I tried to clean up some pieces of the Basis
1370    implementation (e.g., Socket, Word8Array) in order to prevent other
1371    instances of these ?.Foo.Bar.xxx names from being printed.
1372    
1373    The mechanism that picks names for types still needs some work, though.
1374    (Right now it seems that if there is a type A.t which is defined to
1375    be B.u, but B is unavailable at toplevel, then A.t gets printed as
1376    "?.B.u" although the perhaps more sensible solution would be to use
1377    "A.t" in this case.  In other words, the prettyprinter should follow
1378    a chain of DEFtycs not farther than there are corresponding toplevel
1379    names in the current environment.)
1380    
1381    ----------------------------------------------------------------------
1382    Name: Matthias Blume (blume (at) tti - c (dot) org)
1383    Date: 2003/09/24 16:31:00 CDT
1384    Tag: blume-20030924-installer
1385    Description:
1386    
1387    Another installer tweak:  All the ML code for the installer is now
1388    compiled during CMB.make and put into a little library called
1389    $smlnj/installer.cm.  The installation then simply invokes
1390    
1391       sml -m $smlnj/installer.cm
1392    
1393    and everything happens automagically.
1394    
1395    Win32:  ML code senses value of environment variable SMLNJ_HOME.
1396    Unix:   ML code senses values of environment variables ROOT, CONFIGDIR,
1397            and BINDIR.
1398    
1399    The new scheme guarantees that the ML code responsible for the installation
1400    is in sync with the APIs of the main system.  Also, the installer is
1401    somewhat faster because the installer script is precompiled.
1402    
1403    ----------------------------------------------------------------------
1404    Name: Matthias Blume (blume (at) tti - c (dot) org)
1405    Date: 2003/09/24 15:35:00 CDT
1406    Tag: blume-20030924-synsock
1407    Description:
1408    
1409    Added a signature SYNCHRONOUS_SOCKET to basis.cm.  This is like SOCKET
1410    but excludes all non-blocking operations.  Defined SOCKET (in Basis)
1411    and CML_SOCKET in terms of SYNCHRONOUS_SOCKET.  Removed superfluous
1412    implementations of non-blocking operations from CML's Socket
1413    structure.
1414    
1415    ----------------------------------------------------------------------
1416    Name: Matthias Blume (blume (at) tti - c (dot) org)
1417    Date: 2003/09/24 15:10:05 CDT
1418    Tag: blume-20030924-sockets
1419    Description:
1420    
1421    1. Fixed SOCKET API and implementation to match Basis spec.
1422       This required changing the internal representation of sockets to one
1423       that remembers (for each socket file descriptor) whether it is currently
1424       blocking or non-blocking.  This state is maintained lazily (i.e., a system
1425       call is made only if the state actually needs to change).
1426    
1427    2. OS-specific details of sockets were moved into separate files, thus
1428       making it possible to unify the bulk of the socket implementations
1429       between Unix and Win32.
1430    
1431    3. CML's socket API changed accordingly.
1432       (Note that we need to remove non-blocking functions from this API
1433       since they are redundant in the case of CML!)
1434    
1435    4. CML's socket implementation now makes use of non-blocking functions
1436       provided by Basis, thus removing all OS-dependent code from this part
1437       of CML.
1438    
1439    5. Changed Real64.precision from 52 to 53.  Minor cleanup in Real64 code.
1440    
1441    ----------------------------------------------------------------------
1442    Name: Matthias Blume (blume (at) tti - c (dot) org)
1443    Date: 2003/09/22 12:10:00 CDT
1444    Tag: blume-20030922-110_43_2
1445    Description:
1446    
1447    Made a new interim version and bootfiles for developer's bootstrapping
1448    convenience.
1449    
1450       110.43.2 -- NEW BOOTFILES
1451    
1452    ----------------------------------------------------------------------
1453    Name: Matthias Blume (blume (at) tti - c (dot) org)
1454    Date: 2003/09/19 15:55:00 CDT
1455    Tag: blume-20030919-cmdir
1456    Description:
1457    
1458    1. new-install.sh -> install.sh
1459    2. changed default CM "metadata" directory name to ".cm" (instead of "CM")
1460    3. tweaked installer so that another name instead of .cm can be chosen
1461       at install time (by setting the CM_DIR_ARC environment variable
1462       during installation); once installation is complete, the name is
1463       fixed
1464    
1465    ----------------------------------------------------------------------
1466    Name: Matthias Blume (blume (at) tti - c (dot) org)
1467    Date: 2003/09/18 16:00:00 CDT
1468    Tag: blume-20030918-110_43_1
1469    Description:
1470    
1471    Made a new interim version and bootfiles for developer's bootstrapping
1472    convenience.
1473    
1474       110.43.1 -- NEW BOOTFILES
1475    
1476    ----------------------------------------------------------------------
1477    Name: Matthias Blume (blume (at) tti - c (dot) org)
1478    Date: 2003/09/18 15:20:00 CDT
1479    Tag: blume-20030918-misc
1480    Description:
1481    
1482    1. Exported fractionsPerSecond etc. from TimeImp (but not from Time as
1483       this seems to be controversial at the moment) and used those in
1484       Posix.ProcEnv.times.
1485    
1486    2. Added Time.{from,to}Nanoseconds to Time.
1487    
1488    3. Improved Real.{from,to}LargeInt by avoiding needless calculations.
1489       For example, fromLargeInt never needs to look at more than 3 "big
1490       digits" to get its 53 bits of precision.
1491    
1492    ----------------------------------------------------------------------
1493    Name: Matthias Blume (blume (at) tti - c (dot) org)
1494    Date: 2003/09/17 16:30:00 CDT
1495    Tag: blume-20030917-real32-slices
1496    Description:
1497    
1498    Added an entry to the primitive environment
1499    (compiler/Semant/statenv/prim.sml) for int32->real64 conversion and
1500    added code to compiler/CodeGen/main/mlriscGen.sml to implement it.
1501    
1502    Removed some of the "magic" constants in real64.sml and replaced them
1503    with code that generates these values from their corresponding
1504    integer counterparts.
1505    
1506    Made all(?) the slice-related changes to the Basis and made everything
1507    compile again...
1508    
1509    ----------------------------------------------------------------------
1510    Name: Matthias Blume (blume (at) tti - c (dot) org)
1511    Date: 2003/09/15 17:45:00 CDT
1512    Tag: blume-20030915-rbase
1513    Description:
1514    
1515    Fixed bug in Real.fromLargeInt.
1516    
1517    ----------------------------------------------------------------------
1518    Name: Matthias Blume (blume (at) tti - c (dot) org)
1519    Date: 2003/09/13 18:11:00 CDT
1520    Tag: blume-20030913-libinstall
1521    Description:
1522    
1523    Minor bugfix in config/libinstall (set anchor with path to
1524    standalone tool after installing it, otherwise libraries that
1525    need ml-lex or ml-yacc won't compile the first time the installer
1526    runs).
1527    
1528    ----------------------------------------------------------------------
1529    Name: Matthias Blume (blume (at) tti - c (dot) org)
1530    Date: 2003/09/12 11:45:00 CDT
1531    Tag: blume-20030912-various
1532    Description:
1533    
1534     - fixed bug in Real.toLargeInt
1535     - fixed bug in Posix.ProcEnv.times
1536     - changed inputLine functions to return an option
1537     - minor installer improvements / bugfixes
1538     - changed default @SMLalloc parameter for x86/celeron to 64k
1539    
1540    ----------------------------------------------------------------------
1541    Name: Matthias Blume (blume (at) tti - c (dot) org)
1542    Date: 2003/09/09 22:00:00 CDT
1543    Tag: Release_110_43
1544    Description:
1545    
1546        New working release 110.43.  New bootfiles.
1547    
1548    ----------------------------------------------------------------------
1549    Name: Matthias Blume (blume (at) tti - c (dot) org)
1550    Date: 2003/09/09 19:20:00 CDT
1551    Tag: blume-20030909-installer
1552    Description:
1553    
1554    Rewrote large parts of config/install.sh in SML (config/libinstall.sml).
1555    Modified config/install.bat to take advantage of it.  Also modified
1556    config/install.sh (and called it config/new-install.sh) to take advantage
1557    of it on Unix systems.  (The SML code is (supposed to be) platform-
1558    independent.)
1559    
1560    The installer can now install everything under Win32
1561    as well as under *nix as long as it compiles.
1562    
1563    Other changes:
1564    
1565      - made CML compile again under Win32
1566      - made eXene compile under Win32 (by providing a fake structure UnixSock
1567        and by using OS.Process.getEnv instead of Posix.ProcEnv.getenv)
1568      - fixed a bug in nowhere: it assumed that type OS.Process.status is the
1569        same as type int;  under Win32 it isn't
1570      - fixed some slice-related problems in the win32-specific parts of CML
1571      - added a functor argument "sameVol" to os-path-fn.sml in the Basis
1572        (under Win32, the volume name is case-insensitive, and the
1573        OS.Path code compares volume names for equality)
1574    
1575    ----------------------------------------------------------------------
1576    Name: Matthias Blume (blume (at) tti - c (dot) org)
1577    Date: 2003/09/08 11:55:00 CDT
1578    Tag: blume-20030908-fullpath
1579    Description:
1580    
1581    Made Win32 version of OS.FileSys.fullPath return current directory
1582    when given an empty string.  This is what the spec says, and incidentally,
1583    CM depends on it.  (CM otherwise goes into an infinite loop in certain
1584    cases when presented with the name of a non-existing .cm file.)
1585    
1586    ----------------------------------------------------------------------
1587    Name: Matthias Blume (blume (at) tti - c (dot) org)
1588    Date: 2003/09/04 16:30:00 CDT
1589    Tag: blume-20030905-slices-etc
1590    Description:
1591    
1592      1. Changed interface to vectors and arrays in Basis to match
1593         (draft) Basis spec.
1594      2. Added signatures and implementations of slices according to
1595         Basis spec.
1596      3. Edited source code throughout the system to make it compile again
1597         under 1. and 2.  (In some cases code had to be added to have it
1598         match the new signatures.)
1599      4. MLRISC should be backward-compatible: the copies of the originals
1600         of files that needed to change under 3. were retained, the .cm files
1601         check the compiler version number and use old versions when
1602         appropriate.
1603      5. Changed type of OS.FileSys.readDir and Posix.FileSys.readdir to
1604         dirstream -> string option (in accordance with Basis spec).
1605      6. When generating code that counts lines, ml-lex used function
1606         CharVector.foldli, taking advantage of its old interface.
1607         This has been replaced with the corresponding code from
1608         CharVectorSlice.  (html-lex must be re-lexed!)
1609      7. BitArray in smlnj-lib/Util has been extended/modified to match the
1610         new MONO_ARRAY signature.  (Do we need BitArraySlice?)
1611      8. Removed temporary additions (fromInternal, toInternal) from the
1612         (now obsolete) IntInf in smlnj-lib/Util.
1613      9. Cleaned up structure Byte.
1614     10. Added localOffset, scan, and fromString to Date (according to spec).
1615         Cleaned/corrected implementation of Date.
1616         (Still need to check for correctness; implement better canonicalizeDate.)
1617     11. Added "scan" to signature IEEE_REAL.
1618     12. Some improvements to IntInf [in particular: efficiency-hack for
1619         mod and rem when second operand is 2 (for parity checks).]
1620     13. Changed representation of type Time.time, using a single IntInf.int
1621         value counting microseconds.  This considerably simplified the
1622         implementation of structure Time.  We now support negative time
1623         values; scan and fromString handle signs.
1624     14. Functor PrimIO now takes two additional arguments (VectorSlice and
1625         ArraySlice).
1626    
1627    ----------------------------------------------------------------------
1628    Name: Matthias Blume (blume (at) tti - c (dot) org)
1629    Date: 2003/08/28 17:00:00 CDT
1630    Tag: blume-20030828-intinf
1631    Description:
1632    
1633    This is a major update which comes with a version number bump
1634    (110.42.99 -- yes, we are really close to 110.43 :-), NEW BOOTFILES,
1635    and an implementation of IntInf in the Basis.
1636    
1637    There are a fairly large number of related changes and updates throughout
1638    the system:
1639    
1640    Basis:
1641            - Implemented IntInf.
1642            - Made LargeInt a projection of IntInf (by filtering through INTEGER).
1643            - Added some missing Real64 operations, most notably Real.toLargeInt.
1644            - Added FixedInt as a synonym for Int32.
1645    
1646    compiler:
1647            * Added support for a built-in intinf type.
1648              - literals
1649              - pattern matching
1650              - conversion shortcuts (Int32.fromLarge o Int.toLarge etc.)
1651              - overloading on literals and operations
1652    
1653            This required adding a primitive type intinf, some additional
1654            primops, and implementations for several non-trivial intinf
1655            operations in Core.  (The intinf type is completely abstract
1656            to the compiler; all operations get delegated back to the Core.)
1657    
1658            * Intinf equality is handled by polyequal.  However, the compiler
1659            does not print its usual warning in this case (since polyequal
1660            is the right thing to do there).
1661    
1662            * Improved the organization of structure InlineT.
1663    
1664            * A word about conversion primops:
1665            If conversions involving intinf do not cancel out during
1666            CPS contract, then the compiler must insert calls to Core functions.
1667            Since all core access must be resolved already during the FLINT
1668            translate phase, it would be too late a the time of CPS contract
1669            to add new Core calls.  For this reason, conversion primops
1670            for intinf carry two arguments:  1. the numeric argument that
1671            they are supposed to convert, and 2. the Core function that
1672            can help with this conversion if necessary.  If CPS contract
1673            eliminates a primop, then the associated Core function becomes
1674            dead and goes away.  Intinf conversion primops that do not get
1675            eliminated by CPS contract get rewritten into calls of their
1676            core functions by a separate, new phase.
1677    
1678    interactive system:
1679            - Control.Print.intinfDepth controls max length of intinf constants
1680            being printed. (Analogous to Control.Print.stringDepth.)
1681            - Cleanup in printutil and pputil: got rid of unused stuff and
1682            duplicates; replaced some of the code with code that makes better
1683            use of library functionality.
1684    
1685    CM:
1686            Bugfix: parse-errors in init group (system/smlnj/init/init.cmi)
1687            are no longer silent.
1688    
1689    CKIT:
1690            Fixed mismatched uses of Int32 and LargeInt.  I always decided
1691            in favor of LargeInt -- which is now the same as IntInf.
1692            CKIT-knowledgable people should check whether this is what's
1693            intended and otherwise change things back to using Int32 or
1694            FixedInt.
1695    
1696    Throughout the code:
1697            Started using IntInf.int literals and built-in operations
1698            (e.g., comparison with 0) where this seems appropriate.
1699    
1700    
1701    ----------------------------------------------------------------------
1702    Name: Dave MacQueen (dbm@cs.uchicago.edu)
1703    Date: 2003/08/13 11:36:00 CDT
1704    Tag: dbm-20030813-mcz-merge1
1705    Description:
1706    
1707    Merging changes from the mcz-branch development branch into trunk.
1708    These changes involve replacement of the emulated old prettyprinter
1709    interface with direct use of the SML/NJ Lib PP library, and fixing
1710    of a couple of bugs (895, 1186) relating to error messages.  A new
1711    prettyprinter for ast datatypes (Elaborator/print/ppast.{sig,sml})
1712    has been added.
1713    
1714    ----------------------------------------------------------------------
1715    Name: Matthias Blume (blume (at) tti - c (dot) org)
1716    Date: 2003/08/11 15:45:00 CDT
1717    Tag: blume-20030811-windows
1718    Description:
1719    
1720    Version number bumped to 110.42.9.  NEW BOOTFILES!!!
1721    
1722        http://smlnj.cs.uchicago.edu/dist/working/110.42.9/
1723    
1724    This patch restores SML/NJ's ability to run under win32.  There are a
1725    number of changes, including fixes for several bugs that had gone
1726    unnoticed until now:
1727    
1728      - uname "CYGWIN_NT*" is recognized as win32 (This is relevant only when
1729        trying to run the win32 version from within cygwin.)
1730    
1731      - There are a number of simple .bat scripts that substitute for their
1732        corresponding Unix shell-scripts.  (See below.)
1733    
1734      - The internals of ml-build have been modified slightly.  The main
1735        difference is that instead of calling ".link-sml" (or link-sml.bat)
1736        using OS.Process.system, the ML process delegates this task back
1737        to the script.  Otherwise problems arise in mixed environments such
1738        as Cygwin where scripts look and work like Unix scripts, but
1739        where OS.Process.system cannot run them.
1740    
1741      - In CM, the srcpath pickler used native pathname syntax -- which
1742        is incorrect in the case of cross-compilation.  The new pickle format
1743        is independent of platform-specific naming conventions.
1744    
1745      - Path configuration files (such as lib/pathconfig) can now choose
1746        between native and standard syntax.  Placing a line of the form
1747    
1748            standard!
1749    
1750        into the file causes all subsequent paths to be interpreted using
1751        CM standard pathname syntax (= Unix conventions); a line
1752    
1753            native!
1754    
1755        switches back to native style.  This was needed so that
1756        path config files can be written portably, see src/system/pathconfig.
1757    
1758      - Runtime system:
1759    
1760          - win32-filesys.c:  get_file_time and set_file_time now
1761            access modification time, not creation time.
1762    
1763          - I/O code made aware of new array representation.
1764    
1765          - Bug fixes in X86.prim.masm.
1766    
1767       - src/system/makeml made aware of win32. (For use under cygwin
1768            and other Unix-environments for windows.)
1769    
1770       - In Basis, fixed off-by-one error in win32-io.sml (function vecF)
1771         which caused BinIO.inputAll to fail consistently.
1772    
1773    .bat scripts:
1774    
1775       Windows .bat scripts assume that SMLNJ_HOME is defined.
1776    
1777       - sml.bat, ml-yacc.bat, ml-lex.bat:  Driver scripts for standalone
1778         applications (sml, ml-yacc, ml-lex).
1779       - ml-build.bat: analogous to ml-build.
1780       - config\install.bat:  Analogous to config/install.sh.  This requires
1781         that SMLNJ_HOME is set and that Microsoft Visual C is ready to use.
1782         (nmake etc. must be on the path, and vcvars32 must have been run.)
1783         Moreover, sources for ml-lex and ml-yacc need to exist under src,
1784         and the bootfile hierarchy must have been unpacked under
1785         sml.boot.x86-win32.
1786         The script is very primitive and does a poor job at error checking.
1787         It only installs the base system, ml-lex, and ml-yacc.  No other
1788         libraries are being installed (i.e., you get only those that
1789         are part of the compiler.)
1790       - link-sml.bat:  analogous to .link-sml, but not currently used
1791    
1792    Unrelated bug fixes:
1793    
1794      - ml-nlffigen now exports structures ST_* corresponding to incomplete
1795        types.
1796      - Added getDevice to PP/src/pp-debug-fn.sml.  (Would not compile
1797        otherwise.)
1798    
1799    ----------------------------------------------------------------------
1800    Name: Dave MacQueen (macqueen@cs.uchicago.edu)
1801    Date: 2003/06/17
1802    Tag: macqueen-20030617-bug895
1803    Description:
1804    
1805    Modified compiler/Elaborator/print/pptype.sml to fix bug 895.
1806    Tag will be used for new development branch (mcz-branch) for
1807    use by MacQueen, (Lucasz) Zairek, and (George) Cao at uchicago.
1808    
1809    ----------------------------------------------------------------------
1810    Name: Matthias Blume (blume (at) tti - c (dot) org)
1811    Date: 2003/05/27 16:55:00 CDT
1812    Tag: blume-20030527-polyeq
1813    Description:
1814    
1815    Tried to eliminated most cases of polymorphic equality.
1816    
1817    ----------------------------------------------------------------------
1818    Name: Matthias Blume (blume (at) tti - c (dot) org)
1819    Date: 2003/05/21 17:45:00 CDT
1820    Tag: blume-20030517-complete
1821    Description:
1822    
1823    Two changes:
1824    
1825      1. Added a flag for controlling whether non-exhaustive bindings will
1826         be treated as errors (default is false).
1827      2. Cleaned up the *entire* source tree so that CMB.make goes through
1828         without a single non-exhaustive match- or bind warning.
1829    
1830    ----------------------------------------------------------------------
1831    Name: Matthias Blume (blume (at) tti - c (dot) org)
1832    Date: 2003/05/17 10:20:00 CDT
1833    Tag: blume-20030517-absyn
1834    Description:
1835    
1836    1. Added cases for IF, WHILE, ANDALSO, and ORELSE to Absyn.
1837    
1838       This mainly affects the quality of error messages.  However, some
1839       of the code is now more straightforward than before. (Treatment of
1840       the above four constructs in translate.sml is much simpler than
1841       the "macro-expansion" that was going on before.  Plus, the mach-
1842       compiler no longer gets invoked just to be able to compile an
1843       if-expression.)
1844    
1845    2. The ErrorMsg.Error exception is now caught and absorbed by the
1846       interactive loop.
1847    
1848    ----------------------------------------------------------------------
1849    Name: Allen Leung
1850    Date: 2003/05/16 13:05:00 CDT
1851    Tag: leunga-20030516-cygwin-runtime
1852    Description:
1853    
1854        Ported the runtime system to cygwin, which uses the unix
1855    x86-unix bin files.  Missing/buggy features:
1856    
1857       o getnetbyname, getnetbyaddr: these functions seem to be missing in
1858         the Cygwin library.
1859       o Ctrl-C handling may be flaky.
1860       o Windows system calls and Windows I/O are not supported.
1861    
1862       A new set of binfiles is located at:
1863    
1864         http://www.dorsai.org/~leunga/boot.x86-unix.tgz
1865    
1866       This is only needed for bootstrapping the cygwin version of smlnj.
1867       Other x86 versions can use the existing binfiles.
1868    
1869    ----------------------------------------------------------------------
1870    Name: Matthias Blume
1871    Date: 2003/04/08 15:42:00 CDT
1872    Tag: blume-20030408-listpair
1873    Description:
1874    
1875    1. Added a target 'mlrisc' to installer.
1876    
1877    2. Added missing elements to structure ListPair.
1878    
1879    ----------------------------------------------------------------------
1880    Name: Allen Leung
1881    Date: 2003/01/07 10:40:00 EST
1882    Tag: leunga-20030107-int-rem
1883    Description:
1884    
1885    Fixed a bug in Int.rem(x,y) where y is a power of 2 on x86.
1886    The arguments to the SUBL instruction were swapped.
1887    
1888    ----------------------------------------------------------------------
1889    Name: Matthias Blume
1890    Date: 2002/12/12 16:25:00 EST
1891    Tag: blume-20021212-risc-ra
1892    Description:
1893    
1894    Fixed a serious bug in the rewrite code for FP spilling/reloading that
1895    sent the RA into an infinite loop when floating point registers get
1896    spilled.  (Because of this bug, e.g., nucleic stopped compiling between
1897    110.37 and 110.38.)
1898    There was another set of potential problems related to the handling of
1899    MLRISC annotations (but those did not yet cause real problems, apparently).
1900    
1901    ----------------------------------------------------------------------
1902    Name: Matthias Blume
1903    Date: 2002/12/06 22:40:00 EST
1904    Tag: blume-20021206-cm-fileid
1905    Description:
1906    
1907    Added a call of SrcPath.sync at the beginning of Parse.parse (in CM).
1908    This fixes the problem of CM getting confused by files that suddenly
1909    change their identity (e.g., by getting unlinked and recreated by some
1910    text editor such as vi).  There might be a better/cheaper/cleaner way
1911    of doing this, but for now this will have to do.
1912    
1913    ----------------------------------------------------------------------
1914    Name: Matthias Blume
1915    Date: 2002/10/28 09:50:00 EST
1916    Tag: blume-20021028-typecheck
1917    Description:
1918    
1919    Exported structure Typecheck from $smlnj/viscomp/core.cm.
1920    
1921    ----------------------------------------------------------------------
1922    Name: Matthias Blume
1923    Date: 2002/10/17 09:10:00 EDT
1924    Tag: Release_110_42
1925    Description:
1926    
1927    In good old tradition, there has been a slight hiccup so that we have
1928    to patch 110.42 after the fact.   The old release tag has been replaced
1929    (see below).
1930    
1931    The change solves a problem with two competing approaches the
1932    configuration problem regarding MacOS 10.1 vs. MacOS 10.2 which got in
1933    each other's way.
1934    
1935    This change only affects the runtime system code and the installer script.
1936    (No new bootfiles.)
1937    
1938    ----------------------------------------------------------------------
1939    Name: Matthias Blume
1940    Date: 2002/10/16 12:00:00 EDT
1941    Tag: Release_110_42_removed
1942    Description:
1943    
1944    New working release.  New bootfiles.
1945    
1946    ----------------------------------------------------------------------
1947    Name: Matthias Blume
1948    Date: 2002/10/10 13:10:00 EDT
1949    Tag: blume-20021010-ppc-divs
1950    Description:
1951    
1952    The mltree operator DIVS must be implemented with an overflow check on
1953    the PPC because the hardware indicates divide-by-zero using "overflow" as
1954    well.
1955    
1956    ----------------------------------------------------------------------
1957    Name: Matthias Blume
1958    Date: 2002/07/23 11:45:00
1959    Tag: blume-20020723-smlnj-home
1960    Description:
1961    
1962    Sml now senses the SMLNJ_HOME environment variable.  If this is set,
1963    then the bin dir is assumed to be in $SMLNJ_HOME/bin and (unless
1964    CM_PATHCONFIG is also set), the path configuration file is assumed
1965    to be in $SMLNJ_HOME/lib/pathconfig.  This way one can easily move
1966    the entire tree to some other place and everything will "just work".
1967    
1968    (Companion commands such as ml-build and ml-makedepend also sense this
1969    variable.)
1970    
1971    ----------------------------------------------------------------------
1972    Name: Matthias Blume
1973    Date: 2002/07/12 21:19:00 EDT
1974    Tag: blume-20020712-liveness
1975    Description:
1976    
1977    Exported two useful "step" functions from liveness module (MLRISC).
1978    
1979    ----------------------------------------------------------------------
1980    Name: Matthias Blume
1981    Date: 2002/07/05 16:00 EDT
1982    Tag: Release_110_41
1983    Description:
1984    
1985    New working release.  New bootfiles.
1986    
1987    ----------------------------------------------------------------------
1988    Name: Matthias Blume
1989    Date: 2002/07/05 10:25:00 EDT
1990    Tag: blume-20020705-btimp
1991    Description:
1992    
1993    Exported structure BTImp from $smlnj/viscomp/debugprof.cm so that
1994    other clients can set up backtracing support.
1995    
1996    ----------------------------------------------------------------------
1997    Name: Matthias Blume
1998    Date: 2002/06/25 17:23:00 EDT
1999    Tag: blume-20020625-fpmax
2000    Description:
2001    
2002    Fixed a bug in translation of INLMAX (and INLMIN) for the floating-point
2003    case.  (The sense of the isNaN test was reversed -- which made min and
2004    max always return their first argument.)
2005    
2006    ----------------------------------------------------------------------
2007    Name: Matthias Blume
2008    Date: 2002/06/11
2009    Tag: blume-20020611-unixpath
2010    Description:
2011    
2012    Back-ported OS.Path.{from,to}UnixPath from idlbasis-devel branch.
2013    
2014    ----------------------------------------------------------------------
2015    Name: Matthias Blume
2016    Date: 2002/06/10 16:35:00 EDT
2017    Tag: blume-20020610-ieeereal
2018    Description:
2019    
2020    I back-ported my implementation of IEEEReal.fromString from the
2021    idlbasis-devel branch so that we can test it.
2022    
2023    Another small change is that ppDec tries to give more information
2024    than just "<sig>" in the case of functors.  However, this code is
2025    broken in some mysterious way if the functor's body's signature
2026    has not been declared by ascription but gets inferred from the
2027    implementation.  This needs fixing...
2028    
2029    ----------------------------------------------------------------------
2030    Name: Matthias Blume
2031    Date: 2002/05/31
2032    Tag: blume-20020531-btrace-mode
2033    Description:
2034    
2035    Resurrected SMLofNJ.Internals.BTrace.mode.  (It accidentally fell by
2036    the wayside when I switched over to using Controls everywhere.)
2037    
2038    ----------------------------------------------------------------------
2039    Name: Lal George
2040    Date: 2002/05/23 12:21:40 EDT
2041    Tag: george-20020523-visual-labels
2042    Description:
2043    
2044    Labels are now displayed in the graphical output to make
2045    the fall-through and target blocks obvious.
2046    
2047    ----------------------------------------------------------------------
2048    Name: Matthias Blume
2049    Date: 2002/05/22 11:03:00 EDT
2050    Tag: blume-20020522-shrink
2051    Description:
2052    
2053    John tweaked yesterday's fix for 1131 to handle an out-of-memory
2054    situation that comes up when allocating huge arrays.
2055    
2056    ----------------------------------------------------------------------
2057    Name: Matthias Blume
2058    Date: 2002/05/21 16:00:00 EDT
2059    Tag: Release_110_40
2060    Description:
2061    
2062    New working release (110.40).  New bootfiles.
2063    
2064    [Also: John Reppy fixed GC bug 1131.]
2065    
2066    ----------------------------------------------------------------------
2067    Name: Matthias Blume
2068    Date: 2002/05/21 12:35:00 EDT
2069    Tag: blume-20020521-cmdoc
2070    Description:
2071    
2072    CM documentation update.
2073    
2074    ----------------------------------------------------------------------
2075    Name: Matthias Blume
2076    Date: 2002/05/21 10:55:00 EDT
2077    Tag: blume-20020521-misc
2078    Description:
2079    
2080    - John tweaked runtime to be silent on heap export (except when
2081      GC messages are on).
2082    - I added a few more things (cross-compiling versions of CMB) to
2083      config/preloads (as suggestions).
2084    
2085    ----------------------------------------------------------------------
2086    Name: Matthias Blume
2087    Date: 2002/05/20 22:25:00 EDT
2088    Tag: blume-20020520-controls
2089    Description:
2090    
2091    - Added ControlUtil structure to control-lib.cm.
2092    - Use it throughout.
2093    - Used Controls facility to define MLRISC controls (as opposed to
2094      registering MLRISC control ref cells with Controls after the fact)
2095    - Fixed messed-up controls priorities.
2096    
2097    * Removed again all the stuff from config/preloads that one wouldn't
2098      be able to preload at the time the initial heap image is built.
2099      (Many libraries, e.g., CML, do not exist yet at this time.  The
2100       only libraries that can be preloaded via config/preloads are those
2101       that come bundled with the bootfiles.)
2102    
2103    ----------------------------------------------------------------------
2104    Name: Matthias Blume
2105    Date: 2002/05/20 10:59:00 EDT
2106    Tag: blume-20020520-preloads
2107    Description:
2108    
2109    Added a lot of commented-out suggestions for things to be included
2110    in config/preloads.
2111    
2112    ----------------------------------------------------------------------
2113    Name: Allen Leung
2114    Date: 2002/05/18 14:20:00 EDT
2115    Tag: leunga-20020518-mdl
2116    Description:
2117    
2118    o Made the mdl tool stuff compile and run again.
2119    o I've disabled all the stuff that depends on RTL specifications; they
2120      are all badly broken anyway.
2121    
2122    ----------------------------------------------------------------------
2123    Name: Matthias Blume
2124    Date: 2002/05/17 16:49:00 EDT
2125    Tag: blume-20020517-controls
2126    Description:
2127    
2128    0. John Reppy made several modifications to the SML/NJ library.
2129       In particular, there is a shiny new controls-lib.cm.
2130    
2131    1. Pushed new controls interface through compiler so that everything
2132       compiles again.
2133    
2134    2. Added FormatComb and FORMAT_COMB to the CML version of the
2135       SML/NJ library (so that CML compiles again).
2136    
2137    3. Modified init scripts because XXX_DEFAULT environment variables
2138       are no longer with us.  (Boot-time initialization is now done
2139       using the same environment variables that are also used for
2140       startup-time initialization of controls.)
2141    
2142    ----------------------------------------------------------------------
2143    Name: Lal George
2144    Date: 2002/05/15 09:20:10 EDT
2145    Tag: george-20020515-pseudo-op-decls
2146    Description:
2147    
2148            All pseudo-ops emitted before the first segment declaration
2149    such as TEXT, DATA, and BSS directives are assumed to be global
2150    declarations and are emitted first in the assembly file. This is
2151    useful in a number of situations where one has pseudo-ops that are not
2152    specific to any segment, and also works around the constraint that one
2153    cannot have client pseudo-ops in the TEXT segment.
2154    
2155            Because no segment is associated with these declarations it is
2156    an error to allocate any space or objects before the first segment
2157    directive and an exception will be raised. However, we cannot make
2158    this check for client pseudo-ops.
2159    
2160            These top level declarations are a field in the CFG graph_info.
2161    In theory you can continue to add to this field after the CFG has been
2162    built -- provided you know what you are doing;-)
2163    
2164    ----------------------------------------------------------------------
2165    Name: Matthias Blume
2166    Date: 2002/05/13 16:40:00 EDT
2167    Tag: blume-20020513-pp-etc
2168    Description:
2169    
2170    A few minor bugfixes:
2171    
2172      - Stopgap measure for bug recently reported by Elsa Gunter (ppDec).
2173        (Bogus printouts for redefined bindings still occur.  Compiler
2174        bug should no longer occur now.  We need to redo the prettyprinter
2175        from scratch.)
2176    
2177      - CM pathname printer now also adds escape sequences for ( and )
2178    
2179      - commend and docu fixes for ml-nlffi
2180    
2181    ----------------------------------------------------------------------
2182    Name: Matthias Blume
2183    Date: 2002/05/10 16:40:00 EDT
2184    Tag: blume-20020510-erg-textio
2185    Description:
2186    
2187    Applied the following bugfix provided by Emden Gansner:
2188    
2189        Output is corrupted when outputSubstr is used rather than output.
2190    
2191        The problem occurs when a substring
2192    
2193            ss = (s, dataStart, dataLen)
2194    
2195        where dataStart > 0, fills a stream buffer with avail bytes left.
2196        avail bytes of s, starting at index dataStart, are copied into the
2197        buffer, the buffer is flushed, and then the remaining dataLen-avail
2198        bytes of ss are copied into the beginning of the buffer. Instead of
2199        starting this copy at index dataStart+avail in s, the current code
2200        starts the copy at index avail.
2201    
2202        Fix:
2203        In text-io-fn.sml, change line 695 from
2204             val needsFlush = copyVec(v, avail, dataLen-avail, buf, 0)
2205        to
2206             val needsFlush = copyVec(v, dataStart+avail, dataLen-avail, buf, 0)
2207    
2208    ----------------------------------------------------------------------
2209    Name: Matthias Blume
2210    Date: 2002/04/12 13:55:00 EDT
2211    Tag: blume-20020412-assyntax
2212    Description:
2213    
2214    1. Grabbed newer assyntax.h from the XFree86 project.
2215    2. Fiddled with how to compile X86.prim.asm without warnings.
2216    3. (Very) Minor cleanup in CM.
2217    
2218    ----------------------------------------------------------------------
2219    Name: Matthias Blume
2220    Date: 2002/04/01 (no joke!) 17:07:00 EST
2221    Tag: blume-20020401-x86div
2222    Description:
2223    
2224    Added full support for div/mod/rem/quot on the x86, using the machine
2225    instruction's two results (without clumsily recomputing the remainder)
2226    directly where appropriate.
2227    
2228    Some more extensive power-of-two support was added to the x86 instruction
2229    selector (avoiding expensive divs, mods, and muls where they can be
2230    replaced with cheaper shifts and masks).  However, this sort of thing
2231    ought to be done earlier, e.g., within the CPS optimizer so that
2232    all architectures benefit from it.
2233    
2234    The compiler compiles to a fixed point, but changes might be somewhat
2235    fragile nevertheless.  Please, report any strange things that you might
2236    see wrt. div/mod/quot/rem...
2237    
2238    ----------------------------------------------------------------------
2239    Name: Matthias Blume
2240    Date: 2002/03/29 17:22:00
2241    Tag: blume-20020329-div
2242    Description:
2243    
2244    Fixed my broken div/mod logic.  Unfortunately, this means that the
2245    inline code for div/mod now has one more comparison than before.
2246    Fast paths (quotient > 0 or remainder = 0) are not affected, though.
2247    The problem was with quotient = 0, because that alone does not tell
2248    us which way the rounding went.  One then has to look at whether
2249    remainder and divisor have the same sign...  :(
2250    
2251    Anyway, I replaced the bootfiles with fresh ones...
2252    
2253    ----------------------------------------------------------------------
2254    Name: Matthias Blume
2255    Date: 2002/03/29 14:10:00 EST
2256    Tag: blume-20020329-inlprims
2257    Description:
2258    
2259    NEW BOOTFILES!!!    Version number bumped to 110.39.3.
2260    
2261    Primops have changed. This means that the bin/boot-file formats have
2262    changed as well.
2263    
2264    To make sure that there is no confusion, I made a new version.
2265    
2266    
2267    CHANGES:
2268    
2269    * removed REMT from mltree (remainder should never overflow).
2270    
2271    * added primops to deal with divisions of all flavors to the frontend
2272    
2273    * handled these primops all the way through so they map to their respective
2274      MLRISC support
2275    
2276    * used these primops in the implementation of Int, Int32, Word, Word32
2277    
2278    * removed INLDIV, INLMOD, and INLREM as they are no longer necessary
2279    
2280    * parameterized INLMIN, INLMAX, and INLABS by a numkind
2281    
2282    * translate.sml now deals with all flavors of INL{MIN,MAX,ABS}, including
2283      floating point
2284    
2285    * used INL{MIN,MAX,ABS} in the implementation of Int, Int32, Word, Word32,
2286      and Real (but Real.abs maps to a separate floating-point-only primop)
2287    
2288    
2289    TODO items:
2290    
2291    * Hacked Alpha32 instruction selection, disabling the selection of REMx
2292      instructions because the machine instruction encoder cannot handle
2293      them.  (Hppa, PPC, and Sparc instruction selection did not handle
2294      REM in the first place, and REM is supported by the x86 machine coder.)
2295    
2296    * Handle DIV and MOD with DIV_TO_NEGINF directly in the x86 instruction
2297      selection phase.  (The two can be streamlined because the hardware
2298      delivers both quotient and remainder at the same time anyway.)
2299    
2300    * Think about what to do with "valOf(Int32.minInt) div ~1" and friends.
2301      (Currently the behavior is inconsistent both across architectures and
2302      wrt. the draft Basis spec.)
2303    
2304    * Word8 should eventually be handled natively, too.
2305    
2306    * There seems to be one serious bug in mltree-gen.sml.  It appears, though,
2307      as if there currently is no execution path that could trigger it in
2308      SML/NJ.  (The assumptions underlying functions arith and promotable do not
2309      hold for things like multiplication and division.)
2310    
2311    ----------------------------------------------------------------------
2312    Name: Matthias Blume
2313    Date: 2002/03/27 16:27:00 EST
2314    Tag: blume-20020327-mlrisc-divisions
2315    Description:
2316    
2317    Added support for all four division operations (ML's div, mod, quot,
2318    and rem) to MLRISC.  In the course of doing so, I also rationalized
2319    the naming (no more annoying switch-around of DIV and QUOT), by
2320    parameterizing the operation by div_rounding_mode (which can be either
2321    DIV_TO_ZERO or DIV_TO_NEGINF).
2322    
2323    The generic MLTreeGen functor takes care of compiling all four
2324    operations down to only round-to-zero div.
2325    
2326    Missing pieces:
2327    
2328      * Doing something smarter than relying on MLTreeGen on architectures
2329        like, e.g., the x86 where hardware division delivers both quotient and
2330        remainder at the same time.  With this, the implementation of the
2331        round-to-neginf operations could be further streamlined.
2332    
2333      * Remove inlining support for div/mod/rem from the frontend and replace it
2334        with primops that get carried through to the backend.  Do this for all
2335        int and word types.
2336    
2337    ----------------------------------------------------------------------
2338    Name: Matthias Blume
2339    Date: 2002/03/25 17:25:00 EST
2340    Tag: blume-20020325-divmod
2341    Description:
2342    
2343    I improved (hopefully without breaking them) the implementation of Int.div,
2344    Int.mod, and Int.rem.   For this, the code in translate.sml now takes
2345    advantage of the following observations:
2346    
2347      Let  q = x quot y      r = x rem y
2348           d = x div  y      m = x mod y
2349    
2350    where "quot" is the round-to-zero version of integer division that
2351    hardware usually provides.  Then we have:
2352    
2353         r = x - q * y        where neither the * nor the - will overflow
2354         d = if q >= 0 orelse x = q * y then q else q - 1
2355                              where neither the * nor the - will overflow
2356         m = if q >= 0 orelse r = 0 then r else r + y
2357                              where the + will not overflow
2358    
2359    This results in substantial simplification of the generated code.
2360    The following table shows the number of CFG nodes and edges generated
2361    for
2362            fun f (x, y) = x OPER y
2363            (* with OPER \in div, mod, quot, rem *)
2364    
2365    
2366        OPER | nodes(old) | edges(old) | nodes(new) | edges(new)
2367        --------------------------------------------------------
2368         div |         24 |         39 |         12 |         16
2369         mod |         41 |         71 |         12 |         16
2370        quot |          8 |         10 |          8 |         10
2371         rem |         10 |         14 |          8 |         10
2372    
2373    
2374    ----------------------------------------------------------------------
2375    Name: Matthias Blume
2376    Date: 2002/03/25 22:06:00 EST
2377    Tag: blume-20020325-cprotobug
2378    Description:
2379    
2380    Fixed a bug in cproto (c prototype decoder).
2381    
2382    ----------------------------------------------------------------------
2383    Name: Matthias Blume
2384    Date: 2002/03/25 16:00:00 EST
2385    Tag: blume-20020325-raw-primops
2386    Description:
2387    
2388    I did some cleanup to Allen's new primop code and
2389    replaced yesterday's bootfiles with new ones.
2390    (But they are stored in the same place.)
2391    
2392    ----------------------------------------------------------------------
2393    Name: Matthias Blume
2394    Date: 2002/03/24 22:40:00 EST
2395    Tag: blume-20020324-bootfiles
2396    Description:
2397    
2398    Made the bootfiles that Allen asked for.
2399    
2400    ----------------------------------------------------------------------
2401    Name: Allen Leung
2402    Date: 2002/03/23 15:50:00 EST
2403    Tag: leunga-20020323-flint-cps-rcc-primops
2404    Description:
2405    
2406      1. Changes to FLINT primops:
2407    
2408        (* make a call to a C-function;
2409         * The primop carries C function prototype information and specifies
2410         * which of its (ML-) arguments are floating point. C prototype
2411         * information is for use by the backend, ML information is for
2412         * use by the CPS converter. *)
2413      | RAW_CCALL of { c_proto: CTypes.c_proto,
2414                       ml_args: ccall_type list,
2415                       ml_res_opt: ccall_type option,
2416                       reentrant : bool
2417                     } option
2418       (* Allocate uninitialized storage on the heap.
2419        * The record is meant to hold short-lived C objects, i.e., they
2420        * are not ML pointers.  With the tag, the representation is
2421        * the same as RECORD with tag tag_raw32 (sz=4), or tag_fblock (sz=8)
2422        *)
2423      | RAW_RECORD of {tag:bool,sz:int}
2424      and ccall_type = CCALL_INT32 | CCALL_REAL64 | CCALL_ML_PTR
2425    
2426      2.  These CPS primops are now overloaded:
2427    
2428           rawload of {kind:numkind}
2429           rawstore of {kind:numkind}
2430    
2431          The one argument form is:
2432    
2433             rawload {kind} address
2434    
2435          The two argument form is:
2436    
2437             rawload {kind} [ml object, byte-offset]
2438    
2439      3. RAW_CCALL/RCC now takes two extra arguments:
2440    
2441         a. The first is whether the C call is reentrant, i.e., whether
2442            ML state should be saved and restored.
2443         b. The second argument is a string argument specifying the name of
2444            library and the C function.
2445    
2446         These things are currently not handled in the code generator, yet.
2447    
2448      4. In CProto,
2449    
2450         An encoding type of "bool" means "ml object" and is mapped into
2451         C prototype of PTR.  Note that "bool" is different than "string",
2452         even though "string" is also mapped into PTR, because "bool"
2453         is assigned an CPS type of BOGt, while "string" is assigned INT32t.
2454    
2455      5. Pickler/unpicker
2456    
2457         Changed to handle RAW_RECORD and newest RAW_CCALL
2458    
2459      6. MLRiscGen,
2460    
2461         1. Changed to handle the new rawload/rawstore/rawrecord operators.
2462         2. Code for handling C Calls has been moved to a new module CPSCCalls,
2463            in the file CodeGen/cpscompile/cps-c-calls.sml
2464    
2465      7. Added the conditional move operator
2466    
2467             condmove of branch
2468    
2469         to cps.  Generation of this is still buggy so it is currently
2470         disabled.
2471    
2472    ----------------------------------------------------------------------
2473    Name: Lal George
2474    Date: 2002/03/22 14:18:25 EST
2475    Tag: george-20020322-cps-branch-prob
2476    Description:
2477    
2478    Implemented the Ball-Larus branch prediction-heuristics, and
2479    incorporated graphical viewers for control flow graphs.
2480    
2481    Ball-Larus Heuristics:
2482    ---------------------
2483    See the file compiler/CodeGen/cpscompile/cpsBranchProb.sml.
2484    
2485    By design it uses the Dempster-Shafer theory for combining
2486    probabilities.  For example, in the function:
2487    
2488        fun f(n,acc) = if n = 0 then acc else f(n-1, n*acc)
2489    
2490    the ball-larus heuristics predicts that the n=0 is unlikely
2491    (OH-heuristic), and the 'then' branch is unlikely because of the
2492    RH-heuristic -- giving the 'then' branch an even lower combined
2493    probability using the Dempster-Shafer theory.
2494    
2495    Finally, John Reppy's loop analysis in MLRISC, further lowers the
2496    probability of the 'then' branch because of the loop in the else
2497    branch.
2498    
2499    
2500    Graphical Viewing:
2501    ------------------
2502    I merely plugged in Allen's graphical viewers into the compiler. The
2503    additional code is not much. At the top level, saying:
2504    
2505            Control.MLRISC.getFlag "cfg-graphical-view" := true;
2506    
2507    will display the graphical view of the control flow graph just before
2508    back-patching.  daVinci must be in your path for this to work. If
2509    daVinci is not available, then the default viewer can be changed
2510    using:
2511    
2512            Control.MLRISC.getString "viewer"
2513    
2514    which can be set to "dot" or "vcg" for the corresponding viewers. Of
2515    course, these viewers must be in your path.
2516    
2517    The above will display the compilation unit at the level of clusters,
2518    many of which are small, boring, and un-interesting. Also setting:
2519    
2520            Control.MLRISC.getInt "cfg-graphical-view_size"
2521    
2522    will display clusters that are larger than the value set by the above.
2523    
2524    
2525    ----------------------------------------------------------------------
2526    Name: Matthias Blume
2527    Date: 2002/03/21 22:20:00 EST
2528    Tag: blume-20020321-kmp-bugfix
2529    Description:
2530    
2531    Changed the interface to the KMP routine in PreString and fixed
2532    a minor bug in one place where it was used.
2533    
2534    ----------------------------------------------------------------------
2535    Name: Allen Leung
2536    Date: 2002/03/21 20:30:00 EST
2537    Tag: leunga-20020321-cfg
2538    Description:
2539    
2540      Fixed a potential problem in cfg edge splitting.
2541    
2542    ----------------------------------------------------------------------
2543    Name: Allen Leung
2544    Date: 2002/03/21 17:15:00 EST
2545    Tag: leunga-20020321-x86-fp-cfg
2546    Description:
2547    
2548      1. Recoded the buggy parts of x86-fp.
2549    
2550         a. All the block reordering code has been removed.
2551            We now depend on the block placement phases to do this work.
2552    
2553         b. Critical edge splitting code has been simplified and moved into the
2554            CFG modules, as where they belong.
2555    
2556         Both of these were quite buggy and complex.  The code is now much, much
2557         simpler.
2558    
2559      2. X86 backend.
2560    
2561         a. Added instructions for 64-bit support.  Instruction selection for
2562            64-bit has not been committed, however, since that
2563            requires changes to MLTREE which haven't been approved by
2564            Lal and John.
2565    
2566         b. Added support for FUCOMI and FUCOMIP when generating code for
2567            PentiumPro and above.  We only generate these instructions in
2568            the fast-fp mode.
2569    
2570         c. Added cases for JP and JNP in X86FreqProps.
2571    
2572      3. CFG
2573    
2574         CFG now has a bunch of methods for edge splitting and merging.
2575    
2576      4. Machine description.
2577    
2578         John's simplification of MLTREE_BASIS.fcond broke a few machine
2579         description things:
2580    
2581         rtl-build.{sig,sml} and hppa.mdl fixed.
2582    
2583         NOTE: the machine description stuff in the repository is still broken.
2584               Again, I can't put my fixes in because that involves
2585               changes to MLTREE.
2586    
2587    ----------------------------------------------------------------------
2588    Name: Matthias Blume
2589    Date: 2002/03/20 15:55:00 EST
2590    Tag: blume-20020320-kmp
2591    Description:
2592    
2593    Implemented Knuth-Morris-Pratt string matching in PreString and used
2594    it for String.isSubstring, Substring.isSubstring, and
2595    Substring.position.
2596    
2597    (Might need some stress-testing.  Simple examples worked fine.)
2598    
2599    ----------------------------------------------------------------------
2600    Name: Matthias Blume
2601    Date: 2002/03/19 16:37:00 EST
2602    Tag: blume-20020319-witnesses
2603    Description:
2604    
2605    Added a structure C.W and functions convert/Ptr.convert to ml-nlffi-lib.
2606    
2607    This implements a generic mechanism for changing constness qualifiers
2608    anywhere within big C types without resorting to outright "casts".
2609    (So far, functions such as C.rw/C.ro or C.Ptr.rw/C.Ptr.ro only let you
2610    modify the constness at the outermost level.)
2611    The implementation of "convert" is based on the idea of "witness"
2612    values -- values that are not used by the operation but whose types
2613    "testify" to their applicability.  On the implementation side, "convert"
2614    is simply a projection (returning its second curried argument).  With
2615    cross-module inlining, it should not result in any machine code being
2616    generated.
2617    
2618    ----------------------------------------------------------------------
2619    Name: Matthias Blume
2620    Date: 2002/03/15 16:40:00 EST
2621    Tag: blume-20020315-basis
2622    Description:
2623    
2624    Provided (preliminary?) implementations for
2625    
2626      {String,Substring}.{concatWith,isSuffix,isSubstring}
2627    
2628    and
2629    
2630      Substring.full
2631    
2632    Those are in the Basis spec but they were missing in SML/NJ.
2633    
2634    ----------------------------------------------------------------------
2635    Name: Matthias Blume
2636    Date: 2002/03/14 21:30:00 EST
2637    Tag: blume-20020314-controls
2638    Description:
2639    
2640    Controls:
2641    ---------
2642    
2643    1. Factored out the recently-added Controls : CONTROLS stuff and put
2644       it into its own library $/controls-lib.cm.  The source tree for
2645       this is under src/smlnj-lib/Controls.
2646    
2647    2. Changed the names of types and functions in this interface, so they
2648       make a bit more "sense":
2649    
2650          module -> registry
2651          'a registry -> 'a group
2652    
2653    3. The interface now deals in ref cells only.  The getter/setter interface
2654       is (mostly) gone.
2655    
2656    4. Added a function that lets one register an already-existing ref cell.
2657    
2658    5. Made the corresponding modifications to the rest of the code so that
2659       everything compiles again.
2660    
2661    6. Changed the implementation of Controls.MLRISC back to something closer
2662       to the original.  In particular, this module (and therefore MLRISC)
2663       does not depend on Controls.  There now is some link-time code in
2664       int-sys.sml that registers the MLRISC controls with the Controls
2665       module.
2666    
2667    CM:
2668    ---
2669    
2670      * One can now specify the lambda-split aggressiveness in init.cmi.
2671    
2672    ----------------------------------------------------------------------
2673    Name: Allen Leung
2674    Date: 2002/03/13 17:30:00 EST
2675    Tag: leunga-20020313-x86-fp-unary
2676    Description:
2677    
2678    Bug fix for:
2679    
2680    > leunga@weaselbane:~/Yale/tmp/sml-dist{21} bin/sml
2681    > Standard ML of New Jersey v110.39.1 [FLINT v1.5], March 08, 2002
2682    > - fun f(x,(y,z)) = Real.~ y;
2683    > [autoloading]
2684    > [autoloading done]
2685    >       fchsl   (%eax), 184(%esp)
2686    > Error: MLRisc bug: X86MCEmitter.emitInstr
2687    >
2688    > uncaught exception Error
2689    >   raised at: ../MLRISC/control/mlriscErrormsg.sml:16.14-16.19
2690    
2691    The problem was that the code generator did not generate any fp registers
2692    in this case, and the ra didn't know that it needed to run the X86FP phase to
2693    translate the pseudo fp instruction.   This only happened with unary fp
2694    operators in certain situations.
2695    
2696    ----------------------------------------------------------------------
2697    Name: Matthias Blume
2698    Date: 2002/03/13 14:00:00 EST
2699    Tag: blume-20020313-overload-etc
2700    Description:
2701    
2702    1. Added _overload as a synonym for overload for backward compatibility.
2703       (Control.overloadKW must be true for either version to be accepted.)
2704    
2705    2. Fixed bug in install script that caused more things to be installed
2706       than what was requested in config/targets.
2707    
2708    3. Made CM aware of the (_)overload construct so that autoloading
2709       works.
2710    
2711    ----------------------------------------------------------------------
2712    Name: Matthias Blume
2713    Date: 2002/03/12 22:03:00 EST
2714    Tag: blume-20020312-url
2715    Description:
2716    
2717    Forgot to update BOOT and srcarchiveurl.
2718    
2719    ----------------------------------------------------------------------
2720    Name: Matthias Blume
2721    Date: 2002/03/12 17:30:00 EST
2722    Tag: blume-20020312-version110392
2723    Description:
2724    
2725    Yet another version number bump (because of small changes to the
2726    binfile format).  Version number is now 110.39.2.  NEW BOOTFILES!
2727    
2728    Changes:
2729    
2730      The new pid generation scheme described a few weeks ago was overly
2731      complicated.  I implemented a new mechanism that is simpler and
2732      provides a bit more "stability":  Once CM has seen a compilation
2733      unit, it keeps its identity constant (as long as you do not delete
2734      those crucial CM/GUID/* files).  This means that when you change
2735      an interface, compile, then go back to the old interface, and
2736      compile again, you arrive at the original pid.
2737    
2738      There now also is a mechanism that instructs CM to use the plain
2739      environment hash as a module's pid (effectively making its GUID
2740      the empty string).  For this, "noguid" must be specified as an
2741      option to the .sml file in question within its .cm file.
2742      This is most useful for code that is being generated by tools such
2743      as ml-nlffigen (because during development programmers tend to
2744      erase the tool's entire output directory tree including CM's cached
2745      GUIDs).  "noguid" is somewhat dangerous (since it can be used to locally
2746      revert to the old, broken behavior of SML/NJ, but in specific cases
2747      where there is no danger of interface confusion, its use is ok
2748      (I think).
2749    
2750      ml-nlffigen by default generates "noguid" annotations.  They can be
2751      turned off by specifying -guid in its command line.
2752    
2753    ----------------------------------------------------------------------
2754    Name: Lal George
2755    Date: 2002/03/12 12 14:42:36 EST
2756    Tag: george-20020312-frequency-computation
2757    Description:
2758    
2759    Integrated jump chaining and static block frequency into the
2760    compiler. More details and numbers later.
2761    
2762    ----------------------------------------------------------------------
2763    Name: Lal George
2764    Date: 2002/03/11 11 22:38:53 EST
2765    Tag: george-20020311-jump-chain-elim
2766    Description:
2767    
2768    Tested the jump chain elimination on all architectures (except the
2769    hppa).  This is on by default right now and is profitable for the
2770    alpha and x86, however, it may not be profitable for the sparc and ppc
2771    when compiling the compiler.
2772    
2773    The gc test will typically jump to a label at the end of the cluster,
2774    where there is another jump to an external cluster containing the actual
2775    code to invoke gc. This is to allow factoring of common gc invocation
2776    sequences. That is to say, we generate:
2777    
2778            f:
2779               testgc
2780               ja   L1      % jump if above to L1
2781    
2782            L1:
2783               jmp L2
2784    
2785    
2786    After jump chain elimination the 'ja L1' instructions is converted to
2787    'ja L2'. On the sparc and ppc, many of the 'ja L2' instructions may end
2788    up being implemented in their long form (if L2 is far away) using:
2789    
2790            jbe     L3      % jump if below or equal to L3
2791            jmp     L2
2792         L3:
2793            ...
2794    
2795    
2796    For large compilation units L2  may be far away.
2797    
2798    
2799    ----------------------------------------------------------------------
2800    Name: Matthias Blume
2801    Date: 2002/03/11 13:30:00 EST
2802    Tag: blume-20020311-mltreeeval
2803    Description:
2804    
2805    A functor parameter was missing.
2806    
2807    ----------------------------------------------------------------------
2808    Name: Allen Leung
2809    Date: 2002/03/11 10:30:00 EST
2810    Tag: leunga-20020311-runtime-string0
2811    Description:
2812    
2813       The representation of the empty string now points to a
2814    legal null terminated C string instead of unit.  It is now possible
2815    to convert an ML string into C string with InlineT.CharVector.getData.
2816    This compiles into one single machine instruction.
2817    
2818    ----------------------------------------------------------------------
2819    Name: Allen Leung
2820    Date: 2002/03/10 23:55:00 EST
2821    Tag: leunga-20020310-x86-call
2822    Description:
2823    
2824       Added machine generation for CALL instruction (relative displacement mode)
2825    
2826    ----------------------------------------------------------------------
2827    Name: Matthias Blume
2828    Date: 2002/03/08 16:05:00
2829    Tag: blume-20020308-entrypoints
2830    Description:
2831    
2832    Version number bumped to 110.39.1.  NEW BOOTFILES!
2833    
2834    Entrypoints: non-zero offset into a code object where execution should begin.
2835    
2836    - Added the notion of an entrypoint to CodeObj.
2837    - Added reading/writing of entrypoint info to Binfile.
2838    - Made runtime system bootloader aware of entrypoints.
2839    - Use the address of the label of the first function given to mlriscGen
2840      as the entrypoint.  This address is currently always 0, but it will
2841      not be 0 once we turn on block placement.
2842    - Removed the linkage cluster code (which was The Other Way(tm) of dealing
2843      with entry points) from mlriscGen.
2844    
2845    ----------------------------------------------------------------------
2846    Name: Allen Leung
2847    Date: 2002/03/07 20:45:00 EST
2848    Tag: leunga-20020307-x86-cmov
2849    Description:
2850    
2851       Bug fixes for CMOVcc on x86.
2852    
2853       1. Added machine code generation for CMOVcc
2854       2. CMOVcc is now generated in preference over SETcc on PentiumPro or above.
2855       3. CMOVcc cannot have an immediate operand as argument.
2856    
2857    ----------------------------------------------------------------------
2858    Name: Matthias Blume
2859    Date: 2002/03/07 16:15:00 EST
2860    Tag: blume-20020307-controls
2861    Description:
2862    
2863    This is a very large but mostly boring patch which makes (almost)
2864    every tuneable compiler knob (i.e., pretty much everything under
2865    Control.* plus a few other things) configurable via both the command
2866    line and environment variables in the style CM did its configuration
2867    until now.
2868    
2869    Try starting sml with '-h' (or, if you are brave, '-H')
2870    
2871    To this end, I added a structure Controls : CONTROLS to smlnj-lib.cm which
2872    implements the underlying generic mechanism.
2873    
2874    The interface to some of the existing such facilities has changed somewhat.
2875    For example, the MLRiscControl module now provides mkFoo instead of getFoo.
2876    (The getFoo interface is still there for backward-compatibility, but its
2877    use is deprecated.)
2878    
2879    The ml-build script passes -Cxxx=yyy command-line arguments through so
2880    that one can now twiddle the compiler settings when using this "batch"
2881    compiler.
2882    
2883    TODO items:
2884    
2885    We should go through and throw out all controls that are no longer
2886    connected to anything.  Moreover, we should go through and provide
2887    meaningful (and correct!) documentation strings for those controls
2888    that still are connected.
2889    
2890    Currently, multiple calls to Controls.new are accepted (only the first
2891    has any effect).  Eventually we should make sure that every control
2892    is being made (via Controls.new) exactly once.  Future access can then
2893    be done using Controls.acc.
2894    
2895    Finally, it would probably be a good idea to use the getter-setter
2896    interface to controls rather than ref cells.  For the time being, both
2897    styles are provided by the Controls module, but getter-setter pairs are
2898    better if thread-safety is of any concern because they can be wrapped.
2899    
2900    *****************************************
2901    
2902    One bug fix: The function blockPlacement in three of the MLRISC
2903    backpatch files used to be hard-wired to one of two possibilities at
2904    link time (according to the value of the placementFlag).  But (I
2905    think) it should rather sense the flag every time.
2906    
2907    *****************************************
2908    
2909    Other assorted changes (by other people who did not supply a HISTORY entry):
2910    
2911    1. the cross-module inliner now works much better (Monnier)
2912    2. representation of weights, frequencies, and probabilities in MLRISC
2913       changed in preparation of using those for weighted block placement
2914       (Reppy, George)
2915    
2916    ----------------------------------------------------------------------
2917    Name: Lal George
2918    Date: 2002/03/07 14:44:24 EST 2002
2919    Tag: george-20020307-weighted-block-placement
2920    
2921    Tested the weighted block placement optimization on all architectures
2922    (except the hppa) using AMPL to generate the block and edge frequencies.
2923    Changes were required in the machine properties to correctly
2924    categorize trap instructions. There is an MLRISC flag
2925    "weighted-block-placement" that can be used to enable weighted block
2926    placement, but this will be ineffective without block/edge
2927    frequencies (coming soon).
2928    
2929    
2930    ----------------------------------------------------------------------
2931    Name: Lal George
2932    Date: 2002/03/05 17:24:48 EST
2933    Tag: george-20020305-linkage-cluster
2934    
2935    In order to support the block placement optimization, a new cluster
2936    is generated as the very first cluster (called the linkage cluster).
2937    It contains a single jump to the 'real' entry point for the compilation
2938    unit. Block placement has no effect on the linkage cluster itself, but
2939    all the other clusters  have full freedom in the manner in which they
2940    reorder blocks or functions.
2941    
2942    On the x86 the typical linkage code that is generated is:
2943       ----------------------
2944            .align 2
2945       L0:
2946            addl    $L1-L0, 72(%esp)
2947            jmp     L1
2948    
2949    
2950            .align  2
2951       L1:
2952       ----------------------
2953    
2954    72(%esp) is the memory location for the stdlink register. This
2955    must contain the address of the CPS function being called. In the
2956    above example, it contains the address of  L0; before
2957    calling L1 (the real entry point for the compilation unit), it
2958    must contain the address for L1, and hence
2959    
2960            addl $L1-L0, 72(%esp)
2961    
2962    I have tested this on all architectures except the hppa.The increase
2963    in code size is of course negligible
2964    
2965    ----------------------------------------------------------------------
2966    Name: Allen Leung
2967    Date: 2002/03/03 13:20:00 EST
2968    Tag: leunga-20020303-mlrisc-tools
2969    
2970      Added #[ ... ] expressions to mlrisc tools
2971    
2972    ----------------------------------------------------------------------
2973    Name: Matthias Blume
2974    Date: 2002/02/27 12:29:00 EST
2975    Tag: blume-20020227-cdebug
2976    Description:
2977    
2978    - made types in structure C and C_Debug to be equal
2979    - got rid of code duplication (c-int.sml vs. c-int-debug.sml)
2980    - there no longer is a C_Int_Debug (C_Debug is directly derived from C)
2981    
2982    ----------------------------------------------------------------------
2983    Name: Matthias Blume
2984    Date: 2002/02/26 12:00:00 EST
2985    Tag: blume-20020226-ffi
2986    Description:
2987    
2988    1. Fixed a minor bug in CM's "noweb" tool:
2989       If numbering is turned off, then truly don't number (i.e., do not
2990       supply the -L option to noweb).  The previous behavior was to supply
2991       -L'' -- which caused noweb to use the "default" line numbering scheme.
2992       Thanks to Chris Richards for pointing this out (and supplying the fix).
2993    
2994    2. Once again, I reworked some aspects of the FFI:
2995    
2996       A. The incomplete/complete type business:
2997    
2998       - Signatures POINTER_TO_INCOMPLETE_TYPE and accompanying functors are
2999         gone!
3000       - ML types representing an incomplete type are now *equal* to
3001         ML types representing their corresponding complete types (just like
3002         in C).  This is still safe because ml-nlffigen will not generate
3003         RTTI for incomplete types, nor will it generate functions that
3004         require access to such RTTI.   But when ML code generated from both
3005         incomplete and complete versions of the C type meet, the ML types
3006         are trivially interoperable.
3007    
3008         NOTE:  These changes restore the full generality of the translation
3009         (which was previously lost when I eliminated functorization)!
3010    
3011       B. Enum types:
3012    
3013       - Structure C now has a type constructor "enum" that is similar to
3014         how the "su" constructor works.  However, "enum" is not a phantom
3015         type because each "T enum" has values (and is isomorphic to
3016         MLRep.Signed.int).
3017       - There are generic access operations for enum objects (using
3018         MLRep.Signed.int).
3019       - ml-nlffigen will generate a structure E_foo for each "enum foo".
3020         * The structure contains the definition of type "mlrep" (the ML-side
3021         representation type of the enum).  Normally, mlrep is the same
3022         as "MLRep.Signed.int", but if ml-nlffigen was invoked with "-ec",
3023         then mlrep will be defined as a datatype -- thus facilitating
3024         pattern matching on mlrep values.
3025         ("-ec" will be suppressed if there are duplicate values in an
3026          enumeration.)
3027         * Constructors ("-ec") or values (no "-ec") e_xxx of type mlrep
3028         will be generated for each C enum constant xxx.
3029         * Conversion functions m2i and i2m convert between mlrep and
3030         MLRep.Signed.int.  (Without "-ec", these functions are identities.)
3031         * Coversion functions c and ml convert between mlrep and "tag enum".
3032         * Access functions (get/set) fetch and store mlrep values.
3033       - By default (unless ml-nlffigen was invoked with "-nocollect"), unnamed
3034         enumerations are merged into one single enumeration represented by
3035         structure E_'.
3036    
3037    ----------------------------------------------------------------------
3038    Name: Allen Leung
3039    Date: 2002/02/25 04:45:00 EST
3040    Tag: leunga-20020225-cps-spill
3041    
3042    This is a new implementation of the CPS spill phase.
3043    The new phase is in the new file compiler/CodeGen/cpscompile/spill-new.sml
3044    In case of problems, replace it with the old file spill.sml
3045    
3046    The current compiler runs into some serious performance problems when
3047    constructing a large record.  This can happen when we try to compile a
3048    structure with many items.  Even a very simple structure like the following
3049    makes the compiler slow down.
3050    
3051        structure Foo = struct
3052           val x_1 = 0w1 : Word32.int
3053           val x_2 = 0w2 : Word32.int
3054           val x_3 = 0w3 : Word32.int
3055           ...
3056           val x_N = 0wN : Word32.int
3057        end
3058    
3059    The following table shows the compile time, from N=1000 to N=4000,
3060    with the old compiler:
3061    
3062    N
3063    1000   CPS 100 spill                           0.04u  0.00s  0.00g
3064           MLRISC ra                               0.06u  0.00s  0.05g
3065              (spills = 0 reloads = 0)
3066           TOTAL                                   0.63u  0.07s  0.21g
3067    
3068    1100   CPS 100 spill                           8.25u  0.32s  0.64g
3069           MLRISC ra                               5.68u  0.59s  3.93g
3070              (spills = 0 reloads = 0)
3071           TOTAL                                   14.71u  0.99s  4.81g
3072    
3073    1500   CPS 100 spill                           58.55u  2.34s  1.74g
3074           MLRISC ra                               5.54u  0.65s  3.91g
3075              (spills = 543 reloads = 1082)
3076           TOTAL                                   65.40u  3.13s  6.00g
3077    
3078    2000   CPS 100 spill                           126.69u  4.84s  3.08g
3079           MLRISC ra                               0.80u  0.10s  0.55g
3080              (spills = 42 reloads = 84)
3081           TOTAL                                   129.42u  5.10s  4.13g
3082    
3083    3000   CPS 100 spill                           675.59u  19.03s  11.64g
3084           MLRISC ra                               2.69u  0.27s  1.38g
3085              (spills = 62 reloads = 124)
3086           TOTAL                                   682.48u  19.61s  13.99g
3087    
3088    4000   CPS 100 spill                           2362.82u  56.28s  43.60g
3089           MLRISC ra                               4.96u  0.27s  2.72g
3090              (spills = 85 reloads = 170)
3091           TOTAL                                   2375.26u  57.21s  48.00g
3092    
3093    As you can see the old cps spill module suffers from some serious
3094    performance problem.  But since I cannot decipher the old code fully,
3095    instead of patching the problems up, I'm reimplementing it
3096    with a different algorithm.  The new code is more modular,
3097    smaller when compiled, and substantially faster
3098    (O(n log n) time and O(n) space).  Timing of the new spill module:
3099    
3100    4000  CPS 100 spill                           0.02u  0.00s  0.00g
3101          MLRISC ra                               0.25u  0.02s  0.15g
3102             (spills=1 reloads=3)
3103          TOTAL                                   7.74u  0.34s  1.62g
3104    
3105    Implementation details:
3106    
3107    As far as I can tell, the purpose of the CPS spill module is to make sure the
3108    number of live variables at any program point (the bandwidth)
3109    does not exceed a certain limit, which is determined by the
3110    size of the spill area.
3111    
3112    When the bandwidth is too large, we decrease the register pressure by
3113    packing live variables into spill records.  How we achieve this is
3114    completely different than what we did in the old code.
3115    
3116    First, there is something about the MLRiscGen code generator
3117    that we should be aware of:
3118    
3119    o MLRiscGen performs code motion!
3120    
3121       In particular, it will move floating point computations and
3122       address computations involving only the heap pointer to
3123       their use sites (if there is only a single use).
3124       What this means is that if we have a CPS record construction
3125       statement
3126    
3127           RECORD(k,vl,w,e)
3128    
3129       we should never count the new record address w as live if w
3130       has only one use (which is often the case).
3131    
3132       We should do something similar to floating point, but the transformation
3133       there is much more complex, so I won't deal with that.
3134    
3135    Secondly, there are now two new cps primops at our disposal:
3136    
3137     1. rawrecord of record_kind option
3138        This pure operator allocates some uninitialized storage from the heap.
3139        There are two forms:
3140    
3141         rawrecord NONE [INT n]  allocates a tagless record of length n
3142         rawrecord (SOME rk) [INT n] allocates a tagged record of length n
3143                                     and initializes the tag.
3144    
3145     2. rawupdate of cty
3146          rawupdate cty (v,i,x)
3147          Assigns to x to the ith component of record v.
3148          The storelist is not updated.
3149    
3150    We use these new primops for both spilling and increment record construction.
3151    
3152     1. Spilling.
3153    
3154        This is implemented with a linear scan algorithm (but generalized
3155        to trees).  The algorithm will create a single spill record at the
3156        beginning of the cps function and use rawupdate to spill to it,
3157        and SELECT or SELp to reload from it.  So both spills and reloads
3158        are fine-grain operations.  In contrast, in the old algorithm
3159        "spills" have to be bundled together in records.
3160    
3161        Ideally, we should sink the spill record construction to where
3162        it is needed.  We can even split the spill record into multiple ones
3163        at the places where they are needed.  But CPS is not a good
3164        representation for global code motion, so I'll keep it simple and
3165        am not attempting this.
3166    
3167     2. Incremental record construction (aka record splitting).
3168    
3169        Long records with many component values which are simulatenously live
3170        (recall that single use record addresses are not considered to
3171         be live) are constructed with rawrecord and rawupdate.
3172        We allocate space on the heap with rawrecord first, then gradually
3173        fill it in with rawupdate.  This is the technique suggested to me
3174        by Matthias.
3175    
3176        Some restrictions on when this is applicable:
3177        1. It is not a VECTOR record.  The code generator currently does not handle
3178           this case. VECTOR record uses double indirection like arrays.
3179        2. All the record component values are defined in the same "basic block"
3180           as the record constructor.  This is to prevent speculative
3181           record construction.
3182    
3183    ----------------------------------------------------------------------
3184    Name: Allen Leung
3185    Date: 2002/02/22 01:02:00 EST
3186    Tag: leunga-20020222-mlrisc-tools
3187    
3188    Minor bug fixes in the parser and rewriter
3189    
3190    ----------------------------------------------------------------------
3191    Name: Allen Leung
3192    Date: 2002/02/21 20:20:00 EST
3193    Tag: leunga-20020221-peephole
3194    
3195    Regenerated the peephole files.  Some contained typos in the specification
3196    and some didn't compile because of pretty printing bugs in the old version
3197    of 'nowhere'.
3198    
3199    ----------------------------------------------------------------------
3200    Name: Allen Leung
3201    Date: 2002/02/19 20:20:00 EST
3202    Tag: leunga-20020219-mlrisc-tools
3203    Description:
3204    
3205       Minor bug fixes to the mlrisc-tools library:
3206    
3207       1.  Fixed up parsing colon suffixed keywords
3208       2.  Added the ability to shut the error messages up
3209       3.  Reimplemented the pretty printer and fixed up/improved
3210           the pretty printing of handle and -> types.
3211       4.  Fixed up generation of literal symbols in the nowhere tool.
3212       5.  Added some SML keywords to to sml.sty
3213    
3214    ----------------------------------------------------------------------
3215    Name: Matthias Blume
3216    Date: 2002/02/19 16:20:00 EST
3217    Tag: blume-20020219-cmffi
3218    Description:
3219    
3220    A wild mix of changes, some minor, some major:
3221    
3222    * All C FFI-related libraries are now anchored under $c:
3223        $/c.cm      --> $c/c.cm
3224        $/c-int.cm  --> $c/internals/c-int.cm
3225        $/memory.cm --> $c/memory/memory.cm
3226    
3227    * "make" tool (in CM) now treats its argument pathname slightly
3228      differently:
3229        1. If the native expansion is an absolute name, then before invoking
3230           the "make" command on it, CM will apply OS.Path.mkRelative
3231           (with relativeTo = OS.FileSys.getDir()) to it.
3232        2. The argument will be passed through to subsequent phases of CM
3233           processing without "going native".  In particular, if the argument
3234           was an anchored path, then "make" will not lose track of that anchor.
3235    
3236    * Compiler backends now "know" their respective C calling conventions
3237      instead of having to be told about it by ml-nlffigen.  This relieves
3238      ml-nlffigen from one of its burdens.
3239    
3240    * The X86Backend has been split into X86CCallBackend and X86StdCallBackend.
3241    
3242    * Export C_DEBUG and C_Debug from $c/c.cm.
3243    
3244    * C type encoding in ml-nlffi-lib has been improved to model the conceptual
3245      subtyping relationship between incomplete pointers and their complete
3246      counterparts.  For this, ('t, 'c) ptr has been changed to 'o ptr --
3247      with the convention of instantiating 'o with ('t, 'c) obj whenever
3248      the pointer target type is complete.  In the incomplete case, 'o
3249      will be instantiated with some "'c iobj" -- a type obtained by
3250      using one of the functors PointerToIncompleteType or PointerToCompleteType.
3251    
3252      Operations that work on both incomplete and complete pointer types are
3253      typed as taking an 'o ptr while operations that require the target to
3254      be known are typed as taking some ('t, 'c) obj ptr.
3255    
3256      voidptr is now a bit "more concrete", namely "type voidptr = void ptr'"
3257      where void is an eqtype without any values.  This makes it possible
3258      to work on voidptr values using functions meant to operate on light
3259      incomplete pointers.
3260    
3261    * As a result of the above, signature POINTER_TO_INCOMPLETE_TYPE has
3262      been vastly simplified.
3263    
3264    ----------------------------------------------------------------------
3265    Name: Matthias Blume
3266    Date: 2002/02/19 10:48:00 EST
3267    Tag: blume-20020219-pqfix
3268    Description:
3269    
3270    Applied Chris Okasaki's bug fix for priority queues.
3271    
3272    ----------------------------------------------------------------------
3273    Name: Matthias Blume
3274    Date: 2002/02/15 17:05:00
3275    Tag: Release_110_39
3276    Description:
3277    
3278    Last-minute retagging is becoming a tradition... :-(
3279    
3280    This is the working release 110.39.
3281    
3282    ----------------------------------------------------------------------
3283    Name: Matthias Blume
3284    Date: 2002/02/15 16:00:00 EST
3285    Tag: Release_110_39-orig
3286    Description:
3287    
3288    Working release 110.39.  New bootfiles.
3289    
3290    (Update: There was a small bug in the installer so it wouldn't work
3291    with all shells.  So I retagged. -Matthias)
3292    
3293    ----------------------------------------------------------------------
3294    Name: Matthias Blume
3295    Date: 2002/02/15 14:17:00 EST
3296    Tag: blume-20020215-showbindings
3297    Description:
3298    
3299    Added EnvRef.listBoundSymbols and CM.State.showBindings.  Especially
3300    the latter can be useful for exploring what bindings are available at
3301    the interactive prompt.  (The first function returns only the list
3302    of symbols that are really bound, the second prints those but also the
3303    ones that CM's autoloading mechanism knows about.)
3304    
3305    ----------------------------------------------------------------------
3306    Name: Matthias Blume
3307    Date: 2002/02/15 12:08:00 EST
3308    Tag: blume-20020215-iptrs
3309    Description:
3310    
3311    Two improvements to ml-nlffigen:
3312    
3313      1. Write files only if they do not exist or if their current contents
3314         do not coincide with what's being written.  (That is, avoid messing
3315         with the time stamps unless absolutely necessary.)
3316    
3317      2. Implement a "repository" mechanism for generated files related
3318         to "incomplete pointer types".   See the README file for details.
3319    
3320    ----------------------------------------------------------------------
3321    Name: Matthias Blume
3322    Date: 2002/02/14 11:50:00 EST
3323    Tag: blume-20020214-quote
3324    Description:
3325    
3326    Added a type 't t_' to tag.sml (in ml-nlffi-lib.cm).  This is required
3327    because of the new and improved tag generation scheme.  (Thanks to Allen
3328    Leung for pointing it out.)
3329    
3330    ----------------------------------------------------------------------
3331    Name: Lal George
3332    Date: 2002/02/14 09:55:27 EST 2002
3333    Tag: george-20020214-isabelle-bug
3334    Description:
3335    
3336    Fixed the MLRISC bug sent by Markus Wenzel regarding the compilation
3337    of Isabelle on the x86.
3338    
3339    From Allen:
3340    -----------
3341     I've found the problem:
3342    
3343         in ra-core.sml, I use the counter "blocked" to keep track of the
3344         true number of elements in the freeze queue.  When the counter goes
3345         to zero, I skip examining the queue.  But I've messed up the
3346         bookkeeping in combine():
3347    
3348             else ();
3349             case !ucol of
3350               PSEUDO => (if !cntv > 0 then
3351                     (if !cntu > 0 then blocked := !blocked - 1 else ();
3352                                        ^^^^^^^^^^^^^^^^^^^^^^^
3353                      moveu := mergeMoveList(!movev, !moveu)
3354                     )
3355                  else ();
3356    
3357         combine() is called to coalesce two nodes u and v.
3358         I think I was thinking that if the move counts of u and v are both
3359         greater than zero then after they are coalesced then one node is
3360         removed from the freeze queue.  Apparently I was thinking that
3361         both u and v are of low degree, but that's clearly not necessarily true.
3362    
3363    
3364    02/12/2002:
3365        Here's the patch.  HOL now compiles.
3366    
3367        I don't know how this impact on performance (compile
3368        time or runtime).  This bug caused the RA (especially on the x86)
3369        to go thru the potential spill phase when there are still nodes on the
3370        freeze queue.
3371    
3372    
3373    
3374    
3375    ----------------------------------------------------------------------
3376    Name: Matthias Blume
3377    Date: 2002/02/13 22:40:00 EST
3378    Tag: blume-20020213-fptr-rtti
3379    Description:
3380    
3381    Fixed a bug in ml-nlffigen that was introduced with one of the previous
3382    updates.
3383    
3384    ----------------------------------------------------------------------
3385    Name: Matthias Blume
3386    Date: 2002/02/13 16:41:00 EST
3387    Tag: blume-20020213-cmlpq
3388    Description:
3389    
3390    Added new priority queue export symbols (which have just been added to
3391    smlnj-lib.cm) to CML's version of smlnj-lib.cm.  (Otherwise CML would
3392    not compile and the installer would choke.)
3393    
3394    ----------------------------------------------------------------------
3395    Name: Matthias Blume
3396    Date: 2002/02/13 16:15:00 EST
3397    Tag: blume-20020213-various
3398    Description:
3399    
3400    1. More tweaks to ml-nlffigen:
3401    
3402       - better internal datastructures (resulting in slight speedup)
3403       - "-match" option requires exact match
3404       - "localized" gensym counters (untagged structs/unions nested within
3405         other structs/unions or within typedefs get a fresh counter; their
3406         tag will be prefixed by a concatenation of their parents' tags)
3407       - bug fixes (related to calculation of transitive closure of types
3408         to be included in the output)
3409    
3410    2. Minor Basis updates:
3411    
3412       - added implementations for List.collate and Option.app
3413    
3414    ----------------------------------------------------------------------
3415    Name: Matthias Blume
3416    Date: 2002/02/11 15:55:00 EST
3417    Tag: blume-20020211-gensym
3418    Description:
3419    
3420    Added a "-gensym" option to command line of ml-nlffigen.  This can be
3421    used to specify a "stem" -- a string that is inserted in all "gensym'd"
3422    names (ML structure names that correspond to unnamed C structs, unions,
3423    and enums), so that separate runs of ml-nlffigen do not clash.
3424    
3425    ----------------------------------------------------------------------
3426    Name: Matthias Blume
3427    Date: 2002/02/11 12:05:00 EST
3428    Tag: blume-20020211-gensml
3429    Description:
3430    
3431    A quick fix for a problem with GenSML (in the pgraph-util library):
3432    Make generation of toplevel "local" optional.  (Strictly speaking,
3433    signature definitions within "local" are not legal SML.)
3434    
3435    Other than that: updates to INSTALL and cm/TODO.
3436    
3437    ----------------------------------------------------------------------
3438    Name: Matthias Blume
3439    Date: 2002/02/08 15:00:00 EST
3440    Tag: blume-20020208-uniquepid
3441    Description:
3442    
3443    0. Version number has been bumped to 110.38.1.  NEW BOOTFILES!!!
3444    
3445    1. The installer (config/install.sh) has gotten smarter:
3446    
3447         - Configuration options are a bit easier to specify now
3448           (in config/targets).
3449         - Bug in recognizing .tar.bz2 files fixed.
3450         - Installer automatically resolves dependencies between
3451           configuration options (e.g., if you ask for eXene, you will
3452           also get cml -- regardless whether you asked for it or not).
3453         - Installer can run in "quieter mode" by setting the environment
3454           variable INSTALL_QUIETLY to "true".  "Quieter" does not mean
3455           "completely silent", though.
3456         - Build HashCons library as part of smlnj-lib.
3457    
3458    2. A new scheme for assigning persistent identifiers to compilation
3459       units (and, by extension, to types etc.) has been put into place.
3460       This fixes a long-standing bug where types and even dynamic values
3461       can get internally confused, thereby compromising type safety
3462       (abstraction) and dynamic correctness.  See
3463    
3464         http://cm.bell-labs.com/cm/cs/who/blume/pid-confusion.tgz
3465    
3466       for an example of how things could go wrong until now.
3467    
3468       The downside of the new scheme is that pids are not quite as
3469       persistent as they used to be: CM will generate a fresh pid
3470       for every compilation unit that it thinks it sees for the first
3471       time.  That means that if you compile starting from a clean, fresh
3472       source tree at two different times, you end up with different
3473       binaries.
3474    
3475       Cutoff recompilation, however, has not been compromised because
3476       CM keeps pid information in special caches between runs.
3477    
3478    ----------------------------------------------------------------------
3479    Name: Lal George
3480    Date: 2002/02/07 15:34:13 EST 2002
3481    Tag: <none>
3482    Description:
3483    
3484    Compilers that generate assembly code may produce  global labels
3485    whose value is resolved at link time. The various peephole optimization
3486    modules did not take this in account.
3487    
3488    TODO. The Labels.addrOf function should really return an option
3489    type so that clients are forced to deal with this issue, rather
3490    than an exception being raised.
3491    
3492    ----------------------------------------------------------------------
3493    Name: Lal George
3494    Date: 2002/02/06 13:55:02 EST
3495    Tag: george-20020206-ra-breakup
3496    Description:
3497    
3498    1. A bug fix from Allen.
3499    
3500        A typo causes extra fstp %st(0)'s to be generated at compensation
3501        edges, which might cause stack underflow traps at runtime.  This
3502        occurs in fft where there are extraneous fstps right before the 'into'
3503        trap instruction (in this case they are harmless since none of the
3504        integers overflow.)
3505    
3506    2. Pulled out various utility modules that were embedded in the modules
3507       of the register allocator. I need these modules for other purposes, but
3508       they are not complete enough to put into a library (just yet).
3509    ----------------------------------------------------------------------
3510    Name: Matthias Blume
3511    Date: 2002/01/31 16:05:00 EST
3512    Tag: blume-20020131-sparc-ccalls
3513    Description:
3514    
3515    1. C-calls on Sparc needlessly allocated a huge chunk (96 bytes)
3516       of extra stack space by mistake.  Fixed.
3517    
3518    2. Bug in logic of handling of command-line options in ml-nlffigen fixed.
3519    
3520    ----------------------------------------------------------------------
3521    Name: Allen Leung
3522    Date: 2002/01/30
3523    Tag: leunga-20020130-nowhere-bug-fix
3524    Description:
3525    
3526       MLRISC bug fixes:
3527       1. Fixed a bindings computation bug in the 'nowhere' program generator tool.
3528       2. MachineInt.fromString was negating its value.
3529    
3530    ----------------------------------------------------------------------
3531    Name: Matthias Blume
3532    Date: 2002/01/29
3533    Tag: blume-20020129-INSTALL
3534    Description:
3535    
3536    - Added somewhat detailed installation instructions (file INSTALL).
3537    - Fixed curl-detection bug in config/install.sh.
3538    - It is now possible to select the URL getter using the URLGETTER
3539      environment variable:
3540    
3541          not set / "unknown"      --> automatic detection (script tries wget,
3542                                       curl, and lynx)
3543          "wget" / "curl" / "lynx" --> use the specified program (script "knows"
3544                                       how to properly invoke them)
3545          other                    --> use $URLGETTER directly, it must take
3546                                       precisely two command-line arguments
3547                                       (source URL and destination file name)
3548    
3549    ----------------------------------------------------------------------
3550    Name: Matthias Blume
3551    Date: 2002/01/28
3552    Tag: blume-20020128-sparc-ccalls
3553    Description:
3554    
3555    - Fixed problem with calculation of "used" registers in sparc-c-calls.
3556    - Make use of the allocParam argument in sparc-c-calls.
3557    
3558    ----------------------------------------------------------------------
3559    Name: Matthias Blume
3560    Date: 2002/01/28
3561    Tag: blume-20020128-allocParam
3562    Description:
3563    
3564    John Reppy:  Changes c-calls API to accept client-callback for
3565    allocating extra stack space.
3566    me: Corresponding changes to mlriscGen (using a dummy argument that
3567        does not change the current behavior).
3568    
3569    ----------------------------------------------------------------------
3570    Name: Matthias Blume
3571    Date: 2002/01/28 12:00:00
3572    Tag: Release_110_38
3573    Description:
3574    
3575    This time for real!!!
3576    
3577    ----------------------------------------------------------------------
3578    Name: Matthias Blume
3579    Date: 2002/01/28 10:56:00 EST
3580    Tag: blume-20020128-retraction
3581    Description:
3582    
3583    0. Retracted earlier 110.38.  (The Release_110_38 tag has been replaced
3584       with blume-Release_110_38-retracted.)
3585    
3586    1. Fixed a problem with incorrect rounding modes in real64.sml.
3587       (Thanks to Andrew Mccreight <andrew.mccreight@yale.edu>.)
3588    
3589    2. A bug in ml-nlffigen related to the handling of unnamed structs, unions,
3590       and enums fixed.  The naming of corresponding ML identifiers should
3591       now be consistent again.
3592    
3593    ----------------------------------------------------------------------
3594    Name: Allen Leung
3595    Date: 2002/01/27
3596    Tag: leunga-20020127-nowhere
3597    Description:
3598    
3599       Added a target called nowhere in the configuration scripts.
3600       Enabling this will build the MLRISC 'nowhere' tool (for translating
3601       programs with where-clauses into legal SML code) during installation.
3602    
3603    ----------------------------------------------------------------------
3604    Name: Matthias Blume
3605    Date: 2002/01/25 21:27:00 EST
3606    Tag: blume-Release_110_38-retracted
3607    Description:
3608    
3609    Call it a (working) release!  Version is 110.38. Bootfiles are ready.
3610    
3611    README will be added later.
3612    
3613    !!! NOTE:  Re-tagged as blume-Release_110_38-retracted. Original tag
3614    (Release_110_38) removed.  Reason: Last-minute bug fixes.
3615    
3616    ----------------------------------------------------------------------
3617    Name: Matthias Blume
3618    Date: 2002/01/25
3619    Tag: blume-20020125-ffi
3620    Description:
3621    
3622    A large number of tweaks and