mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-14 13:23:53 +00:00
08a5f48e2c20f97c9964f26dd5fe7e7f6fe74f91
Estimated hours taken: _____ Take the code generator a big step closer to notes/ALLOCATION. The new code generator emits code that is smaller and faster than the code we used to emit. Nondet liveness is no longer used; nondet live sets are always empty. In code that was being modified anyway, remove its handling. Other uses will be removed later (this keeps this change from being far too big; as it is it is merely too big). Similarly for cont-lives. In several places, clarify the code that gathers several code pieces together. call_gen: Unset the failure continuation and flush the resume vars to their stack slots before nondet calls. Move the code that decides whether a nondet call can be a tailcall to code_info. code_aux: Remove the code to handle resume points, since these are now handled in the specific constructs that need them. Replace it with a sanity check. code_exprn: Add a predicate to place multiple vars. code_gen: Remove the predicate code_gen__generate_forced_goal, since it packaged together some operations that should be executed at different times. Don't unset the failure continuation after every nondet goal; this is now done in the constructs that need it. Modify the handling of negation to use resume point info according to notes/ALLOCATION. Remove the predicate code_gen__ensure_vars_are_saved which was use to save all lives variables to the stack before nondet disjunctions and if-then-elses; we don't do that anymore. code_info: Significantly simplify and document the handling of failure continuations, and make the types involved abstract types. Factor out common code in the handling of det and semi commits. Keep track of "zombies", variables that are dead wrt forward execution but whose values we need because they may be needed at a resume point we can reach. Remove several now unneeded predicates, and introduce new predicates to help other modules. code_util: Add a couple of predicates to check whether ia goal cannot fail before flushing all variables to the stack, and whether a goal cannot flush any variables to the stack. These are used in liveness to decide which entry labels will be needed at resume points. disj_gen: Unify the handling of det and semi disjunctions. Model the code handling of nondet disjunctions on the code handling pruned disjunctions. It is possible that the handling of nondet and pruned disjunctions can also be unified; the new code should make this significantly easier. Make the code conform to notes/ALLOCATION. This means saving only the variables mentioned in the resume_point field, not flushing all live variables to the stack at the start of a nondet disjunction, handling zombies, and using the new method of flushing variables at the ends of branched structures. ite_gen: Unify the handling of det and semi if-then-elses. Model the code handling of nondet if-then-elses on the code handling det/semi if-then-elses. It is possible that the handling of nondet and pruned if-then-elses can also be unified; the new code should make this significantly easier. Make the code conform to notes/ALLOCATION. This means saving only the variables mentioned in the resume_point field, not flushing all live variables to the stack at the start of a nondet if-then-else, handling zombies, and using the new method of flushing variables at the ends of branched structures. Apply the new rules about liveness in if-then-elses, which say that the else part is parallel not to the then part but to the conjunction of the condition and the then part. dense_switch, lookup_switch, string_switch, switch_gen, tag_switch, middle_rec: Use the new method of flushing variables at the ends of branched structures. Don't call remake_with_store map; switch_gen will do so. Fix an old bug in lookup_switch. The code in switch_gen which looked for the special case of a two-way switch used to use a heuristic to decide which one was recursive and which one was a base case. We now check the codes of the cases. hlds_goal: Adjust the structure of the resume_point field to make it easier to use. Add a more convenient access predicate. hlds_out: Don't print the nondet liveness and cont live fields, since they are not used anymore. Comment out the printing of the context field, which is rarely useful. Modify the printing of the resume_point field to conform to its new definition. live_vars: Use the resume_point field, not the nondetlives field, to decide which variables may be needed on backward execution. Remove some code copied from liveness.m. liveness: Put the several pieces of information we thread through the traversal predicates into a single tuple. Don't put variables which are local to one branch of a branched structure into the post-birth sets of other branches. Apply the new rules about liveness in if-then-elses, which say that the else part is parallel not to the then part but to the conjunction of the condition and the then part. Variables that are needed in the else part but not in the condition or the then part now die in at the start of the condition (they will be protected by the resume point on the condition). We now treat pruned and non-pruned disjunctions the same way wrt deadness; the old way was too conservative (it had to be). We still mishandle branches which produce some variables but can't succeed. mercury_compile: Liveness now prints its own progress message with -V; support this. store_alloc: When figuring out what variables need to be saved across calls, make sure that we put in interference arcs between those variables and those that are required by enclosing resume points. Don't compute cont-lives, since they are not used anymore. livemap: Fix the starting comment.
…
…
…
…
…
This directory contains the source distribution for the University of Melbourne Mercury compiler, version 0.6. The Mercury implementation is free software, but it is Copyright (C) 1994-1996 The University of Melbourne. It is distributed under the terms of the GNU General Public License. See the file COPYING for copying permission. The Mercury library and runtime (the files in the library and runtime subdirectories) are distributed under the terms of the GNU Library General Public License. See the file COPYING.LIB for copying permissions for those files. (If those licencing arrangements are not satisfactory, please contact us! We are willing to offer alternative arrangements, if the need should arise.) The subdirectory `boehm_gc' contains a conservative garbage collector distributed by Hans Boehm - see the file README in that directory for copyright information about those files. A few files (config*, runtime/timing.c) are derived from code that is copyright by the Free Software Foundation, Inc. The program `texi2html' in the doc directory is copyright by CERN; see the copyright notice at the end of that file. THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK. See the file COPYING. See the file INSTALL for installation instructions. But first read README.IRIX-5, README.AIX, or README.BSDI if you are installing on a machine running IRIX 5, AIX, or BSD Unix. The documentation sources are in the `doc' subdirectory. The installation process will install INFO, HTML, and DVI versions in the locations specified in the file Mmake.common - by default these locations are /usr/local/mercury-0.6/info, /usr/local/mercury-0.6/lib/mercury/html, and /usr/local/mercury-0.6/lib/mercury/doc respectively. The files RELEASE_NOTES, NEWS, HISTORY, LIMITATIONS, and BUGS also contain useful information. If you're interested in looking at the source code, the file compiler/notes/COMPILER_DESIGN is a good place to start. For more information about Mercury, see the Mercury WWW home page at http://www.cs.mu.oz.au/mercury, or send mail to mercury@cs.mu.oz.au. If you would like to join the Mercury mailing lists (there are two, mercury-users for general discussion, and mercury-announce for announcements), send mail to mercury@cs.mu.oz.au. Please send bug reports, enhancement requests, suggestions for improvements, and any other feedback to mercury-bugs@cs.mu.oz.au or mercury@cs.mu.oz.au. If you find something you don't like, please tell us. If you find something you do like, please tell the world! The Mercury distribution is available via anonymous ftp or WWW from the following locations: Australia: ftp://turiel.cs.mu.oz.au/pub/mercury USA: ftp://ftp.cs.sunysb.edu/pub/XSB/mercury Europe: ftp://ftp.csd.uu.se/pub/Mercury
Languages
Mercury
85.3%
C
8.7%
Shell
1.4%
Makefile
1%
JavaScript
1%
Other
2.1%