From owner-freebsd-alpha Tue Sep 10 7:36: 2 2002 Delivered-To: freebsd-alpha@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BBBF537B400 for ; Tue, 10 Sep 2002 07:35:57 -0700 (PDT) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id C584F43E42 for ; Tue, 10 Sep 2002 07:35:56 -0700 (PDT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.9.3/8.9.3) with ESMTP id KAA28087; Tue, 10 Sep 2002 10:35:54 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.11.6/8.9.1) id g8AEZOT68840; Tue, 10 Sep 2002 10:35:24 -0400 (EDT) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15742.812.130498.758611@grasshopper.cs.duke.edu> Date: Tue, 10 Sep 2002 10:35:24 -0400 (EDT) To: ticso@cicely.de Cc: Joe Marcus Clarke , alpha@FreeBSD.ORG Subject: Re: getting closer (was Re: mozilla failure on 4.6.2) In-Reply-To: <20020910140414.GC5057@cicely5.cicely.de> References: <1031329151.342.9.camel@gyros.marcuscom.com> <20020906194732.GA2244@dragon.nuxi.com> <15737.2550.488154.4401@grasshopper.cs.duke.edu> <20020907000825.GA4091@dragon.nuxi.com> <15739.43883.152090.936327@grasshopper.cs.duke.edu> <15741.2822.526047.253409@grasshopper.cs.duke.edu> <1031605410.351.90.camel@gyros.marcuscom.com> <15741.17468.701009.998323@grasshopper.cs.duke.edu> <1031635953.342.133.camel@gyros.marcuscom.com> <15741.61382.872535.426732@grasshopper.cs.duke.edu> <20020910140414.GC5057@cicely5.cicely.de> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Bernd Walter writes: > On Tue, Sep 10, 2002 at 09:12:38AM -0400, Andrew Gallatin wrote: > > > > Joe Marcus Clarke writes: > > > Add 8 to the stack pointer ("this", right), and store it in $16. > > > > I wish it were that simple :-( > > > > The problem seems to be that the application code is passing the > > "wrong" value in and somehow the c++ calling standard corrects it, and > > we must correct it too: > > > > impl == 0x12001c080 > > foo == 0x12001c080 > > bar == 0x12001c088 > > I have no idea how the class declaration for you example looks like. http://lxr.mozilla.org/seamonkey/source/xpcom/reflect/xptcall/tests/TestXPTCInvoke.cpp > Possible because I don't know the mozilla code you are talking about. > What is the difference in direct and invoke calling? "direct" is a normal c++ call: bar->BarMethod1(1); "invoke" means the mozilla xptinvoke shims: var[0].val.i32 = 1; var[0].type = nsXPTType::T_I32; var[0].flags = 0; XPTC_InvokeByIndex(bar, 3, 1, var); They are described at: http://www.mozilla.org/scriptable/xptcall-faq.html > Lets asume foo is a virtual function of class x which is based on > class y defining the virtual function bar. > >From what I know about C++ (which might be outdated) we have the > following situation when using an object of class x. > Call of function bar means the caller knows the offset to the function > pointer, because it's using a pointer of type x. > The function bar expects a this pointer of type y so it gets the > this pointer of the embedded y object which may be numericaly different. > > Now asume class x reimplement the virtual function bar. > The newly bar function has to share the calling conventions that were > declared by class y. > If we call function bar using a type y pointer we submit a this pointer > of type y. > But the function is designed to have a this pointer of type x. > Now the function must recalculate the supplied y pointer into an x > pointer. > If we call funtcion bar using a type x pointer we still have to convert > the x pointer into an y pointer because the function still expects an y > pointer. I assume this is all done "behind the scenes" by the compiler? Is there a convention for where the conversions are passed? Since you know quite a bit about c++, and because you know alpha asm, I'd _really_ like your help ;) Do you have an alpha running -stable? Or are you all -current these days? Thanks, Drew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message