public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Sturm <jsturm@sigma6.com>
To: Maury Markowitz <maury@oaai.com>
Cc: java-discuss@sourceware.cygnus.com
Subject: Re: Obj-C wrap-up
Date: Sat, 01 Apr 2000 00:00:00 -0000	[thread overview]
Message-ID: <387E2CF0.3A0BBE9A@sigma6.com> (raw)
In-Reply-To: <200001131830.NAA08363@ns1.oaai.com>

Maury Markowitz wrote:
>   The main concern revolves around the compiler's generated dispatch
> tables.  gcj makes this as close to possible to C++ in general
> concept - one of it's goals - which then tosses out the method names
> (selectors) which would be needed for the dynamic sides of Obj-C.

Not quite.  Gcj preserves the method names and signatures in the .data
section.  They are needed for reflection, though they are never used for
ordinary method calls (interface calls in libgcj originally would lookup
a method by name, but this has been changed to a constant-time lookup).

>   This problem was recently made clear to me by Jon.  The issue here
> is that Obj-C's dispatch is based on selectors, which encode the
> _names_ of both the method and it's parameters.  On the other hand,
> Java encodes the name of the method, but the _types_ of the
> arguments.  I assume this is why Java's multimethods are possible.
> So now you'd also have to change the Obj-C runtime in order to save
> this information in addition to the current selectors

Right; Java supports method overloading, Obj-C does not.  Obj-C
programmers tend to adopt a convention for naming methods that take
arguments, sort of like method signatures, but it is enforced by the
programmer and not by the compiler.

Since gcj has no global selector table, you'd have to build one, along
with some scheme for mangling Obj-C method names/types into Java method
signatures.  That's where it gets ugly.

-- 
Jeff Sturm
jsturm@sigma6.com

  reply	other threads:[~2000-04-01  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-01  0:00 Maury Markowitz
2000-04-01  0:00 ` Jeff Sturm [this message]
2000-04-01  0:00   ` Jon Olson

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=387E2CF0.3A0BBE9A@sigma6.com \
    --to=jsturm@sigma6.com \
    --cc=java-discuss@sourceware.cygnus.com \
    --cc=maury@oaai.com \
    /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).