JS: Change pruning to not rely on Import #20297
Merged
+4
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background: To ensure MaD library models have a near-zero cost for codebases that don't use the modelled library, we prune models based on what packages are imported in the current codebase. This means we don't parse the access paths or synthesise data flow nodes for irrelevant models.
This means that in order to generate
DataFlow::Node
, we first have to compute imported paths. There is thus a dependency on theImport
class. However, theImport
class also depends on local data flow. We therefore haveTEarlyStageNode
, which is used byImport
but does not contain flow summary-generated nodes.For overlay mode, the
TEarlyStageNode
has no effect on locality as the entire newtype needs to be made local. The dependency above puts us in an "all or nothing" situation where a lot needs to be made local in order forDataFlow::Node
to become local.In order to simplify the problem, I'm cutting the dependency in this PR, so pruning of flow summaries only depends on an over-approximation, roughly based on what string literals appear in the program.
Note that there are more dependencies to be cut, but I'm trying to split this into small independent PRs.
Evaluation looks neutral.