Estimated hours taken: 3
Add predicates to perform lower-bound and upper-bound searching, in which
if a search for a key fails, we return the next lower (or higher) key and
its associated value.
library/bintree.m:
library/rbtree.m:
library/tree234.m:
library/map.m:
Add lower-bound and upper-bound search and lookup predicates.
Add plain lookup predicates where missing, or move them next
to their corresponding search preds.
Make the handling of lookup errors more uniform.
library/require.m:
Move map__lookup_error here as report_lookup_error, for use
by bintree, rbtree and tree234, as well as map.
Estimated hours taken: 0.25
Fix a bug caused by zs's recent change to runtime/mercury_stack_trace.{h,c}:
library/require.m:
library/math.m:
Update calls to MR_dump_stack() to pass as the new
`include_trace_data' argument the value `FALSE'.
Estimated hours taken: 0.25
library/require.m:
Remove bogus layout structure for the hand-coded procedure
require__error_internal/1 -- it doesn't create a stack frame,
so it doesn't need a layout structure.
Estimated hours taken: 0.5
Fix a bug that broke error/1 in grades `jump.*' and `fast.*'.
library/require.m:
Rename the C module `require_module_internal' as
`require_internal_module', to be consistent with the names
used for other C modules defined in the Mercury library.
Add code to ensure that the initialization function
for this module gets run.
Estimated hours taken: 3
Fix stack traces dying in -O-1.
error/1 is usually generated with no stack frame, but in -O-1 it is
generated with one (but doesn't need it). error/1 passes
MR_dump_stack MR_succip and MR_sp, and MR_dump_stack assumes that
MR_succip is for the topmost stack frame, but if error/1 has a stack
frame, this is not true.
library/require.m:
Make sure the caller of MR_dump_stack has no stack frame
by using handwritten code. We call the handwritten code
from error/1, and so we have the nice side effect that
error now appears in the stack dump.
runtime/mercury_stack_trace.h:
Document that MR_dump_stack assumes the succip is for the
topmost stack frame.
runtime/mercury_label.h:
Fix a comment, layout info is for a label, not a procedure.
Estimated hours taken: 1
Implement nondet stack dumps.
library/require.m:
Call MR_dump_stack with MR_curfr.
runtime/mercury_stack_trace.c:
runtime/mercury_stack_trace.h:
Get MR_curfr as input.
If we hit a nondet stack frame, handle moving down a frame a
little differently.
Estimated hours taken: 12
Add support for stack dumps, do a stack dump from error/1.
compiler/Mmakefile:
library/Mmakefile:
profiler/Mmakefile:
runtime/Mmakefile:
Insert EXTRA_MGNUCFLAGS before CFLAGS or EXTRA_CFLAGS
becasue mgnuc stops processing its options when it
encounters a non-mgnuc option.
library/require.m:
Call MR_dump_stack if error is called.
runtime/Mmakefile:
runtime/mercury_imp.h:
Add #includes of new files.
runtime/mercury_type_info.h:
Remove conditional definition of MR_STATIC_CODE_ADDRESSES
(moved into mercury_conf.h.in).
runtime/mercury_accurate_gc.h:
Remove stack_layout stuff, leave this file for accurate
GC specific definitions.
runtime/mercury_conf.h.in:
Add conditional definitions of MR_INSERT_LABELS,
MR_USE_STACK_LAYOUTS, MR_NEED_INITIALIZATION_CODE and
MR_STATIC_CODE_ADDRESSES, depending on various other options.
runtime/mercury_goto.h:
Insert labels into label table if MR_INSERT_LABELS is defined,
rather than NATIVE_GC.
util/mkinit.c:
Initialize if MR_NEED_INITIALIZATION_CODE is defined, rather than
NATIVE_GC.
runtime/mercury_stack_layout.h:
All the old stack layout definitions from mercury_accurate_gc.h.
Add code for MR_DETISM_DET_CODE_MODEL.
runtime/mercury_stack_trace.c:
runtime/mercury_stack_trace.h:
Implement MR_dump_stack which just provides a dump of the stack
as far as possible.
Set MR_INSERT_LABELS and MR_USE_STACK_LAYOUTS if MR_STACK_TRACE
is set.
runtime/mercury_grade.h:
Add _strce if stack tracing is enabled in the grade. This
might not be a permanent change.
runtime/mercury_ho_call.c:
Remove unused label declarations.
scripts/mgnuc.in:
Add --stack-trace and --no-stack-trace options.
Consolidate some duplicate code.
Estimated hours taken: 0.5
library/*.m:
compiler/*.m:
Undo Zoltan's bogus update of all the copyright dates.
The dates in the copyright header should reflect the years
in which the file was modified (and no, changes to the
copyright header itself don't count as modifications).
Estimated hours taken: 0.25
library/require.m:
Add `:- pragma no_inline(error/1).', since inlining error/1
results in bigger code with no improvement in speed.
Estimated hours taken: 24
Move the C implementation of various builtins from the `runtime' directory
to inside pragma(c_code) declarations in the `library' directory sources.
library/{io,string,require,std_util,mercury_builtin}.m:
Add lots of pragma(c_code) and pragma(c_header_code) declarations.
Also a few other miscellaneous changes.
library/list.m:
Fix a bug in the as yet unused list__merge_sort.
library/io.m:
Combine io__do_open_{input,output,append} into a single
predicate io__do_open.
library/std_util.m:
Fix the implementation of report_statistics so that it gives
useful information when using conservative garbage collection.
library/*.m:
Improve the documentation.
Add a "Stability: low/medium/high" comment to all modules,
which describes the stability of the interface to that module.
ops.m:
Add `:' as an infix operator.
require.m:
Implement require/1, since higher-order predicates now work.
term.m:
Use the type `comparison_result' from mercury_builtin.m,
rather than defining an identical type `comparison'.
Makefile*:
Add some more stuff for compiling to .o
Makefile*, mercury_compile*, code_gen*:
Add some stuff for handling `.pp' files.
`.pp' files are Mercury source code containing
NU-Prolog hacks inside
#if NU_PROLOG
...
#endif
These hacks are preprocessed out (using sed, not cpp)
except when compiling with `mnc'.
term_io.nl, term_io.nu.nl, interpreter.nl, prog_out.nl:
Make sure all the predicates in term_io.nl are
prefixed with `term_io__', not `io__'.
term_io.nl, require.nl:
Add some `external' declarations.
call_gen.nl, unify_gen.nl:
A temporary hack - generate incorrect code for complicated/polymorphic
unifications, rather than aborting.
random.nl:
Make the code more efficient.
hlds.nl, term.nl:
Allocate pred_ids and variable numbers randomly rather than
sequentially, so that the binary trees remain reasonably balanced.
code_info.nl, unify_gen.nl, hlds_out.nl:
Generate informative comments for tag tests: say the name of
the variable being tested, and which constructor we are testing for.
llds.nl:
Cast field() expressions to (int) when used as rvals, so
that comparisons work as expected.
make_hlds.nl:
Improve error reporting.
prog_io.nl, hlds.nl, modes.nl, mercury_to_mercury.nl, require.nl:
Handle `is erroneous' and `is failure' proc declarations.
Add `is erroneous' to the declaration of error/1.
prog_io.nl:
Report errors in proc declarations instead of just
ignoring them.
hlds.nl:
Fix a mode error (variable numbering error) detected by the
mode checker.
modes.nl:
Fix a minor formatting problem in error message.
mercury_builtin.nl:
Change the work-around for higher-order predicate modes
so that it doesn't cause mode errors.
don't warn about :- interface and :- implementation declarations;
write warnings to stderr not stdout.
hlds_out.nl: write out if-then-else's (etc.) correctly.
typecheck.nl: write messages to stderr instead of stdout.
Lots of files: Fix lots of type errors and modularity violations.
Makefile: add new targets `check' and *.err
Moved most of the non-logical NU-Prolog code from io.nl and term_io.nl into
io.nu.nl and term_io.nu.nl respectively. Rewrote the rest in logical Mercury.
Modified io__write_term to escape string constants if necessary.
Added char.nl and moved some of the predicates in string.nl into char.nl.
Rewrote some of the predicates in these files to avoid NU-Prolog dependencies.
Added a few new predicates.
Modified mercury_to_goedel.nl to correctly output variable names without
any danger of name clashes. Also modified it to correctly escape string
constants. Also modified it to correctly output functor names even
for nasty functors.
Did a little more work on the typechecker.
Moved the non-logical NU-Prolog code in require.nl into require.nu.nl.
Fix bug in prog_io.nl where combined type-and-mode declarations were
getting reversed.
Modified io.nu.nl and require.nu.nl so that calls to error/1 will
actually cause the program to abort.
In prog_io.nl: allow "\+" as a synonym for "not".
Lots of bug fixes for make_hlds.nl.
A couple of bug fixes for hlds.nl.
Did some optimization of memory usage: added io__gc_call to io.nl
and used it in prog_io.nl and module.nl. Rewrote the main loop
of prog_io to take maximum advantage of manual garbage collection.
Started working on typecheck.nl.