Commit Graph

4 Commits

Author SHA1 Message Date
James Goddard
1aa44ba2da Implement RTTI for the Java-backend (incomplete)
Estimated hours taken: 30
Branches: main

Implement RTTI for the Java-backend (incomplete)

java/runtime/PseudoTypeInfo.java:
java/runtime/TypeCtorInfo_Struct.java:
java/runtime/TypeInfo_Struct.java:
	Implement the `unify' operation for these classes.  This implementation
	actually just compares them.

library/rtti_implementation.m:
	Document a bug in notag_functor_arg_type/1

	Define the foreign type of `type_layout' as `TypeLayout' in Java.

	Correct an off-by-one error in type_ctor_and_args/3.

	Implement deconstruct/8 for TypeCtorRep = enum.

	Implement the following predicates in Java:
		get_var_arity_typeinfo_arity/1
		get_pti_from_arg_types/2
		typeinfo_is_variable/2
		get_type_ctor_info/1
		get_primary_tag/1
		get_remote_secondary_tag/1
		ptag_index/2
		sectag_locn/1
		du_sectag_alternatives/2
		type_info_index/2
		type_ctor_arity/1
		type_ctor_rep/1
		type_ctor_module_name/1
		type_ctor_name/1
		type_ctor_functors/1
		type_layout/1
		unsafe_cast/1
		du_functor_desc/3
		du_functor_name/1
		du_functor_arity/1
		du_functor_arg_type_contains_var/1
		du_functor_sectag_locn/1
		du_functor_primary/1
		du_functor_secondary/1
		du_functor_ordinal/1
		du_functor_arg_types/1
		du_functor_arg_names/1
		du_functor_exist_info/1
		enum_functor_desc/3
		enum_functor_name/1
		enum_functor_ordinal/1
		notag_functor_desc/3
		notag_functor_name/1
		notag_functor_arg_type/1
		notag_functor_arg_name/1
		null/1
		null_string/0
		unsafe_get_enum_value/1

library/type_desc.m:
	Implement the following procedures for Java:
		type_of/1
		has_type/1
		type_ctor_and_args/3
		type_ctor_name_and_arity/4

	Implement the Java classes `type_desc_0' and `type_ctor_desc_0'.
2004-02-26 08:17:54 +00:00
Fergus Henderson
c7f6612d9e Bug fixes and code simplifications in the RTTI handling
Estimated hours taken: 4
Branches: main

Bug fixes and code simplifications in the RTTI handling
for the Java back-end.

compiler/rtti.m:
	For Java, map all the different C representations for TypeInfos
	to a single Java type "java.runtime.TypeInfo_Struct".
	Likewise map all the different C representations for type class
	constraints to a single Java type "java.runtime.TypeInfo_Struct".

java/runtime/FA_PseudoTypeInfo_Struct1.java:
java/runtime/FA_PseudoTypeInfo_Struct2.java:
java/runtime/FA_TypeInfo_Struct1.java:
java/runtime/FA_TypeInfo_Struct2.java:
java/runtime/VA_PseudoTypeInfo_Struct0.java:
java/runtime/VA_PseudoTypeInfo_Struct1.java:
java/runtime/VA_PseudoTypeInfo_Struct2.java:
java/runtime/VA_PseudoTypeInfo_Struct3.java:
java/runtime/VA_PseudoTypeInfo_Struct4.java:
java/runtime/VA_PseudoTypeInfo_Struct8.java:
java/runtime/TypeclassInfo.java:
	Deleted these stub files, since they should no longer be needed.

java/runtime/TypeInfo_Struct.java:
	Add two new constructors, corresponding to the constructors for
	the deleted FA_* and VA_*.java files.

java/runtime/PseudoTypeInfo.java:
	Add some comments.  Make the nullary constructor protected,
	to ensure that it is only used by derived classes, since it
	is only intended to be used for TypeInfo_Struct.
2004-02-19 09:37:21 +00:00
Fergus Henderson
cfea29cba0 Runtime fixes for the Java back-end.
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.
2003-12-01 06:55:51 +00:00
Michael Wybrow
1203d79326 This change introduces some (partial) Java versions of the mercury library
Estimated hours taken: 3
Branches: main


This change introduces some (partial) Java versions of the mercury library
which are currently needed to compile some .java files generated by the
mercury compiler for the tests/benchmarks test cases.
These additions are required temporarily for testing purposes until the
mercury library can be compiled in grade java.


mercury/java/Commit.java:
mercury/java/DuExistInfo.java:
mercury/java/DuExistLocn.java:
mercury/java/DuFunctorDesc.java:
mercury/java/DuPtagLayout.java:
mercury/java/EnumFunctorDesc.java:
mercury/java/JavaInternal.java:
mercury/java/MethodPtr.java:
mercury/java/NotagFunctorDesc.java:
mercury/java/PseudoTypeInfo.java:
mercury/java/Sectag_Locn.java:
mercury/java/TypeCtorInfo_Struct.java:
mercury/java/TypeCtorRep.java:
mercury/java/TypeFunctors.java:
mercury/java/TypeLayout.java:
mercury/java/UnreachableDefault.java:
	All files that were located in the mercury/java directory have been
	moved to mercury/java/runtime.

mercury/java/Makefile:
	A simple Makefile to set up a couple of symbolic links so we can
	just include the mercury/java directory in our CLASSPATH.

mercury/java/library/assoc_list.java:
mercury/java/library/bool.java:
mercury/java/library/builtin.java:
mercury/java/library/deconstruct.java:
mercury/java/library/enum.java:
mercury/java/library/integer.java:
mercury/java/library/io.java:
mercury/java/library/list.java:
mercury/java/library/map.java:
mercury/java/library/mer_int.java:
mercury/java/library/mr_char.java:
mercury/java/library/mr_float.java:
mercury/java/library/mr_int.java:
mercury/java/library/ops.java:
mercury/java/library/private_builtin.java:
mercury/java/library/require.java:
mercury/java/library/set.java:
mercury/java/library/std_util.java:
mercury/java/library/string.java:
mercury/java/library/term.java:
mercury/java/library/time.java:
mercury/java/library/tree234.java:
mercury/java/library/type_desc.java:
	These are partial Java versions of mercury library modules. They are
	very rough but will currently allow for most of the tests/benchmark
	directory to run in Java.
2002-02-11 06:31:33 +00:00