[m-dev.] diff: MLDS back-end: MR_MINIMAL_MODEL_TABLING => abort

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Feb 16 20:17:09 AEDT 2000


Estimated hours taken: 0.75

Improve the support for the MLDS back-end in the runtime
and standard library.

library/private_builtin.m:
runtime/mercury_tabling.c:
	Change the code for handling MR_USE_MINIMAL_MODEL
	so that if MR_HIGHLEVEL_CODE is defined, it aborts
	by calling fatal_error(), since that code will only
	work with the low-level back-end.

Workspace: /home/mercury0/fjh/mercury
Index: library/private_builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/private_builtin.m,v
retrieving revision 1.39
diff -u -d -r1.39 private_builtin.m
--- private_builtin.m	2000/01/19 09:45:17	1.39
+++ private_builtin.m	2000/01/26 02:14:39
@@ -825,14 +825,17 @@
 			fatal_error(""MR_maxfr != MR_curfr at table setup\\n"");
 		}
 #endif
-
+#ifdef MR_HIGHLEVEL_CODE
+ 		fatal_error(""sorry, not implemented: ""
+			""minimal_model tabling with --high-level-code"");
+#else
 		subgoal->generator_maxfr = MR_prevfr_slot(MR_maxfr);
 		subgoal->generator_sp = MR_sp;
-
+#endif
 		table->MR_subgoal = subgoal;
 	}
 	T = T0;
-#endif
+#endif /* MR_USE_MINIMAL_MODEL */
 ").
 
 	% The definitions of these two predicates are in the runtime system,
Index: runtime/mercury_tabling.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_tabling.c,v
retrieving revision 1.20
diff -u -d -r1.20 mercury_tabling.c
--- mercury_tabling.c	2000/01/19 09:45:22	1.20
+++ mercury_tabling.c	2000/02/16 08:50:20
@@ -933,6 +933,10 @@
 {
 	restore_transient_registers();
 
+  #ifdef MR_HIGHLEVEL_CODE
+	fatal_error("sorry, not implemented: "
+		"minimal model tabling with --high-level-code");
+  #else
 	saved_state->succ_ip = MR_succip;
 	saved_state->s_p = MR_sp;
 	saved_state->cur_fr = MR_curfr;
@@ -964,6 +968,8 @@
 		saved_state->det_stack_block = NULL;
 	}
 
+  #endif /* ! MR_HIGHLEVEL_CODE */
+
 	saved_state->gen_next = MR_gen_next;
 	saved_state->generator_stack_block = table_allocate_bytes(
 			MR_gen_next * sizeof(MR_GeneratorStackFrame));
@@ -976,7 +982,7 @@
 	table_copy_bytes(saved_state->cut_stack_block,
 		MR_cut_stack, MR_cut_next * sizeof(MR_CutStackFrame));
 
-#ifdef MR_USE_TRAIL
+  #ifdef MR_USE_TRAIL
 	/*
 	** Saving the trail state here would not be sufficient to handle
 	** the combination of trailing and minimal model tabling.
@@ -1001,9 +1007,9 @@
 
 	fatal_error("Sorry, not implemented: "
 		"can't have both minimal model tabling and trailing");
-#endif
+  #endif
 
-#ifdef	MR_TABLE_DEBUG
+  #ifdef MR_TABLE_DEBUG
 	if (MR_tabledebug) {
 		printf("\n%s saves %s stacks: ", who, what);
 		printf("%d non, %d det, %d generator, %d cut\n",
@@ -1011,6 +1017,10 @@
 			saved_state->det_stack_block_size,
 			MR_gen_next, MR_cut_next);
 
+    #ifdef MR_HIGHLEVEL_CODE
+		fatal_error("sorry, not implemented: "
+			"minimal model tabling with --high-level-code");
+    #else
 		printf("non region from ");
 		MR_printnondstackptr(saved_state->non_stack_block_start);
 		printf(" to ");
@@ -1038,14 +1048,17 @@
 		printf(", curfr = ");
 		MR_printnondstackptr(MR_curfr);
 		printf("\n\n");
+    #endif
 
 		MR_print_gen_stack(stdout);
 
+    #ifndef MR_HIGHLEVEL_CODE
 		if (MR_tablestackdebug) {
 			MR_dump_nondet_stack_from_layout(stdout, MR_maxfr);
 		}
+    #endif
 	}
-#endif
+  #endif /* MR_TABLE_DEBUG */
 
 	save_transient_registers();
 }
@@ -1059,6 +1072,13 @@
 {
 	restore_transient_registers();
 
+  #ifdef MR_HIGHLEVEL_CODE
+
+	fatal_error("sorry, not implemented: "
+		"minimal model tabling with --high-level-code");
+
+  #else
+
 	MR_succip = saved_state->succ_ip;
 	MR_sp = saved_state->s_p;
 	MR_curfr = saved_state->cur_fr;
@@ -1072,6 +1092,8 @@
 		saved_state->det_stack_block,
 		saved_state->det_stack_block_size);
 
+  #endif
+
 	MR_gen_next = saved_state->gen_next;
 	table_copy_bytes(MR_gen_stack, saved_state->generator_stack_block,
 		saved_state->gen_next * sizeof(MR_GeneratorStackFrame));
@@ -1080,7 +1102,7 @@
 	table_copy_bytes(MR_cut_stack, saved_state->cut_stack_block,
 		saved_state->cut_next * sizeof(MR_CutStackFrame));
 
-#ifdef	MR_TABLE_DEBUG
+  #ifdef MR_TABLE_DEBUG
 	if (MR_tabledebug) {
 		printf("\n%s restores %s stacks: ", who, what);
 		printf("%d non, %d det, %d generator, %d cut\n",
@@ -1124,7 +1146,7 @@
 			MR_dump_nondet_stack_from_layout(stdout, MR_maxfr);
 		}
 	}
-#endif
+  #endif /* MR_table_debug */
 
 	save_transient_registers();
 }

-- 
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