for review: Stack dumps -- compiler.

Tyson Dowd trd at cs.mu.OZ.AU
Fri Mar 6 16:42:08 AEDT 1998


Hi,

Here is an updated version of my changes to the compiler to support 
stack layouts.  The only new parts are in llds_out.m

===================================================================

Estimated hours taken: 1.0

Small changes to support stack traces.

compiler/llds_out.m:
	Run initialization if MR_INSERT_LABELS is defined, because we
	will need to do this for stack traces, accurate gc, etc.

compiler/stack_layout.m:
	Update the documentation a little to refer to the new file
	mercury_stack_layout.h rather than mercury_accurate_gc.h.

Index: compiler/llds_out.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/llds_out.m,v
retrieving revision 1.73
diff -u -r1.73 llds_out.m
--- llds_out.m	1998/03/03 17:34:55	1.73
+++ llds_out.m	1998/03/05 06:29:49
@@ -259,11 +259,7 @@
 
 		% Output initialization functions, bunched into groups
 		% of 40.
-	io__write_string("#if (defined(USE_GCC_NONLOCAL_GOTOS) && "),
-	io__write_string("!defined(USE_ASM_LABELS)) \\\n\t|| "),
-	io__write_string("defined(PROFILE_CALLS) || defined(DEBUG_GOTOS) \\\n"),
-	io__write_string("\t|| defined(DEBUG_LABELS) || !defined(SPEED) \\\n"),
-	io__write_string("\t|| defined(NATIVE_GC) \n\n"),
+	io__write_string("#if defined(MR_NEED_INITIALIZATION_CODE)\n\n"),
 	io__write_string("static void "),
 	output_bunch_name(BaseName, 0),
 	io__write_string("(void)\n"),
@@ -281,11 +277,7 @@
 	output_init_name(BaseName),
 	io__write_string("(void)\n"),
 	io__write_string("{\n"),
-	io__write_string("#if (defined(USE_GCC_NONLOCAL_GOTOS) && "),
-	io__write_string("!defined(USE_ASM_LABELS)) \\\n\t|| "),
-	io__write_string("defined(PROFILE_CALLS) || defined(DEBUG_GOTOS) \\\n"),
-	io__write_string("\t|| defined(DEBUG_LABELS) || !defined(SPEED) \\\n"),
-	io__write_string("\t|| defined(NATIVE_GC) \n\n"),
+	io__write_string("#if defined(MR_NEED_INITIALIZATION_CODE)\n\n"),
 	io__write_string("\tstatic bool done = FALSE;\n"),
 	io__write_string("\tif (!done) {\n"),
 	io__write_string("\t\tdone = TRUE;\n"),
Index: compiler/stack_layout.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/stack_layout.m,v
retrieving revision 1.8
diff -u -r1.8 stack_layout.m
--- stack_layout.m	1998/03/03 17:36:02	1.8
+++ stack_layout.m	1998/03/04 08:21:31
@@ -28,7 +28,7 @@
 % This table will always contain the following information:
 %
 %	code address		(Code *) - address of entry
-% 	determinism		(Integer) actually, type MR_determinism
+% 	determinism		(Integer) actually, type MR_Determinism
 % 	number of stack slots	(Integer)
 % 	succip stack location	(Integer) actually, type MR_Live_Lval
 % 					(the location will be set to -1
@@ -479,9 +479,9 @@
 
 %---------------------------------------------------------------------------%
 
-	% The constants here should be kept in sync with constants in
-	% the runtime system:
-	% 	mercury_accurate_gc.h - contains macros to access these
+	% The constants and representations here should be kept in sync
+	% with constants in the runtime system:
+	% 	mercury_stack_layout.h - contains macros to access these
 	%			 	constants.
 
 	% Construct a representation of a live_value_type.


-- 
       Tyson Dowd           # There isn't any reason why Linux can't be
                            # implemented as an enterprise computing solution.
     trd at cs.mu.oz.au        # Find out what you've been missing while you've
http://www.cs.mu.oz.au/~trd # been rebooting Windows NT. -- InfoWorld, 1998.



More information about the developers mailing list