Discussion of these changes can be found on the Mercury developers
mailing list archives from June 2018.
COPYING.LIB:
Add a special linking exception to the LGPL.
*:
Update references to COPYING.LIB.
Clean up some minor errors that have accumulated in copyright
messages.
Branches: main
Put all Mercury-generated Java classes into the package `jmercury' and
runtime classes into `jmercury.runtime'. The Mercury module hierarchy is
not reflected in the package name. We name sub-module classes using
their fully-qualified module names with `__' between components, e.g.
`bit_buffer.read' produces `class bit_buffer__read'.
As all generated Java code is in the same package we don't need to package
qualify identifiers, and we don't need the hack to avoid clashing package
and class names. It also makes it easier to write Java foreign code because
generated Java class names are easier to predict from Mercury module names.
The package names are not `mercury' and `mercury.runtime' because on
case-insensitive file systems we may end up with a `mercury' directory
that could be confused with the `Mercury' directory.
compiler/java_names.m:
Delete code related to mangling package names.
Remove the extra `mercury' prefix added to standard library module
names, as it is redundant with `jmercury'.
Change runtime package name.
compiler/mlds_to_java.m:
Make generated code follow the new packaging scheme.
Don't automatically import all runtime classes. It doesn't seem
necessary.
Update for new packaging scheme.
compiler/file_names.m:
Fix Java file paths for the new packaging scheme.
compiler/module_cmds.m:
compiler/rtti.m:
library/array.m:
library/backjump.m:
library/benchmarking.m:
library/bitmap.m:
library/builtin.m:
library/exception.m:
library/io.m:
library/library.m:
library/mutvar.m:
library/private_builtin.m:
library/rtti_implementation.m:
library/store.m:
library/string.m:
library/time.m:
library/type_desc.m:
java/runtime/*.java:
Rename package names.
Delete unnecessary package qualification.
compiler/mlds.m:
Add some XXXs to be fixed later.
library/Mmakefile:
Update for new packaging scheme.
Let mmake --use-mmc-make work in this directory.
Estimated hours taken: 1
Branches: main
Let benchmark.report_stats/0 report real times on POSIX platforms.
configure.in:
Check for time.h and gettimeofday().
runtime/mercury_conf.h.in:
Add MR_HAVE_TIME_H, MR_HAVE_GETTIMEOFDAY.
Unrelated change: add MR_HAVE_PTHREAD_H.
runtime/mercury_timing.c:
runtime/mercury_timing.h:
Add `MR_get_real_milliseconds'.
runtime/mercury_wrapper.c:
runtime/mercury_wrapper.h:
Rename MR_time_* globals to MR_user_time_*.
Add and initialise MR_real_time_* globals.
library/benchmarking.m:
Output real times in ML_report_stats().
Correct spelling of milliseconds.
java/runtime/Native.c:
java/runtime/Native.java.in:
trace/mercury_trace_declarative.c:
Correct spelling of milliseconds.
Estimated hours taken: 2
Branches: main
Implement some library procedures for the Java back-end.
library/time.m:
Implement c_clk_tck/0 for Java. Also changed the C implementation to
use the same macro as that used in Native.c.
java/runtime/Native.java.in:
Add new function clk_tck() to be called by c_clk_tck/0.
java/runtime/Native.c:
Add corresponding implementation for clk_tck().
Estimated hours taken: 0.1
Branches: main
Get configure to add a comment to Constants.java and Native.java
saying that they are automatically generated.
Update the java/runtime/.cvsignore.
java/runtime/Constants.java.in:
java/runtime/Native.java.in:
Get configure to add a comment saying that these files
are automatically generated.
java/runtime/.cvsignore:
Ignore the automatically generated file Native.java.
Estimated hours taken: 1.5
Branches: main
Implement some library procedures for Java.
library/benchmarking.m:
Implement the following predicates in Java:
report_stats/0
report_full_memory_stats/0
java/runtime/Native.java.in:
Record whether or not there has yet been an attempt to load the
library.
Add the side effect of loading the library to isAvailable(), in case
the static code for benchmarking.java is run before the static code
for Native.java.
Estimated hours taken: 13
Branches: main
Implement some library predicates for Java using JNI.
java/runtime/Native.java.in:
A new class which uses JNI to provide any native functionality
required by predicates of the standard library in Java.
So far it only provides methods relating to timing.
java/runtime/Native.c:
Source code, written in C, which implements all the native methods of
mercury.runtime.Native. Note that this implementation makes use of the
existing C implementation of the equivalent functions.
java/runtime/Mmakefile:
Rules for compiling a shared object from Native.c.
library/time.m:
Implement the following predicates for Java using Native interface:
time__c_clock/3
time__clocks_per_sec/1
time__times/7
library/benchmarking.m:
Implement the following predicates for Java using Native interface:
get_user_cpu_miliseconds/1
library/Mmakefile:
Renamed to library/Mmakefile.in, so as to have access to FULLARCH
constant.
library/Mmakefile.in:
Added rules for incorporating the Native shared object.