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

Closure tracking #2357

Merged
merged 7 commits into from Nov 11, 2022
Merged

Closure tracking #2357

merged 7 commits into from Nov 11, 2022

Commits on Nov 5, 2022

  1. Closure tracking

    This adds closure awareness to Opal. Previously, some control flow
    instructions were working based on the most common situation and
    in certain situations we got that wrong. The previous implementation
    also led to a lot of scattered around code and a lot of logic
    duplication. My view is that this patch improves maintainability
    of our codebase a lot and allows for further improvements based on
    the new mini-DSL. Unfortunately, one of the downsides of this code
    is that runtime performance is slightly decreased.
    hmdne committed Nov 5, 2022
    Copy the full SHA
    479bf7e View commit details
    Browse the repository at this point in the history

Commits on Nov 10, 2022

  1. Copy the full SHA
    eb68e72 View commit details
    Browse the repository at this point in the history
  2. Replace BreakFinder with a more generic ThrowerFinder

    BreakFinder used to be called on-demand, now ThrowerFinder is a
    regular rewriter, implementing an early pass of closure tracking.
    
    This should provide some small reduction of generated code.
    hmdne committed Nov 10, 2022
    Copy the full SHA
    4d750de View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    12a0663 View commit details
    Browse the repository at this point in the history
  4. Improve IIFE creation logic.

    Don't create an IIFE, if our catcher is a JS_FUNCTION, because
    it means, that immediately after compiling a catcher we will
    wrap things with some kind of a function, so semantics will
    remain.
    hmdne committed Nov 10, 2022
    Copy the full SHA
    8305e11 View commit details
    Browse the repository at this point in the history
  5. Rename $new_thrower helper to $thrower.

    This is similar to what it used to be called before and also we can
    spare a couple of bytes.
    hmdne committed Nov 10, 2022
    Copy the full SHA
    e23d2f6 View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    f02d63d View commit details
    Browse the repository at this point in the history