RTTI improvements for Java backend. io.write/3 works for some simple types

Branches: main

RTTI improvements for Java backend.  io.write/3 works for some simple types
(builtin types and non-existential d.u. types).

compiler/mlds_to_java.m:
        Fix problem with cyclic RTTI definitions.  Initialisers could refer to
        other RTTI structures which weren't yet allocated, leading to fields
        being null.  The fix is to allocate all top-level RTTI objects first
        and initialise in a second phase.

java/runtime/DuExistInfo.java:
java/runtime/DuExistLocn.java:
java/runtime/DuFunctorDesc.java:
java/runtime/EnumFunctorDesc.java:
java/runtime/ForeignEnumFunctorDesc.java:
java/runtime/TypeClassConstraint.java:
java/runtime/TypeClassDeclStruct.java:
java/runtime/TypeClassId.java:
java/runtime/TypeCtorInfo_Struct.java:
java/runtime/TypeInfo_Struct.java:
        Separate constructors into constructors for the initial allocation,
        and an `init' method to fill in the fields.

java/runtime/MethodPtr.java:
        Use variadic method support to simplify semidet_call_* and
        result_call_* in rtti_implementation.m.

library/builtin.m:
        Make Java definitions of builtin.unify/2 and builtin.compare/3 call
        rtti_implementation.generic_unify and generic_compare.

library/private_builtin.m:
        Add missing MR_TYPECTOR_REP_FOREIGN_ENUM{,_USEREQ} constants
        for C# and Java.

library/rtti_implementation.m:
        Fix and add missing Java versions of many foreign_procs.

        Add more attributes to foreign_procs.

        Clean up the code a bit (fewer casts and ^ field access functions).

README.Java:
        Bump Java version requirement to J2SE 1.5 or higher.
This commit is contained in:
Peter Wang
2009-04-30 00:43:35 +00:00
parent 7d7ca9866b
commit d1cffc4523
17 changed files with 747 additions and 416 deletions

View File

@@ -10,8 +10,7 @@ Java bytecode suitable for running in the J2SE runtime system.
The port is mostly complete, but some parts of the Mercury standard
library are not yet implemented (for a full list see the FAQ below).
The port is currently targeted at J2SE version 1.2 or higher, but we recommend
version 1.4 for optimal performance and access to features.
The port is currently targeted at J2SE version 1.5 or higher.
PREREQUISITES
@@ -108,15 +107,7 @@ A. The main advantages are easy access to the wide range of libraries available
Q. What version of Java should I be using?
A. Java 2 Platform Standard Edition, version 1.2 or greater. Note that some
features require version 1.4 or greater, however.
Q. Which features?
A. When using a Java version earlier than 1.4, there are limitations on treating
stdin and stdout as binary files with respect to seeking. See the
documentation for io.m in the standard library for more details.
A. Java 2 Platform Standard Edition, version 1.5 or greater.
Q. What features are not yet implemented for the Java back-end?