[m-dev.] for review: type_ctor_info version number

Zoltan Somogyi zs at cs.mu.OZ.AU
Fri May 12 21:13:44 AEST 2000


This change is in two parts; the second half is to be committed only after
the first half has been installed on all machines.

Both halves should be reviewed by Tyson.

This is the first half of a change that reduces the size of type_ctor_info
structures, and moves the version number to the start (immediately after the
arity) to make future changes easier.

runtime/mercury_type_info.h:
	Define the new version of the type_ctor_info structure while keeping
	the old one temporarily; the presence of a macro definition, which
	is emitted only by new compiler versions, selects the new version.

	Increment the maximum supported rtti version number.

	Remove some obsolete stuff, and move some macro definitions to their
	proper place in the file.

runtime/mercury_ho_call.h:
	With the new type_ctor_info structures, take the address of the
	unify procedure from the new unify field, since the old one has
	been reused for other purposes.

compiler/type_ctor_info.m:
	Increment the rtti version number.

compiler/rtti_out.m:
	Generate the new type_info structure.

compiler/llds_out.m:
	Generate a macro definition that selects the new type_ctor_info
	for use, since that is what we are generating.

library/private_builtin.c:
	Use a macro to eliminate dependence on type_ctor_info details.

diff -rubB --exclude CVS --exclude CVU --exclude INSTALL --exclude README --exclude REDUNDANT_FILES --exclude Log\* --exclude bindist.build.vars --exclude configure --exclude errs --exclude make_all.log --exclude .error --exclude .errormsgs --exclude Mmake.params --exclude Mmake.stage.params --exclude Mmake.params.runtime --exclude Mmake.params.trace --exclude Mmake.common --exclude mercury_conf.h --exclude .#\* --exclude *.c --exclude *.h trip_base/compiler/llds_out.m ws28/compiler/llds_out.m
--- trip_base/compiler/llds_out.m	Wed Apr 26 07:40:20 2000
+++ ws28/compiler/llds_out.m	Thu May 11 10:27:54 2000
@@ -432,7 +432,9 @@
 		"** UNBOXED_FLOAT=", UnboxedFloatStr, "\n",
 		"**\n",
 		"** END_OF_C_GRADE_INFO\n",
-		"*/\n"
+		"*/\n",
+		"\n",
+		"\n#define MR_BOOTSTRAP_TYPE_CTOR_VERSION_NO\n"
 	]).
 
 :- pred convert_bool_to_string(bool, string).
diff -rubB --exclude CVS --exclude CVU --exclude INSTALL --exclude README --exclude REDUNDANT_FILES --exclude Log\* --exclude bindist.build.vars --exclude configure --exclude errs --exclude make_all.log --exclude .error --exclude .errormsgs --exclude Mmake.params --exclude Mmake.stage.params --exclude Mmake.params.runtime --exclude Mmake.params.trace --exclude Mmake.common --exclude mercury_conf.h --exclude .#\* --exclude *.c --exclude *.h trip_base/compiler/rtti_out.m ws28/compiler/rtti_out.m
--- trip_base/compiler/rtti_out.m	Tue Apr 25 13:32:04 2000
+++ ws28/compiler/rtti_out.m	Thu May 11 09:16:00 2000
@@ -258,7 +258,9 @@
 	{ RttiTypeId = rtti_type_id(Module, Type, TypeArity) },
 	io__write_int(TypeArity),
 	io__write_string(",\n\t"),
-	output_maybe_static_code_addr(UnifyCA),
+	io__write_int(Version),
+	io__write_string(",\n\t"),
+	io__write_int(NumPtags),
 	io__write_string(",\n\t"),
 	output_maybe_static_code_addr(UnifyCA),
 	io__write_string(",\n\t"),
@@ -324,8 +326,6 @@
 	),
 	io__write_string(",\n\t"),
 	io__write_int(NumFunctors),
-	io__write_string(",\n\t"),
-	io__write_int(NumPtags),
 % This code is commented out while the corresponding fields of the
 % MR_TypeCtorInfo_Struct type are commented out.
 %
diff -rubB --exclude CVS --exclude CVU --exclude INSTALL --exclude README --exclude REDUNDANT_FILES --exclude Log\* --exclude bindist.build.vars --exclude configure --exclude errs --exclude make_all.log --exclude .error --exclude .errormsgs --exclude Mmake.params --exclude Mmake.stage.params --exclude Mmake.params.runtime --exclude Mmake.params.trace --exclude Mmake.common --exclude mercury_conf.h --exclude .#\* --exclude *.c --exclude *.h trip_base/compiler/type_ctor_info.m ws28/compiler/type_ctor_info.m
--- trip_base/compiler/type_ctor_info.m	Tue Apr 18 18:41:55 2000
+++ ws28/compiler/type_ctor_info.m	Thu May 11 09:13:59 2000
@@ -235,7 +235,7 @@
 
 :- func type_ctor_info_rtti_version = int.
 
-type_ctor_info_rtti_version = 4.
+type_ctor_info_rtti_version = 5.
 
 %---------------------------------------------------------------------------%
 %---------------------------------------------------------------------------%
diff -rubB --exclude CVS --exclude CVU --exclude INSTALL --exclude README --exclude REDUNDANT_FILES --exclude Log\* --exclude bindist.build.vars --exclude configure --exclude errs --exclude make_all.log --exclude .error --exclude .errormsgs --exclude Mmake.params --exclude Mmake.stage.params --exclude Mmake.params.runtime --exclude Mmake.params.trace --exclude Mmake.common --exclude mercury_conf.h --exclude .#\* --exclude *.c --exclude *.h trip_base/library/private_builtin.m ws28/library/private_builtin.m
--- trip_base/library/private_builtin.m	Mon May  1 19:42:41 2000
+++ ws28/library/private_builtin.m	Thu May 11 10:08:00 2000
@@ -1141,14 +1141,10 @@
 #include ""mercury_type_info.h""	/* for MR_TypeCtorInfo_Struct; */
 #include ""mercury_tabling.h""		/* for MR_TrieNode, etc. */
 
-extern MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_Struct
-	mercury_data___type_ctor_info_int_0;
-extern MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_Struct
-	mercury_data___type_ctor_info_string_0;
-extern MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_Struct
-	mercury_data___type_ctor_info_float_0;
-extern MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_Struct
-	mercury_data___type_ctor_info_character_0;
+MR_DECLARE_TYPE_CTOR_INFO_STRUCT(mercury_data___type_ctor_info_int_0);
+MR_DECLARE_TYPE_CTOR_INFO_STRUCT(mercury_data___type_ctor_info_string_0);
+MR_DECLARE_TYPE_CTOR_INFO_STRUCT(mercury_data___type_ctor_info_float_0);
+MR_DECLARE_TYPE_CTOR_INFO_STRUCT(mercury_data___type_ctor_info_character_0);
 
 ").
 
diff -rubB --exclude CVS --exclude CVU --exclude INSTALL --exclude README --exclude REDUNDANT_FILES --exclude Log\* --exclude bindist.build.vars --exclude configure --exclude errs --exclude make_all.log --exclude .error --exclude .errormsgs --exclude Mmake.params --exclude Mmake.stage.params --exclude Mmake.params.runtime --exclude Mmake.params.trace --exclude Mmake.common --exclude mercury_conf.h --exclude .#\* trip_base/runtime/mercury_ho_call.c ws28/runtime/mercury_ho_call.c
--- trip_base/runtime/mercury_ho_call.c	Tue Apr 11 09:57:19 2000
+++ ws28/runtime/mercury_ho_call.c	Thu May 11 21:20:08 2000
@@ -200,7 +200,20 @@
 	} while(0)
 
 #define	tailcall_user_pred()						\
-	tailcall(type_ctor_info->unify_pred, LABEL(mercury__unify_2_0))
+	do {								\
+		MR_ProcAddr	unify_pred;				\
+									\
+		if (type_ctor_info->type_ctor_old_version		\
+			< MR_RTTI_VERSION__VERSION_NO)			\
+		{							\
+			unify_pred = ((struct MR_TypeCtorInfo_Struct *) \
+				type_ctor_info)->old_unify_pred;	\
+		} else {						\
+			unify_pred = type_ctor_info->new_unify_pred;	\
+		}							\
+									\
+		tailcall(unify_pred, LABEL(mercury__unify_2_0));	\
+	} while (0)
 
 #define	start_label		unify_start
 #define	call_user_code_label	call_unify_in_proc
@@ -310,8 +323,19 @@
 
 #define	tailcall_user_pred()						\
 	do {								\
+		MR_ProcAddr	unify_pred;				\
+									\
+		if (type_ctor_info->type_ctor_old_version		\
+			< MR_RTTI_VERSION__VERSION_NO)			\
+		{							\
+			unify_pred = ((struct MR_TypeCtorInfo_Struct *) \
+				type_ctor_info)->old_unify_pred;	\
+		} else {						\
+			unify_pred = type_ctor_info->new_unify_pred;	\
+		}							\
+									\
 		save_transient_registers();				\
-		(void) MR_call_engine(type_ctor_info->unify_pred, FALSE);\
+		(void) MR_call_engine(unify_pred, FALSE);		\
 		restore_transient_registers();				\
 		return (r1);						\
 	} while (0)
diff -rubB --exclude CVS --exclude CVU --exclude INSTALL --exclude README --exclude REDUNDANT_FILES --exclude Log\* --exclude bindist.build.vars --exclude configure --exclude errs --exclude make_all.log --exclude .error --exclude .errormsgs --exclude Mmake.params --exclude Mmake.stage.params --exclude Mmake.params.runtime --exclude Mmake.params.trace --exclude Mmake.common --exclude mercury_conf.h --exclude .#\* trip_base/runtime/mercury_type_info.h ws28/runtime/mercury_type_info.h
--- trip_base/runtime/mercury_type_info.h	Mon May  1 19:43:13 2000
+++ ws28/runtime/mercury_type_info.h	Thu May 11 10:26:27 2000
@@ -62,10 +62,11 @@
 ** compiler/type_ctor_info.m.
 */
 
-#define MR_RTTI_VERSION                 MR_RTTI_VERSION__CLEAN_LAYOUT
+#define MR_RTTI_VERSION                 MR_RTTI_VERSION__VERSION_NO
 #define MR_RTTI_VERSION__INITIAL        2
 #define MR_RTTI_VERSION__USEREQ         3
 #define MR_RTTI_VERSION__CLEAN_LAYOUT   4
+#define MR_RTTI_VERSION__VERSION_NO     5
 
 /*
 ** Check that the RTTI version is in a sensible range.
@@ -76,7 +77,16 @@
 */
 
 #define MR_TYPE_CTOR_INFO_CHECK_RTTI_VERSION_RANGE(typector)    \
-    assert(typector->type_ctor_version == MR_RTTI_VERSION__CLEAN_LAYOUT)
+    assert(typector->type_ctor_old_version == MR_RTTI_VERSION__CLEAN_LAYOUT \
+	|| typector->type_ctor_old_version == MR_RTTI_VERSION__VERSION_NO)
+
+/*---------------------------------------------------------------------------*/
+
+#ifdef	MR_BOOTSTRAP_TYPE_CTOR_VERSION_NO
+  #define	MR_TypeCtorInfo_Struct	MR_NewTypeCtorInfo_Struct
+#else
+  #define	MR_TypeCtorInfo_Struct	MR_OldTypeCtorInfo_Struct
+#endif
 
 /*---------------------------------------------------------------------------*/
 
@@ -113,8 +123,7 @@
 ** We do not use zero to represent any type variable, for two reasons.
 ** First, variable numbering starts at one inside the compiler. Second,
 ** starting at one allows us to use universally quantified type variable
-** numbers to be used directly as the offset into a (non-higher-order)
-** typeinfo.
+** numbers used directly as an offset into a (non-higher-order) typeinfo.
 **
 ** This scheme relies on the bit patterns of these integers corresponding
 ** to memory that is either inaccessible (due to the first page of virtual
@@ -273,46 +282,6 @@
 /*---------------------------------------------------------------------------*/
 
 /*
-** Definitions and macros for type_ctor_layout definition.
-**
-** See compiler/base_type_layout.m for more information.
-**
-** If we don't have enough tags, we have to encode layouts
-** less densely. The make_typelayout macro does this, and
-** is intended for handwritten code. Compiler generated
-** code can (and does) just create two rvals instead of one.
-**
-** XXX This stuff is part of USEREQ type_ctor_infos and is obsolete;
-** it is needed now only for bootstrapping.
-*/
-
-/*
-** Conditionally define USE_TYPE_LAYOUT.
-**
-** All code using type_layout structures should check to see if
-** USE_TYPE_LAYOUT is defined, and give a fatal error otherwise.
-** USE_TYPE_LAYOUT can be explicitly turned off with NO_TYPE_LAYOUT.
-**
-*/
-#if !defined(NO_TYPE_LAYOUT)
-    #define USE_TYPE_LAYOUT
-#else
-    #undef USE_TYPE_LAYOUT
-#endif
-
-/*
-** Declaration for structs.
-*/
-
-#define MR_DECLARE_STRUCT(T)                                        \
-    extern const struct T##_struct T
-#define MR_DECLARE_TYPE_CTOR_INFO_STRUCT(T)                         \
-    extern const struct MR_TypeCtorInfo_Struct T
-
-/*---------------------------------------------------------------------------*/
-
-
-/*
 ** Offsets for dealing with `univ' types.
 **
 ** `univ' is represented as a two word structure.
@@ -771,15 +740,11 @@
     ** A type_ctor_info describes the structure of a particular
     ** type constructor.  One of these is generated for every
     ** `:- type' declaration.
-    **
-    ** The unify_pred field will soon migrate to the slot now occupied by
-    ** the new_unify_pred field. In the near future, the two slots will
-    ** contain the same data.
     */
 
-struct MR_TypeCtorInfo_Struct {
+struct MR_OldTypeCtorInfo_Struct {
     Integer             arity;
-    MR_ProcAddr         unify_pred;
+    MR_ProcAddr         old_unify_pred;
     MR_ProcAddr         new_unify_pred;
     MR_ProcAddr         compare_pred;
     MR_TypeCtorRep      type_ctor_rep;
@@ -787,11 +752,28 @@
     MR_ProcAddr         init_pred;
     ConstString         type_ctor_module_name;
     ConstString         type_ctor_name;
-    Integer             type_ctor_version;
+    Integer             type_ctor_old_version;
     MR_TypeFunctors     type_functors;
     MR_TypeLayout       type_layout;
     MR_int_least32_t    type_ctor_num_functors;
     MR_int_least8_t     type_ctor_num_ptags;    /* if DU */
+};
+
+struct MR_NewTypeCtorInfo_Struct {
+    Integer             arity;
+    MR_int_least8_t     type_ctor_new_version;
+    MR_int_least8_t     type_ctor_new_num_ptags;    /* if DU */
+    MR_ProcAddr         new_unify_pred;
+    MR_ProcAddr         compare_pred;
+    MR_TypeCtorRep      type_ctor_rep;
+    MR_ProcAddr         solver_pred;
+    MR_ProcAddr         init_pred;
+    ConstString         type_ctor_module_name;
+    ConstString         type_ctor_name;
+    Integer             type_ctor_old_version;
+    MR_TypeFunctors     type_functors;
+    MR_TypeLayout       type_layout;
+    MR_int_least32_t    type_ctor_num_functors;
 
 /*
 ** The following fields will be added later, once we can exploit them:
@@ -807,13 +789,16 @@
 ** structures for builtin and special types.
 */
 
+#ifdef	MR_BOOTSTRAP_TYPE_CTOR_VERSION_NO
+
 #define MR_DEFINE_BUILTIN_TYPE_CTOR_INFO_FULL(m, cm, n, a, cr, u, c)    \
     Declare_entry(u);                                                   \
     Declare_entry(c);                                                   \
-    MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_Struct                  \
+    MR_STATIC_CODE_CONST struct MR_NewTypeCtorInfo_Struct               \
     MR_PASTE6(mercury_data_, cm, __type_ctor_info_, n, _, a) = {        \
         a,                                                              \
-        MR_MAYBE_STATIC_CODE(ENTRY(u)),                                 \
+        MR_RTTI_VERSION,                                                \
+        -1,                                                             \
         MR_MAYBE_STATIC_CODE(ENTRY(u)),                                 \
         MR_MAYBE_STATIC_CODE(ENTRY(c)),                                 \
         cr,                                                             \
@@ -824,10 +809,34 @@
         MR_RTTI_VERSION,                                                \
         { 0 },                                                          \
         { 0 },                                                          \
+        -1                                                              \
+    }
+
+#else
+
+#define MR_DEFINE_BUILTIN_TYPE_CTOR_INFO_FULL(m, cm, n, a, cr, u, c)    \
+    Declare_entry(u);                                                   \
+    Declare_entry(c);                                                   \
+    MR_STATIC_CODE_CONST struct MR_OldTypeCtorInfo_Struct               \
+    MR_PASTE6(mercury_data_, cm, __type_ctor_info_, n, _, a) = {        \
+        a,                                                              \
+        MR_MAYBE_STATIC_CODE(ENTRY(u)),                                 \
+        MR_MAYBE_STATIC_CODE(ENTRY(u)),                                 \
+        MR_MAYBE_STATIC_CODE(ENTRY(c)),                                 \
+        cr,                                                             \
+        NULL,                                                           \
+        NULL,                                                           \
+        MR_string_const(MR_STRINGIFY(m), sizeof(MR_STRINGIFY(m))-1),    \
+        MR_string_const(MR_STRINGIFY(n), sizeof(MR_STRINGIFY(n))-1),    \
+        MR_RTTI_VERSION__CLEAN_LAYOUT,                                  \
+        { 0 },                                                          \
+        { 0 },                                                          \
         -1,                                                             \
         -1                                                              \
     }
 
+#endif
+
 #define MR_DEFINE_BUILTIN_TYPE_CTOR_INFO_PRED(m, n, a, cr, u, c)        \
     MR_DEFINE_BUILTIN_TYPE_CTOR_INFO_FULL(m, m, n, a, cr, u, c)
 
@@ -884,21 +893,18 @@
 
   #define   MR_INIT_BUILTIN_TYPE_CTOR_INFO(B, T)            		\
   do {                                                      		\
-    (B).unify_pred = ENTRY(mercury__builtin_unify##T##2_0);		\
     (B).new_unify_pred = ENTRY(mercury__builtin_unify##T##2_0);		\
     (B).compare_pred = ENTRY(mercury__builtin_compare##T##3_0);		\
   } while (0)
 
   #define   MR_INIT_TYPE_CTOR_INFO_WITH_PRED(B, P)          \
   do {                                                      \
-    (B).unify_pred = ENTRY(P);                              \
     (B).new_unify_pred = ENTRY(P);                          \
     (B).compare_pred = ENTRY(P);                            \
   } while (0)
 
   #define   MR_INIT_TYPE_CTOR_INFO(B, T)                    \
   do {                                                      \
-    (B).unify_pred = ENTRY(mercury____##Unify##___##T);     \
     (B).new_unify_pred = ENTRY(mercury____##Unify##___##T); \
     (B).compare_pred = ENTRY(mercury____##Compare##___##T); \
   } while (0)
@@ -919,6 +925,17 @@
     do { } while (0)
 
 #endif /* MR_STATIC_CODE_ADDRESSES */
+
+/*---------------------------------------------------------------------------*/
+
+/*
+** Declaration for structs.
+*/
+
+#define MR_DECLARE_STRUCT(T)                                        \
+    extern MR_STATIC_CODE_CONST struct T##_struct T
+#define MR_DECLARE_TYPE_CTOR_INFO_STRUCT(T)                         \
+    extern MR_STATIC_CODE_CONST struct MR_TypeCtorInfo_Struct T
 
 /*---------------------------------------------------------------------------*/
 


----------------------------------------------------------------------------

This is the second half of a change that reduces the size of type_ctor_info
structures, and moves the version number to the start (immediately after the
arity) to make future changes easier.

runtime/mercury_type_info.h:
	Delete the old version of the type_ctor_info structure, and the macros
	that support it. Remove the references to "new" in types and field
	names, since there is now no risk of confusion.

	Increment the minimum supported rtti version number.

runtime/mercury_grade.h:
	Increment the version number component in the grade. This is required
	by the increase in the minimum supported rtti version number.

runtime/mercury_bootstrap.h:
	For the time being, allow some entities (a type and a field) that
	have been affected by the change to be referred to by their old names.
	(Some renamed fields are currently unused, and so don't need such a
	macro.)

runtime/mercury_ho_call.h:
	Remove the code to handle old style type_ctor_info structures.

compiler/llds_out.m:
	Do not generate the macro definition that selects the new
	type_ctor_info structure; it is not necessary, since this is now
	the only kind available.

diff -rubB --exclude CVS --exclude CVU --exclude INSTALL --exclude README --exclude REDUNDANT_FILES --exclude Log\* --exclude bindist.build.vars --exclude configure --exclude errs --exclude make_all.log --exclude .error --exclude .errormsgs --exclude Mmake.params --exclude Mmake.stage.params --exclude Mmake.params.runtime --exclude Mmake.params.trace --exclude Mmake.common --exclude mercury_conf.h --exclude .#\* --exclude *.c --exclude *.h --exclude DIFF.dec30 --exclude *.int* --exclude *.*opt* ws28/compiler/llds_out.m ws30/compiler/llds_out.m
--- ws28/compiler/llds_out.m	Thu May 11 10:27:54 2000
+++ ws30/compiler/llds_out.m	Fri May 12 09:48:47 2000
@@ -432,9 +432,7 @@
 		"** UNBOXED_FLOAT=", UnboxedFloatStr, "\n",
 		"**\n",
 		"** END_OF_C_GRADE_INFO\n",
-		"*/\n",
-		"\n",
-		"\n#define MR_BOOTSTRAP_TYPE_CTOR_VERSION_NO\n"
+		"*/\n"
 	]).
 
 :- pred convert_bool_to_string(bool, string).
diff -rubB --exclude CVS --exclude CVU --exclude INSTALL --exclude README --exclude REDUNDANT_FILES --exclude Log\* --exclude bindist.build.vars --exclude configure --exclude errs --exclude make_all.log --exclude .error --exclude .errormsgs --exclude Mmake.params --exclude Mmake.stage.params --exclude Mmake.params.runtime --exclude Mmake.params.trace --exclude Mmake.common --exclude mercury_conf.h --exclude .#\* ws28/runtime/mercury_bootstrap.h ws30/runtime/mercury_bootstrap.h
--- ws28/runtime/mercury_bootstrap.h	Thu Apr 13 20:00:16 2000
+++ ws30/runtime/mercury_bootstrap.h	Thu May 11 16:32:02 2000
@@ -22,6 +22,8 @@
 */
 
 #define MR_TypeCtorInfo_struct  MR_TypeCtorInfo_Struct
+#define	MR_NewTypeCtorInfo_Struct	MR_TypeCtorInfo_Struct
+#define	new_unify_pred			unify_pred
 
 #ifndef MR_NO_BACKWARDS_COMPAT
 
diff -rubB --exclude CVS --exclude CVU --exclude INSTALL --exclude README --exclude REDUNDANT_FILES --exclude Log\* --exclude bindist.build.vars --exclude configure --exclude errs --exclude make_all.log --exclude .error --exclude .errormsgs --exclude Mmake.params --exclude Mmake.stage.params --exclude Mmake.params.runtime --exclude Mmake.params.trace --exclude Mmake.common --exclude mercury_conf.h --exclude .#\* ws28/runtime/mercury_grade.h ws30/runtime/mercury_grade.h
--- ws28/runtime/mercury_grade.h	Thu Apr 13 20:00:16 2000
+++ ws30/runtime/mercury_grade.h	Fri May 12 07:10:41 2000
@@ -52,7 +52,7 @@
 ** RTTI version number.
 */
 
-#define MR_GRADE_PART_0	v3_
+#define MR_GRADE_PART_0	v4_
 
 #ifdef MR_HIGHLEVEL_CODE
 
diff -rubB --exclude CVS --exclude CVU --exclude INSTALL --exclude README --exclude REDUNDANT_FILES --exclude Log\* --exclude bindist.build.vars --exclude configure --exclude errs --exclude make_all.log --exclude .error --exclude .errormsgs --exclude Mmake.params --exclude Mmake.stage.params --exclude Mmake.params.runtime --exclude Mmake.params.trace --exclude Mmake.common --exclude mercury_conf.h --exclude .#\* ws28/runtime/mercury_ho_call.c ws30/runtime/mercury_ho_call.c
--- ws28/runtime/mercury_ho_call.c	Thu May 11 21:20:08 2000
+++ ws30/runtime/mercury_ho_call.c	Thu May 11 16:30:38 2000
@@ -200,20 +200,7 @@
 	} while(0)
 
 #define	tailcall_user_pred()						\
-	do {								\
-		MR_ProcAddr	unify_pred;				\
-									\
-		if (type_ctor_info->type_ctor_old_version		\
-			< MR_RTTI_VERSION__VERSION_NO)			\
-		{							\
-			unify_pred = ((struct MR_TypeCtorInfo_Struct *) \
-				type_ctor_info)->old_unify_pred;	\
-		} else {						\
-			unify_pred = type_ctor_info->new_unify_pred;	\
-		}							\
-									\
-		tailcall(unify_pred, LABEL(mercury__unify_2_0));	\
-	} while (0)
+	tailcall(type_ctor_info->unify_pred, LABEL(mercury__unify_3_0));
 
 #define	start_label		unify_start
 #define	call_user_code_label	call_unify_in_proc
@@ -323,19 +310,8 @@
 
 #define	tailcall_user_pred()						\
 	do {								\
-		MR_ProcAddr	unify_pred;				\
-									\
-		if (type_ctor_info->type_ctor_old_version		\
-			< MR_RTTI_VERSION__VERSION_NO)			\
-		{							\
-			unify_pred = ((struct MR_TypeCtorInfo_Struct *) \
-				type_ctor_info)->old_unify_pred;	\
-		} else {						\
-			unify_pred = type_ctor_info->new_unify_pred;	\
-		}							\
-									\
 		save_transient_registers();				\
-		(void) MR_call_engine(unify_pred, FALSE);		\
+		(void) MR_call_engine(type_ctor_info->unify_pred, FALSE);\
 		restore_transient_registers();				\
 		return (r1);						\
 	} while (0)
diff -rubB --exclude CVS --exclude CVU --exclude INSTALL --exclude README --exclude REDUNDANT_FILES --exclude Log\* --exclude bindist.build.vars --exclude configure --exclude errs --exclude make_all.log --exclude .error --exclude .errormsgs --exclude Mmake.params --exclude Mmake.stage.params --exclude Mmake.params.runtime --exclude Mmake.params.trace --exclude Mmake.common --exclude mercury_conf.h --exclude .#\* ws28/runtime/mercury_type_info.h ws30/runtime/mercury_type_info.h
--- ws28/runtime/mercury_type_info.h	Thu May 11 10:26:27 2000
+++ ws30/runtime/mercury_type_info.h	Fri May 12 07:10:19 2000
@@ -77,16 +77,7 @@
 */
 
 #define MR_TYPE_CTOR_INFO_CHECK_RTTI_VERSION_RANGE(typector)    \
-    assert(typector->type_ctor_old_version == MR_RTTI_VERSION__CLEAN_LAYOUT \
-	|| typector->type_ctor_old_version == MR_RTTI_VERSION__VERSION_NO)
-
-/*---------------------------------------------------------------------------*/
-
-#ifdef	MR_BOOTSTRAP_TYPE_CTOR_VERSION_NO
-  #define	MR_TypeCtorInfo_Struct	MR_NewTypeCtorInfo_Struct
-#else
-  #define	MR_TypeCtorInfo_Struct	MR_OldTypeCtorInfo_Struct
-#endif
+    assert(typector->type_ctor_old_version == MR_RTTI_VERSION__VERSION_NO)
 
 /*---------------------------------------------------------------------------*/
 
@@ -742,28 +733,11 @@
     ** `:- type' declaration.
     */
 
-struct MR_OldTypeCtorInfo_Struct {
+struct MR_TypeCtorInfo_Struct {
     Integer             arity;
-    MR_ProcAddr         old_unify_pred;
-    MR_ProcAddr         new_unify_pred;
-    MR_ProcAddr         compare_pred;
-    MR_TypeCtorRep      type_ctor_rep;
-    MR_ProcAddr         solver_pred;
-    MR_ProcAddr         init_pred;
-    ConstString         type_ctor_module_name;
-    ConstString         type_ctor_name;
-    Integer             type_ctor_old_version;
-    MR_TypeFunctors     type_functors;
-    MR_TypeLayout       type_layout;
-    MR_int_least32_t    type_ctor_num_functors;
+    MR_int_least8_t     type_ctor_version;
     MR_int_least8_t     type_ctor_num_ptags;    /* if DU */
-};
-
-struct MR_NewTypeCtorInfo_Struct {
-    Integer             arity;
-    MR_int_least8_t     type_ctor_new_version;
-    MR_int_least8_t     type_ctor_new_num_ptags;    /* if DU */
-    MR_ProcAddr         new_unify_pred;
+    MR_ProcAddr         unify_pred;
     MR_ProcAddr         compare_pred;
     MR_TypeCtorRep      type_ctor_rep;
     MR_ProcAddr         solver_pred;
@@ -789,8 +763,6 @@
 ** structures for builtin and special types.
 */
 
-#ifdef	MR_BOOTSTRAP_TYPE_CTOR_VERSION_NO
-
 #define MR_DEFINE_BUILTIN_TYPE_CTOR_INFO_FULL(m, cm, n, a, cr, u, c)    \
     Declare_entry(u);                                                   \
     Declare_entry(c);                                                   \
@@ -811,31 +783,6 @@
         { 0 },                                                          \
         -1                                                              \
     }
-
-#else
-
-#define MR_DEFINE_BUILTIN_TYPE_CTOR_INFO_FULL(m, cm, n, a, cr, u, c)    \
-    Declare_entry(u);                                                   \
-    Declare_entry(c);                                                   \
-    MR_STATIC_CODE_CONST struct MR_OldTypeCtorInfo_Struct               \
-    MR_PASTE6(mercury_data_, cm, __type_ctor_info_, n, _, a) = {        \
-        a,                                                              \
-        MR_MAYBE_STATIC_CODE(ENTRY(u)),                                 \
-        MR_MAYBE_STATIC_CODE(ENTRY(u)),                                 \
-        MR_MAYBE_STATIC_CODE(ENTRY(c)),                                 \
-        cr,                                                             \
-        NULL,                                                           \
-        NULL,                                                           \
-        MR_string_const(MR_STRINGIFY(m), sizeof(MR_STRINGIFY(m))-1),    \
-        MR_string_const(MR_STRINGIFY(n), sizeof(MR_STRINGIFY(n))-1),    \
-        MR_RTTI_VERSION__CLEAN_LAYOUT,                                  \
-        { 0 },                                                          \
-        { 0 },                                                          \
-        -1,                                                             \
-        -1                                                              \
-    }
-
-#endif
 
 #define MR_DEFINE_BUILTIN_TYPE_CTOR_INFO_PRED(m, n, a, cr, u, c)        \
     MR_DEFINE_BUILTIN_TYPE_CTOR_INFO_FULL(m, m, n, a, cr, u, c)
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list