imp.h:
Add incr_hp_atomic macro, which for USE_CONSERVATIVE_GC
invokes GC_MALLOC_ATOMIC() rather than GC_MALLOC().
io.mod:
Use the new incr_hp_atomic() macro for allocating strings.
Add implementations of string__index/2, string__length/2,
and string__append/3.
Note - these changes sped up the compiler by nearly 40%!
Cakefile:
If the chmod fails, don't worry about it.
ext_signal.h:
Comment out most of the file if __sgi is defined.
It didn't seem to work on the sgi.
wrapper.mod:
Fix a serious bug with the -w option.
io.mod:
Change io__run/0 so that it works even if main/2 is nondet.
We need this (until we have implemented solutions/2) for the
benchmarks.
memory.c, wrapper.h, wrapper.mod:
Fix yet another serious modulus-on-signed-int bug.
This stopped things working if you used shared libraries,
since the address of fake_regs was negative, which confused
the init_memory() function.
Cakefile:
Don't include the default definition of main/2 in the library.
ext_stdlib.h:
Remove most of the stuff here, since it was causing problems
compiling on Irix.
ext_signal.h:
Remove definition of MINSIGSTKSZ.
io.mod:
Line numbers start from 1, not 0.
io.mod, wrapper.mod, wrapper.h:
Implement io__{set,get}_exit_status.
prof.h:
Add declaration of prof_current_proc.
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.
examples/Mercury:
Add new grades asm_*.
wrapper.mod:
Add a new -h (help) option.
Change the behaviour of the -l option:
Exit after printing the labels
Don't use popen("sort -n"), since it's an unnecessary OS
dependency and the user can do it anyway.
[And because we weren't checking whether the call
succeeded, and I didn't want to add checking code...]
io.mod, init.h, wrapper.mod, label.c:
Remove support for automatically calling *_input.
Optimize things so that we only call init_modules() if we
are going to need the label names.
io.mod:
a couple of alterations. Sort-of bug fixes:
- the mercury level expects an int return status of
-1 for invalid file opening, but the mod level code
was returning NULL.
- univ_to_type was comparing the addresses of the
type_info structures which is incorrect.
io.mod:
Use __Unify___foo rather than unify_foo since the name mangling
for unification preds has changed.
Also add __Compare__ and __Index__ for the types
io__stream, io__external_state and univ.
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.
Cakefile, io.mod, wrapper.h, wrapper.mod, main.mod:
Add an entry point io__run/0 which initializes the io_state
and then calls main/2. Add a default do-nothing definition for
main/2 in main.mod. Implement io__command_line_arguments/3.
call.mod:
Implement compare/3, index/2, and unify/2.
io.mod:
Various updates to defined some undefined procedures, including
string__to_float, io__line_number, and unification procedures
for univ, io__external_state, and io__stream.
Fix a bug (wrongly used field 1 instead of field 0) in type_to_univ.
io.mod:
Change the implementation of type_to_univ/2 so that it uses
the --polymorphism calling convention, and uses the address
of the unification predicate passed as a type identifier.
imp.h:
Define `Integer' to be a signed type the same size as `Word'.
imp.h, io.mod:
Replace incr_hp/1 macro with incr_hp/2.
list.c, std.h:
Various minor cleanups.
tags.h:
Replace all the casts to `unsigned' and `uint' with cases
to `Word'.
aux.c:
Use gcc's __attribute__((noreturn)) to suppress warnings
in functions that call fatal_error().
io.mod:
Fix ANSI incompatibility: stdin/stdout/stderr might not be constants.
Initialize mercury_std***.file on startup, rather than statically.
Add io__write_char, intToString, and string__to_int_list.
mod2c:
Fix bug in the pattern match for labels: it was only
checking for lowercase, and hence it didn't work for intToString.
(All these changes have been tested on both munta and kryten.)
aux.c, aux.h, imp.h
Added a fatal_error() function to centralize error-handling.
Various things in imp.h modified to use it.
io.mod:
Added lots of new code.
Most of the predicates in io.nu.nl are implemented now.
I also implemented a few preds from the other .nu.nl files in here.
wrapper.c, wrapper.h:
Export `progname', because it's needed by io.mod.
Changes to examples/Mercury required changes to some other files.
The most important such change is that mod2c and gnuc now take a speed
grade argument of the form -s{fast,reg,jump,none,init,debug}. The -s
option of mod2c supersedes the -g option which is retained for backward
compatibility.
Renamed test_harness to wrapper because underscores now separate grade names
from the rest of the file base name in cake rules.
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}.