Commit Graph

31 Commits

Author SHA1 Message Date
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
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
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
fce9c95a8c A bunch of changes resulting from work during the BSD/386 port.
imp.h, engine.mod, io_rt.mod:
	Reorder #include lines so that "regs.h" gets included
	before any of the system header files (other than <stddef.h>).
	This is necessary because on some systems, the system header files
	contain inline functions, and the global register variable
	declarations must precede these.

regs.h:
	Add case for i386, since global register variables now work
	on the 386 (the problem was just that we needed -fno-builtin).

label.c, wrapper.mod:
	Add #include of <string.h> for strcmp().
	(These missing #include were not previously noted because gcc has
	a builtin-declaration for strcmp() - it only caused a warning
	when I compiled with `-fno-builtin'.)

regorder.h:
	Change the register allocation order so that `sp' gets
	allocated first, since for the compiler, 36% of all Mercury
	register references are to `sp'.

memory.c:
	With `-dm', if we're using CONSERVATIVE_GC, don't output the
	size etc. for the heap, since they will all be zero - the
	heap gets allocated by the Boehm collector.
1995-09-03 15:22:49 +00:00
Fergus Henderson
906f6cfcfb Fix a silly bug (makelabel instead of make_label) that went
engine.mod:
	Fix a silly bug (makelabel instead of make_label) that went
	undetected until I compiled with -DDEBUG_LABELS.
1995-08-31 08:52:59 +00:00
Fergus Henderson
a38a078a88 Add a new option `-dt' for use with the modes that
runtime/{engine.h,engine.mod,memory.c,wrapper.mod}:
	Add a new option `-dt' for use with the modes that
	don't use gcc non-local gotos.  If this option is
	enabled, the runtime system will use the slow driver
	loop rather than the unrolled one, and if a seg fault
	occurs it will print out the last 40 locations.
	(This is most useful in combination with -DDEBUG_LABELS,
	otherwise you'll just get hex addresses.)
1995-08-24 06:37:55 +00:00
Zoltan Somogyi
332db2aa35 Set up the type of Word at configuration time.
conf.h.in:
	Set up the type of Word at configuration time.

imp.h:
	Changed definition of Word. Also gathered two of the three
	definitions of hash_string into one place, defining a macro
	for use by aux.c.

aux.c:
	Use the macro in imp.h for the body of hash_string.

engine.mod:
	Minor formatting change.
1995-07-12 15:16:43 +00:00
Fergus Henderson
63fa268e28 Call make_entry() macro rather than calling insert_entry()
runtime/engine.mod:
	Call make_entry() macro rather than calling insert_entry()
	directly, so that insert_entry() is not called by default.
1995-06-23 09:26:42 +00:00
Zoltan Somogyi
3c000fea2c Separated out the handwritten .c files from those generated from .mods.
Mmake:
	Separated out the handwritten .c files from those generated from .mods.
	Added a rule for invoking ctags.

engine.c:
	Remove the label do_reset_framevar0_fail, an anachronism. Some
	formatting changes.

io_rt.mod:
	Flush stdout when processing error/1.

memory.c:
	Print out the PC in the SIGBUS handler as well as the SIGSEGV handler.
	Some formatting changes.

stacks.h:
	Cast pointers to nondet frames to (Word *) before use. If they are
	stored in e.g.  detstackvars, their native type is just Word.

table.c:
	Strengthened debugging capability. A check for whether the hash value
	is within bounds is now turned on by default. Later we can turn it off
	again.

wrapper.mod:
	Changed initialization code to always allocate space for the label
	table, even if init_modules does not need to be called. This avoids
	a crash in some situations.
1995-06-14 07:26:24 +00:00
Fergus Henderson
1f703c989e Oops, fix a couple of compiler warnings caused by my previous change.
runtime/engine.mod:
	Oops, fix a couple of compiler warnings caused by my previous change.
1995-05-23 07:55:15 +00:00
Fergus Henderson
b249c3397c Add some debugging code to keep track of the last 40
runtime/engine.mod:
	Add some debugging code to keep track of the last 40
	locations jumped to in a circular buffer which can
	be examined in gdb after a seg fault, if we are not
	using non-local gotos.
	(This is the same sort of effect as running the program with
	-dg and piping the result into tail -40, except that it is
	orders of magnitude cheaper.)
1995-05-23 07:43:28 +00:00
Zoltan Somogyi
0f46c5d4e7 Merged in changes from the pass_str_branch. 1995-05-06 07:29:58 +00:00
Fergus Henderson
3fc5389b53 Add copyright notices.
runtime/*:
	Add copyright notices.
1995-03-30 21:57:11 +00:00
Peter Ross
b0edde4d3d Added an option to turn time and call profiling on seperately.
CFLAGSFILE:
	Added an option to turn time and call profiling on seperately.

imp.h:
	Added macro 'update_prof_current_proc'.  Also removed stack
	implementation of time profiling.

engine.mod:
	Added all the init and finish code for time profiling.

label.*:
	Changed option from USE_PROFILING to PROFILE_CALLS

prof.*:
	Added all the neccesary code to do time profiling.
1995-03-13 17:14:51 +00:00
Zoltan Somogyi
6c049a18f0 declared a standard system label do_last_succeed, which calls
engine:
	declared a standard system label do_last_succeed, which calls
	succeed_discard.

Cakefile:
	removed ./ from in front of the call to mod2c.
1995-03-07 06:21:47 +00:00
Peter Ross
c94a851582 Redefined the tailcall macro's to include the Caller address for
imp.h:
	Redefined the tailcall macro's to include the Caller address for
	profiling, and to call the profile function.

*.mod:
	Changed all the handwritten tailcall's to conform to the new tailcall.
	Need to add makelocalentry macro so that I can save all the handwritten
	label names and they can be looked up by mprof.

prof.*:
	Added some more comment's.
1995-02-28 04:32:32 +00:00
Fergus Henderson
5835cddc6a Cakefile dummy.c dummy.h engine.h engine.mod imp.h io.mod label.h wrapper.mod:
Make various changes required for using assembler labels.
1995-02-26 13:52:58 +00:00
Thomas Conway
90ce96d31f add a new debugging option: -dr which writes the values of
various:
	add a new debugging option: -dr which writes the values of
	the first 8 registers immediately after each goto.
1995-02-12 10:40:27 +00:00
Fergus Henderson
d45f5c6aec Add a new compilation flag -DDEBUG_GOTOS for use in combination
engine.mod label.h imp.h:
	Add a new compilation flag -DDEBUG_GOTOS for use in combination
	with -DSPEED for minimal debugging.
1995-02-08 06:30:52 +00:00
Peter Ross
a05ed0ae3f Included prof.c and prof.h in the compile
Cakefile :
	Included prof.c and prof.h in the compile

CFLAGSFILE:
	Added the USE_PROFILING flag.

engine.mod:
	Added calls so that all the profiling info is dumped to a file

prof.*:
	Added some comments.

imp.h:
	Modified the call and localcall macros so that they save the
	callee-caller address pair if USE_PROFILING defined.

*.mod:
	Added the extra argument to all calls and local calls for the
	handwritten mod files.
1995-02-08 05:19:19 +00:00
Thomas Conway
f25ceb6faf Make the virtual machine registers map to an array of Words rather
*.h. memory.c:
	Make the virtual machine registers map to an array of Words rather
	than to descrete variables.

misc:
	Related changes.
1995-01-30 06:32:49 +00:00
Zoltan Somogyi
14180be18f Eliminated last traces of mkreclaim.
Removed id string from nondet stack frames if SPEED is defined.
1994-10-04 07:00:07 +00:00
Zoltan Somogyi
af68e1e7c9 made the system compile with only one (unavoidable) warning 1994-08-15 07:15:27 +00:00
Zoltan Somogyi
7e1123553a Reorganized header files: each system module now has its own header file.
Some of these are included in imp.h, some aren't; the criterion is whether
automatically generated modules need the information in them.

Created a system whereby Mercury programs can be automatically compiled.

One part is the Mercury cakefile in examples (and the Cakefile that uses it),
which defines two targets for each Mercury program. These are e.g. nrev_fast
and nrev_debug for nrev.nl. As usual with System, the file Conf has one
line for each program in the directory; the file Entry likewise contains
the default entry point. Mod2init now inserts the default entry point
into the xxx_init.c file, and test_harness picks it up from there.

The other part is the creation and installation of the files and tools
referred to by the Mercury cakefile. These include scripts in /usr/contrib/bin,
the system modules in /usr/contrib/lib/mercury/modules, the system header
files in /usr/contrib/lib/mercury/inc, and two libraries, lib{fast,debug}mer.a
in each of /usr/contrib/lib/mercury/{sun4,sgi}.
1994-07-12 10:41:11 +00:00
Zoltan Somogyi
e69f910283 The various memory areas are now allocated dynamically, and one can
specify their sizes on the comand line.

The layout of the memory areas is optimized for reducing conflicts
in primary caches. Any mrXY that are not real registers are #defined
to unreal_reg_XY. Unfortunately, one cannot control the layout of
these variables wrt the cache. #defining excess mrXY as unreal_regs[XY]
avoids conflicts but nevertheless slows down access considerably
due to the longer instruction sequences required.

On SVR4 machines, we now set up a redzone at the end of each area.
The sizes of these areas are configurable by options.

Labels used to be stored in a fixed-size table with linear search.
They are now stored in two hash tables, which can be lookup up
either by address or by name.

The timimg package now counts time in milliseconds and not microseconds,
thus allowing longer runs without overflow.
1994-07-10 11:41:45 +00:00
Zoltan Somogyi
609f01f95d Added files for evaluating general middle recursion optimization 1994-03-14 02:36:35 +00:00
Zoltan Somogyi
5fc2d2cad2 removed colors files, which were obsolete
made childfr be only a local variable inside macros
made calls to get_run_time governed by the OWNTIMER flag
renamed tests to Sanity
removed some overheads from nrev benchmark
1993-12-31 10:11:19 +00:00
Zoltan Somogyi
058036588b updated macros to conform to paper 1993-12-13 11:41:02 +00:00
Zoltan Somogyi
d8db7692e4 interface somewhat tested 1993-12-02 06:59:32 +00:00
Zoltan Somogyi
b582deb6e8 rudimentary functions of the interface working 1993-12-02 05:17:20 +00:00
Fergus Henderson
bb08d04bca Split sys.mod into test_harness.mod and engine.mod.
Added startup.c as an extremely cut-down version of test_harness.mod.
1993-11-22 00:27:16 +00:00