public inbox for bfd@sourceware.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <ian@zembu.com>
To: jason@cygnus.com
Cc: bfd@cygnus.com
Subject: Re: Jumptables: How painful to hack?
Date: Wed, 31 Mar 1999 11:28:00 -0000	[thread overview]
Message-ID: <19990331192809.20688.qmail@comton.airs.com> (raw)
In-Reply-To: <u9emm5mpv6.fsf@yorick.cygnus.com>

   From: Jason Merrill <jason@cygnus.com>
   Date: 31 Mar 1999 11:16:29 -0800

    >    Date: Tue, 30 Mar 1999 21:09:18 -0800
    >    From: Jason Merrill <jason@cygnus.com>

    >    A question for folks who have worked on BFD for a while: How horrible
    >    are jumptables to deal with?  I'm looking at parameterizing the g++
    >    ABI, and am strongly considering that as an implementation strategy.

    > I started to reply, but then I realized that it depends upon what you
    > mean by the g++ ABI.  Do you mean the code that g++ generates, or do
    > you mean the files in gcc/cp?  The former already uses jumptables, of
    > course, since that's what virtual functions are, and I'm not sure in
    > what sense the latter has an ABI.

   I mean the latter.  The C++ ABI involves things like object layout,
   handling of virtual functions and bases, name mangling and such things.

I'd say the main lessons from BFD are:

* Define your interfaces clearly.  People can't look at the code to
  figure them out, since they won't look at all the possible targets
  of an indirect call.

* BFD uses macros to hide the jumptable invocations and make them look
  like a function call.  I think this was a mistake.  It makes it
  harder for novices to understand what the code is doing.  You can't
  do a tags search to find the target of the call.  Macros per se may
  be useful, but don't make it look like an ordinary function.

Ian

      reply	other threads:[~1999-03-31 11:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-30 21:09 Jason Merrill
1999-03-31  7:57 ` Ian Lance Taylor
1999-03-31 11:16   ` Jason Merrill
1999-03-31 11:28     ` Ian Lance Taylor [this message]

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=19990331192809.20688.qmail@comton.airs.com \
    --to=ian@zembu.com \
    --cc=bfd@cygnus.com \
    --cc=jason@cygnus.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).