Estimated hours taken: 8, plus about 12 hours by Tyson.
Remove type_ctor_layouts and type_ctor_functors where not needed.
Simplify type_ctor_layouts by removing code that generates (and
documentations for) particularly representations that are no longer used
now that we use type_ctor_reps.
Several files also had miscellaneous cleanups and documentation fixes,
the most important being the move of the type_ctor_info structures
for preds/funcs from runtime/mercury_type_info.c to library/builtin.m.
compiler/base_type_layout.m:
Simplify documentation.
Remove references to representations in type_ctor_layouts that
are no longer used.compiler/base_type_layout.m:
compiler/base_type_info.m:
Keep base_type_info__type_ctor_rep_to_int in sync with
MR_TypeCtorRepresentation.
runtime/mercury_grade.h:
runtime/mercury_cpp.h:
Move the definitions of MR_STRINGIFY and MR_PASTEn to the new file
mercury_cpp.h. Add MR_PASTEn for several new values of n, for use by
mercury_type_info.h.
runtime/mercury_type_info.h:
Define macros for creating type_ctor_info structures for builtin types.
These have NULL layout and functor fields.
Remove several obsolete macros.
runtime/mercury_layout_util.c:
Use the new macros for defining a dummy type_ctor_info.
runtime/mercury_deep_copy_body.h:
runtime/mercury_tabling.c:
Modify the implementation of some RTTI functions to use the layout
and functors structures only if they are defined.
runtime/mercury_type_info.c:
Modify MR_collapse_equivalences to use the type_ctor_rep, not the
functors indicator, to check for equivalence, since the latter is
not guaranteed to be present.
Move the type_ctor_info structure for preds/funcs to builtin.m.
library/array.m:
Use these macros to define the type_ctor_info structure for array.
library/builtin.m:
Use these macros to define the type_ctor_info structure for int,
float, character, string, saved succip etc values, and for preds
and funcs.
library/private_builtin.m:
Use these macros to define the type_ctor_info structure for type_infos,
type_ctor_infos, typeclass_infos and base_typeclass_infos.
Move a c_header_code to the section that needs it.
library/std_util.m:
Use the new macros to define the type_ctor_info structure for univ
and for std_util's own type_info type.
Modify the implementations of some RTTI predicates to use the
layout and functors structures only if they are defined.
Estimated hours taken: 24
Ensure that the none.gc and none grades compile using a compiler
other than gcc. This is not completely tested as lcc on linux can't
generate code for boehm_gc, and 'cc -std1' on the alpha runs out of
memory while trying to link the compiler. However the compiler does
bootstrap using just gcc and also with lcc with boehm_gc compiled by
gcc.
configure.in:
-Wl,opt1,opt2 syntax is not supported by lcc instead use -Wlopt1
-Wopt2.
compiler/export.m:
Only output a label declaration if that label is exported, as the
static label declarations are not legal C.
library/io.m:
compiler/stack_layout.m:
Replace escape sequence \x with \\x in pragma c code.
library/array.m:
library/std_util.m:
Define what the struct is before using it, so the correct size for the
struct can be calculated.
library/private_builtin.m:
Replace escape sequence \x with \\x in pragma c code.
Ensure that there is at least one local variable so that the
structure definition for holding the local vars contains something.
runtime/mercury_faultaddr.h:
Remove an unnecessary cast.
runtime/mercury_reg_workarounds.h:
#include sys/time.h for FD_ZERO().
runtime/mercury_stack_trace.h:
Remove an extraneous ',' which was causing warnings.
Estimated hours taken: 0.2
library/*.m:
Put MR_ prefixes on uses of string_const(), make_aligned_string()
variants, and COMPARE_EQUAL and friends, in order to allow bootstrap
with -DMR_NO_BACKWARDS_COMPAT.
Estimated hours taken: 1.5
Add version information to type_ctor_infos. This way bootstrapping is
easier and binary compatibility can be broken more slowly.
RTTI code can check version numbers before performing operations on
data structures that have recently changed their representation.
At the least they can abort cleanly and let you know that it's time
to re-compile, at best they can handle both forms of the data structure.
It is a bootstrapping problem that currently there is no version number
information in the appropriate slot in pre-built systems.
The version numbers start at 2 simply because 2 "occurs naturally"
much less often than 1 or 0. And 42 was becoming trite.
compiler/base_type_info.m:
Generate RTTI version numbers in compiler-generated
type_ctor_infos.
library/builtin.m:
library/private_builtin.m:
library/std_util.m:
runtime/mercury_bootstrap.c:
runtime/mercury_type_info.c:
Add RTTI version numbers for handwritten type_ctor_infos.
runtime/mercury_type_info.h:
Add MR_RTTI_VERSION to define the current version of the RTTI
info and the first version: MR_RTTI_VERSION_INITIAL which
happens to have the value of 2.
Estimated hours taken: 8
Reorganize the routines for allocating and deallocating memory:
runtime/mercury_std.h:
runtime/mercury_misc.c:
runtime/mercury_memory.h:
runtime/mercury_memory.c:
- Put the routines in the proper place.
Previously the declarations and definitions of the memory
allocation/deallocation routines were spread amoungst
all four of these files; I moved the ones in mercury_std.h
and mercury_misc.c so that they are now all defined
in mercury_memory.{h,c}
- Avoid unnecessary duplication
The following routines did exactly the same thing,
modulo bugs(!):
allocate_bytes() and newmem()
deallocate_bytes() and oldmem()
make() and allocate_object()
make_many() and allocate_array()
- Use appropriate names.
I added `MR_' prefixes, and ensured that macros that are not
function-like macros use all uppercase. I also used a more
consistent naming scheme.
Previously the names used were
(1) checked_malloc, checked_realloc
(2a) allocate_bytes, deallocate_bytes, reallocate_bytes,
allocate_object, allocate_array, resize_array
(2b) newmem, oldmem, resizemem,
make, make_many, resize_many
The new names are
(1) MR_malloc, MR_free, MR_realloc,
MR_NEW, MR_NEW_ARRAY, MR_RESIZE_ARRAY
(2) MR_GC_malloc, MR_GC_free, MR_GC_realloc,
MR_GC_NEW, MR_GC_NEW_ARRAY, MR_GC_RESIZE_ARRAY
runtime/*.[ch]:
trace/*.[ch]:
library/array.m:
library/benchmarking.m:
library/io.m:
library/std_util.m:
extras/odbc/odbc.m:
extras/aditi/aditi.m:
Use the new names.
Estimated hours taken: 0.1
library/array.m:
Change the documentation to suggest using CFLAGS rather than
MGNUCFLAGS for `-DML_OMIT_ARRAY_BOUNDS_CHECKS'.
Estimated hours taken: 3
Fix problems that broke the `jump' and `fast' grades.
library/builtin.m:
library/private_builtin.m:
library/array.m:
library/std_util.m:
Use MR_MAYBE_STATIC_CODE() in initializers for type_ctor_infos,
to avoid a compilation error when code addresses are not valid
initializers. Call MR_INIT_TYPE_CTOR_INFO() to ensure that the
type_ctor_infos for c_pointer, type_info, type_ctor_info,
typeclass_info, base_typeclass_info, array, and univ are
initialized at runtime if they can't be initialized statically.
Estimated hours taken: 16
Changed all type_ctor_info structures to use the MR_TypeCtorInfo type. This
is primarily to reduce the number of conflicts when merging independent
changes to the type_ctor_info structures. As part of this, changed the type
of `string_const' to be `String' rather than `Word *', to avoid type errors
in the initialisers for compiler-generated type_ctor_infos.
compiler/llds_out.m:
Don't emit definitions for type_ctor_info structs; instead use
`MR_TypeCtorInfo_struct'.
Removed a couple of casts of `string_const's to type `String', since
they are no longer necessary.
compiler/llds.m:
Changed the entries for `string_const' and `multi_string_const' in
llds__const_type/2 to be `string' rather than `data_ptr'.
library/array.m:
library/builtin.m:
library/private_builtin.m:
library/std_util.m:
runtime/mercury_bootstrap.c:
runtime/mercury_type_info.c:
Changed all the hand-defined type_ctor_info structures to just use
`MR_TypeCtorInfo_struct', and added appropriate casts to the
initialisers. This included removing what appears to have been the
last vestiges of `USE_TYPE_LAYOUT' conditionals since their use was
so broken that it would probably be easier to re-implement the same
functionality from scratch than to debug and rebuild on what was left.
runtime/mercury_type_info.h:
Introduced `struct MR_TypeCtorInfo_struct' as the name of the
(previously anonymous) struct which `MR_TypeCtorInfo' was a pointer
to.
Introduced `MR_DECLARE_TYPE_CTOR_INFO_STRUCT' for declaring
type_ctor_info structures, since `MR_DECLARE_STRUCT' generates
old-style names for type_ctor_infos.
runtime/mercury_deep_copy.c:
runtime/mercury_tabling.c:
library/std_util.m:
extras/exceptions/exception.m:
Changed some uses of `MR_DECLARE_STRUCT' to use
`MR_DECLARE_TYPE_CTOR_INFO_STRUCT' instead.
runtime/mercury_bootstrap.h:
Added some `#define's of some old type_ctor_info type names to be
`MR_TypeCtorInfo_struct', so that during bootstrapping the type
names generated by the old version of the compiler work with the new
scheme used in the manual definitions.
runtime/mercury_string.h:
Changed the type of the macro `string_const/2'. It used to cast to
`Word *', now it casts to `String'.
Estimated hours taken: 5
[This change was by Ralph Becket.
I'm just the person who reviewed it and committed it. -fjh.]
Add functions for the single output det predicates in a number
of modules in the standard library. Basically, for each
:- pred f(in, ..., in, out) is det.
I have added the declaration
:- func f(in, ..., in) = out.
and definition
f(X1, ..., Xn) = Y :-
f(X1, ..., Xn, Y).
library/char.m:
library/dir.m:
library/map.m:
library/string.m:
library/list.m:
library/set.m:
Make the changes described above.
library/array.m:
As above, except array input modes are all array_ui or
array_di as appropriate and array output modes are array_uo.
library/int.m:
Added forward versions of +/2, */2 and -/2 as plus/2, times/2
and minus/2 respectively, to make it easier to pass these
as arguments to higher-order predicates.
Also added func constants for max_int, min_int and bits_per_int.
library/integer.m:
Replaced local functions for list head, tail and length with
calls to equivalent functions now defined in list.m.
library/io.m:
Added func for error_message/2.
library/list.m:
Add functions det_head/1 and det_tail/1 which abort on null lists.
library/set.m:
Add functions map/2, filter_map/2 and fold/3.
library/std_util.m:
Added utility function to construct a pair object from its
arguments and general purpose higher order functions for
partial functions and for function composition, exponentiation
and exchanging the arguments of a binary function.
Estimated hours taken: 30 (including debugging)
Add MR_TYPECTOR_REP_* to the type_ctor_info to describe the
representation of this type.
We want to do this because it allows us to check quickly to see
what kind of data representation is being used. Previously this
information was spread throughout the type_ctor_layout and
type_ctor_functors data structures. It was complex to interpret
and contained a lot of unnecessary duplication.
We can now omit data structures such as the type_ctor_layout in many
cases (it is only necessary for discriminated unions). Because we rule
out some of the possible alternatives, the encodings used in the
type_ctor_layout can be simplified. Also, the functors indicator in
type_ctor_functors can be removed, as it subsumed by this data
structure.
Use this representation in code that uses RTTI.
compiler/base_type_info.m:
Add a missing alternative to the type_ctor_rep (this was a
bug).
library/array.m:
library/builtin.m:
library/private_builtin.m:
runtime/mercury_bootstrap.c:
Use MR_TYPECTOR_REP_* in the type_ctor_infos for builtin types.
library/std_util.m:
runtime/mercury_deep_copy_body.h:
runtime/mercury_tabling.c:
Use MR_TYPECTOR_REP_* and MR_DISCUNION_TAG_* to dispatch on
data representations.
Also, fix a bug in deep_copy when copying floating point values.
I'm not sure when this stopped working, or if this is exactly
the right fix, but it is more correct than the previous code.
runtime/mercury_type_info.c:
runtime/mercury_type_info.h:
Update code to use MR_TYPECTOR_REP_*.
Use a struct for type_ctor_info.
tests/hard_coded/Mmakefile:
tests/hard_coded/deep_copy.m:
tests/hard_coded/deep_copy.exp:
Add a test case for deep_copy.
Estimated hours taken: 0.5
Move the type_ctor_infos for array and univ into their proper places.
This change has bootstrapped on most of our platforms, but actually
causes trouble linking small programs (because it creates runtime ->
library dependencies). So we should move it as soon as possible.
library/array.m:
library/std_util.m:
Add type_ctor_info for array and univ.
runtime/mercury_bootstrap.c:
Remove type_ctor_info for array and univ.
Estimated hours taken: 4.5
Remove support for --args simple. We don't use it, we won't use it even for
experiments, and it is unnecessary complication.
If anybody were using --args simple, this would need bootstrapping, but
since nobody does, there is no need, and this can be committed as an
ordinary change.
compiler/options.m:
doc/user_guide.texi:
scripts/*.in:
scripts/*.sh-subr:
Remove the --args option.
compiler/globals.m:
Remove the args_method global and its access predicates.
compiler/handle_options.m:
Don't set the args_method global from the option.
compiler/arg_info.m:
Remove support for --args simple. This allows us to remove a now
redundant argument from an exported predicate.
compiler/mercury_compile.m:
Remove the code for passing -DCOMPACT_ARGS to the C compiler.
compiler/bytecode_gen.m:
compiler/fact_table.m:
compiler/follow_vars.m:
compiler/live_vars.m:
compiler/call_gen.m:
Don't pass the unnecessary argument to arg_info.
compiler/call_gen.m:
compiler/unify_gen.m:
Remove now unnecessary assertions.
compiler/hlds_pred.m:
Don't include an args_method in proc_infos; instead, include
a slot that says whether the procedure's address is taken or not.
(In most cases, this determined whether the args_method was
simple or compact.) We will need this bool in the near future
(when we generate layout structures for procedures whose address
is taken).
Modify the signatures of exported predicates to accommodate
this change to the data structure.
compiler/hlds_out.m:
Print the new slot, not the args_method.
compiler/lambda.m:
When creating procedures from lambdas, set the address-taken slot
to address_is_taken instead of setting up its args_method.
compiler/make_hlds.m:
Minor changes to conform to the changes in the signatures of
the predicates exported from hlds_pred.m.
compiler/check_typeclass.m:
compiler/clause_to_proc.m:
compiler/dnf.m:
compiler/magic.m:
compiler/magic_util.m:
compiler/modecheck_call.m:
compiler/pd_info.m:
compiler/post_typecheck.m:
compiler/unify_gen.m:
Minor changes to conform to the changes in the signatures of
the predicates exported from hlds_pred.m and make_hlds.m.
runtime/mercury_type_info.h:
Remove the conditional definition of the macros that provided
an argument-method-independent way of referring to the registers
holding the inputs and outputs of e.g. unification procedures.
We don't need the independence anymore, and using registers instead
of macros in the code ensures that maintainers are aware of register
reuse issues (e.g. they copy an input from r1 before overwriting it
with an output).
runtime/mercury_conf_param.h:
runtime/mercury_grade.h:
Remove support for the args method component of the grade.
runtime/mercury_ho_call.c:
runtime/mercury_tabling.c:
library/*.m:
Conform to the changes in runtime/mercury_type_info.h by effectively
applying the #defines appropriate to compact args by hand.
Remove code and data structures only needed for simple args.
Remove comments needed only in the presence of uncertainty about
the args method.
Estimated hours taken: 0.4
Add a new predicate to array.m: array__map.
NEWS:
mention the new predicate.
library/array.m:
add the new predicate array__map/3.
Estimated hours taken: 8
During the writing of the RTTI paper, we decided that type_ctor_info
was a much better name than base_type_info.
Rename base_type* as type_ctor*, except we don't rename the modules
base_type_info and base_type_layout just yet.
Most of these changes were made using the following sed patterns:
s/base_type_info/type_ctor_info/g
s/base_type_layout/type_ctor_layout/g
s/base_type_functors/type_ctor_functors/g
s/BASETYPE_INFO/TYPE_CTOR_INFO/g
s/TYPEFUNCTORS/TYPE_CTOR_FUNCTORS/g
s/TYPELAYOUT/TYPE_CTOR_LAYOUT/g
s/BASE_TYPEINFO/TYPE_CTOR_INFO/g
s/BASE_TYPE_INFO/TYPE_CTOR_INFO/g
s/BaseTypeInfo/TypeCtorInfo/g
s/BaseTypeLayout/TypeCtorLayout/g
s/base_type(/type_ctor(/g
s/:- module type_ctor_info/:- module base_type_info/g
s/:- module type_ctor_layout/:- module base_type_layout/g
s/type_ctor_info__/base_type_info__/g
s/type_ctor_layout__/base_type_layout__/g
/import_module/s/type_ctor_info/base_type_info/g
/import_module/s/type_ctor_layout/base_type_layout/g
compiler/*.m:
library/*.m:
runtime/*.{c,h}:
profiler/demangle.m:
util/mdemangle.c:
Applied the above sed commands.
runtime/mercury_bootstrap.h:
Add bootstrapping #defines so the type_ctor_* substitutions in
the library don't cause link problems.
Delete some redundant bootstrapping definitions.
Estimated hours taken: 18
Make it possible to compile a module (e.g. std_util) without debugging,
while still allowing debuggable code called from that module via higher-order
predicates (e.g. solutions) to have a proper stack trace.
compiler/options.m:
Add the new option --stack-trace-higher-order.
compiler/mercury_compile.m:
Always invoke continuation_info and stack_layout, since it is no
longer the case that either all procedures or none get layout
structures generated for them, and the other modules are in a better
position to make that decision.
compiler/continuation_info.m:
Handle the extra tests required by the change to mercury_compile.m.
When we gather info about a procedure, remember whether that
procedure must have a procedure layout that includes the procedure id
section.
compiler/stack_layout.m:
Use the flag remembered by continuation_info to help decide
whether we need procedure layout structures.
Fix an old space wastage: after generating marker saying that
the second and later groups of fields of a procedure layout are
not present, do not generate another marker saying that the
third group of fields is not present. Since it was in the wrong
position, it did not have the right meaning; it only worked because,
due to the presence of the first marker, it was never looked at anyway.
compiler/code_gen.m:
Use the new capability of continuation_info.m to require
procedure layouts including procedure id sections for any predicate
that has higher-order arguments, if --stack-trace-higher-order is set.
compiler/globals.m:
Rename want_return_layouts as want_return_var_layouts, since this
is a more accurate representation of what the predicate does.
compiler/call_gen.m:
compiler/code_info.m:
Conform to the change in globals.m.
compiler/llds_out.m:
Separate the c_modules containing compiler-generated code into two
groups, those that define labels that have stack layouts and those
that don't. In most cases one or the other category will be empty,
but with --stack-trace-higher-order, the c_modules containing
higher-order procedures will have stack layouts, while others will
not.
Reorganize the way the way the initialization functions are generated,
by putting c_modules falling into different categories into different
bunches. c_module falling into the first category always have their
initialization code included, while those in the second category
have it included only if the old flag MR_MAY_NEED_INITIALIZATION
is set.
Delete the obsolete #define of MR_STACK_TRACE_THIS_MODULE.
Improve some predicate names, in an effort to prevent confusion
about what a "file" is (since the code uses more than one meaning,
given the presence of --split-c-files).
compiler/pragma_c_gen.m:
Fix an old bug: s/NONDET_FIXED_SIZE/MR_NONDET_FIXED_SIZE/.
Required for the change to library/string.m.
doc/user_guide.texi:
Document the new option.
runtime/mercury_goto.c:
Simplify the conditions under which labels get added to the label
table with:
- The macros init_{entry,label,local}_ai always add
the label to the label table without a layout structure.
- The macros init_{entry,label,local}_sl always add it with a layout
structure.
- Whether the macros init_{entry,label,local} with no suffix
add the label to the label table depends on the values of other
configuration parameters, but they will never include a layout
structure.
The intended use is that any label that has a layout structure should
be initialized with a _sl macro. Any other label that should always
be in the label table if the label table is needed at all (labels
such as do_fail) should be initialized with _ai. Everything else
should be initialized with a suffixless macro.
runtime/mercury_conf_params.c:
Remove MR_USE_STACK_LAYOUTS and MR_STACK_TRACE_THIS_MODULE, since
due to the simplification of mercury_goto.h, they are not used anymore.
runtime/mercury_stack_layout.h:
Remove the old macros for creating layout structures with bogus
contents, and replace them with new macros for creating layout
structures with meaningful contents.
runtime/mercury_engine.c:
runtime/mercury_wrapper.c:
Remove bogus layout structures. Ensure the labels defined here
always get into the label table.
runtime/mercury_ho_call.c:
Remove bogus layout structures. Add proper ones where necessary.
runtime/mercury_bootstrap.c:
runtime/mercury_type_info.c:
Remove bogus layout structures.
runtime/mercury_boostrap.h:
Add this new file for bootstrapping purposes.
Temporarily #define NONDET_FIXED_SIZE as MR_NONDET_FIXED_SIZE, since
pragma_c_gen.m refers to the former until the update to it gets
installed.
runtime/Mmakefile:
Add a reference to mercury_boostrap.h.
library/builtin.m:
Remove bogus layout structures.
library/array.m:
library/benchmarking.m:
library/private_builtin.m:
Remove bogus layout structures. Add proper ones.
library/std_util.m:
Remove bogus layout structures. Add proper ones.
Replace references to framevar(n) with references to MR_framevar(n+1).
Fix an old bug in code under #ifndef COMPACT_ARGS: in the
implementation of mercury____Compare___std_util__univ_0_0_i1, the
succip register was not being saved across the call to
mercury__compare_3_0.
library/string.m:
Remove the need for bogus layout structures, by converting the
implementation of string__append(out, out, in) from hand-written
C module into nondet pragma C code.
Estimated hours taken: 0.5
Another fix to my change to ensure that the declarations and definitions
for data constants specify the same linkage (extern or static).
This one is needed to make it work with --split-c-files.
runtime/mercury_goto.h:
Add an `MR_' prefix to the MODULE_STATIC_OR_EXTERN.
library/array.m:
library/builtin.m:
library/std_util.m:
extras/clpr/cfloat.m:
Use MR_MODULE_STATIC_OR_EXTERN instead of `static' on the hand-coded
definitions of the base_type_functors and base_type_layouts for
builtin types.
Estimated hours taken: 3
Ensure that the declarations and definitions for data constants
specify the same linkage (extern or static), because the C standard
says that if the linkage is different, then the behaviour is undefined.
This bug resulted in undefined symbol link errors for the RS/6000 AIX port.
compiler/llds_out.m:
When printing out declarations for data constants,
compute the linkage from the data_name, rather than
always assuming `extern'. When printing out definitions,
add a sanity check to ensure that the linkage that would be
computed from the data_name is the same as the linkage used
for the definition.
compiler/base_type_info.m:
Make base_type_infos always exported from the module, never local.
This is necessary to ensure that the linkage can be
computed from the data_name.
compiler/base_type_layout.m:
Make base_type_functors and base_type_info structures
always local to the module, rather than exported.
This is necessary to ensure that the linkage can be
computed from the data_name.
library/array.m:
library/builtin.m:
library/std_util.m:
Add `static' to the hand-coded definitions of the base_type_functors
and base_type_layouts for builtin types.
compiler/base_typeclass_info.m:
compiler/llds.m:
compiler/stack_layout.m:
Add comments pointing to the new predicate linkage/2 in
llds_out.m, to ensure that future maintenance doesn't break
the assumptions it makes.
Estimated hours taken: 1.5
Improve the multi-threaded execution support.
runtime/mercury_context.{c,h}:
Move the code for runnext from the .h file to the .c file -
it is reasonably large (in the thread_safe grades) so avoiding
the duplication is handy. It also makes debugging much easier!
Also, make scheduling a context as runnable append it to the
end of the runqueue, rather than consing it to the front. This
yeilds more useful behaviour for concurrent code that wants to
yeild in favour of any other runnable context.
library/math.m:
library/string.m:
library/io.m:
Add thread_safe to the flags for a whole bunch of predicates and
functions that are thread-safe.
Estimated hours taken: 0.5
library/*.m:
Convert
:- pragma(c_code, ...
to
:- pragma c_code(...
and introduce will_not_call_mercury in places where it is implicit
(this is in preparation for changing the default to may_call_mercury).
Estimated hours taken: 0.5
NEWS:
mention the changes to map and tree234.
library/map.m:
added map__foldl/4 and map__map_values/3 which forward to the
corresponding predicates in tree234.
library/tree234.m:
implement tree234__foldl and tree234__map_values.
Estimated hours taken: 0.2
library/array.m:
Fix comments about bounds checking - the "maximum" performance
recommendation can be improved by compiling the entire
module with bounds checking off, not just the bits that
get intermodule-optimized.
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: 30
Add library and runtime support for stack layouts.
library/array.m:
library/benchmarking.m:
library/mercury_builtin.m:
library/std_util.m:
library/string.m:
runtime/mercury_engine.c:
runtime/mercury_ho_call.c:
runtime/mercury_type_info.c:
Add MR_MAKE_STACK_LAYOUT_* macros to add basic stack layouts for
handwritten C code.
runtime/mercury_type_info.c:
Remove some duplicate label declarations.
runtime/mercury_calls.h:
Don't use ASM_FIXUP_REGS in calls with NATIVE_GC - we don't
want (or need) to use it. We define all labels as entry labels
anyway, so an ASM_FIXUP_REGS is done at each label.
runtime/mercury_label.c:
runtime/mercury_label.h:
runtime/mercury_goto.h:
Insert references to stack layouts into the label table.
Use the label table when NATIVE_GC is defined.
Modify the way labels are declared so they have the necessary
scope.
runtime/mercury_imp.h:
Include mercury_accurate_gc.h
runtime/mercury_accurate_gc.h:
Add some macros to define stack layouts for handwritten
code, and access various fields of the stack layouts.
util/mkinit.c:
Add NATIVE_GC to the #ifdef .... that controls the running of
the initialization code for each module. NATIVE_GC requires the
label table to be initialized.
Fix this code so the two instances of this list of #defines are
replaced by a single string constant. I've been bitten _twice_
by this double definition, and I refuse to be bitten again.
compiler/stack_layout.m:
Rename MR_LIVE_LVAL to Mr_Live_Lval in the documentation.
Estimated hours taken: 0.25
library/array.m:
Put code for array bounds checking inside
`#ifndef ML_OMIT_ARRAY_BOUNDS_CHECKS', so that the user
can disable array bounds checking.
Estimated hours taken: 1
A few small changes towards supporting backtrackable destructive update
better.
library/mercury_builtin.m:
Add new insts mdi/1 and mostly_dead/0.
library/array.m:
Change the name of the inst for unique arrays
from `array' to `uniq_array' (someone got over-enthusiastic
with global search and replace when uniq_array.m was
renamed array.m).
Add insts for non-unique arrays and mostly-unique arrays.
library/bt_array.m:
Add a comment.
Estimated hours taken: 0.1
library/array.m:
Move `:- import_module std_util' declaration into the
interface, since it's needed there for the type `maybe(T)'
used by array__bsearch.
Estimated hours taken: 6
The main purpose of this change is to rename array.m as bt_array.m, and
uniq_array.m as array.m. The interfaces of those two modules have grown
slightly so that they match a little more closely. Details are in the
file NEWS.
The implementation of bt_array (formerly array) has been changed to use
a slightly more efficient implementation.
NEWS:
Interface changes documented.
library/array.m:
library/bt_array.m:
Changes mentioned above and detailed in the NEWS file.
library/uniq_array.m:
Bereft of life and resting in peace.
library/io.m:
library/library.m:
library/std_util.m:
library/term.m:
compiler/base_type_layout.m:
runtime/deep_copy.c:
runtime/type_info.h:
Minor changes to fix the special case of base_type_layout
operations for arrays rather than uniq_arrays.
tests/hard_coded/write.exp:
tests/hard_coded/write.m:
Test writing of arrays.
tests/general/array_test.exp:
tests/general/array_test.m:
Test some array/bt_array operations.
Estimated hours taken: 3
Enable --warn-interface-imports by default. This was turned off while
list and term were defined in mercury_builtin.m, since it caused many
warnings.
Fix all the unused interface imports that have been added since then.
compiler/options.m:
Enable --warn-interface-imports by default.
compiler/module_qual.m:
Fix formatting inconsistencies with module names in warning
messages. (".m" was not appended to module names if there was
only one module).
compiler/*.m:
library/*.m:
tests/invalid/type_loop.m:
tests/warnings/*.m:
Remove usused interface imports, or move them into
implementation (mostly bool, list and std_util).
Estimated hours taken: Not much at all. :-)
Fixed some stuff in array.m.
library/array.m:
Moved array__fetch_items into the interface. Some general
cleanups of the documentation.
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.mercury:
Override the MERCURY_LIB_OBJS variable when invoking ml.
This avoids some bootstrapping problems.
Also, add mercury_compile.nu.
Makefile.common:
Bump NU-Prolog's -u option up to 2000 (8M), to avoid some memory
problems.
array.nl, bintree.nl, char.nl, dir.nl, globals.nl, list.nl, map.nl, modes.nl,
prog_util.nl, stack.nl, std_util.nl, string.nl, term.nl:
Avoid the use of implied modes.
code_info.nl, bimap.nl, make_hlds.nl, mercury_compile.nl,
mercury_to_mercury.nl, unify_proc.nl:
Fix determinism errors which had previously not been discovered
because of either implied modes or running out of memory.
(Note that I had to change the interface to bimap__lookup, since
it's not possible to make it bidirectional.)
code_util.nl, llds.nl, opt_debug.nl, value_number.nl:
Rename `operator' as `binary_op'.
hlds.nl, code_info.nl, unify_gen.nl, llds.nl, opt_debug.nl, switch_gen.nl:
*** Handle simple cases of higher-order pred terms. ***
(We don't yet handle taking the address of an overloaded
predicate or a predicate with multiple modes.
We don't handle closures. call/1 and call/N are not yet implemented.
This has not yet been tested.)
make_hlds.nl:
Modify the mode priority ordering so that semidet modes get
selected before det ones.
llds.nl:
Don't include the priority part of the mode number in the mangled
label name. *** Note: this will break some things! ***
mercury_compile.nl:
Move the NU-Prolog hacks into mercury_compile.nu.nl.
switch_gen.nl:
Fix a simple logic bug in handling the grab/slap of the code_info.
prog_io.nl, builtins.nl, int.nl:
Fix bugs and omissions with handling of the new arithmetic operators.
prog_io.nl:
As a quick hack, strip off calls to io__gc_call
(this avoids spurious error messages which are due to
the fact that we don't get mode analysis right in those cases).