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

SCM Repository

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

Diff of /sml/trunk/HISTORY

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

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

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

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