Estimated hours taken: 0.25
Branches: main
This change fixes a compiler abort while compiling array.m in grade java.
compiler/java_util.m:
Added a translation for ">=" as a binary infix operator.
Reordered the code to match the order of binary_op in
compiler/builtin_ops.m.
Estimated hours taken: 2
Branches: main
compiler/*.m:
Import only one compiler module per line. Sort the blocks of imports.
This makes it easier to merge in changes.
In a couple of places, remove unnecessary imports.
Estimated hours taken: 0.25
Branches: main
Trivial comment changes.
compiler/inst_match.m:
Update some obsolete comments to match the current interface.
Add a comment about contravariance/covariance in
pred_inst_argmodes_matches.
compiler/java_util.m:
compiler/notes/compiler_design.html:
Fix typos.
The main aim of this change is to make the overall, high-level structure
of the compiler clearer, and to encourage better encapsulation of the
major components.
compiler/libs.m:
compiler/backend_libs.m:
compiler/parse_tree.m:
compiler/hlds.m:
compiler/check_hlds.m:
compiler/transform_hlds.m:
compiler/bytecode_backend.m:
compiler/aditi_backend.m:
compiler/ml_backend.m:
compiler/ll_backend.m:
compiler/top_level.m:
New files. One module for each of the major components of the
Mercury compiler. These modules contain (as separate sub-modules)
all the other modules in the Mercury compiler, except gcc.m and
mlds_to_gcc.m.
Mmakefile:
compiler/Mmakefile:
Handle the fact that the top-level module is now `top_level',
not `mercury_compile' (since `mercury_compile' is a sub-module
of `top_level').
compiler/Mmakefile:
Update settings of *FLAGS-<modulename> to use the appropriate
nested module names.
compiler/recompilation_check.m:
compiler/recompilation_version.m:
compiler/recompilation_usage.m:
compiler/recompilation.check.m:
compiler/recompilation.version.m:
compiler/recompilation.version.m:
Convert the `recompilation_*' modules into sub-modules of the
`recompilation' module.
compiler/*.m:
compiler/*.pp:
Module-qualify the module names in `:- module', `:- import_module',
and `:- use_module' declarations.
compiler/base_type_info.m:
compiler/base_type_layout.m:
Deleted these unused empty modules.
compiler/prog_data.m:
compiler/globals.m:
Move the `foreign_language' type from prog_data to globals.
compiler/mlds.m:
compiler/ml_util.m:
compiler/mlds_to_il.m:
Import `globals', for `foreign_language'.
Mmake.common.in:
trace/Mmakefile:
runtime/Mmakefile:
Rename the %.check.c targets as %.check_hdr.c,
to avoid conflicts with compiler/recompilation.check.c.
Estimated hours taken: 50
Branches: main
Bug fixes and additions to the Java back-end so that it will now successfully
compile and run mercury programs which contain higher order code as well as
non-deterministic code.
With some hacked up Mercury library code (in Java) I am able to compile 10 of
the 11 files in the tests/benchmarks directory into Java and run them to
receive the correct output.
mercury/compiler/mlds_to_java.m:
Many small bug fixes.
Disabled current (incomplete) name mangling code. All class, package
and method names apart from java.* and mercury.runtime.* will be
output as lowercase for the moment.
Added code to prefix some classes/packages so we don't run into the
problem of having a class or package name which is also a Java reserved
word. This is the case with the mercury library modules int and char.
Added code to implement commits.
mercury/compiler/java_util.m:
Added a few missing Java reserved words.
mercury/compiler/ml_code_util.m:
A small change so that in one case where they weren't, multiple return
values are now generated in the MLDS.
mercury/java/Commit.java:
Added this file, a throwable class used for the implementation of
commits.
mercury/java/ProcAddr.java:
mercury/java/Compare.java:
mercury/java/Unify.java:
Removed these files, they're now obsolete as they all use the standard
interface for method pointers provided by MethodPtr.java.
mercury/java/TypeCtorInfo_Struct.java:
Altered to reference mercury.runtime.MethodPtr instead of
mercury.runtime.[Unify|Compare].
Estimated hours taken: 90
Branches: main
Changes and additions to the Java back-end so that:
o While tags shouldn't be generated, they do get generated in some cases
and are now handled correctly.
o The Java back-end now generates class constructors.
o The Java back-end is now able to simulate the behaviour of function
pointers, which are used for closures, continuations, as well as unify
and compare.
mercury/compiler/mlds_to_java.m:
Extensive changes to existing code to implement tags and class
constructors. Also, addition of code to search MLDS for uses of
function pointers and to generate MLDS for wrapper classes. As well
as many small bug fixes.
Removed some (unfinished) code for dealing with Unify and Compare, this
code was redundant now that function pointers have been implemented.
mercury/compiler/java_util.m:
Updated to return noops for most tag operators.
mercury/java/MethodPtr.java:
New file. This is the interface which the wrapper classes used for
function pointers extend.
Estimated hours taken: 0.25
Branches: main
Merge changes from the reuse branch back onto the main branch.
compiler/ml_unify_gen.m:
Handle the case where the tag on the cell to be reused is unknown.
compiler/hlds_goal.m:
Add a field which records what possible cons_ids the cell to be
reused can be tagged with.
compiler/builtin_ops.m:
Add the unary builtin operator strip_tag.
compiler/bytecode.m:
compiler/c_util.m:
compiler/java_util.m:
compiler/llds.m:
compiler/mlds_to_il.m:
compiler/opt_debug.m:
bytecode/mb_disasm.c:
bytecode/mb_exec.c:
Handle the strip_tag operator.
Estimated hours taken: 200
Converts MLDS to Java source code. The following features
do not work/have not yet been implemented:
* RTTI
* foreign language interface
* multidet and nondet predicates
* higher order predicates
* enforced usage of Java coding conventions
compiler/mlds_to_java.m:
Replaces existing file.
compiler/java_util.m:
New file. Contains utility predicates that are used
by the Java backend.
compiler/c_util.m:
Added comment about Java backend.