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

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

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