[m-rev.] for review: improperly initialised rtti structures in java

Peter Wang novalazy at gmail.com
Fri Jun 26 11:08:21 AEST 2009


2009/6/26 Julien Fischer <juliensf at csse.unimelb.edu.au>:
>
> On Thu, 25 Jun 2009, Peter Wang wrote:
>>
>> 1. Don't allocate a new TypeInfo_Struct object to emulate the "cast"
>> unless the
>> value is actually a TypeCtorInfo_Struct, avoiding the problem of copying
>> uninitialised fields.  Currently this is implemented by a runtime check
>> because
>> the MLDS `cast' operation doesn't record the original type of the value
>> being
>> cast.
>
> (You presumably saw the the XXX regrading that MLDS cast op?)

Yes.

>> +            % XXX we really should be able to tell if we are casting a
>> +            % TypeCtorInfo or a TypeInfo
>
> That's probably going to be rather difficult as the compiler doesn't
> keep track of where type_ctor_infos are acting as type_infos properly,
> i.e. the common case optimization described at the beginning of
> compiler/polymorphism.m.  (This is already involved in several open
> bugs).  This is one the the next major rewrite of polymorphism.m is
> going to have do properly.

Thanks, that probably saved me some time.

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