mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-16 06:14:59 +00:00
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.
52 lines
1.7 KiB
Java
52 lines
1.7 KiB
Java
//
|
|
// Copyright (C) 2001-2004 The University of Melbourne.
|
|
// This file may only be copied under the terms of the GNU Library General
|
|
// Public License - see the file COPYING.LIB in the Mercury distribution.
|
|
//
|
|
|
|
package mercury.runtime;
|
|
|
|
public class DuFunctorDesc {
|
|
|
|
public java.lang.String du_functor_name;
|
|
public int du_functor_orig_arity;
|
|
public int du_functor_arg_type_contains_var;
|
|
public mercury.runtime.Sectag_Locn du_functor_sectag_locn;
|
|
public int du_functor_primary;
|
|
public int du_functor_secondary;
|
|
public int du_functor_ordinal;
|
|
// XXX PseudoTypeInfo's have not been implemented properly
|
|
// yet, so this may not be correct.
|
|
public /*final*/ mercury.runtime.PseudoTypeInfo[] du_functor_arg_types;
|
|
public /*final*/ java.lang.String[] du_functor_arg_names;
|
|
public /*final*/ mercury.runtime.DuExistInfo du_functor_exist_info;
|
|
|
|
public DuFunctorDesc()
|
|
{
|
|
}
|
|
|
|
public void init(java.lang.String functor_name, int orig_arity,
|
|
int arg_type_contains_var, int sectag_locn, int primary,
|
|
int secondary, int ordinal,
|
|
// XXX why do we need to use Object here?
|
|
java.lang.Object arg_types,
|
|
java.lang.Object arg_names,
|
|
java.lang.Object exist_info)
|
|
{
|
|
du_functor_name = functor_name;
|
|
du_functor_orig_arity = orig_arity;
|
|
du_functor_ordinal = ordinal;
|
|
du_functor_arg_type_contains_var = arg_type_contains_var;
|
|
du_functor_sectag_locn =
|
|
new mercury.runtime.Sectag_Locn(sectag_locn);
|
|
du_functor_primary = primary;
|
|
du_functor_secondary = secondary;
|
|
du_functor_ordinal = ordinal;
|
|
du_functor_arg_types = (mercury.runtime.PseudoTypeInfo [])
|
|
arg_types;
|
|
du_functor_arg_names = (java.lang.String []) arg_names;
|
|
du_functor_exist_info =
|
|
(mercury.runtime.DuExistInfo) exist_info;
|
|
}
|
|
}
|