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: 3
Branches: main
Some fixes to the Java back-end, to make it work again after
Zoltan's recent type class RTTI changes.
java/runtime/DuExistInfo.java:
Add a new field "exist_constraints" to the DuExistInfo type
and a corresponding argument to the constructor, to match
Zoltan's recent changes.
java/runtime/TypeClassId.java:
java/runtime/TypeClassMethod.java:
java/runtime/TypeClassDeclStruct.java:
java/runtime/TypeClassConstraint.java:
New files. These correspond to the C types MR_TypeClassId,
MR_TypeClassMethod, MR_TypeClassDeclStruct,
and MR_TypeClassConstraint in the C runtime.
java/runtime/TypeCtorInfo_Struct.java:
Add a comment.
compiler/rtti_to_mlds.m:
Don't cast null pointers to mlds__generic_type; they should have
the right type already. Casting to mlds__generic_type here causes
type errors for the Java back-end, because in Java there are no
implicit conversions from Object (unlike C, which allows implicit
conversions from `void *').
compiler/rtti.m:
Change tc_rtti_name_java_type so that it maps the new typeclass-related
RTTI types to the appropriate Java types.
library/private_builtin.m:
Define MR_PREDICATE and MR_FUNCTION.
java/runtime/PredFunc.java:
Fix a bug in my previous change:
s/MR_PRED/MR_PREDICATE/
s/MR_FUNC/MR_FUNCTION/