Dynamic dispatch of class typebound procedures ~ methods

Paul Richard Thomas paul.richard.thomas@gmail.com
Fri Sep 25 07:43:00 GMT 2009


Daniel,

> My original intention was that dyamic dispatch would replace the
> resolve_compcall_static method and the check for CLASS would be inside
> resolve_compcall, but you probably know better what you do, so this is of
> course ok (and I guess the better way).

Hmmmm.... I would not be so sure of that:-)  It was the route that I
saw.  If you think that there is a better one, I am all ears.
>
> Just one minor comment:  It seems you do not check for NON_OVERRIDABLE
> methods -- those can be dispatched statically even for CLASS of course, and
> I think this is one of the reasons to have NON_OVERRIDABLE in the first
> place; so it may be worth checking if a TBP is (in the nearest ancestor of
> the declared type) marked as NON_OVERRIDABLE and then do a static dispatch
> of it without vtable lookup.
>
> But this is just a thought and not important for now :)  Or I guess this is
> something we could also do in stage 3 as sort-of bugfix.

I am going out of range in a few minutes for a weekend in Wales.
fortran-dev is bootstrapping on my laptop and every minute that I get
over the weekend, I will work on the patch.  Thus, this wrinkle, user
operators, subroutines and testcases will get worked on.

By the way, Janus, why don''t you write a comparable bit of code to
obtain the derived type sizes dynamically?  We can mark all of these
up with TODO - VTABLE!

I am also going to try using a hash on 'derived_name#module_name' as a
vindex.  The '#'is needed for disambiguation.  This should get rid of
ambiguities caused by multiple inheritance paths.

Cheers

Paul



More information about the Fortran mailing list