[m-rev.] for review: various mlds_to_il fixes

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Jul 13 20:41:43 AEST 2001


On 13-Jul-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> compiler/mlds_to_il.m:
>     When generating the initializer for arrays use the type information
>     to generate arrays of the correct type.  We still treat structs like
>     they are an array of System.Object.

That is already done by the change that I posted earlier this week
and just committed:
<http://www.cs.mu.oz.au/research/mercury/mailing-lists/mercury-reviews/mercury-reviews.0107/0106.html>.

>     Set fields with local access to .NET private.

I don't see why that is needed.
It's an invariant of the MLDS that fields shouldn't have "local" access.
Only entities declared in "block" statements should have "local" access.

For fields of environment structs, which were originally local vars,
ml_elim_nested changes their access from "local" to "public"
(see convert_local_to_field).  Perhaps that should be changed to
"default".

>     Check to see if a field is a field of the current class before
>     assuming that it is handwritten.

That's OK, but you will get merge conflicts with my changes;
could you please post a diff after resolving those?

>  		% To initialize an array, we generate the following
>  		% code:
>  		% 	ldc <length of array>
> -		% 	newarr System::Object
> +		% 	newarr <array element type>
>  		%	
>  		% Then, for each element in the array:
>  		%	dup
>  		%	ldc <index of this element in the array>
>  		%	... allocation instructions ...
>  		%	... initialization instructions ...
> -		%	box the value (if necessary)
> -		%	stelem System::Object
> +		%	stelem <array element type>

That hunk of the diff is good -- it's something I forgot to do
when I was making this change.  I'll go ahead and commit that bit.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list