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 671, Mon Jun 19 02:02:32 2000 UTC revision 774, Wed Jan 10 12:50:56 2001 UTC
# Line 13  Line 13 
13  Description:  Description:
14  ----------------------------------------------------------------------  ----------------------------------------------------------------------
15  Name: Matthias Blume  Name: Matthias Blume
16    Date: 2001/01/10 21:55:00 JST
17    Tag: blume-20010110-rcc
18    Description:
19    
20    The RCC stuff now seems to work (but only on the x86).
21    This required hacking of the c-calls interface (and -implementation) in
22    MLRISC.
23    
24    Normal compiler users should be unaffected.
25    
26    ----------------------------------------------------------------------
27    Name: Matthias Blume
28    Date: 2001/01/09 01:20:00 JST
29    Tag: blume-20010109-rcc
30    Description:
31    
32    This is a fairly big patch, flushing out a large number of pending
33    changes that I made to my development copy over the last couple of days.
34    
35    Of practical relevance at this moment is a workaround for a pickling
36    bug that Allen ran into the other day.  The cause of the bug itself is
37    still unknown and it might be hard to fix it properly, but the
38    workaround has some merits of its own (namely somewhat reducing pickling
39    overhead for certain libraries).  Therefore, I think this solution should
40    be satisfactory at this time.
41    
42    The rest of the changes (i.e., the vast majority) has to do with my
43    ongoing efforts of providing direct support for C function calls from
44    ML.  At the moment there is a new primop "RAW_CCALL", typing magic
45    in types/cproto.sml (invoked from FLINT/trans/translate.sml), a new
46    case in the FLINT CPS datatype (RCC), changes to cps/convert.sml to
47    translate uses of RAW_CCALL into RCC, and changes to mlriscGen.sml to
48    handle RCC.
49    
50    The last part (the changes to mlriscGen.sml) are still known to be
51    wrong on the x86 and not implemented on all other architectures.  But
52    the infrastructure is in place. I had to change a few functor
53    signatures in the backend to be able to route the CCalls interface
54    from MLRISC there, and I had to specialize the mltree type (on the
55    x86) to include the necessary extensions. (The extensions themselves
56    were already there and redy to go in MLRISC/x86).
57    
58    Everything should be very happy as soon as someone helps me with
59    mlriscGen.sml...
60    
61    In any case, nothing of this should matter to anyone as long as the
62    new primop is not being used (which is going to be the case unless you
63    find it where I hid it :). The rest of the compiler is completely
64    unaffected.
65    
66    ----------------------------------------------------------------------
67    Name: Matthias Blume
68    Date: 2001/01/05 00:30:00 JST
69    Tag: blume-20010105-primops
70    Description:
71    
72    Added some experimental support for work that I am doing right now.
73    These changes mostly concern added primops, but there is also a new
74    experimental C library in the runtime system (but currently not enabled
75    anywhere except on Linux/X86).
76    
77    In the course of adding primops (and playing with them), I discovered that
78    Zhong's INL_PRIM hack (no type info for certain primops) was, in fact, badly
79    broken.  (Zhong was very right he labeled this stuff as "major gross hack".)
80    To recover, I made type information in INL_PRIM mandatory and changed
81    prim.sml as well as built-in.sml accordingly.  The InLine structure now
82    has complete, correct type information (i.e., no bottom types).
83    
84    Since all these changes mean that we need new binfiles, I also bumped the
85    version number to 110.32.1.
86    
87    ----------------------------------------------------------------------
88    Name: Matthias Blume
89    Date: 2000/12/30 22:10:00 JST
90    Tag: blume-20001230-various
91    Description:
92    
93    Added proxy libraries for MLRISC and let MLRISC libraries refer
94    to each other using path anchors.  (See CM manual for explanation.)
95    
96    Updated CM documentation.
97    
98    Fixed some bugs in CM.
99    
100    Implemented "proxy" libraries (= syntactic sugar for CM).
101    
102    Added "-quiet" option to makeml and changed runtime system accordingly.
103    
104    Added cleanup handler for exportML to reset timers and compiler stats.
105    
106    ----------------------------------------------------------------------
107    Name: Lal George
108    Date: 2000/12/22 22:22:58 EST 2000
109    Tag: Release_110_32
110    Description:
111    
112            Infinite precision used throughout MLRISC.
113            see MLRISC/mltree/machine-int.sig
114    
115    ----------------------------------------------------------------------
116    Name: Matthias Blume
117    Date: 2000/12/22 23:16:00 JST
118    Tag: blume-20001222-warn
119    Description:
120    
121    Corrected wording and formatting of some CM warning message which I
122    broke in my previous patch.
123    
124    ----------------------------------------------------------------------
125    Name: Matthias Blume
126    Date: 2000/12/22 21:20:00 JST
127    Tag: blume-20001222-anchorenv
128    Description:
129    
130    Fixed CM's handling of anchor environments in connection with CMB.make.
131    
132    ----------------------------------------------------------------------
133    Name: Matthias Blume
134    Date: 2000/12/22 13:15:00 JST
135    Tag: blume-20001222-cleanup
136    Description:
137    
138    Removed src/cm/ffi which does not (and did not) belong here.
139    
140    ----------------------------------------------------------------------
141    Name: Matthias Blume
142    Date: 2000/12/21 23:55:00 JST
143    Tag: blume-20001221-exn
144    Description:
145    
146    Probably most important: CM no longer silently swallows all exceptions
147    in the compiler.
148    Plus: some other minor CM changes.  For example, CM now reports some
149    sizes for generated binfiles (code, data, envpickle, lambdapickle).
150    
151    ----------------------------------------------------------------------
152    Name: Matthias Blume
153    Date: 2000/12/15 00:01:05 JST
154    Tag: blume-20001215-dirtool
155    Description:
156    
157    - "dir" tool added.
158    - improvements and cleanup to Tools structure
159    - documentation updates
160    
161    ----------------------------------------------------------------------
162    Name: Allen Leung
163    Date: Thu Dec 14 03:45:24 EST 2000
164    Description:
165    Tag:  leunga-20001214-int-inf
166    Description:
167    
168       In IntInf, added these standard functions, which are missing from our
169    implementation:
170    
171        andb : int * int -> int
172        xorb : int * int -> int
173        orb  : int * int -> int
174        notb : int -> int
175         <<   : int * word -> int
176        ~>>  : int * word -> int
177    
178       Not tested, I hope they are correct.
179    
180    ----------------------------------------------------------------------
181    Name: Allen Leung
182    Date: Fri Dec  8 19:23:26 EST 2000
183    Description:
184    Tag:  leunga-20001208-nowhere
185    Description:
186    
187      Slight improvements to the 'nowhere' tool to handle OR-patterns,
188    to generate better error messages etc.  Plus a brief manual.
189    
190    ----------------------------------------------------------------------
191    Name: Lal George
192    Date: 2000/12/08 09:54:02 EST 2000
193    Tag: Release_110_31
194    Description:
195    
196    - Version 110.31
197    ----------------------------------------------------------------------
198    Name: Allen Leung
199    Date: Thu Dec  7 22:01:04 EST 2000
200    Tag:  leunga-20001207-cell-monster-hack
201    Description:
202    
203    Major MLRISC internal changes.  Affect all clients.
204    Summary:
205    
206    1.  Type CELLS.cell = int is now replaced by a datatype.
207        As a result, the old regmap is now gone.  Almost all interfaces
208        in MLRISC change as a consequence.
209    
210    2.  A new brand version of machine description tool (v3.0) that generates
211        modules expecting the new interface.  The old version is removed.
212    
213    3.  The RA interface has been further abstracted into two new functors.
214        RISC_RA and X86RA.  These functors have much simpler interfaces.
215        [See also directory MLRISC/demo.]
216    
217    4.  Some other new source->source code generation tools are available:
218    
219        a. MLRISC/Tools/RewriteGen -- generate rewriters from rules.
220        b. MLRISC/Tools/WhereGen -- expands conditional pattern matching rules.
221           I use this tool to generate the peephole optimizers---with the new
222           cell type changes, peephole rules are becoming difficult to write
223           without conditional pattern matching.
224    
225    5.  More Intmap -> IntHashTable change.  Previous changes by Matthias didn't
226        cover the entire MLRISC source tree so many things broke.
227    
228    6.  CM files have been moved to the subdirectory MLRISC/cm.
229        They are moved because there are a lot of them and they clutter up the
230        root dir.
231    
232    7.  More detailed documentation to come...
233    
234        NOTE: To rebuild from 110.30 (ftp distribution), you'll have to do
235        a makeml -rebuild first.  This is because of other other
236        changes that Matthias has made (see below).
237    
238    
239    ----------------------------------------------------------------------
240    Name: Matthias Blume
241    Date: 2000/11/30 23:12:00 JST
242    Tag: blume-20001130-filereorg
243    Description:
244    
245    Some manual updates and some file reorganizations in CM.
246    
247    ----------------------------------------------------------------------
248    Name: Matthias Blume
249    Date: 2000/11/24 17:45:00 JST
250    Tag: blume-20001124-link
251    Description:
252    
253    Drastically improved link traversal code for the case that the dynamic
254    value was already loaded at bootstrap time.  As a result, CM and CMB
255    now both load blazingly fast -- even on a very slow machine.  Also,
256    memory consumption has been further reduced by this.
257    
258    Warning: The format of the PIDMAP file has changed.  THerefore, to
259    bootstrap you have to do this:
260    
261    1. Run CMB.make
262    2. Make a symbolic link for the boot directory:
263         ln -s sml.boot.ARCH-OS xxx
264    3. "Rebuild" the boot directory:
265         ./makeml -boot xxx -rebuild sml ; rm xxx
266    4. Boot normally:
267          ./makeml
268    
269    ----------------------------------------------------------------------
270    Name: Matthias Blume
271    Date: 2000/11/21 21:20:00 JST
272    Tag: blume-20001121-tools
273    Description:
274    
275    Continued hacking on autoloading problem -- with success this time.
276    Also changed tool-plugin mechanism.  See new CM manual.
277    
278    ----------------------------------------------------------------------
279    Name: Matthias Blume
280    Date: 2000/11/19 14:30:00 JST
281    Tag:  blume-20001119-autoload
282    Description:
283    
284    Some hacking to make autoloading faster.  Success for CMB, no success
285    so far for CM.  There is a reduced structure CM' that autoloads faster.
286    (This is a temporary, non-documented hack to be eliminated again when
287    the general problem is solved.)
288    
289    ----------------------------------------------------------------------
290    Name: Matthias Blume
291    Date: 2000/11/17 14:10:00 JST
292    Tag: blume-20001117-pickle-lib
293    Description:
294    
295    1. Eliminated comp-lib.cm
296    2. Made pickle-lib.cm
297    3. Eliminated all uses of intset.sml (from comp-lib.cm)
298    4. Replaced all uses of intmap.{sig,sml} (from comp-lib.cm) with
299       equivalent constructs from smlnj-lib.cm (INtHashTable).
300    5. Point 4. also goes for those uses of intmap.* in MLRISC.
301       Duplicated intmap modules thrown out.
302    6. Hunted down all duplicated SCC code and replaced it with
303       equivalent stuff (GraphSCCFn from smlnj-lib.cm).
304    7. Rewrote Feedback module.
305    8. Moved sortedlist.sml into viscomp-lib.cm.  Eventually it
306       should be thrown out and equivalent modules from smlnj-lib.cm
307       should be used (IntRedBlackSet, IntListSet, ...).
308    
309    Confirmed that compiler compiles to fixpoint.
310    
311    ----------------------------------------------------------------------
312    Name: Allen Leung
313    Date: 2000/11/10 18:00:00
314    Tag: leunga-20001110-new-x86-fp
315    
316    A new x86 floating point code generator has been added.
317    By default this is turned off.  To turn this on, do:
318    
319        CM.autoload "$smlnj/compiler.cm";
320        Compiler.Control.MLRISC.getFlag "x86-fast-fp" := true;
321    
322    Changes:
323    
324    1.  Changed FTAN to FPTAN so that the assembly output is correct.
325    2.  Changed the extension callback for FTANGENT to generate:
326    
327              fptan
328              fstp  %st(0)
329        instead of
330              fptan
331              fstpl ftempmem
332    
333    3.  Numerous assembly fixes for x86.
334    
335    5.  Cleaned up the machine code output module x86/x86MC.sml and added
336        support for a whole bunch of instructions and addressing modes:
337    
338          fadd/fsub/fsubr/fmul/fdiv/fdivr  %st, %st(n)
339          faddp/fsubp/fsubrp/fmulp/fdivp/fdivrp  %st, %st(n)
340          fadd/fsub/fsubr/fmul/fdiv/fdivr  %st(n), %st
341          fiadd/fisub/fisubr/fimul/fidiv/fidivr mem
342          fxch %st(n)
343          fld %st(n)
344          fst %st(n)
345          fst mem
346          fstp %st(n)
347          fucom %st(n)
348          fucomp %st(n)
349    
350        All these are now generated when the fast fp mode is turned on.
351    
352    6.  Removed the dedicated registers %st(0), ..., %st(7) from X86CpsRegs
353    
354    ----------------------------------------------------------------------
355    Name: Matthias Blume
356    Date: 2000/11/09 11:20:00 JST
357    Tag: blume-20001109-scc
358    Description:
359    
360    Eliminated some code duplication:
361    
362    1. Added "where" clause to GraphSCCFn in SML/NJ Library.
363       (Otherwise the functor is useless.)
364    2. Used GraphSCCFn where SCCUtilFun was used previously.
365    3. Got rid of SCCUtilFun (in comp-lib.cm).
366    
367    ----------------------------------------------------------------------
368    Name: Lal George
369    Date: 2000/11/06 09:02:21 EST 2000
370    Tag: Release_110_30
371    Description:
372    
373    - Version 110.30
374    ----------------------------------------------------------------------
375    Name: Matthias Blume
376    Date: 2000/11/04 14:45:00
377    Tag: blume-20001104-mlbuild
378    Description:
379    
380    - Made ml-build faster on startup.
381    - Documentation fixes.
382    
383    ----------------------------------------------------------------------
384    Name: Matthias Blume
385    Date: 2000/11/02 17:00:00 JST
386    Tag: blume-20001102-condcomp
387    Description:
388    
389    - Small tweaks to pickler -- new BOOTFILES!
390    - Version bumped to 110.29.2.
391    - Added conditional compilation facility to init.cmi (see comment there).
392    ----------------------------------------------------------------------
393    Name: Allen Leung
394    Date: 2000/10/23 19:31:00
395    Tag: leunga-20001023-demo-ra
396    
397    1. Minor RA changes that improves spilling on x86 (affects Moby and C-- only)
398    2. Test programs for the graph library updated
399    3. Some new MLRISC demo programs added
400    
401    ----------------------------------------------------------------------
402    Name: Matthias Blume
403    Date: 2000/08/31 22:15:00 JST
404    Tag: blume-20001017-errmsg
405    Description:
406    
407    More error message grief: Where there used to be no messages, there
408    now were some that had bogus error regions.  Fixed.
409    
410    ----------------------------------------------------------------------
411    Name: Matthias Blume
412    Date: 2000/08/31 17:30:00 JST
413    Tag: blume-20001017-v110p29p1
414    Description:
415    
416    I made a version 110.29.1 with new bootfiles.
417    
418    Changes:  Modified pickler/unpickler for faster and leaner unpickling.
419              CM documentation changes and a small bugfix in CM's error reporting.
420    
421    ----------------------------------------------------------------------
422    Name: Lal George
423    Date: 2000/09/27 14:42:35 EDT
424    Tag: george-20000927-nodestatus
425    Description:
426    
427    Changed the type of the nodestatus, so that:
428    
429            SPILLED(~1)             is now SPILLED
430            SPILLED(m) where m>=0   is now MEMREG(m)
431            SPILLED(s) where s<~1   is now SPILL_LOC(~s)
432    
433    ----------------------------------------------------------------------
434    Name: Matthias Blume
435    Date: 2000/09/07 14:45:00 JST
436    Tag: blume-20000907-cmerrmsg
437    Description:
438    
439    Small tweak to CM to avoid getting ML syntax error messages twice.
440    
441    ----------------------------------------------------------------------
442    Name: Matthias Blume
443    Date: 2000/08/31 18:00:00 JST
444    Tag: blume-20000831-cvsbootfiles
445    Description:
446    
447    New URL for boot files (because the 110.29 files on the BL server do
448    now work correctly with my updated install scripts for yacc and lex).
449    
450    ----------------------------------------------------------------------
451    Name: Matthias Blume
452    Date: 2000/08/08 12:33:00 JST
453    Tag: blume-20000808-manual
454    Description:
455    
456    Tiny update to CM manual.
457    
458    ----------------------------------------------------------------------
459    Name: Allen Leung
460    Date: 2000/08/7 19:31:00
461    Tag: leunga-20000807-a-whole-bunch-of-stuff
462    
463      Moby, C--, SSA, x86, machine descriptions etc.  Should only affect C--
464    and Mobdy.
465    
466    1.  x86
467    
468       a.  Fixes to peephole module by John and Dan.
469       b.  Assembly fix to SETcc by Allen.
470       c.  Fix to c-call by John.
471       d.  Fix to spilling by John.  (This one deals with the missing FSTPT case)
472       e.  Instruction selection optimization to SETcc as suggested by John.
473    
474           For example,
475    
476            MV(32, x, COND(32, CMP(32, LT, a, b), LI 1, LI 0))
477    
478           should generate:
479    
480            MOVL a, x
481            SUBL b, x
482            SHRL 31, x
483    
484    2.  IR stuff
485    
486         A bunch of new DJ-graph related algorithms added.  These
487         speed up SSA construction.
488    
489    3.  SSA + Scheduling
490    
491         Added code for SSA and scheduling to the repository
492    
493    ----------------------------------------------------------------------
494    Name: Lal George
495    Date: 2000/07/27 11:53:14 EDT
496    
497    Tag: lal-20000727-linux-ppc
498    Description:
499    
500     Made changes to support Linux PPC.
501     p.s. I have confirmation that the 110.29 boot files work fine.
502    
503    ----------------------------------------------------------------------
504    Name: Matthias Blume
505    Date: 2000/07/27 17:40:00 JST
506    Tag: blume-20000727-scripts
507    Description:
508    
509    !!!! WARNING !!!!
510    You must recompile the runtime system!
511    !!!! WARNING !!!!
512    
513    This is basically another round of script-enhancements:
514    
515    1. sml, ml-build, and ml-makedepend accept options -D and -U to define
516       and undefine CM preprocessor symbols.
517    
518    2. ml-build avoids generating a new heap image if it finds that the
519       existing one is still ok.  (The condition is that no ML file had to
520       be recompiled and all ML files are found to be older that the heap
521       file.)
522    
523       To make this work smoothly, I also hacked the runtime system as
524       well as SMLofNJ.SysInfo to get access to the heap image suffix
525       (.sparc-solaris, ...) that is currently being used.
526    
527       Moreover, the signature of CM.mk_standalone has changed.  See the
528       CM manual.
529    
530    3. ml-makedepend accepts additional options -n, -a, and -o.  (See the
531       CM manual for details.)
532    
533    4. More CM manual updates:
534        - all of the above has been documented.
535        - there is now a section describing the (CM-related) command line
536          arguments that are accepted by the "sml" command
537    
538    ----------------------------------------------------------------------
539    Name: Matthias Blume
540    Date: 2000/07/25 16:20:00 JST
541    Tag: blume-20000725-makedepend
542    Description:
543    
544    Added a script called ml-makedepend.  This can be used in makefiles
545    for Unix' make in a way very similar to the "makedepend" command for
546    C.
547    
548    The script internally uses function CM.sources.
549    
550    Synopsis:
551    
552        ml-makedepend [-f makefile] cmfile targetname
553    
554    The default for the makefile is "makefile" (or "Makefile" should
555    "makefile" not exist).
556    
557    ml-makedepend adds a cmfile/targetname-specific section to this
558    makefile (after removing the previous version of this section).  The
559    section contains a single dependency specification with targetname on
560    the LHS (targetname is an arbitrary name), and a list of files derived
561    from the cmfile on the RHS.  Some of the files on the RHS are
562    ARCH/OPSYS-specific.  Therefore, ml-makedepend inserts references to
563    "make" variables $(ARCH) and $(OPSYS) in place of the corresponding
564    path names.  The makefile writer is responsible for making sure that
565    these variables have correct at the time "make" is invoked.
566    
567    ----------------------------------------------------------------------
568    Name: Matthias Blume
569    Date: 2000/07/22 23:30:00 JST
570    Tag: blume-20000722-urlupdate
571    Description:
572    
573    Changed BOOT and config/srcarchiveurl to point to BL server:
574    
575        ftp://ftp.research.bell-labs.com/dist/smlnj/working/110.29/
576    
577    ----------------------------------------------------------------------
578    Name: Matthias Blume
579    Date: 2000/07/18 18:00:00 JST
580    Tag: blume-20000718-Version_110_29
581    Description:
582    
583    1. Updated src/compiler/TopLevel/main/version.sml to version 110.29
584    
585    2. Updated config/version to 110.29
586    
587    3. Updated config/srcarchiveurl
588    
589    3. New boot files!
590       ftp://ftp.cs.princeton.edu/pub/people/blume/sml/110.29-autofetch
591    
592    ----------------------------------------------------------------------
593    Name: Matthias Blume
594    Date: 2000/07/11 13:58:00 JST
595    Tag: blume-20000711-doctypo
596    Description:
597    
598    Fixed a few typos in CM manual.
599    
600    ----------------------------------------------------------------------
601    Name: Allen Leung
602    Date: 2000/06/15 00:38:00
603    Tag: leunga-20000704-sparc-x86
604    
605    1. x86 peephole improvement sp += k; sp -= k => nop  [from John]
606    2. fix to x86 RET bug [found by Dan Grossman]
607    3. sparc assembly bug fix for ticc instructions [found by Fermin]
608    
609       Affects c-- and moby only
610    
611    ----------------------------------------------------------------------
612    Name: Matthias Blume
613    Date: 2000/07/04 15:26:00
614    Tag: blume-20000704-trigger
615    Description:
616    
617    1. Improvements to CM manual.
618    2. SMLofNJ.Internals.BTrace.trigger reinstated as an alternative way
619       of getting a back-trace.  The function, when called, raises an
620       internal exception which explicitly carries the full back-trace history,
621       so it is unaffected by any intervening handle-raise pairs ("trivial"
622       or not).  The interactive loop will print that history once it arrives
623       at top level.
624       Short of having all exceptions implicitly carry the full history, the
625       recommended way of using this facility is:
626         - compile your program with instrumentation "on"
627         - run it, when it raises an exception, look at the history
628         - if the history is "cut off" because of some handler, go and modify
629           your program so that it explicitly calls BTrace.trigger
630         - recompile (still instrumented), and rerun; look at the full history
631    
632    ----------------------------------------------------------------------
633    Name: Matthias Blume
634    Date: 2000/07/03 15:36:00 JST
635    Tag: blume-20000702-manual
636    Description:
637    
638    Small corrections and updates to CM manual.
639    
640    ----------------------------------------------------------------------
641    Name: Matthias Blume
642    Date: 2000/06/29 16:04:00 JST
643    Tag: blume-20000629-yacctool
644    Description:
645    
646    Changes:
647    
648    1. Class "mlyacc" now takes separate arguments to pass options to
649       generated .sml- and .sig-files independently.
650    2. Corresponding CM manual updates.
651    3. BTrace module now also reports call sites.  (However, for loop clusters
652       it only shows from where the cluster was entered.)  There are associated
653       modifications to core.sml, internals.{sig,sml}, btrace.sml, and btimp.sml.
654    
655    ----------------------------------------------------------------------
656    Name: Matthias Blume
657    Date: 2000/06/27 16:51:00 JST
658    Tag: blume-20000627-noweb
659    Description:
660    
661    Changes:
662    
663     1. Implemented "subdir" and "witness" options for noweb tool.
664        This caused some slight internal changes in CM's tool implementation.
665     2. Fixed bug in "tool plugin" mechanism.  This is essentially cleaning
666        some remaining issues from earlier path anchor changes.
667     3. Updated CM manual accordingly.
668    
669     4. Changed implementation of back-tracing so that I now consider it
670        ready for prime-time.
671    
672        In particular, you don't have to explicitly trigger the back-trace
673        anymore.  Instead, if you are running BTrace-instrumented code and
674        there is an uncaught exception (regardless of whether or not it was
675        raised in instrumented code), the top-level evalloop will print
676        the back-trace.
677    
678        Features:
679    
680          - Instrumented and uninstrumented code work together seemlessly.
681            (Of course, uninstrumented code is never mentioned in actual
682             back-traces.)
683    
684          - Asymptotic time- and space-complexity of instrumented code is
685            equal to that of uninstrumented code.  (This means that
686            tail-recursion is preserved by the instrumentation phase.)
687    
688          - Modules whose code has been instrumented in different sessions
689            work together without problem.
690    
691          - There is no penalty whatsoever on uninstrumented code.
692    
693          - There is no penalty on "raise" expressions, even in
694            instrumented code.
695    
696        A potential bug (or perhaps it is a feature, too):
697    
698          A back-trace reaches no further than the outermost instrumented
699          non-trivial "raise".  Here, a "trivial" raise is one that is the
700          sole RHS of a "handle" rule.  Thus, back-traces reach trough
701    
702               <exp> handle e => raise e
703    
704          and even
705    
706               <exp> handle Foo => raise Bar
707    
708          and, of course, through
709    
710               <exp> handle Foo => ...
711    
712         if the exception was not Foo.
713    
714         Back-traces always reach right through any un-instrumented code
715         including any of its "handle" expressions, trivial or not.
716    
717       To try this out, do the following:
718    
719         - Erase all existing binfiles for your program.
720           (You may keep binfiles for those modules where you think you
721            definitely don't need back-tracing.)
722         - Turn on back-trace instrumentation:
723              SMLofNJ.Internals.BTrace.mode (SOME true);
724         - Recompile your program.  (I.e., run "CM.make" or "use".)
725         - You may now turn instrumentation off again (if you want):
726              SMLofNJ.Internals.BTrace.mode (SOME false);
727         - Run your program as usual.  If it raises an exception that
728           reaches the interactive toplevel, then a back-trace will
729           automatically be printed.  After that, the toplevel loop
730           will print the exception history as usual.
731    
732    ----------------------------------------------------------------------
733    Name: Matthias Blume
734    Date: 2000/06/26 09:56:46 JST
735    Tag: blume-20000626-setup
736    Description:
737    
738    CM: - setup-parameter to "sml" added; this can be used to run arbitrary
739          ML code before and after compiling a file (e.g., to set compiler
740          flags)
741    
742    Compiler: - improved btrace API (in core.sml, internals.{sig,sml})
743              - associated changes to btrace.sml (BTrace instrumentation pass)
744              - cleaner implementation of btimp.sml (BTrace tracing and report
745                module)
746    
747    CM manual: * new path encoding documented
748               * description of setup-parameter to "sml" added
749    
750    The biggest user-visible change to back-tracing is that it is no
751    longer necessary to compile all traced modules within the same
752    session.  (This was a real limitation.)
753    
754    ----------------------------------------------------------------------
755    Name: Matthias Blume
756    Date: 2000/06/24 12:40:00 JST
757    Tag: blume-20000624-startup
758    Description:
759    
760    Fixes startup slowdown problem.  (I was calling SrcPath.sync a _tad_
761    bit too often -- to put it mildly. :)
762    
763    ----------------------------------------------------------------------
764    Name: Matthias Blume
765    Date: 2000/06/23 18:20:00 JST
766    Tag: blume-20000623-btrace
767    Description:
768    
769    This updates adds a backtrace facility to aid programmers in debugging
770    their programs.  This involves the following changes:
771    
772    1. Module system/smlnj/init/core.sml (structure _Core) now has hooks for
773       keeping track of the current call stack.  When programs are compiled
774       in a special mode, the compiler will insert calls to these hooks
775       into the user program.
776       "Hook" means that it is possible for different implementations of
777       back-tracing to register themselves (at different times).
778    
779    2. compiler/MiscUtil/profile/btrace.sml implements the annotation phase
780       as an Absyn.dec->Absyn.dec rewrite.  Normally this phase is turned off.
781       It can be turned on using this call:
782         SMLofNJ.Internals.BTrace.mode (SOME true);
783       Turning it off again:
784         SMLofNJ.Internals.BTrace.mode (SOME false);
785       Querying the current status:
786         SMLofNJ.Internals.BTrace.mode NONE;
787       Annotated programs are about twice as big as normal ones, and they
788       run a factor of 2 to 4 slower with a dummy back-trace plugin (one
789       where all hooks do nothing).  The slowdown with a plugin that is
790       actually useful (such as the one supplied by default) is even greater,
791       but in the case of the default plugin it is still only an constant
792       factor (amortized).
793    
794    3. system/Basis/Implementation/NJ/internals.{sig,sml} have been augmented
795       with a sub-structure BTrace for controlling back-tracing.  In particular,
796       the above-mentioned function "mode" controls whether the annotation
797       phase is invoked by the compiler.  Another important function is
798       "trigger": when called it aborts the current execution and causes
799       the top-level loop to print a full back-trace.
800    
801    4. compiler/MiscUtil/profile/btimp.sml is the current default plugin
802       for back-tracing.  It keeps track of the dynamic call stack and in
803       addition to that it keeps a partial history at each "level" of that
804       stack.  For example, if a tail-calls b, b tail-calls c, and c tail-calls
805       d and b (at separate times, dynamically), then the report will show:
806    
807       GOTO   d
808             /c
809       GOTO  \b
810       CALL   a
811    
812       This shows that there was an initial non-tail call of a, then a
813       tail-call to b or c, looping behavior in a cluster of functions that
814       consist of b and c, and then a goto from that cluster (i.e., either from
815       b or from c) to d.
816    
817       Note that (depending on the user program) the amount of information
818       that the back-trace module has to keep track of at each level is bounded
819       by a constant.  Thus, the whole implementation has the same asymptotical
820       complexity as the original program (both in space and in time).
821    
822    5. compiler/TopLevel/interact/evalloop.sml has been modified to
823       handle the special exception SMLofNJ.Internals.BTrace.BTrace
824       which is raised by the "trigger" function mentioned above.
825    
826    Notes on usage:
827    
828    - Annotated code works well together with unannotated code:
829    Unannotated calls simply do not show up at all in the backtrace.
830    
831    - It is not a good idea to let modules that were annotated during
832    different sessions run at the same time.  This is because the compiler
833    chooses small integers to identify individual functions, and there
834    will be clashes if different modules were compiled in separate sessions.
835    (Nothing will crash, and you will even be told about the clashes, but
836    back-trace information will in general not be useful.)
837    
838    - Back-tracing can be confused by callcc and capture.
839    
840    - The only way of getting a back-trace right now is to explicitly
841    invoke the "trigger" function from your user program.  Eventually, we
842    should make every exception carry back-trace information (if
843    available).  But since this creates more overhead at "raise"-time
844    (similar to the current exnHistory overhead), I have not yet
845    implemented this.  (The implementation will be rather easy.)  With
846    exceptions carrying back-trace information, this facility will be even
847    more useful because users don't need to modify their programs...
848    
849    - While it is possible to compile the compiler with back-trace
850    annotations turned on (I did it to get some confidence in
851    correctness), you must make absolutely sure that core.sml and
852    btimp.sml are compiled WITHOUT annotation!  (core.sml cannot actually
853    be compiled with annotation because there is no core access yet, but
854    if you compile btimp.sml with annotation, then the system will go into
855    an infinite recursion and crash.)
856    Since CM currently does not know about BTrace, the only way to turn
857    annotations on and off for different modules of the compiler is to
858    interrupt CMB.make, change the settings, and re-invoke it.  Of course,
859    this is awkward and clumsy.
860    
861    Sample sessions:
862    
863    Standard ML of New Jersey v110.28.1 [FLINT v1.5], June 5, 2000
864    - SMLofNJ.Internals.BTrace.mode (SOME true);
865    [autoloading]
866    [autoloading done]
867    val it = false : bool
868    - structure X = struct
869    -     fun main n = let
870    -         fun a (x, 0) = d x
871    -           | a (x, n) = b (x, n - 1)
872    -         and b (x, n) = c (x, n)
873    -         and c (x, n) = a (x, n)
874    -         and d x = e (x, 3)
875    -         and e (x, 0) = f x
876    -           | e (x, n) = e (x, n - 1)
877    -         and f 0 = SMLofNJ.Internals.BTrace.trigger ()
878    -           | f n = n * g (n - 1)
879    -         and g n = a (n, 3)
880    -     in
881    -         f n
882    -     end
883    - end;
884    structure X : sig val main : int -> int end
885    - X.main 3;
886    *** BACK-TRACE ***
887    GOTO   stdIn:4.2-13.20: X.main[2].f
888    GOTO-( stdIn:4.2-13.20: X.main[2].e
889    GOTO   stdIn:4.2-13.20: X.main[2].d
890         / stdIn:4.2-13.20: X.main[2].a
891         | stdIn:4.2-13.20: X.main[2].b
892    GOTO-\ stdIn:4.2-13.20: X.main[2].c
893    CALL   stdIn:4.2-13.20: X.main[2].g
894    GOTO   stdIn:4.2-13.20: X.main[2].f
895    GOTO-( stdIn:4.2-13.20: X.main[2].e
896    GOTO   stdIn:4.2-13.20: X.main[2].d
897         / stdIn:4.2-13.20: X.main[2].a
898         | stdIn:4.2-13.20: X.main[2].b
899    GOTO-\ stdIn:4.2-13.20: X.main[2].c
900    CALL   stdIn:4.2-13.20: X.main[2].g
901    GOTO   stdIn:4.2-13.20: X.main[2].f
902    GOTO-( stdIn:4.2-13.20: X.main[2].e
903    GOTO   stdIn:4.2-13.20: X.main[2].d
904         / stdIn:4.2-13.20: X.main[2].a
905         | stdIn:4.2-13.20: X.main[2].b
906    GOTO-\ stdIn:4.2-13.20: X.main[2].c
907    CALL   stdIn:4.2-13.20: X.main[2].g
908    GOTO   stdIn:4.2-13.20: X.main[2].f
909    CALL   stdIn:2.15-17.4: X.main[2]
910    -
911    
912    (Note that because of a FLINt bug the above code currently does not
913    compile without BTrace turned on.)
914    
915    Here is another example, using my modified Tiger compiler:
916    
917    Standard ML of New Jersey v110.28.1 [FLINT v1.5], June 5, 2000
918    - SMLofNJ.Internals.BTrace.mode (SOME true);
919    [autoloading]
920    [autoloading done]
921    val it = false : bool
922    - CM.make "sources.cm";
923    [autoloading]
924    ...
925    [autoloading done]
926    [scanning sources.cm]
927    [parsing (sources.cm):parse.sml]
928    [creating directory CM/SKEL ...]
929    [parsing (sources.cm):tiger.lex.sml]
930    ...
931    [wrote CM/sparc-unix/semant.sml]
932    [compiling (sources.cm):main.sml]
933    [wrote CM/sparc-unix/main.sml]
934    [New bindings added.]
935    val it = true : bool
936    - Main.compile ("../testcases/merge.tig", "foo.out");
937    *** BACK-TRACE ***
938    CALL   lib/semant.sml:99.2-396.21: SemantFun[2].transExp.trvar
939    CALL   lib/semant.sml:99.2-396.21: SemantFun[2].transExp.trexp
940    CALL   lib/semant.sml:289.3-295.22: SemantFun[2].transExp.trexp.check[2]
941    GOTO   lib/semant.sml:289.3-295.22: SemantFun[2].transExp.trexp.check[2]
942    CALL   lib/semant.sml:99.2-396.21: SemantFun[2].transExp.trexp
943    CALL   lib/semant.sml:99.2-396.21: SemantFun[2].transExp.trexp
944    CALL   lib/semant.sml:488.3-505.6: SemantFun[2].transDec.trdec[2].transBody[2]
945         / lib/semant.sml:411.65-543.8: SemantFun[2].transDec
946    CALL-\ lib/semant.sml:413.2-540.9: SemantFun[2].transDec.trdec[2]
947    CALL   lib/semant.sml:99.2-396.21: SemantFun[2].transExp.trexp
948    CALL   lib/semant.sml:8.52-558.4: SemantFun[2].transProg[2]
949    CALL   main.sml:1.18-118.4: Main.compile[2]
950    -
951    
952    ----------------------------------------------------------------------
953    Name: Matthias Blumen
954    Date: 2000/06/21 18:00:00 JST
955    Tag: blume-20000621-manual
956    Description:
957    
958    CM manual update: Path environments documented.
959    
960    ----------------------------------------------------------------------
961    Name: Matthias Blume
962    Date: 2000/06/19 13:40:00
963    Tag: blume-20000619-manual
964    Description:
965    
966    CM manual and system/README update.  This only covers the fact that
967    there are no more implicit anchors.  (Path environments and the "bind"
968    option to "cm" have yet to be documented.)
969    
970    ----------------------------------------------------------------------
971    Name: Matthias Blume
972  Date: 2000/06/19 11:05:00 JST  Date: 2000/06/19 11:05:00 JST
973  Tag: blume-20000619-chdir-bugfix  Tag: blume-20000619-chdir-bugfix
974  Description:  Description:

Legend:
Removed from v.671  
changed lines
  Added in v.774

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0