mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-14 21:35:49 +00:00
Estimated hours taken: 10 Branches: main Bug fixes for the Java back-end. The standard library now almost compiles in grade java. compiler/mlds_to_java.m: Output Java foreign declarations before any other code, to fix a problem with references to the TYPE_CTOR_REP constants in library/private_builtin.m. Fix some bugs where we were not being consistent about mangling the module name when naming the classes used to simulate taking procedure addresses. This bug broke Java compilation of library/char.m. Fix some bugs where the compiler was getting confused about which types map to array types in Java. For MLDS casts that cast to type_info or pseudo_type_info, generate Java constructor calls, not Java casts. This fixes type errors in the generated Java code. Simplify the code for hand_defined_type. compiler/rtti.m: Fix a bug in tc_rtti_name_java_type: map typeclass_infos to the Java type "java.lang.Object[]", not "java.lang.Integer[]". The latter didn't work because the elements which hold the method addresses do not have type java.lang.Integer. java/runtime/DuExistInfo.java: java/runtime/NotagFunctorDesc.java: Define constructors for these types. java/runtime/TypeInfo_Struct.java: Define some additional constructors for this type. library/builtin.m: Provide Java stub definitions of - classes for the types func/0 and c_pointer/0; - unify/compare preds for func, c_pointer, tuple, and void; Define Java definitions for the additional modes of compare/3 (they just call the first mode). library/exception.m: Define Java versions of make_io_state and consume_io_state, and Java stubs for throw_impl and catch_impl. Change try_all so that it calls catch_impl, like try does, rather than calling builtin_catch directly. This is needed since the .NET and Java back-ends only define catch_impl, not builtin_catch. library/io.m: Provide Java `pragma foreign_type' declarations for the types array.array(T) and io.system_error. This is needed to avoid compilation errors when building in grade `java'. library/private_builtin.m: Delete the Java definition of the type_info for type_info/1, because that is generated automatically now, after petdr's recent bug fix. Provide Java stubs definitions of the unify/compare preds for ref/1, heap_pointer/0, type_ctor_info, type_info, base_typeclass_info, and typeclass_info. Provide Java definition of dummy_var. library/type_desc.m: Provide Java stub definitions of - classes for type_desc/0 and type_ctor_desc/0 - unify/compare preds for those types library/store.m: Define unification and comparison predicates for the store(S) type. This is needed because the automatically generated ones might not have the right semantics, but also because the Java back-end generates some invalid code for the automatically generated unification and compare predicates (the generated code has some invalid references to "dummy_var").
25 lines
714 B
Java
25 lines
714 B
Java
//
|
|
// Copyright (C) 2001-2003 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 DuExistInfo {
|
|
|
|
public int exist_typeinfos_plain;
|
|
public int exist_typeinfos_in_tci;
|
|
public int exist_tcis;
|
|
public /* final */ mercury.runtime.DuExistLocn[] exist_typeinfo_locns;
|
|
|
|
public DuExistInfo(int typeinfos_plain, int typeinfos_in_tci, int tcis,
|
|
mercury.runtime.DuExistLocn[] typeinfo_locns)
|
|
{
|
|
exist_typeinfos_plain = typeinfos_plain;
|
|
exist_typeinfos_in_tci = typeinfos_in_tci;
|
|
exist_tcis = tcis;
|
|
exist_typeinfo_locns = typeinfo_locns;
|
|
}
|
|
}
|