Estimated hours taken: 1
Branches: main, release
Prepare for the 0.13 release and fix/update documentation.
NEWS:
HISTORY:
Update the NEWS and HISTORY files for the 0.13 release.
RELEASE_NOTES:
s/0.12/0.13/
Add Linux/x86_64 to the list of architectures supported by this
release.
Remove Solaris 8/x86 from the same list.
.README.in:
extras/README:
Remove references to the clp(r) binding. We no longer support it.
bindist/bindist.README:
Update the year in the copyright message.
Fix the gc version; 0.13 uses 6.5.
BUGS:
README.DotNet:
README.Java:
README.gcc-backend:
doc/faq.texi:
doc/make_manpage:
doc/mercury.html.in:
doc/mercury.info.in:
s/.cs.mu.oz.au/.csse.unimelb.edu.au/
library/array.m:
library/builtin.m:
library/eqvclass.m:
library/graph.m:
samples/README:
Fix typos.
Estimated hours taken: 1
Branches: main
Use `pragma foreign_export' in preference to `pragma export' throughout
the Mercury distribution.
Convert more of the extras distribution to four-space indentation and
other minor cleanups.
browser/*.m:
library/*.m:
samples/*:
extras/*:
As above.
Estimated hours taken: 0.2
Branches: main, release
library/*.m:
Improve the library reference manual by formatting the beginning of
library modules consistently.
library/integer.m:
Fix some bad indentation.
Estimated hours taken: 18
Branches: main
Move the univ, maybe, pair and unit types from std_util into their own
modules. std_util still contains the general purpose higher-order programming
constructs.
library/std_util.m:
Move univ, maybe, pair and unit (plus any other related types
and procedures) into their own modules.
library/maybe.m:
New module. This contains the maybe and maybe_error types and
the associated procedures.
library/pair.m:
New module. This contains the pair type and associated procedures.
library/unit.m:
New module. This contains the types unit/0 and unit/1.
library/univ.m:
New module. This contains the univ type and associated procedures.
library/library.m:
Add the new modules.
library/private_builtin.m:
Update the declaration of the type_ctor_info struct for univ.
runtime/mercury.h:
Update the declaration for the type_ctor_info struct for univ.
runtime/mercury_mcpp.h:
runtime/mercury_hlc_types.h:
Update the definition of MR_Univ.
runtime/mercury_init.h:
Fix a comment: ML_type_name is now exported from type_desc.m.
compiler/mlds_to_il.m:
Update the the name of the module that defines univs (which are
handled specially by the il code generator.)
library/*.m:
compiler/*.m:
browser/*.m:
mdbcomp/*.m:
profiler/*.m:
deep_profiler/*.m:
Conform to the above changes. Import the new modules where they
are needed; don't import std_util where it isn't needed.
Fix formatting in lots of modules. Delete duplicate module
imports.
tests/*:
Update the test suite to confrom to the above changes.
Estimated hours taken: 1
Branches: main
library/*.m:
Replace __ with . as the module qualifier everywhere.
tests/hard_coded/test_injection.exp:
Replace __ with . as the module qualifier in expected exceptions.
Estimated hours taken: 0.5
Branches: main
library/*.m:
Annotate foreign_procs with trail usage information throughout most of
the standard library.
Fix an out of date comment in string.m.
Fix some minor formatting problems.
Estimated hours taken: 1
Branches: main, release
Add some synonyms for various functions in the string module
and make some more general cleanups to parts of the standard library.
library/array.m:
s/applys/applies/
library/list.m:
Position descriptive comments according to our coding
standard.
Fix a cut and paste error. list.foldl6 has six accumulators
not five.
library/parser.m:
library/pqueue.m:
library/set_bbbtree.m:
library/set_ctree234.m:
Fix minor formatting problems and spelling mistakes.
library/string.m:
Add functions string.from_int/1, string.from_char/1
and string.from_float/1 as synonyms for string.int_to_string/1
etc.
library/version_types.m:
s/incurrs/incurs/
Estimated hours taken: 3
Branches: main, version-0_12-branch
library/array.m:
library/array2d.m:
library/assoc_list.m:
library/bag.m:
library/benchmarking.m:
library/bimap.m:
library/bintree_set.m:
library/bitmap.m:
library/bool.m:
library/builtin.m:
library/cord.m:
library/float.m:
library/graph.m:
library/group.m:
library/hash_table.m:
library/int.m:
library/lexer.m:
library/list.m:
library/map.m:
library/math.m:
library/multi_map.m:
library/ops.m:
library/parser.m:
library/rbtree.m:
library/set.m:
library/stack.m:
library/store.m:
library/string.m:
library/time.m:
Minor reformatting; added some renamed preds and funcs to improve
consistency of naming in the library; removed some preds and types that
have been marked obsolete since 0.11.
Estimated hours taken: 3.5
Branches: main
Make the positioning of descriptive comments conform
to the coding standard for the following library modules.
Convert preds to predmode syntax where possible.
Make the ordering of related predicates and functions
conform to the coding standard, where the descriptive
comment makes it possible to do that.
Other minor changes are listed below.
library/bimap.m:
Fix capitalisation of a few comments.
library/dir.m:
s/throw an exception/throws an exception/.
library/exception.m:
Fix the comment about the exception_result/1 type.
There is only one type and an inst following the comment.
library/map.m:
Remove the unique modes for map.set/4, map.delete/3 and
map.delete_list/3.
library/rbtree.m:
Remove the unique modes for rbtree.set/4, rbtree.delete/3,
rbtree.remove/4, rbtree.remove_smallest/4 and rbtree.remove_largest/4.
library/tree234.m:
Remove left over unique modes for preds.
library/set.m:
XXX the ordering of procedures in this module is a bit strange.
library/set_bbbtree.m:
library/set_unordlist.m:
Remove various unique modes for set operations like
delete/3. (Some of these were commented out anyway).
library/term_to_xml.m:
Fix a spot where line width exceeded 79 characters.
library/array.m:
library/assoc_list.m:
library/random.m:
library/multi_map.m:
library/pqueue.m:
library/queue.m:
library/bool.m:
library/char.m:
library/construct.m:
library/counter.m:
library/deconstruct.m:
library/eqvclass.m:
library/gc.m:
library/io.m:
library/sparse_bitset.m:
library/stack.m:
library/std_util.m:
library/store.m:
library/string.m:
library/term.m:
library/term_io.m:
library/type_desc.m:
library/varset.m:
As above.
Estimated hours taken: 20
Branches: main
Improve the termination analyser's handling of user-defined
special predicates.
Currently termination analysis assumes that all calls
to special predicates terminate. For those that are
user-defined this is not necessarily true.
This diff adds a new pass to the compiler that is run after
the main termination analysis pass. It checks any user-defined
special predicates and emits a warning if their termination
can not be proved.
Add a new option, `--no-warn-non-term-special-preds' that
disables this warning. The warning is only emitted when
termination analysis is enabled. The new option has
no effect if termination analysis is not enabled.
compiler/post_term_analysis.m:
New file. Add an additional pass that runs after the main
termination analysis and makes use of the information obtained
then to perform further semantic checks and optimizations.
compiler/termination.m:
Run the new pass after the main analysis.
Update the comment about the termination analyser doing the
wrong thing for user-defined special predicates.
compiler/options.m:
Parse the new option.
Update the special handler for the inhibit_warning
option so that it handles `--warn-table-with-inline'
and the new option correctly.
Fix some typos.
compiler/transform_hlds.m:
Include the new module.
compiler/notes/compiler_design.html:
Mention the new module.
doc/user_guide.texi:
Document the new option.
Fix some typos: s/occured/occurred/,
s/interative/interactive/, s/exlained/explained/
and /currect/current/
library/array.m:
library/version_array.m:
Add pragma terminates declarations to the user-defined
equality and comparison predicates for the array/1
and version_array/1 types. The termination analyser
cannot (yet) prove termination in these cases because
it cannot reason about iteration over arrays.
tests/warnings/Mercury.options:
tests/warnings/Mmakefile:
tests/warnings/warn_non_term_user_special.m:
tests/warnings/warn_non_term_user_special.exp:
Test the new option.
Estimated hours taken: 0.1
Branches: main
library/array.m:
Remove a redundant promise_pure pragma on array.max/2.
All the foreign clauses are promised pure anyway.
Estimated hours taken: 16
Branches: main
Get Mercury to work with gcc 3.4. This required fixing several problems.
One problem that caused errors is that gcc 3.4 is smart enough to figure out
that in LLDS grades with gcc gotos, the C functions containing our code are
not referred to, and so it optimizes them away. The fix is to ensure that
mercury_<module>_init is defined always to call those functions, even if
the macro that usually controls this, MR_MAY_NEED_INITIALIZATION, is not
defined. The mercury_<module>_init won't be called from the init_modules
function in the program's _init.c file, so there is no impact on initialization
time, but gcc doesn't know this when compiling a module's .c file, so
it doesn't optimize away the code we need. The cost of this change is thus
only a small amount of code space. It is worth paying this cost even with
compilers other than gcc 3.4 for simplicity. Actually, this size increase seems
to be slightly smaller than the size reduction due to the better optimization
capabilities of gcc 3.4 compared to gcc 3.2.2.
A second problem is that gcc 3.4 warns about casts in lvalues being a
deprecated feature. This gave lots of warnings, since we used to define
several Mercury abstract machine registers, including MR_succip, MR_hp, MR_sp,
MR_maxfr and MR_curfr using lvalue casts. The fix is to have two macros
for each of these abstract machine registers, one of type MR_Word that you can
assign to (e.g. MR_sp_word), and one of the original type that is of the right
type but not an lvalue (e.g. MR_sp). The lvalue itself can't be made the right
type, because MR_sp isn't a variable in its own right, but possibly defined
to be a machine register. The machine register could made the right type,
but only at the cost of a lot of complexity.
This problem doesn't apply to the special-purpose Mercury abstract machine
registers that can't be allocated to machine registers. Instead of #defining
these to slots in MR_fake_reg, we make them global variables of the natural
type. This should also make it easier to debug code using these registers.
We treat these global variables as if they were machine registers in that
MR_save_registers copies values from these global variables to slots reserved
for them in the MR_fake_reg array, to allow code to loop over all Mercury
abstract machine registers. These saved slots must of course be of type
MR_Word, so we again need two macros to refer to them, a lvalue of type
MR_Word and an rvalue with the right type.
A third problem is that gcc 3.4 warns about conditionals in lvalues being a
deprecated feature. This gave a few warnings, since we used to define
MR_virtual_reg and MR_saved_reg using lvalues using conditionals. The fix
is to have one macro (MR_virtual_reg_value) for use in rvalues and a
separate macro which uses an if-then-else instead of a conditional
expression (MR_virtual_reg_assign), for assignments.
A fourth problem is that gcc 3.4 warns about comma operators in lvalues
being a deprecated feature. This gave warnings in the few places where
we refer to MR_r(N) for values of N that can map to fake registers directly,
since in those cases we preceded the reference to the fake_reg array with
a range check of the array index. The fix to this is to move the test to
compile time for compiler-generated code. Hand-written code never refers
to MR_r(N) for these values, and is very unlikely to do so in the future;
instead, it refers to the underlying fake_reg array directly, since that way
it doesn't have to worry about which fake registers have their own MR_rN macro
and which don't. Therefore no check mechanism for hand-written code is
necessary. This change mean that changing the number of MR_rN registers
now requires change to the compiler as well as to the runtime system.
A fifth problem is that gcc 3.4 by default assumes -fstrict-aliasing at -O2.
Since we cast between integers and pointers of different types all the time,
and changing that is not practical, at least in the short term, we need to
disable -fstrict-aliasing when we enable -O2.
NEWS:
Note that Mercury now works with gcc 3.4.
configure.in:
scripts/mgnuc.in:
Detect whether the compiler supports -fstrict-aliasing, and if so,
whether it assumes it by default with -O2. If the answer is yes to
both, make mgnuc specify -fno-strict-aliasing when it specifies -O2.
By including it in CFLAGS_FOR_OPT, which gets put into Mercury.config,
we also get -f-no-strict-aliasing when mmc invokes the C compiler
directly.
compiler/llds_out.m:
Don't generate #ifdef MR_MAY_NEED_INITIALIZATION around the definitions
and calls to the bunch functions, which call the functions we don't
want the C compiler to optimize away.
Generate the newly required lvalues on the left sides of assignments.
We still have code to generate LVALUE_CASTs in some cases, but I don't
think those cases ever arise.
Add a compile-time check of register numbers. Ideally, the code
generator should use stack slots instead of registers beyond the max
number, but I don't recall us ever bumping into this limit by accident.
compiler/fact_table.m:
Use the newly required lvalues on the left sides of assignments
in some hand-written C code included in generated .c files.
runtime/mercury_regs.h:
Make the changes described above to fix the second, third and fourth
problems. We still use comma operators in lvalues when counting
references to registers, but it is OK to require anyone who wants
to enable this feature to use a compiler version that supports comma
operators in lvalues or to ignore the warnings.
Use the same mapping from Mercury abstract machine registers to
the register count array as to the MR_fake_reg array.
Have this mapping depend as little as possible on whether we need a
real machine register to store MR_engine base, even if it costs a
wasted slot in MR_fake_reg.
Fix an old inconsistency: treat the Mercury abstract machine registers
used for trailing the same way as the other Mercury abstract machine
registers, by making MR_save_registers/MR_restore_registers copy them
to and from their global variable homes.
Document the requirement for the match between the runtime's and the
compiler's notions of the maximum MR_rN register number. This
requirement makes it harder for users to increase the number of
virtual registers, but as far as I know noone has wanted to do this.
Change the names of some of the macros to make them clearer.
Reorder some parts of this file, and add some documentation, also
in the interest of clarity.
runtime/mercury_regorder.h:
Delete this file after moving its contents, in much modified form,
to mercury_regs.h. mercury_regorder.h was always logically part of
mercury_regs.h, but was separated out to make it easier to change
the mapping from Mercury abstract machine registers to machine
registers. However, the cost of incompatibility caused by any such
changes would be much greater that any likely performance benefit.
runtime/Mmakefile:
Remove the reference to mercury_regorder.h.
runtime/mercury_regs.[ch]:
runtime/mercury_memory_zones.[ch]:
Move some functionality dealing with registers from
mercury_memory_zones to mercury_regs, since it belongs there.
runtime/mercury_regs.[ch]:
Add a function to make it easiler to debug changes to map from
Mercury abstract machine to MR_fake_reg slots.
runtime/mercury_regs.[ch]:
runtime/mercury_wrapper.c:
Move the code to print counts of register uses from mercury_wrapper.c
to mercury_regs.c.
Make mercury_wrapper.c call the debugging function in mercury_regs.c
if -X is specified in MERCURY_OPTIONS.
runtime/mercury_bootstrap.h:
Move the old MR_saved_reg and MR_virtual_reg macros from mercury_regs.h
to mercury_bootstrap.h to prevent their accidental use. Since
they shouldn't be used by user code, move them to the section
that is not enabled by default.
runtime/mercury_stacks.[ch]:
Add _word versions of the macros for stack slots, for the same reason
why we need them for Mercury abstract machine registers, and use them.
Add global variables for the Mercury abstract machine registers
for the gen, cut and pneg stacks.
runtime/mercury_heap.h:
Change the macros for allocating memory to assign to MR_hp_word instead
of MR_hp.
runtime/mercury_string.h:
Change the macros for allocating strings to accomodate the updates to
mercury_heap.h. Also change the expected type of the target to make it
MR_String instead of MR_ConstString, since the latter requires casts in
the caller.
runtime/mercury_trail.h:
runtime/mercury_types.h:
Move the definition of the type MR_TrailEntry from mercury_trail.h
to mercury_types.h, since it is now used in mercury_regs.h.
runtime/mercury_accurate_gc.c:
runtime/mercury_agc_debug.c:
runtime/mercury_calls.h:
runtime/mercury_context.[ch]:
runtime/mercury_deconstruct_macros.h:
runtime/mercury_deep_copy_body.h:
runtime/mercury_engine.[ch]:
runtime/mercury_hand_compare_body.h:
runtime/mercury_hand_unify_body.h:
runtime/mercury_ho_call.c:
runtime/mercury_layout_util.c:
runtime/mercury_make_type_info_body.h:
runtime/mercury_minimal_model.c:
runtime/mercury_ml_deconstruct_body.h:
runtime/mercury_ml_functor_body.h:
runtime/mercury_stack_layout.h:
runtime/mercury_type_desc.c:
runtime/mercury_type_info.c:
runtime/mercury_unify_compare_body.h:
runtime/mercury_wrapper.c:
Conform to the changes in the rest of the runtime.
In some cases, fix inconsistencies in indentation.
runtime/mercury_stack_trace.c:
Add some conditionally compiled debugging code controlled by the macro
MR_ADDR_DEBUG, to help debug some problems with stored stack pointers.
runtime/mercury_grade.h:
Increment the binary compatibility version number. This is needed to
avoid potential problems when a Mercury module and the debugger are
compiled with different versions of the macros in mercury_regs.h.
library/exception.m:
Update the code that assigns to abstract machine registers.
library/array.m:
library/construct.m:
library/dir.m:
library/io.m:
library/string.m:
Conform to the new definitions of allocation macros.
library/time.m:
Delete an unnecessary #include.
trace/mercury_trace.c:
trace/mercury_trace_declarative.c:
trace/mercury_trace_util.c:
Conform to the changes in the rest of the runtime.
tests/hard_coded/qual_test_is_imported.m:
tests/hard_coded/aditi_private_builtin.m:
Remove an unnecessary import to avoid a warning.
tools/makebatch:
Add an option --save-stage2-on-error, that saves the stage2 directory
if a bootcheck fails.
scripts/ml.in:
Make ml more robust in the face of garbage files.
Estimated hours taken: 8
Branches: main
library/*.m:
Bring these modules up to date with our current style guidelines.
Use predmode declarations where appropriate. Use state variable syntax
where appropriate. Reorder arguments where this makes it possible to
to use state variable syntax. Standardize format of predicate
description comments. Standardize indentation.
Estimated hours taken: 5
Branches: main
Implement some library procedures for the Java back end.
library/array.m:
Implement the following procedures:
bounds_checks/0
array__init_2/3
array__make_empty_array/1
array__min/2
array__max/2
array__size/2
array__unsafe_lookup/3
array__unsafe_set/4
array__resize/4
array__shrink_2/3
array__copy/2
Estimated hours taken: 0.5
Branches: main
library/array.m:
library/io.m:
Provide Java `pragma foreign_type' declarations for the types
array.array(T) and io.system_error. This is needed to avoid
compilation errors when building in grade `java'.
Estimated hours taken: 2
Branches: main
Begin porting the the library just to use C# as its foreign_proc
language.
library/array.m:
library/char.m:
library/exception.m:
library/float.m:
library/int.m:
library/math.m:
library/private_builtin.m:
library/rtti_implementation.m:
library/std_util.m:
Trivial changes to convert MC++ to C#.
library/table_builtin.m:
Delete some unused MC++ functions.
Estimated hours taken: 400
Branches: main
Implement the infrastructure for term size profiling. This means adding two
new grade components, tsw and tsc, and implementing them in the LLDS code
generator. In grades including tsw (term size words), each term is augmented
with an extra word giving the number of heap words it contains; in grades
including tsc (term size cells), each term is augmented with an extra word
giving the number of heap cells it contains. The extra word is at the start,
at offset -1, to leave almost all of the machinery for accessing the heap
unchanged.
For now, the only way to access term sizes is with a new mdb command,
"term_size <varspec>". Later, we will use term sizes in conjunction with
deep profiling to do experimental complexity analysis, but that requires
a lot more research. This diff is a necessary first step.
The implementation of term size profiling consists of three main parts:
- a source-to-source transform that computes the size of each heap cell
when it is constructed (and increments it in the rare cases when a free
argument of an existing heap cell is bound),
- a relatively small change to the code generator that reserves the extra
slot in new heap cells, and
- extensions to the facilities for creating cells from C code to record
the extra information we now need.
The diff overhauls polymorphism.m to make the source-to-source transform
possible. This overhaul includes separating type_ctor_infos and type_infos
as strictly as possible from each other, converting type_ctor_infos into
type_infos only as necessary. It also includes separating type_ctor_infos,
type_infos, base_typeclass_infos and typeclass_infos (as well as voids,
for clarity) from plain user-defined type constructors in type categorizations.
This change needs this separation because values of those four types do not
have size slots, but they ought to be treated specially in other situations
as well (e.g. by tabling).
The diff adds a new mdb command, term_size. It also replaces the proc_body
mdb command with new ways of using the existing print and browse commands
("print proc_body" and "browse proc_body") in order to make looking at
procedure bodies more controllable. This was useful in debugging the effect
of term size profiling on some test case outputs. It is not strictly tied
to term size profiling, but turns out to be difficult to disentangle.
compiler/size_prof.m:
A new module implementing the source-to-source transform.
compiler/notes/compiler_design.html:
Mention the new module.
compiler/transform_hlds.m:
Include size_prof as a submodule of transform_hlds.
compiler/mercury_compile.m:
If term size profiling is enabled, invoke its source-to-source
transform.
compiler/hlds_goal.m:
Extend construction unifications with an optional slot for recording
the size of the term if the size is a constant, or the identity of the
variable holding the size, if the size is not constant. This is
needed by the source-to-source transform.
compiler/quantification.m:
Treat the variable reference that may be in this slot as a nonlocal
variable of construction unifications, since the code generator needs
this.
compiler/compile_target_code.m:
Handle the new grade components.
compiler/options.m:
Implement the options that control term size profiling.
doc/user_guide.texi:
Document the options and grade components that control term size
profiling, and the term_size mdb command. The documentation is
commented out for now.
Modify the wording of the 'u' HLDS dump flag to include other details
of unifications (e.g. term size info) rather than just unification
categories.
Document the new alternatives of the print and browse commands. Since
they are for developers only, the documentation is commented out.
compiler/handle_options.m:
Handle the implications of term size profiling grades.
Add a -D flag value to print HLDS components relevant to HLDS
transformations.
compiler/modules.m:
Import the new builtin library module that implements the operations
needed by term size profiling automatically in term size profiling
grades.
Switch the predicate involved to use state var syntax.
compiler/prog_util.m:
Add predicates and functions that return the sym_names of the modules
needed by term size profiling.
compiler/code_info.m:
compiler/unify_gen.m:
compiler/var_locn.m:
Reserve an extra slot in heap cells and fill them in in unifications
marked by size_prof.
compiler/builtin_ops.m:
Add term_size_prof_builtin.term_size_plus as a builtin, with the same
implementation as int.+.
compiler/make_hlds.m:
Disable warnings about clauses for builtins while the change to
builtin_ops is bootstrapped.
compiler/polymorphism.m:
Export predicates that generate goals to create type_infos and
type_ctor_infos to add_to_construct.m. Rewrite their documentation
to make it more detailed.
Make orders of arguments amenable to the use of state variable syntax.
Consolidate knowledge of which type categories have builtin unify and
compare predicates in one place.
Add code to leave the types of type_ctor_infos alone: instead of
changing their types to type_info when used as arguments of other
type_infos, create a new variable of type type_info instead, and
use an unsafe_cast. This would make the HLDS closer to being type
correct, but this new code is currently commented out, for two
reasons. First, common.m is currently not smart enough to figure out
that if X and Y are equal, then similar unsafe_casts of X and Y
are also equal, and this causes the compiler do not detect some
duplicate calls it used to detect. Second, the code generators
are also not smart enough to know that if Z is an unsafe_cast of X,
then X and Z do not need separate stack slots, but can use the same
slot.
compiler/type_util.m:
Add utility predicates for returning the types of type_infos and
type_ctor_infos, for use by new code in polymorphism.m.
Move some utility predicates here from other modules, since they
are now used by more than one module.
Rename the type `builtin_type' as `type_category', to better reflect
what it does. Extend it to put the type_info, type_ctor_info,
typeclass_info, base_typeclass_info and void types into categories
of their own: treating these types as if they were a user-defined
type (which is how they used to be classified) is not always correct.
Rename the functor polymorphic_type to variable_type, since types
such as list(T) are polymorphic, but they fall into the user-defined
category. Rename user_type as user_ctor_type, since list(int) is not
wholly user-defined but falls into this category. Rename pred_type
as higher_order_type, since it also encompasses functions.
Replace code that used to check for a few of the alternatives
of this type with code that does a full switch on the type,
to ensure that they are updated if the type definition ever
changes again.
compiler/pseudo_type_info.m:
Delete a predicate whose updated implementation is now in type_util.m.
compiler/mlds_to_c.m:
compiler/mlds_to_gcc.m:
compiler/mlds_to_il.m:
compiler/mlds_to_java.m:
Still treat type_infos, type_ctor_infos, typeclass_infos and
base_typeclass_infos as user-defined types, but prepare for when
they won't be.
compiler/hlds_pred.m:
Require interface typeinfo liveness when term size profiling is
enabled.
Add term_size_profiling_builtin.increase_size as a
no_type_info_builtin.
compiler/hlds_out.m:
Print the size annotations on unifications if HLDS dump flags call
for unification details. (The flag test is in the caller of the
modified predicate.)
compiler/llds.m:
Extend incr_hp instructions and data_addr_consts with optional fields
that allow the code generator to refer to N words past the start of
a static or dynamic cell. Term size profiling uses this with N=1.
compiler/llds_out.m:
When allocating memory on the heap, use the macro variants that
specify an optional offset, and specify the offset when required.
compiler/bytecode_gen.m:
compiler/dense_switch.m:
compiler/dupelim.m:
compiler/exprn_aux.m:
compiler/goal_form.m:
compiler/goal_util.m:
compiler/higher_order.m:
compiler/inst_match.m:
compiler/intermod.m:
compiler/jumpopt.m:
compiler/lambda.m:
compiler/livemap.m:
compiler/ll_pseudo_type_info.m:
compiler/lookup_switch.m:
compiler/magic_util.m:
compiler/middle_rec.m:
compiler/ml_code_util.m:
compiler/ml_switch_gen.m:
compiler/ml_unify_gen.m:
compiler/mlds.m:
compiler/mlds_to_c.m:
compiler/mlds_to_gcc.m:
compiler/mlds_to_il.m:
compiler/mlds_to_java.m:
compiler/modecheck_unify.m:
compiler/opt_debug.m:
compiler/opt_util.m:
compiler/par_conj_gen.m:
compiler/post_typecheck.m:
compiler/reassign.m:
compiler/rl.m:
compiler/rl_key.m:
compiler/special_pred.m:
compiler/stack_layout.m:
compiler/static_term.m:
compiler/string_switch.m:
compiler/switch_gen.m:
compiler/switch_util.m:
compiler/table_gen.m:
compiler/term_util.m:
compiler/type_ctor_info.m:
compiler/unused_args.m:
compiler/use_local_vars.m:
Minor updates to conform to the changes above.
library/term_size_prof_builtin.m:
New module containing helper predicates for term size profiling.
size_prof.m generates call to these predicates.
library/library.m:
Include the new module in the library.
doc/Mmakefile:
Do not include the term_size_prof_builtin module in the library
documentation.
library/array.m:
library/benchmarking.m:
library/construct.m:
library/deconstruct.m:
library/io.m:
library/sparse_bitset.m:
library/store.m:
library/string.m:
Replace all uses of MR_incr_hp with MR_offset_incr_hp, to ensure
that we haven't overlooked any places where offsets may need to be
specified.
Fix formatting of foreign_procs.
Use new macros defined by the runtime system when constructing
terms (which all happen to be lists) in C code. These new macros
specify the types of the cell arguments, allowing the implementation
to figure out the size of the new cell based on the sizes of its
fields.
library/private_builtin.m:
Define some constant type_info structures for use by these macros.
They cannot be defined in the runtime, since they refer to types
defined in the library (list.list and std_util.univ).
util/mkinit.c:
Make the addresses of these type_info structures available to the
runtime.
runtime/mercury_init.h:
Declare these type_info structures, for use in mkinit-generated
*_init.c files.
runtime/mercury_wrapper.[ch]:
Declare and define the variables that hold these addresses, for use
in the new macros for constructing typed lists.
Since term size profiling can refer to a memory cell by a pointer
that is offset by one word, register the extra offsets with the Boehm
collector if is being used.
Document the incompatibility of MR_HIGHTAGS and the Boehm collector.
runtime/mercury_tags.h:
Define new macros for constructing typed lists.
Provide macros for preserving the old interface presented by this file
to the extent possible. Uses of the old MR_list_cons macro will
continue to work in grades without term size profiling. In term
size profiling grades, their use will get a C compiler error.
Fix a bug caused by a missing backslash.
runtime/mercury_heap.h:
Change the basic macros for allocating new heap cells to take
an optional offset argument. If this is nonzero, the macros
increment the returned address by the given number of words.
Term size profiling specifies offset=1, reserving the extra
word at the start (which is ignored by all components of the
system except term size profiling) for holding the size of the term.
Provide macros for preserving the old interface presented by this file
to the extent possible. Since the old MR_create[123] and MR_list_cons
macros did not specify type information, they had to be changed
to take additional arguments. This affects only hand-written C code.
Call new diagnostic macros that can help debug heap allocations.
Document why the macros in this files must expand to expressions
instead of statements, evn though the latter would be preferable
(e.g. by allowing them to declare and use local variables without
depending on gcc extensions).
runtime/mercury_debug.[ch]:
Add diagnostic macros to debug heap allocations, and the functions
behind them if MR_DEBUG_HEAP_ALLOC is defined.
Update the debugging routines for hand-allocated cells to print the
values of the term size slot as well as the other slots in the relevant
grades.
runtime/mercury_string.h:
Provide some needed variants of the macro for copying strings.
runtime/mercury_deconstruct_macros.h:
runtime/mercury_type_info.c:
Supply type information when constructing terms.
runtime/mercury_deep_copy_body.h:
Preserve the term size slot when copying terms.
runtime/mercury_deep_copy_body.h:
runtime/mercury_ho_call.c:
runtime/mercury_ml_expand_body.h:
Use MR_offset_incr_hp instead of MR_incr_hp to ensure that all places
that allocate cells also allocate space for the term size slot if
necessary.
Reduce code duplication by using a now standard macro for copying
strings.
runtime/mercury_grade.h:
Handle the two new grade components.
runtime/mercury_conf_param.h:
Document the C macros used to control the two new grade components,
as well as MR_DEBUG_HEAP_ALLOC.
Detect incompatibilities between high level code and profiling.
runtime/mercury_term_size.[ch]:
A new module to house a function to find and return term sizes
stored in heap cells.
runtime/mercury_proc_id.h:
runtime/mercury_univ.h:
New header files. mercury_proc_id.h contains the (unchanged)
definition of MR_Proc_Id, while mercury_univ.h contains the
definitions of the macros for manipulating univs that used to be
in mercury_type_info.h, updated to use the new macros for allocating
memory.
In the absence of these header files, the following circularity
would ensue:
mercury_deep_profiling.h includes mercury_stack_layout.h
- needs definition of MR_Proc_Id
mercury_stack_layout.h needs mercury_type_info.h
- needs definition of MR_PseudoTypeInfo
mercury_type_info.h needs mercury_heap.h
- needs heap allocation macros for MR_new_univ_on_hp
mercury_heap.h includes mercury_deep_profiling.h
- needs MR_current_call_site_dynamic for recording allocations
Breaking the circular dependency in two places, not just one, is to
minimize similar problems in the future.
runtime/mercury_stack_layout.h:
Delete the definition of MR_Proc_Id, which is now in mercury_proc_id.h.
runtime/mercury_type_info.h:
Delete the macros for manipulating univs, which are now in
mercury_univ.h.
runtime/Mmakefile:
Mention the new files.
runtime/mercury_imp.h:
runtime/mercury.h:
runtime/mercury_construct.c:
runtime/mercury_deep_profiling.h:
Include the new files at appropriate points.
runtime/mercury.c:
Change the names of the functions that create heap cells for
hand-written code, since the interface to hand-written code has
changed to include type information.
runtime/mercury_tabling.h:
Delete some unused macros.
runtime/mercury_trace_base.c:
runtime/mercury_type_info.c:
Use the new macros supplying type information when constructing lists.
scripts/canonical_grade_options.sh-subr:
Fix an undefined sh variable bug that could cause error messages
to come out without identifying the program they were from.
scripts/init_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
scripts/canonical_grade_options.sh-subr:
scripts/mgnuc.in:
Handle the new grade components and the options controlling them.
trace/mercury_trace_internal.c:
Implement the mdb command "term_size <varspec>", which is like
"print <varspec>", but prints the size of a term instead of its value.
In non-term-size-profiling grades, it prints an error message.
Replace the "proc_body" command with optional arguments to the "print"
and "browse" commands.
doc/user_guide.tex:
Add documentation of the term_size mdb command. Since the command is
for implementors only, and works only in grades that are not yet ready
for public consumption, the documentation is commented out.
Add documentation of the new arguments of the print and browse mdb
commands. Since they are for implementors only, the documentation
is commented out.
trace/mercury_trace_vars.[ch]:
Add the functions needed to implement the term_size command, and
factor out the code common to the "size" and "print"/"browse" commands.
Decide whether to print the name of a variable before invoking the
supplied print or browse predicate on it based on a flag design for
this purpose, instead of overloading the meaning of the output FILE *
variable. This arrangement is much clearer.
trace/mercury_trace_browse.c:
trace/mercury_trace_external.c:
trace/mercury_trace_help.c:
Supply type information when constructing terms.
browser/program_representation.m:
Since the new library module term_size_prof_builtin never generates
any events, mark it as such, so that the declarative debugger doesn't
expect it to generate any.
Do the same for the deep profiling builtin module.
tests/debugger/term_size_words.{m,inp,exp}:
tests/debugger/term_size_cells.{m,inp,exp}:
Two new test cases, each testing one of the new grades.
tests/debugger/Mmakefile:
Enable the two new test cases in their grades.
Disable the tests sensitive to stack frame sizes in term size profiling
grades.
tests/debugger/completion.exp:
Add the new "term_size" mdb command to the list of command completions,
and delete "proc_body".
tests/debugger/declarative/dependency.{inp,exp}:
Use "print proc_body" instead of "proc_body".
tests/hard_coded/nondet_c.m:
tests/hard_coded/pragma_inline.m:
Use MR_offset_incr_hp instead of MR_incr_hp to ensure that all places
that allocate cells also allocate space for the term size slot if
necessary.
tests/valid/Mmakefile:
Disable the IL tests in term size profiling grades, since the term size
profiling primitives haven't been (and probably won't be) implemented
for the MLDS backends, and handle_options causes a compiler abort
for grades that combine term size profiling and any one of IL, Java
and high level C.
Estimated hours taken: 0.5
library/array.m:
Improve completeness guarantees by using if-then-else's to ensure that
operations that can throw an exception are really conditional on bounds
checks.
This also allows us to call the `unsafe' (unchecked) versions directly.
Estimated hours taken: 3
Branches: main
Have the compiler define the RTTI of the array type, instead of having
it be handwritten.
library/array.m:
Add a type definition for the array type, making it a foreign type
(MR_ArrayPtr) with the existing predicates array_equal and
array_compare as its unify and compare preds.
Change array_compare to return the result as uo, not out,
to make this possible.
Delete all the hand-written code and data structures needed by
RTTI, since they are now compiler-generated.
Delete the old casts from MR_Word to MR_ArrayType *, since
they are now not needed (MR_ArrayPtr is defined as MR_ArrayType *).
Add a macro to centralize the LVALUE_CAST we now need when calling
MR_incr_hp_msg (which assumes that it assigning to an MR_Word).
compiler/mlds_to_c.m:
Generate MR_ArrayPtr instead of MR_Array for array/1.
compiler/mlds.m:
Back out my earlier change to mlds.m, since it isn't needed for
bootstrapping anymore.
runtime/mercury_library_types.h:
runtime/mercury_types.h:
Move the definitions of MR_ArrayType, MR_ArrayPtr and MR_ConstArrayPtr
from mercury_library_types to mercury_types, since they can now be
referred to from any compiler-generated C file in high level C grades.
Estimated hours taken: 4
Branches: main
Get the mercury compiler working with ROTOR, the MS shared source CLI
implementation.
compiler/mlds_to_il.m:
ROTOR doesn't allow calli calls to be made tail calls, so
don't make them tail calls.
compiler/options.m:
Add the option --support-rotor-clr which avoids generating
code which can cause problems for the ROTOR CLR.
library/array.m:
Fix some function signatures which were incorrectly declared
as returning int rather than MR_bool, which the MS CLR accepts
but ROTOR doesn't.
runtime/Mmakefile:
Add a commented out rule for compiling mercury_il.il for
ROTOR.
runtime/mercury_il.il:
Add a `// REMOVE FOR ROTOR comment' to all the tail. prefixes
associatied with calli instructions.
doc/user_guide.texi:
Document --support-rotor-clr.
Estimated hours taken: 4
Branches: main
library/*.m:
Delete Mercury clauses that just call sorry/1.
I applied this change to all files except the following:
rtti_implementation.m (because in that case, there is no C
implementation) and profiling_builtin.m and table_builtin.m
(because new back-ends needn't support profiling or tabling;
the warnings with `--warn-stubs' for those would be just noise.)
library/array.m:
Provide C# code for the (in, array_uo) mode of array__copy/2,
by copying the code for the (array_ui, array_uo) mode.
library/math.m:
Provide Mercury implementations of some of the math functions.
Estimated hours taken: 0.25
Branches: main
library/array.m:
Document why we have chosen to represent arrays of size 0 as
the null pointer on the .NET backend.
Estimated hours taken: 1
Branches: main
Implement array__make_empty_array on the IL backend.
library/array.m:
Use the null pointer to signify an empty array in
array__make_empty_array. Check for this null pointer before
manipulating an array object in all the relevant places.
Estimated hours taken: 6
Branches: main
Enforce namespace cleanliness in the library and browser directories
as well as in the runtime and trace directories.
Mmake.common.in:
Move the rules check_namespace here (they used to be in the Mmakefiles
of the runtime and trace directories), together with the variables they
need. Generalize them to also handle the needs of the browser, library
and bytecode directories. The former two in particular need the
ability to check automatically generated .mh files.
Make all the rules used by check_namespace conditional on a macro
that is defined by the Makefiles in all the directories that are
checked for namespace cleanliness.
trace/Mmakefile:
runtime/Mmakefile:
Replace the old rules for check_namespace, which are now in
../Mmake.common.in, with the macros needed to control their behavior.
bytecode/Mmakefile:
Add the macros needed to control the behavior of the rules for
check_namespace.
Move the lists of files to the start, before the include of
../Mmake.common.
browser/Mmakefile:
library/Mmakefile:
Add the macros needed to control the behavior of the rules for
check_namespace.
runtime/RESERVED_MACRO_NAMES:
Update comments, and delete obsolete exceptions.
browser/RESERVED_MACRO_NAMES:
library/RESERVED_MACRO_NAMES:
New files to contain the exceptions from the naming scheme.
tools/bootcheck:
Invoke "mmake check_namespace" in the library and browser directories
as well as the runtime and the trace directories. Perform the
invocation before we delete the object files we are checking for
cleanliness.
Clean up object files in all stage2 directories, not just the library,
as soon as we can.
library/array.m:
library/builtin.m:
library/io.m:
library/time.m:
Fix namespace violations.
Estimated hours taken: 3
Branches: main
Remove the assumption on user supplied comparison predicates that
C(X, Y, =) implies X = Y (similarly for comparison functions). Our code
shouldn't need to assume this, and sometimes more general orderings are
useful (for example, when you only want to compare the key of a key-value
pair). The existing assumptions were not documented anywhere, so we now
document the remaining assumptions in builtin.m.
With this assumption gone the issue of the stability of library sorting
predicates that allow a user supplied ordering arises, since elements may
be equivalent according to the ordering even though they are not equal.
Therefore modify the documentation of standard library predicates to make
clear what we do with equivalent elements, and make minor modifications to
the code to ensure that it does as we claim.
Although the builtin comparison predicates are guaranteed to satisfy the
assumption, we nevertheless remove it from the implementation of predicates
in list.m that use builtin comparison. The rationale for this is that we
don't need the assumption, and it may not be robust if in future we ever
decide to allow user defined comparison.
NEWS:
Mention the changed assumptions about user supplied comparison
predicates and functions.
Mention the new predicate exported from list.m.
library/builtin.m:
Add types comparison_pred/1 and comparison_func/1, and corresponding
insts. Document the assumptions we make about comparison predicates
and functions.
library/list.m:
Modify sort/3, sort_and_remove_dups/3, merge/4 and
merge_and_remove_dups/4, as well as any functional versions, to use
the new types. Document the stability of sorting, and modify the
code to ensure that we conform to this.
Add remove_adjacent_dups/3, which takes a user supplied comparison
predicate and determines whether elements are duplicates based on
this, rather than the usual equality.
Modify the implementation of some predicates that use compare, to
avoid the unnecessary assumption.
Fix some spelling and grammatical errors.
library/array.m:
library/bt_array.m:
Modify the interface of {,bt_}array__bsearch to use the new types
and insts. Update the documentation.
tests/hard_coded/Mmakefile:
tests/hard_coded/stable_sort.exp:
tests/hard_coded/stable_sort.m:
A test case that checks the stability of list__sort.
Estimated hours taken: 20
Branches: main
Add support for interfacing Mercury with the MPS garbage collector.
This change is broken into three parts:
1. Import version 1.100.1 of the MPS kit into the Mercury
CVS repository, in the directory `mps_gc'.
2. Make some changes to the MPS kit for Mercury,
to support fully-conservative collection and tagged pointers,
and to wrap it in an interface that is similar to that of
the Boehm collector.
3. Modify the rest of the Mercury implementation
to support linking with the MPS kit instead
of the Boehm collector. This involved defining
`mps' as a new GC method and a new grade component.
This is part 3 of 3.
Mmake.workspace:
Include the MPS directories in the header file and library search
paths.
tools/bootcheck:
Link the mps_gc directory into the stage2 and stage3 directories.
Mmake.workspace:
runtime/Mmakefile:
scripts/ml.in:
For *.mps grades, link in mps.a.
(XXX ml.in is linking in libmps.a, which is wrong.)
runtime/Mmakefile:
trace/Mmakefile:
In the rule for `check_headers', which checks macro namespace
cleanliness, allow names to start with `MPS_' or `mps_'.
runtime/RESERVED_MACRO_NAMES:
Add `mercury_mps_h', which is used by mps_gc/code/mercury_mps.h
for its header guard. (Normally it would be better to use
uppercase for header guard macro names, but that would be
inconsistent with the coding style used in mps_gc/code.)
scripts/canonical_grade.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
scripts/canonical_grade.sh-subr:
Handle the new `mps' GC method and grade component.
compiler/globals.m:
compiler/options.m:
doc/user_guide.texi:
Replace gc_method `conservative' with two alternatives
`boehm' and `mps'. ("--gc conservative" is still allowed,
and treated as equivalent to "--gc boehm".)
Add new function `gc_is_conservative' to globals.m.
compiler/mercury_compile.m:
compiler/handle_options.m:
Use `gc_is_conservative' rather than `= conservative'.
compiler/handle_options.m:
Handle the "mps" grade component.
(XXX need to document this in options.m and user_guide.texi)
compiler/compile_target_code.m:
Pass the appropriate C defines for the new GC methods.
compiler/mercury_compile.m:
Wrap the work-around for a Boehm GC bug inside `#ifndef MR_MPS_GC'.
library/array.m:
Use GC_FREE() rather than GC_free().
This is needed for two reasons:
- so that it works with MPS, which only defines GC_FREE
- so that it works with then Boehm collector when
GC debugging is enabled
library/benchmarking.m:
Output GC statistics for the MPS collector.
runtime/mercury.h:
runtime/mercury_heap.h:
runtime/mercury_init.h:
runtime/mercury_memory.h:
If MR_MPS_GC is defined, use mercury_mps.h rather than gc.h.
runtime/mercury_conf_param.h:
Add configuration macros MR_BOEHM_GC and MR_MPS_GC.
Set MR_CONSERVATIVE_GC if either of these is set.
Default to MR_BOEHM_GC if only MR_CONSERVATIVE_GC is set.
runtime/mercury_context.h:
runtime/mercury_deep_copy.h:
runtime/mercury_engine.h:
runtime/mercury_float.h:
runtime/mercury_heap.h:
Explictly #include "mercury_conf.h", so that
MR_CONSERVATIVE_GC will be set properly before it is tested.
runtime/mercury_grade.h:
Handle the .mps grade component.
runtime/mercury_memory.c:
runtime/mercury_wrapper.c:
runtime/mercury_memory_handlers.c:
Move the call to MR_setup_signals() earlier in the
initialization sequence, so that the MPS signal handlers
get installed after our signal handlers. This is needed
because our signal handlers assume that any signals that
they can't handle are fatal errors, which interfere's
with MPS's use of signal handlers for memory barriers.
runtime/mercury_wrapper.c:
Add code to initialize the MPS collector.
Put code which is specific to the Boehm collector inside
#ifdef MR_BOEHM_GC rather than #ifdef MR_CONSERVATIVE_GC.
runtime/mercury_wrapper.h:
Update a comment.
Estimated hours taken: 36
Branches: main
Harmonize the treatment of the builtin types by the runtime system across
the MLDS and LLDS C backends. (Their treatment by the .NET and Java backends
is unchanged, at least for now.)
Previously, the RTTI data structures and unify and compare predicates for the
builtin types were defined in runtime/mercury.c for the MLDS backend but in
library/{builtin,private_builtin,type_desc}.m for the LLDS backend. This
make several kinds of maintenance difficult, and more likely to be forgotten.
The two backends also had their generic unify/compare code in different modules
(mercury.c and mercuy_ho_call.c) and used distinct macros for defining RTTI
data structures. This change fixes those problems by defining a consistent
set of macros (with backend-specific implementations but backend-independent
semantics), concentrating the definitions of all the RTTI structures and of all
the unify and compare predicates for builtin types in a new module in the
runtime, mercury_builtin_types.[ch], and concentrating all the generic
unify/compare predicates in mercury_ho_call.[ch].
This change also makes the runtime use consistently module qualified names
for the RTTI data structures for the builtin types. Since they are not module
qualified by the Mercury compiler, we module qualify them by macros that map
the mmc-generated names to the ones expected by the runtime system. This makes
it easier to use the same macros in LLDS and MLDS grades.
runtime/mercury_builtin_types.[ch]:
New module to contain all the C code for the implementation of
unify and compare predicates for the builtin types. Its contents
comes from mercury.c in the runtime (for the MLDS C backend) and
builtin.m, private_builtin.m and type_desc.m in the library (for the
LLDS C backend).
The unify/compare predicates for tuples now report errors. This is
necessary because the tuple is a variable arity constructor. Their
previous implementations for the MLDS backend relied on only being
called from the generic unify/compare routines with a nonstandard
interface, being passed a typeinfo for the tuple type, rather than
the typeinfos for the arguments of the type constructor. This worked
because we don't currently specialize unifies/compares of tuple types,
but was a potential problem if we ever started to do such
specialization. The fix is to handle tuples in the generic
unify/compare routines, just as in the LLDS backend.
runtime/mercury_ho_call.c:
Move the generic unify/compare routines for the MLDS backend here
from mercury.c.
Conform to the coding standard wrt indentation.
runtime/mercury_ho_call.h:
Declare the generic unify/compare routines for both backends.
Delete a typedef that now needs to be in mercury_types.h to avoid
circular dependencies.
runtime/mercury_type_info.h:
Use the same macros for defining type_ctor_info structures for the MLDS
and LLDS backends.
This required moving the definitions of MR_UnifyFunc_N and
MR_CompareFunc_N here from mercury.c.
runtime/mercury_hlc_types.h:
A new file containing definitions of types needed by the MLDS C
backend. These definitions used to be in mercury.h, but now they are
needed in mercury_type_info.h, a header file that doesn't and shouldn't
include mercury.h. They can't easily be put in mercury_types.h because
they depend on mercury_std.h, and we are not allowed to include
mercury_std.h in mercury_types.h.
runtime/mercury.h:
Delete the definitions of the C types representing type_info and
pseudo_type_infos, since these are now in mercury_type_info.h.
#include mercury_type_info.h.
Delete the definitions now in mercury_hlc_types.h.
runtime/mercury.c:
Delete the definitions of the C types representing unify and compare
predicates, since these are now in mercury_type_info.h.
runtime/mercury_bootstrap.h:
Module qualify the RTTI data structures of the builtin types, since
it makes it easier to use the same macros to define RTTI structures
in the LLDS and MLDS backend. (Previously, mercury_bootstrap.h had
macros to delete such module qualification for the variable arity
types.)
runtime/mercury_types.h:
Move some type definitions from mercury_ho_call.h and
mercury_deep_profiling.h to mercury_types.h to prevent problems
with circular dependencies between header files.
runtime/mercury_debug.h:
Delete a #include to prevent a circular dependency.
runtime/mercury_profiling_builtin.[ch]:
A new module containing the {call,exit,redo,fail} port predicates
for deep profiling, moved here from library/profiling_builtin.m.
They are referred to by the implementations of the unify and compare
predicates of builtin types, and thus they need to be in the runtime
directory to avoid references from the runtime to the library.
runtime/Mmakefile:
Add the new files.
tools/make_port_code:
A script to generate runtime/mercury_profiling_builtin.[ch] fully
automatically.
library/array.m:
Use the new backend-independent macros to reduce the amount of code
that was duplicated for the two backends.
library/builtin.m:
library/private_builtin.m:
library/type_desc.m:
Delete RTTI structures and unify and compare predicates
that are now in runtime/mercury_builtin_types.c.
library/profiling_builtin.m:
Replace the definitions of the predicates implementing the
{call,exit,redo,fail} port predicates with external declarations.
trace/mercury_trace_vars.c:
Use a now backend-independent macro to refer to a type_ctor_info.
trace/Mmakefile:
Do not define MERCURY_BOOTSTRAP_H, since mercury_bootstrap.h now
contains some definitions needed by code in the trace directory.
Replace it with MR_NO_BACKWARDS_COMPAT.
util/mkinit.c:
Module qualify the references to the RTTI structures of builtin types,
since the generated _init.c files don't include mercury_bootstrap.h.
Note that after this change has bootstrapped, we should be able to
delete those references, since they were only needed to give the
runtime access to the addresses of RTTI structures that used to be
defined in the library, but are now defined in the runtime.
Estimated hours taken: 120
Branches: main
Allow the library to compile in the grade il (high level data).
compiler/ml_util.m:
Add more types which need to be represented using the low level
representation because of how they are handled in the library.
compiler/mlds_to_il.m:
Remove an XXX which is no longer necessary.
Add the heap_pointer type to the list of types whose RTTI is defined
by hand.
library/exception.m:
Move the definition of Exception from the runtime to the local module.
This is needed for when univ/0 is no longer represented as a low level
type.
runtime/mercury_mcpp.cpp:
Remove the implementation of Exception that is now in exception.m.
library/Mmakefile:
The lowlevel Exception type is now defined in the library not the
runtime, so add rules to ensure that the foreign code is built in
the correct order.
library/io.m:
Reimplement io__stream as a foreign_type. This makes the code more
type safe and avoids problems with the different representation of
the io__stream type when using high and low level data.
Change io__command_line_arguments so that it throws an exception
when we use high level data, as I am yet to work out how to access
high level lists.
library/rtti_implementation.m:
Add a comment that get_subterm doesn't work with high level data.
Fix some bugs with the default versions of type_ctor_compare_pred and
type_ctor_unify_pred.
library/sparse_bitset.m:
Remove the foreign_proc implementation of make_bitset_elem as it
will not work with both data representations and their is a Mercury
implementation.
library/string.m:
Remove the foreign_proc implementation of all the predicates which
manipulate lists as they all have a Mercury implementation, as I am yet
to work out how to access high level lists.
Add a Mercury implementation for string__join_list.
runtime/mercury_mcpp.h:
library/array.m:
library/builtin.m:
library/private_builtin.m:
library/type_desc.m:
Define and use typedefs where appropiate for type_info/0, type_info/1,
comparison_result/0 and univ/0, as there representation may change in
the future between using high level and low level data.
Estimated hours taken: 20
Branches: main
The tag bootstrap_20020613_intermod can be used to get a compiler which
compiles this change.
configure.in:
Test that the option --bug-intermod-2002-06-13 exists. This signifies
that the a bug in intermodule optimization for predicates which are
defined as both mercury and foreign code clauses.
library/array.m:
library/benchmarking.m:
library/builtin.m:
library/char.m:
library/construct.m:
library/deconstruct.m:
library/float.m:
library/gc.m:
library/int.m:
library/io.m:
library/library.m:
library/math.m:
library/private_builtin.m:
library/profiling_builtin.m:
library/rtti_implementation.m:
library/sparse_bitset.m:
library/std_util.m:
library/store.m:
library/table_builtin.m:
library/time.m:
library/type_desc.m:
Define a mercury version of every pragma foreign_proc.
Remove any foreign_procs which are not implemented yet.
Estimated hours taken: 0.2
Branches: main
library/*.m
Back out Pete's unreviewed change from yesterday.
It doesn't compile without a recent bug fix, but no
CVS tag was added.
Estimated hours taken: 16
Branches: main
Define a mercury version of every pragma foreign_proc, and remove any
foreign_procs which just throw an exception that the code is not implemented.
library/array.m:
library/benchmarking.m:
library/builtin.m:
library/char.m:
library/construct.m:
library/deconstruct.m:
library/exception.m:
library/float.m:
library/gc.m:
library/int.m:
library/io.m:
library/library.m:
library/math.m:
library/private_builtin.m:
library/profiling_builtin.m:
library/rtti_implementation.m:
library/sparse_bitset.m:
library/std_util.m:
library/store.m:
library/string.m:
library/table_builtin.m:
library/time.m:
library/type_desc.m:
Define a mercury version of every pragma foreign_proc, and remove any
foreign_procs which just throw an exception that the code is not
implemented.
Estimated hours taken: 8
Branches: main
library/array.m:
extras/trailed_update/tr_array.m:
runtime/mercury_deep_copy_body.h:
runtime/mercury_library_types.h:
Allocate arrays on the Mercury heap, using MR_incr_hp_msg(),
rather than using MR_GC_malloc(). This is needed for accurate
GC, to ensure that the objects pointed to by the array elements
will get traced by the collector.
Estimated hours taken: 0.25
Branches: main, release
library/array.m:
Fix an undetected unique mode error -- the input array
to 'elem :=' should have mode `array_di', not `array_ui'.
Estimated hours taken: 4
Branches: main
Add MR_ prefixes to the remaining non-prefixed symbols.
This change will require all workspaces to be updated
The compiler will start generating references to MR_TRUE,
MR_bool, etc., which are not defined in the old runtime
header files.
runtime/mercury_std.h:
Add MR_ prefixes to bool, TRUE, FALSE, max, min,
streq, strdiff, strtest, strntest, strneq, strndiff,
strntest, NO_RETURN.
Delete a commented out definition of `reg'.
runtime/mercury_tags.h:
Add an MR_ prefix to TAGBITS.
configure.in:
runtime/mercury_goto.h:
runtime/machdeps/i386_regs.h/mercury_goto.h:
Add an MR_ prefix to PIC.
runtime/mercury_conf_param.h:
Allow non-prefixed PIC and HIGHTAGS to be defined on
the command line.
runtime/mercury_bootstrap.h:
Add backwards compatibility definitions.
RESERVED_MACRO_NAMES:
Remove the renamed macros.
compiler/export.m:
compiler/ml_code_gen.m:
Use MR_bool rather than MR_Bool (MR_Bool is
meant to be for references to the Mercury type
bool__bool).
runtime/mercury_types.h:
Add a comment the MR_Bool is for references to
bool__bool.
*/*.c:
*/*.h:
*/*.m:
Add MR_ prefixes.
Estimated hours taken: 0.45
Branches: main
library/array.m:
- Don't include the array type name in the error message,
since doing so could inhibit optimization.
- Move the call to throw/1 into the body of out_of_bounds_error/3,
to improve code locality.
- Improve the error message: say explicitly "index ... not in range".
Estimated hours taken: 8
Branches: main
Soon foreign_proc will be impure by default unless given a promise_pure
or promise_semipure attribute. The syntax has been accepted for some
time, we now add the necessary declarations.
browser/dl.m:
compiler/timestamp.m:
library/*.m:
tests/hard_coded/unused_float_box_test.m:
Add promise_pure and promise_semipure declarations for foreign_procs.
Estimated hours taken: 0.3
Branches: main
library/array.m:
Added a new function out_of_bounds_error/3 to construct more
informative index-out-of-bounds error messages. Altered
array__lookup and array__set to use the new function.