[PATCH 1/3] Add an inlined fast path for __libdw_form_val_len

Josh Stone jistone at redhat.com
Thu Dec 12 19:06:06 UTC 2013


On 12/12/2013 02:47 AM, Petr Machata wrote:
> Josh Stone <jistone at redhat.com> writes:
>> +  /* Note that form_lengths[flag_present] is 0, like every other absent index.
>> +   * But since flag_present's length truly is 0, check for it explicitly.  */
>> +  if (form == DW_FORM_flag_present)
>> +    return 0;
> 
> One way to get rid of this if would be to store X | 0x80 in the table
> (including 0 | 0x80 for DW_FORM_flag_present), and then return
> len ^ 0x80 later.  I don't feel strongly about this though, and
> certainly not if it offsets the performance gains again ;)

That's a good idea, though I'd probably use len & 0x7f so the others
don't need to have 0x80.  I'll play with it.

>> +
>> +  /* Return immediately for forms with fixed lengths.  */
>> +  if (form < sizeof(form_lengths) / sizeof(form_lengths[0]))
> 
> Space after sizeof

The spaces in all of these will be the end of me... ;)

Thanks,
Josh



More information about the elfutils-devel mailing list