Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Paul Pluzhnikov <ppluzhnikov@google.com>
Cc: Andreas Schwab <schwab@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [patch] Speed up dwarf2_frame_find_fde
Date: Tue, 04 Aug 2009 18:18:00 -0000	[thread overview]
Message-ID: <m3tz0ne949.fsf@fleche.redhat.com> (raw)
In-Reply-To: <8ac60eac0907221324n28e246c1k5e62f79973955ae@mail.gmail.com> (Paul Pluzhnikov's message of "Wed\, 22 Jul 2009 13\:24\:45 -0700")

>>>>> "Paul" == Paul Pluzhnikov <ppluzhnikov@google.com> writes:

Paul> 2009-07-22  Paul Pluzhnikov  <ppluzhnikov@google.com>
Paul>        * dwarf2-frame.c (struct dwarf2_cie): Remove 'next'.
Paul>        (struct dwarf2_cie_table): New.
Paul>        (struct dwarf2_fde): Remove 'next'.
Paul>        (struct dwarf2_fde_table): New.
Paul>        (struct comp_unit): Remove 'cie'.
Paul>        (bsearch_cie_cmp, bsearch_fde_cmp): New function.
Paul>        (find_cie, dwarf2_frame_find_fde): Use bsearch.
Paul>        (add_cie, add_fde): Use array instead of linked list.
Paul>        (decode_frame_entry, decode_frame_entry_1): New parameters.
Paul>        (qsort_fde_cmp): New function.
Paul>        (dwarf2_build_frame_info): Adjust.

Overall this seems reasonable to me.

Paul> +static int
Paul> +qsort_fde_cmp (const void *a, const void *b)
Paul> +{
Paul> +  struct dwarf2_fde *aa = *(struct dwarf2_fde **)a;
Paul> +  struct dwarf2_fde *bb = *(struct dwarf2_fde **)b;
Paul> +  if (aa->initial_location == bb->initial_location)
Paul> +    /* Put eh_frame entries after debug_frame ones.  */
Paul> +    return aa->eh_frame_p - bb->eh_frame_p;

I don't understand this comment.
I thought perhaps there would be some reason to do this -- but then it
seems like the bsearch comparison function ought to have similar logic.
Could you explain it?

Tom


  parent reply	other threads:[~2009-08-04 18:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-22  5:37 Paul Pluzhnikov
2009-07-22 10:02 ` Andreas Schwab
2009-07-22 23:12   ` Paul Pluzhnikov
2009-07-30  3:13     ` Paul Pluzhnikov
2009-08-04 18:18     ` Tom Tromey [this message]
2009-08-04 19:08       ` Paul Pluzhnikov
2009-08-06 21:24         ` Tom Tromey

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=m3tz0ne949.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=ppluzhnikov@google.com \
    --cc=schwab@redhat.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