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

(abandoned) [compiler][rewrite] PropagateScopeDeps hir rewrite #30079

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ import {
validatePreservedManualMemoization,
validateUseMemo,
} from "../Validation";
import { propagateScopeDependenciesHIR } from "../HIR/PropagateScopeDependenciesHIR";

export type CompilerPipelineValue =
| { kind: "ast"; name: string; value: CodegenFunction }
Expand Down Expand Up @@ -306,6 +307,13 @@ function* runWithEnvironment(
});
assertTerminalSuccessorsExist(hir);
assertTerminalPredsExist(hir);

propagateScopeDependenciesHIR(hir);
yield log({
kind: "hir",
name: "PropagateScopeDependenciesHIR",
value: hir,
});
Comment on lines +311 to +316
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that enableReactiveScopesInHIR has been enabled by default for some time with strong validation of the results, i think as a precursor to this diff we should promote enableReactiveScopesInHIR to stable, removing the alternative code path. Let's repurpose the feature flag for the remainder of the conversion, including this one.

Basically, it would be nice to just compare the old/new PropagateScopeDeps behavior without also including all the other bugs from non-enableReactiveScopesInHIR mode.

}

const reactiveFunction = buildReactiveFunction(hir);
Expand Down Expand Up @@ -359,16 +367,15 @@ function* runWithEnvironment(
name: "FlattenScopesWithHooks",
value: reactiveFunction,
});
}
assertScopeInstructionsWithinScopes(reactiveFunction);

assertScopeInstructionsWithinScopes(reactiveFunction);

propagateScopeDependencies(reactiveFunction);
yield log({
kind: "reactive",
name: "PropagateScopeDependencies",
value: reactiveFunction,
});
propagateScopeDependencies(reactiveFunction);
yield log({
kind: "reactive",
name: "PropagateScopeDependencies",
value: reactiveFunction,
});
}

pruneNonEscapingScopes(reactiveFunction);
yield log({
Expand Down
Loading
Loading