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

Legend:
Removed from v.672  
changed lines
  Added in v.744

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