Files
mercury/tests/debugger/retry.inp
Zoltan Somogyi b816836f02 Optimize away stack slots storing dummy values; values of the io__state and
Estimated hours taken: 8
Branches: main

Optimize away stack slots storing dummy values; values of the io__state and
store__store types.

compiler/stack_alloc.m:
	Allocate distinct negative stack slot numbers to values of dummy types.
	We need

compiler/hlds_pred.m:
	Add a predicate for testing whether a value is of a dummy type.

compiler/code_into.m:
	When constructing the list of live locations after a call, do not
	include the negative stack slots containing dummy values. The list
	of live locations is used by the (future) native collector, which
	should ignore dummy types, and by the debugger. The debugger can't
	do anything with these dummy values on the stack except tell the
	user about their existence, which doesn't do the debugger user any
	good.

	We still keep liveness information about dummy values in registers
	at calls and returns, since both the procedural and declarative
	debuggers need to know procedures' full argument lists.

	With respect to the list of live locations before the call, which
	was used only by the (now extinct) value numbering optimization,
	filter out all dummy types, since their values need not be preserved.

compiler/trace.m:
	Do not ask the code generator to preserve values of dummy types,
	since doing so would require referring to negative stack slots.

compiler/unify_gen.m:
compiler/var_locn.m:
	Fix a couple of situations in which we could refer to the negative
	stack slots we now allocate to dummy values.

compiler/call_gen.m:
	Reorder some code to make the source match what happens at runtime.

compiler/llds_out.m:
	Fix the formatting of the sanity check for negative stack slots.

compiler/handle_options.m:
	Since the --debug-opt-pred-id option is useless without --debug-opt,
	make --debug-opt-pred-id option imply --debug-opt. This was useful
	in debugging this diff.

trace/mercury_trace.c:
	Adapt the test for whether a retry is across I/O. We used to base the
	test on whether the retried predicate has any I/O state arguments,
	and if so, whether the original I/O state variable is still around
	on the stack. After this change, the answer to the second half of
	that question would always be "no", so we now use only the first half:
	whether the retried predicate has any I/O state arguments. This
	requires us to consider more retries to be retries across I/O, but
	from the point of view of a user who may not remember whether the I/O
	predicate has done any I/O so far or not, is arguably more consistent
	than our previous policy.

	Allow retries even if a value of type store.store is missing, since
	store.store is a dummy type just as io.state is.

trace/mercury_trace.c:
compiler/type_util.m:
	Document the fact that you need to update both these files if you
	want to modify the set of dummy types.

tests/debugger/retry.{inp,exp,exp2}:
	Due to the change in mercury_trace.c, one retry in this test case
	changes to being retry over I/O. Update the test input to force this
	retry over I/O, and expect the expanded input to be echoed in the
	output.

tests/debugger/nondet_stack.{exp,exp2}:
	Update these expected outputs to account for the fact that we now need
	fewer stack slots to hold old I/O states when debugging is enabled.
2004-09-02 04:31:42 +00:00

64 lines
635 B
Plaintext

echo on
register --quiet
scroll off
context none
goal_paths off
break det_without_cut_1
continue -a
disable 0
retry
stack
finish
retry 1
stack
break det_without_cut_2
continue -a
delete *
retry 2
finish
stack
break det_with_cut_1
continue -a
delete *
finish
retry 1
finish
stack
retry -f 1
break det_with_cut_2
continue -a
delete *
break nondet
continue
print *
break nondet_2
continue
retry 1
print *
delete *
break fib
continue
print *
continue
print *
continue
continue
step
retry 2
print *
next
retry 1
finish -n
delete *
break t
continue
table t 1 2
finish
table t 1 2
retry
table t 1 2
finish
table t 1 2
delete *
continue -n -S