[m-rev.] For review: Implemention of the region runtime system
Julien Fischer
juliensf at csse.unimelb.edu.au
Mon Oct 8 17:50:21 AEST 2007
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/
The document should be added to compiler/notes? (It's the one that
is currently in the papers directory called advanced support, right?)
> 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.
> 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?
>
> 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?
> 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
> The diff is below.
To be continued ...
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
--------------------------------------------------------------------------
More information about the reviews
mailing list