[m-rev.] diff: don't allocate stack slots for the decl debugger
Mark Brown
dougl at cs.mu.OZ.AU
Thu May 16 23:10:18 AEST 2002
Estimated hours taken: 0.5
Branches: main
Remove the code that reserves two stack slots for declarative debugging.
Now that code for MR_USE_DECL_STACK_SLOT no longer exists, there is no
chance that the stack slots will be required.
compiler/layout.m:
Remove the maybe_decl_debug_slot field from proc_layout_exec_trace.
compiler/layout_out.m:
Don't print the field that was just removed.
Update a couple of comments.
compiler/trace.m:
Remove the slot_decl field from trace_slot_info. Don't reserve
the two slots.
compiler/llds_common.m:
compiler/code_info.m:
compiler/stack_layout.m:
Propagate the effects of the above changes.
compiler/trace_params.m:
Remove trace_level_needs_decl_debug_slots.
runtime/mercury_stack_layout.h:
Remove the MR_exec_maybe_decl_debug field from MR_Exec_Trace.
runtime/mercury_conf_param.h:
Don't document MR_USE_DECL_STACK_SLOT.
trace/mercury_trace_declarative.c:
Remove the prototypes of two unused functions whose definitions
were removed earlier.
Index: compiler/code_info.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/code_info.m,v
retrieving revision 1.267
diff -u -r1.267 code_info.m
--- compiler/code_info.m 28 Mar 2002 03:42:45 -0000 1.267
+++ compiler/code_info.m 16 May 2002 12:24:19 -0000
@@ -469,7 +469,7 @@
TraceSlotInfo, TraceInfo),
code_info__set_maybe_trace_info(yes(TraceInfo))
;
- { TraceSlotInfo = trace_slot_info(no, no, no, no, no, no) }
+ { TraceSlotInfo = trace_slot_info(no, no, no, no, no) }
).
%---------------------------------------------------------------------------%
Index: compiler/layout.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/layout.m,v
retrieving revision 1.6
diff -u -r1.6 layout.m
--- compiler/layout.m 12 Apr 2002 10:08:14 -0000 1.6
+++ compiler/layout.m 16 May 2002 12:24:21 -0000
@@ -158,8 +158,7 @@
maybe_trail_slot :: maybe(int),
maybe_maxfr_slot :: maybe(int),
eval_method :: eval_method,
- maybe_call_table_slot :: maybe(int),
- maybe_decl_debug_slot :: maybe(int)
+ maybe_call_table_slot :: maybe(int)
).
:- type file_layout_data
Index: compiler/layout_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/layout_out.m,v
retrieving revision 1.10
diff -u -r1.10 layout_out.m
--- compiler/layout_out.m 17 Apr 2002 05:49:28 -0000 1.10
+++ compiler/layout_out.m 16 May 2002 12:24:29 -0000
@@ -176,7 +176,7 @@
DeclSet) }
).
- % This code should be kept in sync with output_layout_name/2 below.
+ % This code should be kept in sync with output_layout_name/3 below.
make_label_layout_name(Label) = Name :-
llds_out__get_label(Label, yes, LabelName),
string__append_list([
@@ -186,7 +186,7 @@
], Name).
output_layout_name(label_layout(Label, _)) -->
- % This code should be kept in sync with make_label_layout_name/2 above.
+ % This code should be kept in sync with make_label_layout_name/1 above.
io__write_string(mercury_data_prefix),
io__write_string("_label_layout__"),
{ llds_out__get_label(Label, yes, LabelName) },
@@ -634,7 +634,7 @@
MaybeTableIoDecl, _HeadVarNums, _VarNames, _MaxVarNum,
_MaxRegNum, _MaybeFromFullSlot, _MaybeIoSeqSlot,
_MaybeTrailSlot, _MaybeMaxfrSlot, _EvalMethod,
- _MaybeCallTableSlot, _MaybeDeclDebugSlot) },
+ _MaybeCallTableSlot) },
{ ModuleName = get_defining_module_name(ProcLabel) },
output_layout_decl(CallLabelLayout, DeclSet0, DeclSet1),
output_layout_decl(module_layout(ModuleName), DeclSet1, DeclSet2),
@@ -660,8 +660,7 @@
{ ExecTrace = proc_layout_exec_trace(CallLabelLayout, MaybeProcBody,
MaybeTableIoDecl, HeadVarNums, _VarNames, MaxVarNum,
MaxRegNum, MaybeFromFullSlot, MaybeIoSeqSlot, MaybeTrailSlot,
- MaybeMaxfrSlot, EvalMethod, MaybeCallTableSlot,
- MaybeDeclDebugSlot) },
+ MaybeMaxfrSlot, EvalMethod, MaybeCallTableSlot) },
io__write_string("\t{\n\t(const MR_Label_Layout *) &"),
output_layout_name(CallLabelLayout),
io__write_string(",\n\t(const MR_Module_Layout *) &"),
@@ -706,8 +705,6 @@
io__write_string(eval_method_to_c_string(EvalMethod)),
io__write_string(",\n\t"),
write_maybe_slot_num(MaybeCallTableSlot),
- io__write_string(",\n\t"),
- write_maybe_slot_num(MaybeDeclDebugSlot),
io__write_string("\n\t}\n").
:- pred write_maybe_slot_num(maybe(int)::in, io__state::di, io__state::uo)
Index: compiler/llds_common.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/llds_common.m,v
retrieving revision 1.42
diff -u -r1.42 llds_common.m
--- compiler/llds_common.m 12 Apr 2002 10:08:14 -0000 1.42
+++ compiler/llds_common.m 16 May 2002 12:24:31 -0000
@@ -206,15 +206,13 @@
ExecTrace0 = proc_layout_exec_trace(CallLabel, MaybeProcBody0,
MaybeTableIoDecl, HeadVarNums, VarNames, MaxVarNum, MaxReg,
MaybeFromFullSlot, MaybeIoSeqSlot, MaybeTrailSlot,
- MaybeMaxfrSlot, EvalMethod, MaybeCallTableSlot,
- MaybeDeclDebugSlot),
+ MaybeMaxfrSlot, EvalMethod, MaybeCallTableSlot),
llds_common__process_maybe_rval(MaybeProcBody0, MaybeProcBody,
Info0, Info),
ExecTrace = proc_layout_exec_trace(CallLabel, MaybeProcBody,
MaybeTableIoDecl, HeadVarNums, VarNames, MaxVarNum, MaxReg,
MaybeFromFullSlot, MaybeIoSeqSlot, MaybeTrailSlot,
- MaybeMaxfrSlot, EvalMethod, MaybeCallTableSlot,
- MaybeDeclDebugSlot).
+ MaybeMaxfrSlot, EvalMethod, MaybeCallTableSlot).
:- pred llds_common__process_procs(list(c_procedure)::in,
list(c_procedure)::out, common_info::in, common_info::out) is det.
Index: compiler/stack_layout.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/stack_layout.m,v
retrieving revision 1.67
diff -u -r1.67 stack_layout.m
--- compiler/stack_layout.m 12 Apr 2002 10:08:16 -0000 1.67
+++ compiler/stack_layout.m 16 May 2002 12:24:42 -0000
@@ -513,7 +513,7 @@
},
{ TraceSlotInfo = trace_slot_info(MaybeFromFullSlot,
MaybeIoSeqSlot, MaybeTrailSlots, MaybeMaxfrSlot,
- MaybeCallTableSlot, MaybeDeclSlots) },
+ MaybeCallTableSlot) },
% The label associated with an event must have variable info.
{ CallLabelLayout = label_layout(CallLabel, label_has_var_info) },
{
@@ -527,7 +527,7 @@
MaybeTableIoDeclName, HeadVarNumVector, VarNameVector,
MaxVarNum, MaxTraceReg, MaybeFromFullSlot, MaybeIoSeqSlot,
MaybeTrailSlots, MaybeMaxfrSlot, EvalMethod,
- MaybeCallTableSlot, MaybeDeclSlots) }.
+ MaybeCallTableSlot) }.
:- pred stack_layout__construct_var_name_vector(prog_varset::in,
map(int, string)::in, int::out, list(int)::out,
Index: compiler/trace.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/trace.m,v
retrieving revision 1.51
diff -u -r1.51 trace.m
--- compiler/trace.m 28 Mar 2002 03:43:41 -0000 1.51
+++ compiler/trace.m 16 May 2002 12:24:49 -0000
@@ -109,21 +109,13 @@
% at the time of the call. Otherwise,
% it will be no.
- slot_call_table :: maybe(int),
+ slot_call_table :: maybe(int)
% If the procedure's evaluation method
% is memo, loopcheck or minimal model,
% this will be yes(M), where stack slot
% M holds the variable that represents
% the tip of the call table. Otherwise,
% it will be no.
-
- slot_decl :: maybe(int)
- % If --trace-decl is set, this will
- % be yes(M), where stack slots M
- % and M+1 are reserved for the runtime
- % system to use in building proof
- % trees for the declarative debugger.
- % Otherwise, it will be no.
).
% Return the set of input variables whose values should be preserved
@@ -293,21 +285,14 @@
% in the maybe_from_full field in the proc layout;
% if there is no such slot, that field will contain -1.
%
- % stage 4: If --trace-decl is given, allocate the next two
- % available slots to hold the pointers to the proof tree
- % node of the parent and of this call respectively.
- % The number of the first of these two slots is recorded
- % in the maybe_decl_debug field in the proc layout;
- % if there are no such slots, that field will contain -1.
- %
- % stage 5: If --trace-table-io is given, allocate the next slot
+ % stage 4: If --trace-table-io is given, allocate the next slot
% to hold the saved value of the io sequence number,
% for use in implementing retry. The number of this slot
% is recorded in the maybe_io_seq field in the proc
% layout; if there is no such slot, that field will
% contain -1.
%
- % stage 6: If --use-trail is set (given or implied), allocate
+ % stage 5: If --use-trail is set (given or implied), allocate
% two slots to hold the saved value of the trail pointer
% and the ticket counter at the point of the call, for
% use in implementing retry. The number of the first of
@@ -315,7 +300,7 @@
% in the proc layout; if there are no such slots, that
% field will contain -1.
%
- % stage 7: If the procedure lives on the det stack but can put
+ % stage 6: If the procedure lives on the det stack but can put
% frames on the nondet stack, allocate a slot to hold
% the saved value of maxfr at the point of the call,
% for use in implementing retry. The number of this
@@ -323,7 +308,7 @@
% layout; if there is no such slot, that field will
% contain -1.
%
- % stage 8: If the procedure's evaluation method is memo, loopcheck
+ % stage 7: If the procedure's evaluation method is memo, loopcheck
% or minimal model, we allocate a slot to hold the
% variable that represents the tip of the call table.
% The debugger needs this, because when it executes a
@@ -383,11 +368,6 @@
;
FromFull = 0
),
- ( trace_level_needs_decl_debug_slots(TraceLevel) = yes ->
- DeclDebug = 2
- ;
- DeclDebug = 0
- ),
( TraceTableIo = yes ->
IoSeq = 1
;
@@ -408,7 +388,7 @@
Maxfr = 0
),
ReservedSlots0 = Fixed + RedoLayout + FromFull + IoSeq
- + Trail + Maxfr + DeclDebug,
+ + Trail + Maxfr,
proc_info_get_call_table_tip(ProcInfo, MaybeCallTableVar),
( MaybeCallTableVar = yes(CallTableVar) ->
ReservedSlots = ReservedSlots0 + 1,
@@ -450,28 +430,18 @@
MaybeFromFullSlotLval = yes(CallFromFullSlot),
NextSlotAfterFromFull is NextSlotAfterRedoLayout + 1
},
- { trace_level_needs_decl_debug_slots(TraceLevel) = DeclDebugSlots },
- {
- DeclDebugSlots = yes,
- MaybeDeclSlots = yes(NextSlotAfterFromFull),
- NextSlotAfterDecl = NextSlotAfterFromFull + 2
- ;
- DeclDebugSlots = no,
- MaybeDeclSlots = no,
- NextSlotAfterDecl = NextSlotAfterFromFull
- },
{
TraceTableIo = yes,
- MaybeIoSeqSlot = yes(NextSlotAfterDecl),
+ MaybeIoSeqSlot = yes(NextSlotAfterFromFull),
IoSeqLval = llds__stack_slot_num_to_lval(CodeModel,
- NextSlotAfterDecl),
+ NextSlotAfterFromFull),
MaybeIoSeqLval = yes(IoSeqLval),
- NextSlotAfterIoSeq = NextSlotAfterDecl + 1
+ NextSlotAfterIoSeq = NextSlotAfterFromFull + 1
;
TraceTableIo = no,
MaybeIoSeqSlot = no,
MaybeIoSeqLval = no,
- NextSlotAfterIoSeq = NextSlotAfterDecl
+ NextSlotAfterIoSeq = NextSlotAfterFromFull
},
{ globals__lookup_bool_option(Globals, use_trail, yes) ->
MaybeTrailSlot = yes(NextSlotAfterIoSeq),
@@ -510,8 +480,7 @@
MaybeCallTableLval = no
},
{ TraceSlotInfo = trace_slot_info(MaybeFromFullSlot, MaybeIoSeqSlot,
- MaybeTrailSlot, MaybeMaxfrSlot, MaybeCallTableSlot,
- MaybeDeclSlots) },
+ MaybeTrailSlot, MaybeMaxfrSlot, MaybeCallTableSlot) },
{ TraceInfo = trace_info(TraceLevel, TraceSuppress,
MaybeFromFullSlotLval, MaybeIoSeqLval, MaybeTrailLvals,
MaybeMaxfrLval, MaybeCallTableLval, MaybeRedoLayoutLabel) }.
Index: compiler/trace_params.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/trace_params.m,v
retrieving revision 1.7
diff -u -r1.7 trace_params.m
--- compiler/trace_params.m 28 Mar 2002 03:43:42 -0000 1.7
+++ compiler/trace_params.m 16 May 2002 12:24:51 -0000
@@ -34,7 +34,6 @@
:- func trace_level_needs_input_vars(trace_level) = bool.
:- func trace_level_needs_fixed_slots(trace_level) = bool.
:- func trace_level_needs_from_full_slot(trace_level) = bool.
-:- func trace_level_needs_decl_debug_slots(trace_level) = bool.
:- func trace_level_allows_delay_death(trace_level) = bool.
:- func trace_needs_return_info(trace_level, trace_suppress_items) = bool.
:- func trace_needs_all_var_names(trace_level, trace_suppress_items) = bool.
@@ -99,12 +98,6 @@
trace_level_needs_from_full_slot(deep) = no.
trace_level_needs_from_full_slot(decl) = no.
trace_level_needs_from_full_slot(decl_rep) = no.
-
-trace_level_needs_decl_debug_slots(none) = no.
-trace_level_needs_decl_debug_slots(shallow) = no.
-trace_level_needs_decl_debug_slots(deep) = no.
-trace_level_needs_decl_debug_slots(decl) = yes.
-trace_level_needs_decl_debug_slots(decl_rep) = yes.
trace_level_allows_delay_death(none) = no.
trace_level_allows_delay_death(shallow) = no.
Index: runtime/mercury_conf_param.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_conf_param.h,v
retrieving revision 1.58
diff -u -r1.58 mercury_conf_param.h
--- runtime/mercury_conf_param.h 15 May 2002 09:00:48 -0000 1.58
+++ runtime/mercury_conf_param.h 16 May 2002 12:24:58 -0000
@@ -511,10 +511,6 @@
/*
** MR_USE_DECLARATIVE_DEBUGGER -- include support for declarative
** debugging in the internal debugger.
-**
-** MR_USE_DECL_STACK_SLOT -- reserve a stack slot for use by the
-** declarative debugger. Requires programs
-** to be compiled with the flag `--trace-decl'.
*/
#if defined(MR_CONSERVATIVE_GC) && !defined(MR_DISABLE_DECLARATIVE_DEBUGGER)
Index: runtime/mercury_stack_layout.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_stack_layout.h,v
retrieving revision 1.59
diff -u -r1.59 mercury_stack_layout.h
--- runtime/mercury_stack_layout.h 12 Apr 2002 10:08:24 -0000 1.59
+++ runtime/mercury_stack_layout.h 16 May 2002 12:25:04 -0000
@@ -592,12 +592,6 @@
** We cannot put enums into structures as bit fields. To avoid wasting space,
** we put MR_EvalMethodInts into structures instead of MR_EvalMethods
** themselves.
-**
-** If --trace-decl is not set, the maybe_decl field will contain a negative
-** number. If it is set, it will contain the number of the first of two stack
-** slots used by the declarative debugger; the other slot is the next higher
-** numbered one. (The determinism of the procedure decides whether the stack
-** slot refers to a stackvar or a framevar.)
*/
typedef enum {
@@ -627,7 +621,6 @@
MR_int_least8_t MR_exec_maybe_maxfr;
MR_EvalMethodInt MR_exec_eval_method_CAST_ME;
MR_int_least8_t MR_exec_maybe_call_table;
- MR_int_least8_t MR_exec_maybe_decl_debug;
} MR_Exec_Trace;
/*-------------------------------------------------------------------------*/
Index: trace/mercury_trace_declarative.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_declarative.c,v
retrieving revision 1.53
diff -u -r1.53 mercury_trace_declarative.c
--- trace/mercury_trace_declarative.c 16 May 2002 00:02:10 -0000 1.53
+++ trace/mercury_trace_declarative.c 16 May 2002 12:25:28 -0000
@@ -190,10 +190,6 @@
MR_Trace_Node prev);
static MR_Trace_Node MR_trace_decl_neg_failure(MR_Event_Info *event_info,
MR_Trace_Node prev);
-static MR_Trace_Node MR_trace_decl_get_slot(const MR_Proc_Layout *entry,
- MR_Word *saved_regs);
-static void MR_trace_decl_set_slot(const MR_Proc_Layout *entry,
- MR_Word *saved_regs, MR_Trace_Node node);
static MR_Trace_Node MR_trace_matching_call(MR_Trace_Node node);
static MR_bool MR_trace_first_disjunct(MR_Event_Info *event_info);
static MR_bool MR_trace_matching_cond(const char *path,
--------------------------------------------------------------------------
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