[m-rev.] For review: Implemention of the region runtime system

Quan Phan quan.phan at cs.kuleuven.be
Mon Oct 8 19:14:27 AEST 2007


On Mon, Oct 08, 2007 at 05:50:21PM +1000, Julien Fischer wrote:
> 
> On Sat, 6 Oct 2007, Quan Phan wrote:
> 
> >Estimated hours taken: 50h.
> >Branch: main.
> >
> >Implement the runtime system for region-based memory management. This 
> >includes
> >the implementation of regions, region instructions and the advanced support
> >for backtracking.
> >
> >This advanced support deals with the resurrection of regions
> >and provides the ability of instant reclaiming when backtracking happens.
> >The support is provided for if-then-elses, disjunctions, and commit 
> >operations.
> >The technical details of the advanced support is documented in a seperate
> >document.
> 
> s/seperate/separate/

Done.

> 
> The document should be added to compiler/notes?

I would agree with it. Are there any objections?

>  (It's the one that
> is currently in the papers directory called advanced support, right?)

Yes, it is.
> 
> >Make use of the rbmm_goal_info when generating the backtracking-support 
> >code
> >for if-then-elses, disjunctions and commit operations.
> 
> >library/region_builtin.m:
> 
> There is already an entry for region_builtin.m below.
> 
> >runtime/mercury_region.h
> >runtime/mercury_region.c
> >runtime/Mmakefile
> 
> Likewise for these ones.
> 

Removed.

> >compiler/code_info.m:
> >	Change the option to control the addition of region operations from
> >	use_region to region_analysis so that no region operations are
> >	introduced when compiling a compiler in .rbmm grade. This is 
> >	temporary,
> >	just as the re-adding of --region-analysis option.
> >
> >	Make use of rbmm_goal_info when generating backtrack-supporting code
> >	for commit operations.
> >
> >compiler/commit_gen.m:
> >	Make use of rbmm_goal_info when generating backtrack-supporting code.
> >
> >compiler/disj_gen.m:
> >	Make use of rbmm_goal_info when generating semidet disjunction.
> >	Correct one error so that use_region_disj_later is not generated in
> >	the code for the first disjunct.
> >	Add XXX comment for the wrong protection of regions.
> >
> >compiler/ite_gen.m:
> >	Make use of rbmm_goal_info.
> 
> to do what?
> 
I extended the phrase.
> >
> >compiler/options.m:
> >	Modify the size of disj_protect(ion) to 1 instead of 2.
> >
> >library/region_builtin.m:
> >	Change the region builtins to call to the correct region operations
> >	in the region runtime system.
> >
> >	Add a predicate to print out profiling information for region-based
> >	memory management. It is a workaround and is probably not the way to
> >	go.
> 
> In what sense is it a workaround?
> 
Maybe it should go in to benchmarking.m, and be used in the same way as 
the report_stats predicate.

Currently, to use it I have to import region_builtin module explicitly,
make an impure call to it, therefore main predicate also needs to be
changed to impure.

> >runtime/Mmakefile:
> >	Link the region runtime system into the runtime system of Mercury.
> >
> >runtime/mercury_region.h
> >runtime/mercury_region.c
> >	Implementation of the region runtime system.
> >
> >	I also implement the profiler and debugging messages here. They can 
> >	be
> >	turned on and off by MR_RBMM_PROFILING and MR_RBMM_DEBUG flags. I
> >	am not sure that this is a correct way or not so currently the 2 
> >	flags
> >	have to be changed manually and require re-compilation of the 
> >	compiler.
> 
> What do you mean by changed manually?  The usually way to enable or
> disable such flags is to put something like the following in
> Mmake.params
> 
> 	EXTRA_CFLAGS = -DMR_RBMM_PROFILING -DMR_RBMM_DEBUG
> 
I was not aware of this EXTRA_CFLAGS, thanks. So I will document the two
flags as you said.

> >The diff is below.
> 
> To be continued ...
> 
Thanks Julien.

Regards,
Quan.

> Julien.
> --------------------------------------------------------------------------
> mercury-reviews mailing list
> Post messages to:       mercury-reviews at csse.unimelb.edu.au
> Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
> Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
> --------------------------------------------------------------------------
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list