Commit Graph

387 Commits

Author SHA1 Message Date
David Jeffery
0763735ac7 Changed a call to solver_malloc to checked_malloc
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...
1996-05-08 13:11:24 +00:00
David Jeffery
f24fd28604 Changed path to the CLP(R) .h files.
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.
1996-05-08 10:57:48 +00:00
Fergus Henderson
263bd2f25b Add stuff from the gcc source code, as documentation of the
Estimated hours taken: 0.1

runtime/machdeps/RS6000_REGS:
	Add stuff from the gcc source code, as documentation of the
	registers used for RS/6000.
1996-05-02 16:35:18 +00:00
Fergus Henderson
771b7a76f3 In mercury_main(), use `exit(mercury_exit_status)' rather than
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.)
1996-04-30 21:29:00 +00:00
Fergus Henderson
92bcc02ec3 Use register $15 as a seventh global register.
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.
1996-04-30 18:16:01 +00:00
Fergus Henderson
7aeaefab4a Add missing #include "dummy.h", which is needed for grade `debug'.
Estimated hours taken: 0.1

runtime/wrapper.mod:
	Add missing #include "dummy.h", which is needed for grade `debug'.
1996-04-30 14:56:04 +00:00
Fergus Henderson
d5380f9345 Fix a small scoping error which broke grade `debug'.
Estimated hours taken: 0.1

runtime/engine.mod:
	Fix a small scoping error which broke grade `debug'.
1996-04-30 14:54:56 +00:00
Zoltan Somogyi
3a95b81f0a Added a new option, -L, for loading the label table at the start, and thus
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.)
1996-04-28 07:27:48 +00:00
Zoltan Somogyi
573e515784 When reporting statistics, print the total time elapsed so far,
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.
1996-04-27 04:23:52 +00:00
Fergus Henderson
5c1cddc7da Ensure that `mmake' doesn't remove the .c files.
Estimated hours taken: 0.1

runtime/Mmake:
	Ensure that `mmake' doesn't remove the .c files.
1996-04-25 03:50:13 +00:00
Zoltan Somogyi
853c33fbf4 Put back the definitions of call_{det,semidet,nondet}_closure
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.
1996-04-24 10:02:52 +00:00
Zoltan Somogyi
b95bedb1f3 Removed the call_{det,semidet,nondet}_closure macros, since they are
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.
1996-04-24 09:01:13 +00:00
Zoltan Somogyi
eebd0e7f01 Formatting change.
Estimated hours taken: 0.2

memory.c:
	Formatting change.
1996-04-24 01:03:12 +00:00
Fergus Henderson
003df106c3 Make sure that the rules for mmake clean' and mmake realclean'
*/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.
1996-04-23 18:30:39 +00:00
Fergus Henderson
6eb8e3c677 Fix a bug: my changes for grade asm_fast on the Alpha broke grade jump.
Estimated hours taken: 0.5

runtime/goto.h:
	Fix a bug: my changes for grade asm_fast on the Alpha broke grade jump.
1996-04-21 19:56:34 +00:00
Zoltan Somogyi
692af222be Work around a problem with []s in m4.
Estimated hours taken: 0.2

Work around a problem with []s in m4.
1996-04-20 09:06:40 +00:00
Zoltan Somogyi
69d4a1b072 Change the method of access to the PC at signals to allow it to work
Estimated hours taken: 0.2

memory.c, conf.h.in:
	Change the method of access to the PC at signals to allow it to work
	on Alphas.
1996-04-20 08:39:17 +00:00
Fergus Henderson
a6f378ad95 A fix for global register variables on the RS/6000.
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.)
1996-04-17 20:48:28 +00:00
Zoltan Somogyi
a1fd3093d9 Add a global variable to hold the time recorded at the last call to
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,
1996-04-16 06:10:09 +00:00
Fergus Henderson
cd61687c3a Fix a wrong #ifdef: the printregs() etc. routines are needed if
Estimated hours taken: 0.25

runtime/aux.c:
	Fix a wrong #ifdef: the printregs() etc. routines are needed if
	DEBUG_GOTOS is defined.
1996-04-15 07:46:43 +00:00
Fergus Henderson
aac93ced80 For RS/6000, we need to check for #ifdef _POWER, not
Estimated hours taken: 0.25

runtime/regs.h:
	For RS/6000, we need to check for #ifdef _POWER, not
	#ifdef __RS6000.
1996-04-10 15:34:25 +00:00
Fergus Henderson
cde62cd13f Enable the use of gcc global registers on RS/6000.
Estimated hours taken: 0.1

runtime/regs.h:
	Enable the use of gcc global registers on RS/6000.
	(Not tested yet, but to be tested shortly.)
1996-04-10 14:32:35 +00:00
Fergus Henderson
da812ec3c1 Fix a security problem with the use of `chmod +w'.
{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.
1996-04-10 09:26:18 +00:00
David Jeffery
e7db070c4f Added mercury_solver_backtrack.h to the list of headers that get installed.
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).
1996-04-10 07:21:01 +00:00
Fergus Henderson
e12543dd38 Add dependencies and `mmake clean' rule for *.pic_o files.
Estimated hours taken: 0.1

runtime/Mmake:
	Add dependencies and `mmake clean' rule for *.pic_o files.
1996-04-07 17:52:00 +00:00
Fergus Henderson
0b45949b04 Fix a bug in the definition of float_const for the
Estimated hours taken: 0.25

runtime/imp.h:
	Fix a bug in the definition of float_const for the
	USE_SINGLE_PREC_FLOAT case.
1996-04-06 22:05:21 +00:00
Fergus Henderson
ce26b8339f Change the names of internal labels so that mod2c recognizes
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.
1996-04-06 22:04:13 +00:00
Fergus Henderson
e343cf50f0 Suppress a warning about no previous declaration for
Estimated hours taken: 0.1

runtime/imp.h:
	Suppress a warning about no previous declaration for
	hash_string() in aux.c.
1996-04-06 21:06:30 +00:00
Fergus Henderson
62d6d7ca50 Fix a problem with the definition of float_to_word and word_to_float
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.
1996-04-06 17:31:52 +00:00
Fergus Henderson
8ddaa8939c Add rs6000_regs.h to the list of MACHHDRS.
Estimated hours taken: 0.1

runtime/Mmake:
	Add rs6000_regs.h to the list of MACHHDRS.
1996-04-06 16:56:52 +00:00
Fergus Henderson
238c1a1e98 Change the #include of gc_inl.h to include "gc_inl.h"
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.
1996-04-06 16:54:51 +00:00
Fergus Henderson
c2944fb6f2 Fix typo in definition of JUMP() macro which broke grade `jump'.
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.)
1996-04-06 14:45:54 +00:00
Fergus Henderson
129133d751 `mmake realclean' should remove libmer.a and libmer.so.
Estimated hours taken: 0.1

runtime/Mmake:
	`mmake realclean' should remove libmer.a and libmer.so.
1996-04-03 16:22:45 +00:00
Fergus Henderson
913cda0f4a Add inline assembler hacks for restoring the $gp register 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.
1996-04-01 19:03:47 +00:00
Fergus Henderson
06d359d2d2 Fix a problem noticed by Andreas Kuehlmann.
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.
1996-04-01 18:46:53 +00:00
Fergus Henderson
05c8f2a702 Add GNU C global register declarations for RS/6000.
Estimated hours taken: 0.75

runtime/machdeps/rs6000_regs.h:
	Add GNU C global register declarations for RS/6000.
	Untested.
1996-03-30 09:33:01 +00:00
Fergus Henderson
ac8c719bbe Fix a missing cast warning for the non-gcc version of hash_string().
Estimated hours taken: 0.25

runtime/{imp.h,aux.c}:
	Fix a missing cast warning for the non-gcc version of hash_string().
1996-03-30 09:30:18 +00:00
Fergus Henderson
4ef34321fa Fix a portability problem which stopped things working on some
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.
1996-03-30 09:29:22 +00:00
Fergus Henderson
2e27b97d95 Change -I $(RUNTIME_DIR)' to -I$(RUNTIME_DIR)', since some
Estimated hours taken: 0.1

runtime/Mmake:
	Change `-I $(RUNTIME_DIR)' to `-I$(RUNTIME_DIR)', since some
	C compilers don't allow a space after `-I'.
1996-03-29 16:31:12 +00:00
Fergus Henderson
db0b1abce2 If mprotect() fails, just ignore it (after printing a warning,
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.
1996-03-29 16:25:17 +00:00
David Jeffery
4b58650200 Mercurial Constraints II (the plot thickens)
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.
1996-03-26 16:54:51 +00:00
Fergus Henderson
076c7a258e Use the value of LOW_TAG_BITS determined by configure as the
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).
1996-03-25 12:00:07 +00:00
Zoltan Somogyi
fe2eb0323a Fix the byzantine inclusion relationship between prof.h and imp.h.
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.
1996-03-24 06:40:57 +00:00
Peter Ross
acb95582e5 Moved the profiling initialisation code so that it sits around
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.
1996-03-21 12:00:10 +00:00
Fergus Henderson
88f788f5fe Recommit a change, since I accidentally committed the original
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...)
1996-03-21 07:23:50 +00:00
Fergus Henderson
300df90c9a Fix a bug in the code for float_to_word() in non-gc grades:
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.
1996-03-19 09:14:24 +00:00
Fergus Henderson
978f2df55d Eliminate a -Wmissing-prototypes warning.
Estimated hours taken: 0.1

runtime/goto.h:
	Eliminate a -Wmissing-prototypes warning.
1996-03-17 04:40:59 +00:00
Fergus Henderson
9cd5277cba If grade is *.gc.prof, link with -lgc_prof' / libgc_prof.a',
*/Mmake:
	If grade is *.gc.prof, link with `-lgc_prof' / `libgc_prof.a',
	not `-lgc' / `libgc.a'.
1996-03-08 17:16:33 +00:00
Fergus Henderson
f0b04dee17 Fix recently introduced bug which meant it didn't compile
Estimated hours taken: 0.1

runtime/goto.h:
	Fix recently introduced bug which meant it didn't compile
	without -DUSE_GCC_NONLOCAL_GOTOS.
1996-03-05 15:00:53 +00:00
Fergus Henderson
8ca6a23297 Add an extra declaration to suppress a gcc -Wmissing-decls
Estimated hours taken: 0.1

runtime/goto.h:
	Add an extra declaration to suppress a gcc -Wmissing-decls
	warning when --split-c-files is used.
1996-03-05 03:59:27 +00:00