Skip to content

Exception unwinding performance improvements #1025

@dnadlinger

Description

@dnadlinger

To keep track of some things we could do to increase the performance of exception unwinding:

  • Keep a free list (or just a constant-sized buffer) for _d_exception and cleanup block structs to avoid memory allocations.
  • For the unwind target frame (i.e. where the catch is), cache the results of the search phase inside _d_exception (or the cache in the context on ARM EHABI). This spares us from iterating through the tables and comparing classinfos a second time.
  • Mark up (re)throw-related runtime functions as nounwind. Might lead to slightly more compact call site code.
  • Avoid pushing a cleanup record/calling _d_eh_begin_catch for landing pads that are only for catches and have no cleanup part. Might be a bit tricky to figure out, and requires putting the _d_eh_begin_catch call into a separate BB before calling the catch (which is shared between different landing pads), or otherwise handling this situation in a more intelligent way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions