[m-dev.] poor code generation for field accesses

Peter Ross pro at missioncriticalit.com
Wed Jun 5 01:09:42 AEST 2002


fjh wrote:
> Currently we seem to generate poor code for field accesses,
> in at least some situations.
> Here's an example, from the Mercury ICFP2000 submission.
> For the following source (line 256 of renderer.m),
>
> snd(Intersection)^object_id \= IgnoreId
>
> which is equivalent to
>
> \+ (
> snd(Intersection)^object_id = IgnoreId
> ),
>
> we generate code
>
> \+ (
> V_24 <= intersection(IgnoreId, _, _, _, _), % construction
> V_40 <= snd(Intersection),     % function call
> V_24 = V_40                                 % unification
> )
>
> This is bad, because the initial unification with V_24 is a
> construction, which allocates memory.
>
How can we construct V_24 without providing values for all the other
fields in intersection?  It doesn't look mode correct to me.

--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list