mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-19 15:54:18 +00:00
runtime/mercury_type_info.h:
Use unsigned integer types for a few RTTI structure fields that
are known to hold non-negative values.
Add comments for other field types that could be changed later.
compiler/rtti.m:
Use fixed size integer types for fields matching the size
and signedness of the corresponding C RTTI structure fields.
Encode type ctor flags in a uint16 instead of int.
Make type_ctor_details_num_ptags and type_ctor_details_num_functors
return a maybe value, instead of a negative value to represent no
primary tags or no function symbols, respectively.
compiler/type_ctor_info.m:
Conform to type changes.
Use uint16 to represent the "contains var" bit vector.
compiler/rtti_out.m:
compiler/rtti_to_mlds.m:
Conform to type changes.
Add comments to make it easier to find the code that writes out
each particular RTTI structure field.
compiler/ml_util.m:
Add helper functions.
compiler/add_special_pred.m:
compiler/du_type_layout.m:
compiler/erl_rtti.m:
compiler/erlang_rtti.m:
compiler/hlds_data.m:
compiler/llds_out_data.m:
compiler/ml_unify_gen_construct.m:
compiler/opt_debug.m:
compiler/pseudo_type_info.m:
compiler/stack_layout.m:
compiler/unify_gen_construct.m:
Conform to type changes.
compiler/parse_type_defn.m:
compiler/prog_data.m:
Use uint32 for functor ordinal numbers.
library/rtti_implementation.m:
Use fixed size integer types for RTTI field accessor functions,
and update callers.
java/runtime/DuArgLocn.java:
java/runtime/DuExistInfo.java:
java/runtime/DuExistLocn.java:
java/runtime/DuFunctorDesc.java:
java/runtime/TypeCtorInfo_Struct.java:
Use integer types in RTTI structure definitions for Java that match
the types in the C versions of the same structures.
runtime/mercury_dotnet.cs.in:
Use integer types in RTTI structure definitions for C# that match
the types in the C versions of the same structures.
64 lines
2.3 KiB
Java
64 lines
2.3 KiB
Java
// vim: ts=4 sw=4 expandtab ft=java
|
|
//
|
|
// Copyright (C) 2001-2004, 2011 The University of Melbourne.
|
|
// Copyright (C) 2015, 2018 The Mercury team.
|
|
// This file is distributed under the terms specified in COPYING.LIB.
|
|
//
|
|
|
|
package jmercury.runtime;
|
|
|
|
public class DuFunctorDesc implements java.io.Serializable {
|
|
|
|
public java.lang.String du_functor_name;
|
|
public short du_functor_orig_arity;
|
|
public short du_functor_arg_type_contains_var;
|
|
public Sectag_Locn du_functor_sectag_locn;
|
|
public byte 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*/ PseudoTypeInfo[] du_functor_arg_types;
|
|
public /*final*/ java.lang.String[] du_functor_arg_names;
|
|
public /*final*/ DuArgLocn[] du_functor_arg_locns;
|
|
public /*final*/ DuExistInfo du_functor_exist_info;
|
|
public FunctorSubtypeInfo du_functor_subtype_info;
|
|
public byte du_functor_num_sectag_bits; // not used in Java grades
|
|
|
|
public DuFunctorDesc()
|
|
{
|
|
}
|
|
|
|
public void init(java.lang.String functor_name,
|
|
short orig_arity,
|
|
short arg_type_contains_var,
|
|
int sectag_locn,
|
|
byte 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 arg_locns,
|
|
java.lang.Object exist_info,
|
|
int functor_subtype_info,
|
|
byte num_sectag_bits)
|
|
{
|
|
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 Sectag_Locn(sectag_locn);
|
|
du_functor_primary = primary;
|
|
du_functor_secondary = secondary;
|
|
du_functor_ordinal = ordinal;
|
|
du_functor_arg_types = (PseudoTypeInfo []) arg_types;
|
|
du_functor_arg_names = (java.lang.String []) arg_names;
|
|
du_functor_arg_locns = (DuArgLocn []) arg_locns;
|
|
du_functor_exist_info = (DuExistInfo) exist_info;
|
|
du_functor_subtype_info =
|
|
new FunctorSubtypeInfo(functor_subtype_info);
|
|
du_functor_num_sectag_bits = num_sectag_bits;
|
|
}
|
|
}
|