harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel Pervov" <pmcfi...@gmail.com>
Subject Re: [drlvm] Cleaning insides of Class.h header
Date Tue, 25 Jul 2006 09:02:53 GMT
Michail,

you can get root class set to A and iterate "all incarnations" from there.

Regards,
    Pavel.

On 7/24/06, Mikhail Fursov <mike.fursov@gmail.com> wrote:
>
> On 7/24/06, Pavel Pervov <pmcfirst@gmail.com> wrote:
> >
> > Michail,
> >
> > If some component external to VM core has direct access to class.h, this
> > should be eliminated shortly. AFAIU, there are none such components.
>
>
> Yes there are no such components, JIT uses 'vm.h' file to access class or
> methods information.
> But 'vm.h' functions use class.h functionality in their implementation.
>
> Answering your questions:
> > 1) It is possible to traverse class hierarchy downward using available
> > specialized interfaces. It is also possible to traverse class hierarchy
> > upward by asking direct super class of any class you have. The only
> > impossible thing to do is to traverse one level of class hierarchy in
> both
> > directions. Do you really want to do the thing?
>
> 2) AFAIU, it is also available in the interface.
>
>
> Do you mean this method?
>
> // Initializes the CHA_Method_Iterator, to iterate over all methods that
> // match the method signature and descend from root_class (including
> root_class itself).
> // Returns TRUE if iteration is supported over root_class, FALSE if not.
> VMEXPORT Boolean method_iterator_initialize(ChaMethodIterator*,
> Method_Handle method, Class_Handle root_class);
>
>
> I'm afraid this will not work, let's check the example:
>
> class A {
> void foo(){}
> }
> class B extends A {
> void foo(){}
> }
> class C extends B {
> void foo(){}
> }
>
> In runtime I can have a handle of B::foo() and want to get all method
> incarnations: A::foo(), B::foo(), C::foo().
> What is the best way to get them all?
>
> --
> Mikhail Fursov
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message