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

Legend:
Removed from v.673  
changed lines
  Added in v.758

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