[m-rev.] For review: Bug fix for Java grade RTTI definitions

James Goddard goddardjames at yahoo.com
Thu Feb 26 17:30:32 AEDT 2004


 --- Peter Ross <pro at missioncriticalit.com> wrote: > On Tue, Feb 24, 2004 at
06:16:02PM +1100, James Goddard wrote:
> > Estimated hours taken: 4
> > Branches: main
> > 
> > Bug fix for Java grade RTTI definitions.
> > 
> > compiler/rtti_to_mlds.m:
> > 	Re-ordered the output of definitions so that subdefinitions always
> > 	appear before the definition which uses them.
> > 	This is neccessary because in Java, static intializers are performed at
> > 	runtime in textual order, and if a definition relies on another static
> > 	variable for its constructor but said variable has not been
> > 	initialized, then it is treated as `null' by the JVM with no warning.
> > 	This change should not effect the other back-ends.
> > 
> > 
> If possible it would be better to append the entries to the beginning of
> the list and then reverse them before returning the MLDS_Defns list, so
> that the algorithm stays O(N).

I've just tried this, and I'm afraid the ordering is incorrect after reversing
the list.  Correcting this to an O(N) algorithm will take more time than I have
left (this is my last day) so I'm afraid I'll have to leave it as is at the
moment, although I will add an XXX comment about this.  In any case, there are
more serious problems with the current approach, so I'm documenting this as
well.  Hopefully at some point someone will implement Fergus's suggestion and
all these problems will go away =)

Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com
--------------------------------------------------------------------------
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