Page MenuHomePhabricator

DWARF: Use a more compact internal representation in the manual dwarf index
AbandonedPublic

Authored by labath on Tue, Jun 18, 6:27 AM.

Details

Summary

Reduce the size of the manual index by storing the entries in a more
compact form. This introduces the CompressedRef class, which is similar
to the DIERef class, but it is more compact because it lacks the
unit_offset field (which is not necessary now, as the unit is uniquely
identified by the rest of the fields). The user_id_t representation
would have the same size, but I did not use that here because:

  • it's more complicated to convert it to/from a DIERef
  • it's more clunky to handle as it is just an integer

The new class is for internal use only. It is converted to a regular
DIERef before returning it to the outside world.

Event Timeline

labath created this revision.Tue, Jun 18, 6:27 AM

I made this depend on the DIERef patch instead of the other way around because the cleaner separation between dwo identifiers and compile unit offsets implemented in that patch makes it easier to implement this. It would still be possible to implement it the other way around, but the logic would be more complex, and it would have to be redone anyway once the DIERef patch lands.

Another possibility would be to just remove the unit_offset field from the DIERef class, and have the manual index keep using DIERefs. Once we introduce the dwo identifier, the unit offset is strictly optional, as the unit is uniquely identified by the other coordinates.

I made this depend on the DIERef patch instead of the other way around because the cleaner separation between dwo identifiers and compile unit offsets implemented in that patch makes it easier to implement this. It would still be possible to implement it the other way around, but the logic would be more complex, and it would have to be redone anyway once the DIERef patch lands.

Another possibility would be to just remove the unit_offset field from the DIERef class, and have the manual index keep using DIERefs. Once we introduce the dwo identifier, the unit offset is strictly optional, as the unit is uniquely identified by the other coordinates.

Lets just fix the DIERef class and remove the unit_offset field? No need for yet another minimal DIE reference class.

labath abandoned this revision.Tue, Jun 18, 7:21 AM

Ok, sounds good. In that case, I think I can squeeze that change into the previous patch in this series.

Ok, sounds good. In that case, I think I can squeeze that change into the previous patch in this series.

That will be great, thanks.