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

[compiler][ez] Add shape for global Object.keys #31583

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

[compiler][ez] Add shape for global Object.keys #31583

wants to merge 3 commits into from

Commits on Nov 19, 2024

  1. [compiler][ez] Clean up duplicate code in propagateScopeDeps

    Clean up duplicate checks for when to skip processing values as dependencies / hoistable temporaries.
    mofeiZ committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    8fb1dc4 View commit details
    Browse the repository at this point in the history
  2. [compiler] Context variables as dependencies

    We previously didn't track context variables in the hoistable values sidemap of `propagateScopeDependencies`. This was overly conservative as we *do*  track the mutable range of context variables, and it is safe to hoist accesses to context variables after their last direct / aliased maybe-assignment.
    
    ```js
    function Component({value}) {
      // start of mutable range for `x`
      let x = DEFAULT;
      const setX = () => x = value;
      const aliasedSet = maybeAlias(setX);
      maybeCall(aliasedSet);
      // end of mutable range for `x`
    
      // here, we should be able to take x (and property reads
      // off of x) as dependencies
      return <Jsx value={x} />
    }
    ```
    mofeiZ committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    22902de View commit details
    Browse the repository at this point in the history
  3. [compiler][ez] Add shape for global Object.keys

    Add shape / type for global Object.keys. This is useful because
    - it has an Effect.Read (not an Effect.Capture) as it cannot alias its argument.
    - Object.keys return an array
    mofeiZ committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    ffe8e00 View commit details
    Browse the repository at this point in the history