Files
mercury/tests/trailing/tr_reset_bug.exp
Julien Fischer 9c98a60bd5 Add a mechanism for dynamically growing the trail by adding new segments to it
Estimated hours taken: 20
Branches: main

Add a mechanism for dynamically growing the trail by adding new segments to it
in a similar fashion to what we do for the stacks with stack segments.  The
mechanism is enabled by the trseg (trail segments) grade component.  Unlike
stack segments the trail segment mechanism also works with the high-level C
backend.

The mechanism works by adding a test to MR_trail_{value,function} that checks
if we are about to run out of a trail and allocates a new trail segment if
that test succeeds.

Extend mdb's trail_details command to print the current number of trail
segments in trseg grades.

Fix a bug where the MR_trail_ptr was not being reset correctly after
a trail reset.

runtime/mercury_grade.h:
	Add the new grade component.

runtime/mercury_conf_param.h:
	Document the new grade component, and the option used to debug
	trail segments.

runtime/mercury_memory_zones.h:
	Shift the definition MR_MemoryZones to this file in order break
	a cyclic dependency between header files.

runtime/mercury_context.h:
	Add a new field to the context structure to hold a list previous
	trail segments.

	Delete the definition of the type MR_MemoryZones from here.

runtime/mercury_trail.[ch]:
	When adding a new trail entry in trseg grades first check whether we
	need to extend the trail and do so if necessary.

	Export the definitions of MR_TRAIL_{BASE,ZONE}.

	Add a macro, MR_PREV_TRAIL_ZONES, for accessing the list of trail zones
	in a grade independent manner.

	Fix a typo in a comment.

	Add functions for creating and destroying trail segments.

	Handle trail segments in the code that handles untrailing and
	resets.  This also fixes a bug with trail reset where MR_trail_ptr
	was not being reset along with the rest of the trail state.

compiler/options.m:
compiler/handle_options.m:
compiler/compile_target_code.m:
scripts/canonical_grade.sh-subr:
scripts/init_grade_option.sh-subr:
scripts/mgnuc.in:
scripts/parse_grade_options.sh-subr:
	Handle the new grade component.

trace/mercury_trace_cmd_developer.c:
	Make the trail_details command print out the number of trail segments
	in trseg grades.

tests/trailing/Mmakefile:
tests/trailing/tr_reset_bug.{m,exp}:
	Regression test for the bug with trail resets.
2008-09-05 11:19:34 +00:00

2 lines
7 B
Plaintext