[m-rev.] for review: thread safe mutables (part 2)

Peter Wang wangp at students.cs.mu.oz.au
Wed Aug 30 10:56:01 AEST 2006


On 2006-08-29, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
> Fix intermodule inlining so that the clauses for the mutable access 
> predicates
> are written to .opt files even though they contain calls to impure 
> predicates.
> This is usually not allowed because of problems caused be reordering what 
> were

by reordering

> @@ -1802,6 +1815,7 @@
>  should_output_marker(marker_calls_are_fully_qualified, no).
>  should_output_marker(marker_mode_check_clauses, yes).
>  should_output_marker(marker_may_have_parallel_conj, no).
> +should_output_marker(marker_mutable_access_pred, no).   % XXX should be 
> yes.

What happens if you output it?

> @@ -341,13 +341,37 @@
>      module_add_mode_defn(VarSet, Name, Params, ModeDefn,
>          Cond, Context, !.Status, !ModuleInfo, InvalidMode, !IO).
>  add_item_decl_pass_1(Item, Context, !Status, !ModuleInfo, no, !IO) :-
> -    Item = item_pred_or_func(TypeVarSet, InstVarSet, ExistQVars, 
> PredOrFunc,
> -        PredName, TypesAndModes, _WithType, _WithInst, MaybeDet, _Cond,
> -        Purity, ClassContext),
> -    init_markers(Markers),
> -    module_add_pred_or_func(TypeVarSet, InstVarSet, ExistQVars, PredOrFunc,
> -        PredName, TypesAndModes, MaybeDet, Purity, ClassContext, Markers,
> -        Context, !.Status, _, !ModuleInfo, !IO).
> +    Item = item_pred_or_func(Origin, TypeVarSet, InstVarSet, ExistQVars,
> +        PredOrFunc, PredName, TypesAndModes, _WithType, _WithInst, 
> MaybeDet,
> +        _Cond, Purity, ClassContext),
> +    init_markers(Markers0),
> +    %
> +    % If this predicate was added as a result of the mutable transformation
> +    % then mark this predicate ad a mutable access pred.  We do this

as a

> @@ -694,6 +735,22 @@
>                  ReportErrors = yes,
>                  get_global_name_from_foreign_names(ReportErrors, Context,
>                      ModuleName, Name, ForeignNames, _TargetMutableName, 
>                      !IO)
> +            ),
> +            %
> +            % If we are creating the I/O version of the set predicate then 
> we
> +            % need to add a promise_pure pragma for it.  This needs to be 
> done
> +            % here (in stage 2) rather than in stage 3 where the rest of 
> the
> +            % mutable transformation is.
> +            %

Add a reason?

>  %
>  % For constant mutables the transformation is:
>  %
> @@ -160,6 +173,13 @@
> 
>  %-----------------------------------------------------------------------------%
> 
> +    % Create premode declarations for the four primitive operations.

predmode

Peter

--------------------------------------------------------------------------
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