From: Nic Ferrier <nferrier@tapsellferrier.co.uk>
To: Eric Blake <ebb9@email.byu.edu>
Cc: Bryce McKinlay <bryce@waitaki.otago.ac.nz>, java@gcc.gnu.org
Subject: Re: gcj producing bad code
Date: Sat, 06 Apr 2002 15:47:00 -0000 [thread overview]
Message-ID: <87vgb4bdtk.fsf@pooh-sticks-bridge.tapsellferrier.co.uk> (raw)
In-Reply-To: <3CAF1A5E.9E1841B3@email.byu.edu>
Eric Blake <ebb9@email.byu.edu> writes:
> Nic Ferrier wrote:
> >
> > GCJ is not compiling method calls quite right... it seems that all
> > super invocations are done through invokespecial. invokespecial
> > cannot be used when the target needs to be called through virtual
> > dispatch however.
>
> I'm not quite sure you said that right. Any call to super.method() is
> required to compile to invokespecial (unless method is static, in which
> case invokestatic is appropriate). By the way, in the case of
> EnclosingClass.super.method(), it may require the assistance of an
> accessor method to use invokespecial while still obeying access rules.
> Consider this example, from the point of view of class C:
The case I'm referring to is a metjod invocation on a property of the
super class, thus:
class A
X x;
public X getX() { return x; }
class B extends A
public Y getY() { return super.getX().getY(); }
The method B::getY() must compile to call getY() through a virtual
dispatch even though X is in super.
That's how Sun's compiler compiples such code anyway.
Nic
next prev parent reply other threads:[~2002-04-06 23:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-05 15:29 Nic Ferrier
2002-04-05 18:51 ` Bryce McKinlay
2002-04-06 7:55 ` Nic Ferrier
2002-04-06 8:22 ` Eric Blake
2002-04-06 15:47 ` Nic Ferrier [this message]
2002-04-06 17:39 ` Per Bothner
2002-04-06 19:34 ` Bryce McKinlay
2002-04-07 14:31 ` Java patch: " Bryce McKinlay
2002-04-08 2:04 ` Alexandre Petit-Bianco
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87vgb4bdtk.fsf@pooh-sticks-bridge.tapsellferrier.co.uk \
--to=nferrier@tapsellferrier.co.uk \
--cc=bryce@waitaki.otago.ac.nz \
--cc=ebb9@email.byu.edu \
--cc=java@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).