Estimated hours taken: 2
Branches: main
Runtime fixes for the Java back-end.
java/runtime/DuExistLocn.java:
java/runtime/DuFunctorDesc.java:
java/runtime/DuPtagLayout.java:
Define constructors for these types.
java/runtime/MaybeResAddrFunctorDesc.java:
New file (corresponds to MR_MaybeResAddrFunctorDesc type in C).
java/runtime/MaybeResFunctorDesc.java:
New file (corresponds to MR_MaybeResFunctorDesc type in C).
java/runtime/PseudoTypeInfo.java:
Define constructors.
Make non-abstract (XXX temp work-around only).
java/runtime/TypeCtorInfo_Struct.java:
XXX Pass some parameters of the constructor as "Object",
to work around type errors in invocations of those constructors.
java/runtime/TypeFunctors.java:
java/runtime/TypeLayout.java:
Model the C unions better; use a single field, with accessor
functions that convert to each alternative, not several fields.
java/runtime/TypeclassInfo.java:
Implement as stub (previous code was just copy of TypeInfo.java).
java/runtime/VA_PseudoTypeInfo_Struct*.java:
Fix a bug: change the order of the constructor parameters
to match the way we generate code which invokes those constructors.
Estimated hours taken: 18
Branches: main
Some fixes to the Java back-end to make it support RTTI
better. The aim is to at least be able to *compile* code
that makes use of polymorphism (e.g. the Mercury standard
library!), although that aim is not yet achieved with this diff.
Getting code which actually *uses* the RTTI to work is still
a long way off...
compiler/rtti.m:
compiler/mlds_to_java.m:
Fix some bugs in the code to output RTTI type names.
compiler/mlds_to_java.m:
Output the RTTI definitions. This is needed to avoid errors
in code which references them.
Handle initializers better; in particular deal with nested
initializers properly.
Pass the current module name down to output_lval, so that we can
module-qualify data names only if they occur in a different
module. This is needed to ensure that static data defined
in other modules gets module-qualified, but local variables don't.
This also required change some places which were incorrectly
calling output_fully_qualified_name to instead call output_name.
Add comments in the generated output code when generating
"java.lang.Object", so that it is clearer what kind of object
is involved.
Add some special treatment for the types with hand-defined RTTI.
java/runtime/*.java:
Add some definitions of RTTI types, and some new constructors
for the RTTI types that were already defined.
These are currently all just stubs.