[m-rev.] diff: removing MR_USE_DECL_STACK_SLOT

Zoltan Somogyi zs at cs.mu.OZ.AU
Thu May 16 02:21:59 AEST 2002


Mark has agreed to this change.

trace/mercury_trace_declarative.c:
	Remove the code conditional on MR_USE_DECL_STACK_SLOT, since it is long
	obsolete and we don't intend ever to use it again.

cvs diff: Diffing .
Index: mercury_trace_declarative.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_declarative.c,v
retrieving revision 1.51
diff -u -b -r1.51 mercury_trace_declarative.c
--- mercury_trace_declarative.c	15 May 2002 11:24:18 -0000	1.51
+++ mercury_trace_declarative.c	15 May 2002 11:32:52 -0000
@@ -322,19 +322,6 @@
 		return NULL;
 	}
 
-#ifdef MR_USE_DECL_STACK_SLOT
-	if (entry->MR_sle_maybe_decl_debug < 1) {
-		/*
-		** If using reserved stack slots, we ignore any event
-		** for a procedure that does not have a slot reserved.
-		** Such procedures are effectively assumed correct, so
-		** we give the user a warning.
-		*/
-		MR_edt_compiler_flag_warning = MR_TRUE;
-		return NULL;
-	}
-#endif /* MR_USE_DECL_STACK_SLOT */
-
 	event_details.MR_call_seqno = MR_trace_call_seqno;
 	event_details.MR_call_depth = MR_trace_call_depth;
 	event_details.MR_event_number = MR_trace_event_number;
@@ -475,11 +462,6 @@
 		}
 	);
 
-#ifdef MR_USE_DECL_STACK_SLOT
-	MR_trace_decl_set_slot(layout->MR_sll_entry,
-					event_info->MR_saved_regs, node);
-#endif
-
 	return node;
 }
 	
@@ -495,14 +477,7 @@
 				event_info->MR_saved_regs,
 				MR_PORT_EXIT);
 
-#ifdef MR_USE_DECL_STACK_SLOT
-	call = MR_trace_decl_get_slot(event_info->MR_event_sll->MR_sll_entry,
-				event_info->MR_saved_regs);
-#else
-	call = MR_trace_matching_call(prev);
 	MR_decl_checkpoint_match(call);
-#endif
-	
 	MR_TRACE_CALL_MERCURY(
 		last_interface = MR_DD_call_node_get_last_interface(
 				(MR_Word) call);
@@ -525,10 +500,6 @@
 	MR_Trace_Node		next;
 	MR_Word			last_interface;
 
-#ifdef MR_USE_DECL_STACK_SLOT
-	call = MR_trace_decl_get_slot(event_info->MR_event_sll->MR_sll_entry,
-				event_info->MR_saved_regs);
-#else
 	/*
 	** Search through previous contour for a matching EXIT event.
 	*/
@@ -548,7 +519,6 @@
 			MR_fatal_error("MR_trace_decl_redo: no matching EXIT");
 		}
 	);
-#endif /* !MR_USE_DECL_STACK_SLOT */
 
 	MR_TRACE_CALL_MERCURY(
 		last_interface = MR_DD_call_node_get_last_interface(
@@ -571,25 +541,17 @@
 	MR_Trace_Node		call;
 	MR_Word			redo;
 
-#ifdef MR_USE_DECL_STACK_SLOT
-	call = MR_trace_decl_get_slot(event_info->MR_event_sll->MR_sll_entry,
-				event_info->MR_saved_regs);
-#else
-	if (MR_trace_node_port(prev) == MR_PORT_CALL)
-	{
+	if (MR_trace_node_port(prev) == MR_PORT_CALL) {
 		/*
 		** We are already at the corresponding call, so there
 		** is no need to search for it.
 		*/
 		call = prev;
-	}
-	else
-	{
+	} else {
 		next = MR_trace_find_prev_contour(prev);
 		call = MR_trace_matching_call(next);
 	}
 	MR_decl_checkpoint_match(call);
-#endif
 
 	MR_TRACE_CALL_MERCURY(
 		redo = MR_DD_call_node_get_last_interface((MR_Word) call);
@@ -610,13 +572,8 @@
 	MR_Trace_Node		call;
 	MR_Word			last_interface;
 
-#ifdef MR_USE_DECL_STACK_SLOT
-	call = MR_trace_decl_get_slot(event_info->MR_event_sll->MR_sll_entry,
-				event_info->MR_saved_regs);
-#else
 	call = MR_trace_matching_call(prev);
 	MR_decl_checkpoint_match(call);
-#endif
 
 	MR_TRACE_CALL_MERCURY(
 		last_interface = MR_DD_call_node_get_last_interface(
@@ -850,51 +807,6 @@
 	return node;
 }
 
-#ifdef MR_USE_DECL_STACK_SLOT
-
-static	MR_Trace_Node
-MR_trace_decl_get_slot(const MR_Proc_Layout *entry, MR_Word *saved_regs)
-{
-	int			decl_slot;
-	MR_Word			*saved_sp;
-	MR_Word			*saved_curfr;
-	MR_Trace_Node		node;
-	
-	decl_slot = entry->MR_sle_maybe_decl_debug;
-	
-	if (MR_DETISM_DET_STACK(entry->MR_sle_detism)) {
-		saved_sp = (MR_Word *) MR_saved_sp(saved_regs);
-		node = (MR_Trace_Node) MR_based_stackvar(saved_sp, decl_slot);
-	} else {
-		saved_curfr = (MR_Word *) MR_saved_curfr(saved_regs);
-		node = (MR_Trace_Node) MR_based_framevar(saved_curfr,
-							decl_slot);
-	}
-	
-	return node;
-}
-
-static	void
-MR_trace_decl_set_slot(const MR_Proc_Layout *entry,
-		MR_Word *saved_regs, MR_Trace_Node node)
-{
-	int			decl_slot;
-	MR_Word			*saved_sp;
-	MR_Word			*saved_curfr;
-	
-	decl_slot = entry->MR_sle_maybe_decl_debug;
-	
-	if (MR_DETISM_DET_STACK(entry->MR_sle_detism)) {
-		saved_sp = (MR_Word *) MR_saved_sp(saved_regs);
-		MR_based_stackvar(saved_sp, decl_slot) = (MR_Word) node;
-	} else {
-		saved_curfr = (MR_Word *) MR_saved_curfr(saved_regs);
-		MR_based_framevar(saved_curfr, decl_slot) = (MR_Word) node;
-	}
-}
-
-#endif /* MR_USE_DECL_STACK_SLOT */
-
 static	MR_Trace_Node
 MR_trace_matching_call(MR_Trace_Node node)
 {
@@ -1214,17 +1126,6 @@
 				"compiled with trace level `decl'.\n");
 		return MR_FALSE;
 	}
-
-#ifdef MR_USE_DECL_STACK_SLOT
-	if (entry->MR_sle_maybe_decl_debug < 1) {
-		/* No slots are reserved for declarative debugging */
-		fflush(MR_mdb_out);
-		fprintf(MR_mdb_err, "mdb: cannot start declarative debugging, "
-				"because this procedure was not\n"
-				"compiled with stack slots reserved.\n");
-		return MR_FALSE;
-	}
-#endif /* MR_USE_DECL_STACK_SLOT */
 
 	if (trace_mode == MR_TRACE_DECL_DEBUG_DUMP) {
 		out = fopen(outfile, "w");
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list