Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 11835 invoked from network); 25 Jul 2006 09:03:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 Jul 2006 09:03:23 -0000 Received: (qmail 16804 invoked by uid 500); 25 Jul 2006 09:03:16 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 16754 invoked by uid 500); 25 Jul 2006 09:03:16 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 16743 invoked by uid 99); 25 Jul 2006 09:03:16 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Jul 2006 02:03:16 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of pmcfirst@gmail.com designates 64.233.182.187 as permitted sender) Received: from [64.233.182.187] (HELO nf-out-0910.google.com) (64.233.182.187) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Jul 2006 02:03:15 -0700 Received: by nf-out-0910.google.com with SMTP id x4so159085nfb for ; Tue, 25 Jul 2006 02:02:54 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=oB/xst7ED50grGwhItdAE+NfnFkx2KcUzpQEZUE9iSAsne14lQTTtvErNBICohaDLh2ZgtPuDT6jofG/uIRkLRthruKNpfll6S6MKuLBoLo4gHydXa6F7TAFV+WDNkGpZMcs1dKxAOQTL/rj6nhBTFY7+WDmO/Ug8uLCN3mUrpU= Received: by 10.78.158.11 with SMTP id g11mr2177253hue; Tue, 25 Jul 2006 02:02:53 -0700 (PDT) Received: by 10.78.118.10 with HTTP; Tue, 25 Jul 2006 02:02:53 -0700 (PDT) Message-ID: Date: Tue, 25 Jul 2006 13:02:53 +0400 From: "Pavel Pervov" To: harmony-dev@incubator.apache.org Subject: Re: [drlvm] Cleaning insides of Class.h header In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_64420_819333.1153818173884" References: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_64420_819333.1153818173884 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Michail, you can get root class set to A and iterate "all incarnations" from there. Regards, Pavel. On 7/24/06, Mikhail Fursov wrote: > > On 7/24/06, Pavel Pervov 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 > > ------=_Part_64420_819333.1153818173884--