[m-dev.] for review: direct retry

Zoltan Somogyi zs at cs.mu.OZ.AU
Mon Oct 16 15:31:52 AEDT 2000


On 16-Oct-2000, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> I'll go with the opposite convention, with MR_EvalMethod still being the enum
> and a new type MR_EvalMethodInt which is typedef'd to MR_int_least8_t.

This is the diff I am committing.

runtime/mercury_stack_layout.h:
	Make the eval_method field of proc layouts an int, not an enum,
	to avoid problems on standard C compilers. Provide a macro to access
	the field in a type safe manner.

trace/mercury_trace.c:
	Use the macro to refer to the field.

Zoltan.

cvs diff: Diffing .
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/xml
cvs diff: Diffing library
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
Index: runtime/mercury_stack_layout.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_stack_layout.h,v
retrieving revision 1.40
diff -u -b -r1.40 mercury_stack_layout.h
--- runtime/mercury_stack_layout.h	2000/10/13 04:06:31	1.40
+++ runtime/mercury_stack_layout.h	2000/10/16 03:00:55
@@ -345,6 +345,14 @@
 	MR_EVAL_METHOD_MINIMAL
 } MR_EvalMethod;
 
+/*
+** We cannot put evals into structures as bit fields. To avoid wasting space,
+** we put MR_EvalMethodInts into structures instead of MR_EvalMethods
+** themselves.
+*/
+
+typedef	MR_int_least8_t		MR_EvalMethodInt;
+
 typedef	struct MR_Stack_Layout_Entry_Struct {
 	/* stack traversal group */
 	MR_Code			*MR_sle_code_addr;
@@ -367,10 +375,13 @@
 	MR_int_least8_t		MR_sle_maybe_from_full;
 	MR_int_least8_t		MR_sle_maybe_trail;
 	MR_int_least8_t		MR_sle_maybe_maxfr;
-	MR_EvalMethod		MR_sle_eval_method:8;
+	MR_EvalMethodInt	MR_sle_eval_method_CAST_ME;
 	MR_int_least8_t		MR_sle_maybe_call_table;
 	MR_int_least8_t		MR_sle_maybe_decl_debug;
 } MR_Stack_Layout_Entry;
+
+#define	MR_sle_eval_method(entry)				\
+			((MR_EvalMethod) (entry)->MR_sle_eval_method_CAST_ME)
 
 #define	MR_sle_user	MR_sle_proc_id.MR_proc_user
 #define	MR_sle_comp	MR_sle_proc_id.MR_proc_comp
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
Index: trace/mercury_trace.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace.c,v
retrieving revision 1.29
diff -u -b -r1.29 mercury_trace.c
--- trace/mercury_trace.c	2000/10/16 02:09:47	1.29
+++ trace/mercury_trace.c	2000/10/16 03:02:14
@@ -935,7 +935,7 @@
 			return MR_RETRY_ERROR;
 		}
 
-		if (proc_layout->MR_sle_eval_method != MR_EVAL_METHOD_MINIMAL)
+		if (MR_sle_eval_method(proc_layout) != MR_EVAL_METHOD_MINIMAL)
 		{
 			continue;
 		}
@@ -996,7 +996,7 @@
 		label_layout = event_info->MR_event_sll;
 		proc_layout = label_layout->MR_sll_entry;
 
-		if (proc_layout->MR_sle_eval_method == MR_EVAL_METHOD_MINIMAL) {
+		if (MR_sle_eval_method(proc_layout) == MR_EVAL_METHOD_MINIMAL) {
 			return MR_RETRY_OK_FAIL_FIRST;
 		} else {
 			return MR_RETRY_OK_FINISH_FIRST;
@@ -1052,7 +1052,7 @@
 				"in MR_maybe_record_call_table");
 	}
 
-	switch (level_layout->MR_sle_eval_method) {
+	switch (MR_sle_eval_method(level_layout)) {
 
 	case MR_EVAL_METHOD_NORMAL:
 		/* nothing to do */
cvs diff: Diffing trax
cvs diff: Diffing trial
cvs diff: Diffing util
--------------------------------------------------------------------------
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