mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-20 08:19:28 +00:00
Branches: main
Mark Java RTTI classes as implementing java.io.Serializable to
enable serialization of existentially typed values.
java/runtime/DuExistInfo.java:
java/runtime/DuExistLocn.java:
java/runtime/DuFunctorDesc.java:
java/runtime/DuPtagLayout.java:
java/runtime/EnumFunctorDesc.java:
java/runtime/ForeignEnumFunctorDesc.java:
java/runtime/MethodPtr.java:
java/runtime/NotagFunctorDesc.java:
java/runtime/PseudoTypeInfo.java:
java/runtime/ReservedAddrFunctorDesc.java:
java/runtime/Sectag_Locn.java:
java/runtime/TypeClassConstraint.java:
java/runtime/TypeClassDeclStruct.java:
java/runtime/TypeClassId.java:
java/runtime/TypeClassMethod.java:
java/runtime/TypeCtorInfo_Struct.java:
java/runtime/TypeCtorRep.java:
java/runtime/TypeFunctors.java:
java/runtime/TypeInfo_Struct.java:
java/runtime/TypeLayout.java:
As above.
TypeCtorInfo_Struct.unify() cannot rely on the uniqueness of
TypeCtorInfo_Struct instances, as deserialisation will create new
copies.
53 lines
1.4 KiB
Java
53 lines
1.4 KiB
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 jmercury.runtime;
|
|
|
|
public class TypeLayout implements java.io.Serializable {
|
|
// This should hold a value of one of the types
|
|
// accessible by the access functions that follow.
|
|
public java.lang.Object layout_init;
|
|
|
|
//
|
|
// In runtime/mercury_type_info.h:
|
|
// typedef MR_DuPtagLayout *MR_DuTypeLayout;
|
|
// so here we just use DuPtagLayout[]
|
|
//
|
|
public DuPtagLayout[] layout_du() {
|
|
return (DuPtagLayout[]) layout_init;
|
|
}
|
|
|
|
//
|
|
// In runtime/mercury_type_info.h:
|
|
// typedef MR_EnumFunctorDesc **EnumTypeLayout;
|
|
// so here we just use EnumFunctorDesc[][]
|
|
//
|
|
public EnumFunctorDesc[] layout_enum() {
|
|
return (EnumFunctorDesc[]) layout_init;
|
|
}
|
|
|
|
//
|
|
// In runtime/mercury_type_info.h:
|
|
// typedef MR_NotagFunctorDesc *MR_NotagTypeLayout;
|
|
// so here we just us NotagFunctorDesc[]
|
|
//
|
|
public NotagFunctorDesc[] layout_notag() {
|
|
return (NotagFunctorDesc[]) layout_init;
|
|
}
|
|
//
|
|
// In runtime/mercury_type_info.h:
|
|
// typedef MR_PseudoTypeInfo MR_EquivType;
|
|
// so here we just use MR_PseudoTypeInfo
|
|
//
|
|
public PseudoTypeInfo layout_equiv() {
|
|
return (PseudoTypeInfo) layout_init;
|
|
}
|
|
|
|
public TypeLayout(java.lang.Object init) {
|
|
layout_init = init;
|
|
}
|
|
}
|