Commit Graph

12 Commits

Author SHA1 Message Date
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
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
4202468422 Made some changes suggested by bromages's code review. 1997-03-25 02:15:45 +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
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
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
40949b41b9 Finished off everything needed for disassembler. 1997-01-31 04:27:17 +00:00
Bert Thompson
030c530b0a I've decided the `no typedefs for structs' programming convention
is indeed without good justification, hence we now use typedefs
for all the structs.
1997-01-29 01:41:04 +00:00
Bert Thompson
1c43bef167 Added more stuff for interpreting bytestream. All still half-munged. 1997-01-28 01:59:57 +00:00
Bert Thompson
15b22fde95 Initial revision 1997-01-24 07:13:10 +00:00