Commit Graph

56 Commits

Author SHA1 Message Date
Peter Ross
a019dd4f6a Changes to reflect that body is now a binop.
Estimated hours taken: 0.1

disasm.c:
    Changes to reflect that body is now a binop.
2000-10-09 08:30:53 +00:00
Fergus Henderson
d7ed113ec6 Support installing both .par' and non-.par' versions of the GC library.
Estimated hours taken: 3

Support installing both `.par' and non-`.par' versions of the GC library.

scripts/ml.in:
	Change the code for computing which version of the GC library
	to link in so that it also takes the `.par' grade component
	into account, rather than just the `.prof' grade component.
	Add new options `--print-gc-grade' (for use by the top-level
	Mmakefile) and `--print-grade' (for symmetry).

Mmakefile:
	When invoking sub-makes in the boehm_gc directory,
	pass down GC_GRADE instead of PROF.
	Compute the GC_GRADE value using `scripts/ml ... --print-gc-grade`
	rather than computing it manually, since this avoids code duplication.

boehm_gc/Mmakefile:
boehm_gc/Makefile:
boehm_gc/NT_MAKEFILE:
	s/gc$(PROF)/$(GC_GRADE)/g

runtime/Mmakefile:
trace/Mmakefile:
browser/Mmakefile:
bytecode/Mmakefile:
library/Mmakefile:
compiler/Mmakefile:
profiler/Mmakefile:
	Change the code for computing which version of the GC library
	to link in so that it also takes the `.par' grade component
	into account, rather than just the `.prof' grade component.
2000-08-17 05:31:11 +00:00
Fergus Henderson
98b0afa001 Use clean_local' instead of clean' and `realclean_local' instead
Estimated hours taken: 0.75

Mmakefile:
*/Mmakefile:
*/*/Mmakefile:
*/*/*/Mmakefile:
	Use `clean_local' instead of `clean' and `realclean_local' instead
	of `realclean' where appropriate.  This is necessary now that
	`realclean' does not depend on `clean'.
1999-09-16 04:46:31 +00:00
Fergus Henderson
68d2f1c727 Simplify the Mmakefiles. Fix a few minor latent bugs.
Estimated hours taken: 2

Simplify the Mmakefiles.  Fix a few minor latent bugs.

*/Mmakefile:
	- Factor out some common code by defining a new variable M_ENV
	  which holds settings of environment variables for mmc, mgnuc, etc.
	- For consistency, always override MERCURY_C_ALL_INCL_DIRS rather
	  than passing extra `-I' options to mgnuc.
	- Make sure to always include `$(BOEHM_GC)/include' in the search path,
	  so that it will work if we try to compile with `-O6'.
	- Make sure to always include `--cflags $(ALL_CFLAGS)' in MCS, so
	  that the EXTRA_CFLAGS etc. will get passed down to gcc via mmc.
	- Make sure that the Mmakefiles in all directories set
	  all the MC* variables: MCPI, MCSI, MCOI, MCTOI, etc.
1999-04-08 12:58:17 +00:00
Fergus Henderson
2873b00e76 Fix a bug that broke grades `*.gc.prof.tr'.
Estimated hours taken: 0.25

Fix a bug that broke grades `*.gc.prof.tr'.
(This change was previously applied to the Mmakefiles
in the runtime, library, compiler, and profiler directories,
but I missed the `bytecode' directory.)

bytecode/Mmakefile:
	When deciding whether to link with -lgc or -lgc_prof,
	match against `*.gc*.prof*' rather than `*.gc*.prof'.
				 ^
1998-01-29 13:56:22 +00:00
Fergus Henderson
04b720630b Update the copyright messages so that (a) they contain the correct years
and (b) they say "Copyright (C) ... _The_ University of Melbourne".
1997-07-27 15:09:59 +00:00
Bert Thompson
6a1fcc80d2 This module is no longer necessary since I've put similar data
Estimated hours taken: 0.1

bytecode/static_data.c:
bytecode/static_data.h:
	This module is no longer necessary since I've put similar data
	in the "machine" module.
1997-06-02 13:58:16 +00:00
Bert Thompson
e2a6038b16 List abstract data type. (Absolutely minimal.)
Estimated hours taken: 0.5

bytecode/slist.c:
bytecode/slist.h:
	List abstract data type. (Absolutely minimal.)
1997-06-02 13:54:16 +00:00
Bert Thompson
ff7b34149e Added exported procedures:
Estimated hours taken: 1

bytecode/dict.c:
bytecode/dict.h:
	Added exported procedures:
		- dict_is_empty
		- dict_first_key
		- dict_next_key
	Also added a simple-minded unit test.
1997-05-29 09:52:58 +00:00
Bert Thompson
dce28cf057 Added target for mdb
Estimated hours taken: 0.1

bytecode/Mmakefile:
	Added target for mdb
1997-05-29 09:48:05 +00:00
Bert Thompson
090732de52 Simple Mercury driver for the bytecode interpreter.
Estimated hours taken: 0.1

bytecode/mdb.m:
	Simple Mercury driver for the bytecode interpreter.
	The driver allows us to initialise the Mercury runtime
	engine and various modules in libmercury without having
	to duplicate code from the runtime.

	This really is overkill and it would make sense to rewrite
	parts of the runtime so that initialisation and startup of
	compiled Mercury code are not so tightly coupled. May revisit
	this later.
1997-05-29 06:20:21 +00:00
Bert Thompson
1be6aa13a3 - Removed "-static" from link line since we can't use
Estimated hours taken: 0.1

bytecode/Mmakefile
	- Removed "-static" from link line since we can't use
	  dlopen and so on with statically linked binaries.
	- Added -DDEBUGGING as C compile flag. Turn it off when
	  the bytecode interpreter is working.
	- Added "dict" module, a dictionary ADT.
1997-05-28 09:36:05 +00:00
Bert Thompson
0c8e9e6187 Added #includes for the headers that these headers depend upon.
Estimated hours taken: 0.1

bytecode/disasm.h:
bytecode/mem.h:
bytecode/util.h:
	Added #includes for the headers that these headers depend upon.
	I'm still not convinced of the wisdom of having #includes inside
	headers. Tracking down the location of a declaration by using
	preprocessed source files is bad enough when nested  #include
	is forbidden.
1997-05-28 09:32:14 +00:00
Bert Thompson
06454f727a Added a dictionary abstract data type. Currently it's implemented as
Estimated hours taken: 2

Added a dictionary abstract data type. Currently it's implemented as
a dirt-simple ordered list, but it should later be reimplemented using a
hash table. Note that C has only very poor support for ADTs
and private data must be included in the header. We trust clients
of the ADT not to use the private data.

bytecode/dict.h:
	Interface of dictionary ADT.
bytecode/dict.c:
	Implementation of dictionary ADT.
1997-05-28 05:58:59 +00:00
Bert Thompson
7f1d65cad6 LIBMBI_OBJS variable was being used before its definition,
Estimated hours taken: 0.1

bytecode/Mmakefile:
	LIBMBI_OBJS variable was being used before its definition,
	hence moved it earlier.
1997-05-27 07:35:09 +00:00
Bert Thompson
afe712d198 Fixed a couple of small problems with the `tags' target.
Estimated hours taken: 0.1

bytecode/Mmakefile:
	Fixed a couple of small problems with the `tags' target.
1997-05-27 07:29:41 +00:00
Bert Thompson
1e42952101 Also generating C tags for headers.
Estimated hours taken: 0.1

bytecode/Mmakefile:
	Also generating C tags for headers.
1997-05-27 07:14:09 +00:00
Fergus Henderson
dc3217a170 Tell cvs to ignore the automatically-generated `depend.mk' file.
Estimated hours taken: 0.1

bytecode/.cvsignore:
	Tell cvs to ignore the automatically-generated `depend.mk' file.
1997-05-23 17:39:32 +00:00
Fergus Henderson
4793bb003e Add new targets libmbi.{a,so}.
Estimated hours taken: 1

bytecode/Mmakefile:
	Add new targets libmbi.{a,so}.
	In profiling grades, link with -lgc_prof rather than -lgc.

bytecode/mbi.c:
	Rename the main() function as BC_mbi_main().

bytecode/mbi_main.c:
	New file, whose main() function just calls BC_mbi_main().
1997-05-07 12:12:29 +00:00
Fergus Henderson
a3644ae6cf More cleanup of the bytecode stuff; in particular, add a `MB_' prefix
Estimated hours taken: 2

More cleanup of the bytecode stuff; in particular, add a `MB_' prefix
to most names.

bytecode/*:
	- Prefix all names defined in header files with `MB_'
	  (except for `TRUE', `FALSE', `DEBUGGING', and `XXXdebug').
	- Add macros `MB_new', `MB_new_array', and `MB_resize_array',
	  and use those instead of using `MB_malloc' and `MB_resize'
	  (formerly `mem_malloc' and `mem_resize') or malloc() and realloc()
	  directly.  Uncomment the definition of MB_strdup() now that it
	  calls MB_malloc().
	- Delete the definitions of `uchar', `uint', `ushort', `ulong'
	  (just spell them out, its clearer and more portable that way).
	- Fix the indentation in a few places I missed on my previous pass.
	- Add a `README' file.
1997-04-26 05:57:14 +00:00
Fergus Henderson
48103ac54c A cleanup of the bytecode stuff.
Estimated hours taken: 2

A cleanup of the bytecode stuff.

bytecode/*:
	Various changes to make it conform to our C coding standard.
	In particular:
		- fix indentation and layout, particularly of switch
		  statements;
		- use `#include "..."' rather than `#include <...>'
		  for user-defined header files

bytecode/Mmakefile:
	Avoid the use of `$^' in hard-coded rules, since it is
	not portable to non-GNU makes (many makes only allow the
	use of variables such as $*, $^, etc. in suffix rules),
	and since it is easy to avoid.
	Also add an XXX comment, since the header dependency handling
	is done twice.

bytecode/bytecode.c:
	s/BIG_ENDING/MR_BIG_ENDIAN/ and s/LITTLE_ENDING/MR_LITTLE_ENDIAN/,
	to match my recent change to runtime/conf.h.in.
	In fact every identifier in the bytecode directory ought to be
	prefixed with `MB_', but I haven't done that in this change.
1997-04-26 03:16:18 +00:00
Bert Thompson
ba415565b5 - Changes to support portable numeric constants in the
Estimated hours taken: 3

A number of changes:
	- Changes to support portable numeric constants in the
	  bytecode file.
	- read_int() now returns a Mercury `Integer', which is platform
	  dependent. However it actually reads a portable, 64-bit,
	  big-endian, 2's complement integer from the bytecode stream.
	- read_float() now returns a Mercury `Float', which is platform
	  dependent.
	- Comment-style changed to agree with C coding standard.
	- malloc and realloc are now used instead of mem_malloc and
	  mem_realloc. Need to look at memory-management in a lot
	  more depth when the bytecode interpreter starts linking
	  in Mercury shared objects.
	- Removed Bytecode-doc since it's now an HTML file in
	  the developer documentation directory of the Mercury web pages.
	- Removed the Makefile since we're now using an Mmakefile.

bytecode/
	bytecode.c
	bytecode.h
		Changes to read_int(), read_float() and others.
	disasm.c
	disasm.h
	machine.c
	machine.h
	mbi.c
	mbi.h
	mdis.c
	mdis.h
	mem.c
	mem.h
	static_data.c
	static_data.h
	template.c
	template.h
	util.c
	util.h
		Divers changes as described above.
	Bytecode-doc
	Mmakefile
		Removed as described above.
1997-04-24 05:31:48 +00:00
Bert Thompson
9b8137b1d9 Small changes to Mmakefile.
Estimated hours taken: 0.1

Small changes to Mmakefile.

bytecode/Mmakefile:
	Now linking with libmer and libgc. Added $(MERCURY_DIR)/runtime
	to link path.
1997-04-24 05:16:04 +00:00
Bert Thompson
fd811ddee7 For consistency with the rest of Mercury, we use an Mmakefile in
Estimated hours taken: 2

For consistency with the rest of Mercury, we use an Mmakefile in
the bytecode directory.

bytecode/Mmakefile:
	Added Mmakefile.
1997-03-26 07:25:38 +00:00
Bert Thompson
eb454beb95 Fixed error in comment. 1997-03-25 03:53:19 +00:00
Bert Thompson
35498c8e44 Made some changes suggested by bromages's code review. 1997-03-25 03:10:28 +00:00
Bert Thompson
4202468422 Made some changes suggested by bromages's code review. 1997-03-25 02:15:45 +00:00
Bert Thompson
12eae5e466 Various inconsequential changes.
This module is still a half-munched Twistie. 8^)
1997-03-25 02:11:01 +00:00
Bert Thompson
3cde83e386 Initial revision 1997-03-20 08:17:33 +00:00
Bert Thompson
caeef88a38 Changed calls to malloc and free etc to calls to mem_malloc, mem_free.
In bytecode stream, cons_id's are now module-qualified.
Made changes to accomodate this.
1997-03-20 08:16:50 +00:00
Bert Thompson
5addf0844f In bytecode stream, cons_id's are now module-qualified.
Made changes to accomodate this.
Added `noop' bytecode.
1997-03-20 08:15:46 +00:00
Bert Thompson
7444bfa1e7 Initial revision 1997-02-13 06:00:17 +00:00
Bert Thompson
52c99f2052 Initial revision 1997-02-11 09:15:43 +00:00
Bert Thompson
00ad612b06 Added rcs_id static string 1997-02-11 08:06:37 +00:00
Bert Thompson
229af11390 Fixed typo. 1997-02-11 08:03:55 +00:00
Bert Thompson
6e17d431d3 Added rcs_id static string 1997-02-11 07:52:16 +00:00
Bert Thompson
1e7c8d4ccf Added comment about freeing the bytecodes that are read. 1997-02-11 07:40:53 +00:00
Bert Thompson
c7f6988bcb Brought up-to-date with version 8 of the bytecode. 1997-02-04 02:24:05 +00:00
Bert Thompson
600f8f1240 Changed all ushorts to shorts. 1997-02-04 01:39:53 +00:00
Bert Thompson
3f47a61531 Replaced the stub quote_cstring with a proper implementation. 1997-02-03 08:02:42 +00:00
Bert Thompson
4498524dbb Nuked some crap. 1997-02-01 13:36:33 +00:00
Bert Thompson
61d3e53678 We use shorts rather than ushorts for most of the stuff in the
bytecode file. A label, for instance, may be negative in enter_disjunct.
(Specifically, in the last enter_disjunct in a disjunction, the
label is -1.)
1997-02-01 13:36:01 +00:00
Bert Thompson
b0a8799252 Moved a lot of definitions related to bytecode from here to
the bytecode module.
1997-02-01 09:22:13 +00:00
Bert Thompson
6f44799b92 Moved code related to printing bytecodes to here from the bytecode module. 1997-02-01 09:21:18 +00:00
Bert Thompson
4eae45fcc1 Made static everything that needn't be exported from this module.
Moved code related to printing out of here. Only code for
parsing the bytestream should be in here.
1997-02-01 09:21:04 +00:00
Bert Thompson
619f65a72e Commented disassemble(). 1997-02-01 09:15:02 +00:00
Bert Thompson
40949b41b9 Finished off everything needed for disassembler. 1997-01-31 04:27:17 +00:00
Bert Thompson
3a0fe363a6 Added tags target.
Added some CFLAGS for debugging and testing.
1997-01-31 04:24:03 +00:00
Bert Thompson
2e0d5ab8bc Bytecode version number is now a ushort, not an int. 1997-01-30 01:17:21 +00:00
Bert Thompson
f45dcafc54 We also define __STDC__ since we want to use assert.h, which is
part of ANSI C but not part of POSIX.
1997-01-29 06:17:05 +00:00