[m-dev.] diff: remove old bootstrapping code

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Dec 12 02:31:52 AEDT 1999


Note that this change increments the binary compatibility version
number, which means that when you do a cvs update to incorporate this
change into your workspace, you will need to recompile all the .o
files in the library, compiler, and profiler directories to avoid link
errors.  You don't need to recompile the .c files, though, so doing

	rm -f {library,compiler,profiler}/{*.o,Mercury/os/*.o}

rather than `mmake clean' will save you a bit of time.

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

Estimated hours taken: 1

Delete old bootstrapping code.

runtime/mercury_ho_call.c:
	Delete code to handle old closure representations.

runtime/mercury_type_info.h:
runtime/mercury_type_info.c:
runtime/mercury_deep_copy_body.h:
runtime/mercury_tabling.c:
	Delete code to handle old RTTI representations.

runtime/mercury_grade.h:
	Increment the binary compatibility version number.
	This is needed to ensure that any code compiled
	with the old closure or RTTI representations will
	get a link error.

compiler/notes/release_checklist.html:
	Delete the item about deleting code to handle old closure
	representations, since it has been done now.
	(Also delete the item about muz, since that has been
	done now too.)

Workspace: /usr/hg2/fjh/mercury
Index: compiler/notes/release_checklist.html
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/notes/release_checklist.html,v
retrieving revision 1.12
diff -u -d -r1.12 release_checklist.html
--- compiler/notes/release_checklist.html	1999/04/16 06:20:47	1.12
+++ compiler/notes/release_checklist.html	1999/12/11 15:20:57
@@ -15,19 +15,12 @@
 <!-------------------------->
 
 <ol>
-<li> Items for the next version (0.9) only:
+<li> Items for the next version (1.0) only:
 	<ol>
 	<li>
-	Remove the bootstrap-only code from runtime/mercury_ho_call.c,
-	which are (a) three closure call routines, (b) three method
-	call routines, and (c) a backward compatibility check in the
-	new closure call routine.
-	<li>
 	Make sure that the runtime headers contain no symbols (function names,
 	variable names, type names, struct/enum tags or macros) that do not
 	begin with MR_.
-	<li>
-	Ask Philip to check in muz, preferably with documentation.
 	</ol>
 
 <li> Make sure configure.in is updated to check for new features.
Index: runtime/mercury_deep_copy_body.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_deep_copy_body.h,v
retrieving revision 1.16
diff -u -d -r1.16 mercury_deep_copy_body.h
--- runtime/mercury_deep_copy_body.h	1999/12/10 19:12:12	1.16
+++ runtime/mercury_deep_copy_body.h	1999/12/11 15:05:04
@@ -48,7 +48,7 @@
     layout_entry = type_ctor_info->type_ctor_layout[data_tag];
     entry_value = (Word *) MR_strip_tag(layout_entry);
 
-    switch (MR_get_new_type_ctor_rep(type_ctor_info)) {
+    switch (type_ctor_info->type_ctor_rep) {
         case MR_TYPECTOR_REP_ENUM:
         case MR_TYPECTOR_REP_ENUM_USEREQ:
             new_data = data;    /* just a copy of the actual item */
Index: runtime/mercury_grade.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_grade.h,v
retrieving revision 1.23
diff -u -d -r1.23 mercury_grade.h
--- runtime/mercury_grade.h	1999/11/09 01:45:38	1.23
+++ runtime/mercury_grade.h	1999/12/11 15:16:19
@@ -53,17 +53,13 @@
 ** Note that the binary compatibility version number has no direct
 ** relationship with the source release number (which is in ../VERSION).
 **
-** Note: next time the binary compatibility version number is increased,
-** we should remove the MR_get_new_type_ctor_rep() function in
-** runtime/mercury_type_info.c.  
-**
 ** It is a good idea to inspect all code for RTTI version number checks
 ** and remove them when increasing the binary compatibility version number.   
 ** Searching for MR_RTTI_VERSION__ should find all code related to the
 ** RTTI version number.
 */
 
-#define MR_GRADE_PART_0		v1_
+#define MR_GRADE_PART_0		v2_
 
 #ifdef USE_ASM_LABELS
   #define MR_GRADE_PART_1	MR_PASTE2(MR_GRADE_PART_0, asm_)
Index: runtime/mercury_ho_call.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_ho_call.c,v
retrieving revision 1.27
diff -u -d -r1.27 mercury_ho_call.c
--- runtime/mercury_ho_call.c	1999/11/10 09:04:34	1.27
+++ runtime/mercury_ho_call.c	1999/12/11 15:14:47
@@ -57,19 +57,6 @@
 #define MR_CLASS_METHOD_CALL_INPUTS	4
 
 /*
-** The following entries are obsolete, and are kept for bootstrapping only.
-*/
-
-Define_extern_entry(do_call_det_closure);
-Define_extern_entry(do_call_semidet_closure);
-Define_extern_entry(do_call_nondet_closure);
-Define_extern_entry(do_call_old_closure);
-
-Define_extern_entry(do_call_det_class_method);
-Define_extern_entry(do_call_semidet_class_method);
-Define_extern_entry(do_call_nondet_class_method);
-
-/*
 ** These are the real implementations of higher order calls and method calls.
 */
 
@@ -90,19 +77,8 @@
 Declare_label(mercury__compare_3_0_i1);
 
 BEGIN_MODULE(call_module)
-	init_entry_ai(do_call_det_closure);
-	init_entry_ai(do_call_semidet_closure);
-	init_entry_ai(do_call_nondet_closure);
-	init_entry_ai(do_call_old_closure);
-
 	init_entry_ai(mercury__do_call_closure);
-
-	init_entry_ai(do_call_det_class_method);
-	init_entry_ai(do_call_semidet_class_method);
-	init_entry_ai(do_call_nondet_class_method);
-
 	init_entry_ai(mercury__do_call_class_method);
-
 	init_entry_ai(mercury__unify_2_0);
 	init_entry_ai(mercury__index_2_0);
 	init_entry_ai(mercury__compare_3_0);
@@ -111,48 +87,6 @@
 	init_entry_ai(mercury__compare_3_3);
 BEGIN_CODE
 
-Define_entry(do_call_det_closure);
-	tailcall(ENTRY(mercury__do_call_closure),
-		LABEL(do_call_det_closure));
-Define_entry(do_call_semidet_closure);
-	tailcall(ENTRY(mercury__do_call_closure),
-		LABEL(do_call_semidet_closure));
-Define_entry(do_call_nondet_closure);
-	tailcall(ENTRY(mercury__do_call_closure),
-		LABEL(do_call_nondet_closure));
-
-Define_entry(do_call_old_closure);
-{
-	Word	closure;
-	int	i, num_in_args, num_extra_args;
-
-	closure = r1; /* The closure */
-	num_in_args = MR_field(0, closure, 0); /* number of input args */
-	num_extra_args = r2; /* number of immediate input args */
-
-	save_registers();
-
-	if (num_in_args < MR_HO_CALL_INPUTS) {
-		for (i = 1; i <= num_extra_args; i++) {
-			virtual_reg(i + num_in_args) =
-				virtual_reg(i + MR_HO_CALL_INPUTS);
-		}
-	} else if (num_in_args > MR_HO_CALL_INPUTS) {
-		for (i = num_extra_args; i>0; i--) {
-			virtual_reg(i + num_in_args) =
-				virtual_reg(i + MR_HO_CALL_INPUTS);
-		}
-	} /* else do nothing because i == MR_HO_CALL_INPUTS */
-
-	for (i = 1; i <= num_in_args; i++) {
-		virtual_reg(i) = MR_field(0, closure, i + 1); /* copy args */
-	}
-
-	restore_registers();
-
-	tailcall((Code *) MR_field(0, closure, 1), LABEL(do_call_det_closure));
-}
-
 Define_entry(mercury__do_call_closure);
 {
 	MR_Closure	*closure;
@@ -161,14 +95,6 @@
 	int		i;
 
 	closure = (MR_Closure *) r1;
-
-	/* This check is for bootstrapping only. */
-	if (((Word) closure->MR_closure_layout) < 1024) {
-		/* we found an old-style closure, call the old handler */
-		tailcall(ENTRY(do_call_old_closure),
-			LABEL(mercury__do_call_closure));
-	}
-
 	num_extra_args = r2;
 	num_hidden_args = closure->MR_closure_num_hidden_args;
 
@@ -198,16 +124,6 @@
 		LABEL(mercury__do_call_closure));
 }
 
-Define_entry(do_call_det_class_method);
-	tailcall(ENTRY(mercury__do_call_class_method),
-		LABEL(do_call_det_class_method));
-Define_entry(do_call_semidet_class_method);
-	tailcall(ENTRY(mercury__do_call_class_method),
-		LABEL(do_call_semidet_class_method));
-Define_entry(do_call_nondet_class_method);
-	tailcall(ENTRY(mercury__do_call_class_method),
-		LABEL(do_call_nondet_class_method));
-
 	/*
 	** r1: the typeclass_info
 	** r2: index of class method
@@ -274,11 +190,10 @@
 	type_ctor_info = MR_TYPEINFO_GET_TYPE_CTOR_INFO((Word *) type_info);
 
 #ifdef	MR_CTOR_REP_STATS
-	MR_ctor_rep_unify[MR_get_new_type_ctor_rep(
-				type_ctor_info->type_ctor_rep)]++;
+	MR_ctor_rep_unify[type_ctor_info->type_ctor_rep]++;
 #endif
 
-	switch (MR_get_new_type_ctor_rep(type_ctor_info)) {
+	switch (type_ctor_info->type_ctor_rep) {
 
 			/*
 			** For notag and equiv types, we should probably
@@ -508,11 +423,10 @@
 	type_ctor_info = MR_TYPEINFO_GET_TYPE_CTOR_INFO((Word *) type_info);
 
 #ifdef	MR_CTOR_REP_STATS
-	MR_ctor_rep_index[MR_get_new_type_ctor_rep(
-				type_ctor_info->type_ctor_rep)]++;
+	MR_ctor_rep_index[type_ctor_info->type_ctor_rep]++;
 #endif
 
-	switch (MR_get_new_type_ctor_rep(type_ctor_info)) {
+	switch (type_ctor_info->type_ctor_rep) {
 
 			/*
 			** For notag and equiv types, we should probably
@@ -707,11 +621,10 @@
 	type_ctor_info = MR_TYPEINFO_GET_TYPE_CTOR_INFO((Word *) type_info);
 
 #ifdef	MR_CTOR_REP_STATS
-	MR_ctor_rep_compare[MR_get_new_type_ctor_rep(
-				type_ctor_info->type_ctor_rep)]++;
+	MR_ctor_rep_compare[type_ctor_info->type_ctor_rep]++;
 #endif
 
-	switch (MR_get_new_type_ctor_rep(type_ctor_info)) {
+	switch (type_ctor_info->type_ctor_rep) {
 
 			/*
 			** For notag and equiv types, we should probably
Index: runtime/mercury_tabling.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_tabling.c,v
retrieving revision 1.16
diff -u -d -r1.16 mercury_tabling.c
--- runtime/mercury_tabling.c	1999/11/15 05:03:08	1.16
+++ runtime/mercury_tabling.c	1999/12/11 15:07:43
@@ -486,11 +486,11 @@
 #ifdef  MR_TABLE_DEBUG
     if (MR_tabledebug) {
         printf("ENTRY %p %x, data rep: %d\n",
-            table, data, MR_get_new_type_ctor_rep(type_ctor_info));
+            table, data, type_ctor_info->type_ctor_rep);
     }
 #endif  /* MR_TABLE_DEBUG */
 
-    switch (MR_get_new_type_ctor_rep(type_ctor_info)) {
+    switch (type_ctor_info->type_ctor_rep) {
         case MR_TYPECTOR_REP_ENUM: 
         case MR_TYPECTOR_REP_ENUM_USEREQ: 
 	{
Index: runtime/mercury_type_info.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_type_info.c,v
retrieving revision 1.28
diff -u -d -r1.28 mercury_type_info.c
--- runtime/mercury_type_info.c	1999/12/10 15:53:34	1.28
+++ runtime/mercury_type_info.c	1999/12/11 15:16:25
@@ -684,30 +684,3 @@
 }
 
 /*---------------------------------------------------------------------------*/
-
-	/* Functions for handling previous versions of the RTTI code */
-
-	/*
-	** After updating the type_ctor_rep enumeration to add user
-	** defined equality alternatives, we need to convert old
-	** type_ctor_reps into the new type_ctor_rep.
-	*/
-MR_TypeCtorRepresentation
-MR_get_new_type_ctor_rep(MR_TypeCtorInfo type_ctor_info)
-{
-	MR_TYPE_CTOR_INFO_CHECK_RTTI_VERSION_RANGE(type_ctor_info);
-	if (type_ctor_info->type_ctor_version < MR_RTTI_VERSION__USEREQ) {
-		if (type_ctor_info->type_ctor_rep < 3) {
-			return type_ctor_info->type_ctor_rep * 2;
-		} else {
-			return type_ctor_info->type_ctor_rep + 3;
-		}
-	} else {
-		return type_ctor_info->type_ctor_rep;
-	}
-}
-
-/*---------------------------------------------------------------------------*/
-
-
-
Index: runtime/mercury_type_info.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_type_info.h,v
retrieving revision 1.32
diff -u -d -r1.32 mercury_type_info.h
--- runtime/mercury_type_info.h	1999/12/10 14:40:39	1.32
+++ runtime/mercury_type_info.h	1999/12/11 15:20:11
@@ -64,7 +64,7 @@
 */
 
 #define MR_TYPE_CTOR_INFO_CHECK_RTTI_VERSION_RANGE(typector)	\
-	assert(MR_RTTI_VERSION__INITIAL <= typector->type_ctor_version \
+	assert(MR_RTTI_VERSION__USEREQ <= typector->type_ctor_version \
 		&& typector->type_ctor_version <= MR_RTTI_VERSION__USEREQ)
 
 /*---------------------------------------------------------------------------*/
@@ -955,13 +955,6 @@
 
 #define MR_TYPE_CTOR_INFO_GET_TYPE_MODULE_NAME(TypeCtorInfo)		\
 	((TypeCtorInfo)->type_ctor_module_name)
-
-/*---------------------------------------------------------------------------*/
-
-	/* Functions for handling previous versions of the RTTI code */
-
-MR_TypeCtorRepresentation
-MR_get_new_type_ctor_rep(MR_TypeCtorInfo type_ctor_info);
 
 /*---------------------------------------------------------------------------*/
 #endif /* not MERCURY_TYPEINFO_H */

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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