Estimated hours taken: 0.01
Changed a call to solver_malloc to checked_malloc
mercury_solver_backtrack.h
Changed a call to solver_malloc() to checked_malloc(). That function
was renamed a while ago...
Estimated hours taken: 0.01
Changed path to the CLP(R) .h files.
mercury_solver_backtrack.h:
Changed the required location of the CLP(R) source to make things a
little easier to install.
Estimated hours taken: 0.5
runtime/wrapper.mod:
In mercury_main(), use `exit(mercury_exit_status)' rather than
`return mercury_exit_status'. This avoids problems with
returning to code that was compiled without global register
variables without restoring the values of those registers.
(It might be better to actually save/restore the registers,
but this change was simpler.)
Estimated hours taken: 0.75
runtime/machdeps/alpha_regs.h:
Use register $15 as a seventh global register.
This should improve performance slightly, but
the main reason for the change is that it may
avoid some problems with $15 being clobbered
due to cross-function jumps skipping the save
and restore of it in the function prologue/epilogue.
Estimated hours taken: 8
Added a new option, -L, for loading the label table at the start, and thus
being warned about duplicate labels then. (I thought this might be the
problem causing the segmentation violations described in Fergus's mail.)
Estimated hours taken: 0.5
wrapper.{h,mod}:
When reporting statistics, print the total time elapsed so far,
as well as the time elapsed since the last statistics.
memory.c:
When a stack or the heap overflows, print the value of the PC.
Estimated hours taken: 0.1
imp.h:
Put back the definitions of call_{det,semidet,nondet}_closure
until the code generation changes have been reflected in all
the installed compilers.
Estimated hours taken: 0.2
imp.h:
Removed the call_{det,semidet,nondet}_closure macros, since they are
not needed anymore.
solutions:
Use the new method of calling closures.
call.mod:
Cosmetic changes.
*/Mmake:
Make sure that the rules for `mmake clean' and `mmake realclean'
remove a few files that we'd missed.
Change the rules for making tags so that it uses the local
version of `mtags' (i.e. ../scripts/mtags) rather than the
installed one.
Estimated hours taken: 0.25
(Plus about 6-12 hours debugging via email, over the course of
a week, to find the problem.)
A fix for global register variables on the RS/6000.
runtime/machdeps/rs6000_regs.h:
Work around a bug in gcc for the rs6000: gcc 2.7.2 sometimes
saves/restores global register variables in function
prologue/epilogues, which causes havoc, and goes against what
the gcc documentation says. In particular, it save and restores
all the registers from the lowest-numbered call-saved register
used through to r31. The work-around is to use only the
lowest-numbered call-saved registers for global register variables.
(This fix is as yet untested.)
Estimated hours taken: 0.5
Add a global variable to hold the time recorded at the last call to
report_stats, and add code to initialize this variable by calling the
timer routine at startup,
{scripts,runtime}/Mmake:
Use `chmod u+w' rather than `chmod +w' on the installed files,
since `chmod +w' has the wrong effect with some versions of chmod.
When configure creates automatically-generated files, we do a
`chmod -w' on them to make sure that you don't accidentally edit
the automatically-generated file rather than the source `.in' file.
However, if the installed copies are write-only, then it causes
problems when installing a new copy on top of an old one.
Hence we turn write permission back on again on the installed copies.
The `chmod +w' command has the right effect on Solaris, OSF/1, and
SunOS, where it takes into account the umask. However, on IRIX and
ULTRIX, `chmod +w' does not take the umask into account, and so
makes the files world-writable, which is a security problem.
Hence, we now use `chmod u+w' instead.
Estimated hours taken: 0.05
Added mercury_solver_backtrack.h to the list of headers that get installed.
runtime/Mmake:
Added mercury_solver_backtrack.h to the list of headers that get
installed (so that *.cnstr grades work).
Estimated hours taken: 0.25
runtime/call.mod:
Change the names of internal labels so that mod2c recognizes
them as such, and doesn't think they are entry labels.
Estimated hours taken: 0.1
runtime/imp.h:
Fix a problem with the definition of float_to_word and word_to_float
for the case of USE_SINGLE_PREC_FLOAT; gcc didn't like the cast
from Integer to union FloatWord - it wanted a cast from Integer
to Word first.
Estimated hours taken: 0.1
runtime/heap.h:
Change the #include of gc_inl.h to include "gc_inl.h"
rather than "include/gc_inl.h", since when we install
it it isn't in an `include' subdirectory.
Estimated hours taken: 0.1
runtime/goto.h:
Fix typo in definition of JUMP() macro which broke grade `jump'.
(This bug was introduced in my changes for getting asm_fast
working on the Alpha.)
Estimated hours taken: 24
Add inline assembler hacks for restoring the $gp register on the alpha,
to make the `asm_fast.gc' grade work on the alpha.
runtime/goto.h:
For the alpha, change the GOTO macro so that it sets up
register $27 (the "procedure value" register) to contain the
address to which you are going to jump, and change the
Define_{entry,local,static} macros so that they have a `ldgp'
instruction after the label which restores the gp register from
$27.
runtime/call.mod:
For the alpha, change the call macro so that it uses a `ldgp'
instruction to restore the gp register on return from a call.
Add new call_localret macro, for the case when the continuation
label is a local label (this is like the inverse of the localcall
macro), because a call_localret is two instructions cheaper
than the equivalent call would be.
runtime/engine.mod:
In call_engine(), we need to use `Define_label(engine_done)'
rather than just `engine_done:', so that it works on the alpha.
These changes improve the speed of the compiler by about 21%,
and cut executable size by about 24%.
There's still a fair bit of room for improving efficiency by
avoiding moves to $27 and `ldgp' instructions in situations
where they aren't needed.
Estimated hours taken: 0.25
Fix a problem noticed by Andreas Kuehlmann.
runtime/{imp.h,aux.c}:
Define hash_string() as a function in aux.c unconditionally,
even if we're not using gcc. This avoids trouble when linking
programs compiled with cc with a runtime library that was
compiled with gcc.
Estimated hours taken: 0.25
runtime/regs.h:
Fix a portability problem which stopped things working on some
non-gcc compilers: if we're not compiling with gcc, don't
assume that the result of a conditional expression is an lvalue.
Estimated hours taken: 0.25
runtime/memory.c:
If mprotect() fails, just ignore it (after printing a warning,
if memdebug is set). Some systems (e.g. HPUX and AIX) have
an mprotect() which doesn't work, or only works for limited
purposes such as only on mmap()ed memory. For such systems,
we want to do the same thing as on systems which don't have
mprotect() at all, which is to not worry about it.
Estimated hours taken: 1 summer studentship
This is the implementation of the constraint solver interface runtime stuff.
We maintain a stack of tickets, accessible via mercury_solver_sp.
runtime/aux.[ch]
Introduce a new memory allocation function, checked_malloc(). This is
similar to newmem(), except that it always uses malloc(), not
GC_malloc(), regardless of the grade. This is useful when allocating
memory for the ticket stack as the garbage collector needn't know
about the ticket stack - it never contains pointers into gc'ed memory.
runtime/imp.h
Include mercury_solver_backtrack.h if we are in an appropriate grade.
runtime/wrapper.mod
Initialise the ticket stack, call the solver initialisation macro.
runtime/mercury_solver_backtrack.h
Implement the ticket macros, and the solver initialisation macro. This
file is currently specific to the CLP(R) solver; to interface to a
different solver, only the macros etc. in this file need be altered.
Estimated hours taken: 0.5
runtime/tags.h:
Use the value of LOW_TAG_BITS determined by configure as the
default value for TAGBITS (unless HIGHTAGS was defined).
Estimated hours taken: 1
imp.h, prof.h:
Fix the byzantine inclusion relationship between prof.h and imp.h.
prof.c:
Fix the hashing function for code addresses so that it doesn't waste
three quarters of the hash table.
In each hash slot, use a binary search tree instead of an unordered
list of entries. This can be expected to handle high loads better,
which is necessary because the hash table size is not adaptive.
(Making it adaptive would be a better fix.)
Instead of turning signals off and on in the handler of profiling
signals, simply set a volatile variable to detect cases when two
profiling signals arrive too closely.
Estimated hours taken: 1
library/io.m:
Moved the profiling initialisation code so that it sits around
the call to main/2(0). Thus the profiler will now begin all it's
profiles from main not from call_engine.
profiler/read.m:
The profiler now expects that it's address are written out in decimal.
read.m now assumes that an address is a decimal, but if it can't parse
it, it will then read it in as a hexadecimal. Thus the profiler will
still be able to read it's old files.
NB. A possible bug with this is that two numbers will get converted to
the same number if one is treated as hex and the other decimal.
profiler/.cvsignore:
Some more files to ignore.
runtime/{engine, wrapper}.mod:
Remove the profiling initialisation code.
runtime/imp.h:
Add a new call macro noprof_call() which doesn't record an arc
in the call graph for profiling ever. This is used to ignore some
of the initial system set-up calls.
runtime/prof.c:
Output integers instead of hexs for the addresses.
Estimated hours taken: 0.1
Recommit a change, since I accidentally committed the original
change on a branch version.
runtime/prof.c:
Fix race condition which resulted in profiled programs dying
with "Profiling Timer Expired". The fix was to use sigaction()
rather than signal() to install the handler, since signal()
sets the SA_RESETHAND option which causes system to reset
signal handler before entry to the handler. (Of course, this
is all inside #ifdef HAVE_SIGACTION...)
Estimated hours taken: 0.75
runtime/imp.h:
Fix a bug in the code for float_to_word() in non-gc grades:
the part which was supposed to ensure correct alignment
of floats allocated on the heap was not working correctly.