Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Apply &on-heap selectively #1781

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

[WIP] Apply &on-heap selectively #1781

wants to merge 5 commits into from

Commits on Aug 9, 2024

  1. Configuration menu
    Copy the full SHA
    b937fd1 View commit details
    Browse the repository at this point in the history
  2. Prepare for moving parser temporaries to the stack.

    The parser generator is creating temporaries at a few places that will
    then later receive parsed values. Currently, those temporaries are
    always simply of the type being parsed. Turns out that works for
    units/structs only because we're always wrapping them into
    `value_ref`, meaning we can create those temporaries as null values.
    However, in a subsequent commit, we will get rid of those wrappings in
    some cases, meaning the structs would need to be default initialized
    at the time they are created on the stack. That doesn't work for some
    struct types though: if a struct receives parameters, we would need to
    pass them at instantiation time, but for these temporaries we don't
    know parameters at that point. So to prepare for the upcoming  change,
    this commit wraps such temporary struct values into `optional<>` iff
    they receive parameters.
    
    (I have been wondering if we should generally wrap all these parser
    temporaries into optionals, independent of their type. Semantically
    that would make sense, but I'm guessing the C++ compiler gets better
    optimization opportunties if we don't.)
    rsmmr committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    90d6e8a View commit details
    Browse the repository at this point in the history
  3. Apply &on-heap selectively only where needed.

    Previously, we would attach `&on-heap` to any `struct` compiled from a
    Spicy `unit`. Now we only attach it only for specific cases that need it,
    moving state to the stack otherwise.
    rsmmr committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    d93f6fd View commit details
    Browse the repository at this point in the history
  4. Change a set to an unordered_set.

    For efficiency and consistency.
    rsmmr committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    35aa3c0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1acdf78 View commit details
    Browse the repository at this point in the history