-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add lambda support to CHACallGraph (#1476)
Fixes #1459 To support lambdas, we re-use logic from the `LambdaMethodTargetSelector` to handle calls that use `invokedynamic`. `CHACallGraph` only includes edges for methods reachable from given entrypoints, and our handling of lambdas adds new synthetic classes to the class hierarchy (representing the classes generated for lambdas). So to ensure a complete call graph, we do a second pass after adding these synthetic classes to recompute call targets. This is probably not the most efficient way to do things, but I'm not sure it's the bottleneck; if we need to optimize in the future we should do so based on profiling. Note that the handling of lambdas here is very imprecise; every call site of a functional interface method will have an edge to every lambda of that functional interface type. Still, it could be practically useful, e.g., when combined with other heuristic filtering of irrelevant code. We add new tests, and also fix a couple other minor bugs (e.g., there was no edge before to the synthetic method that invokes class initializers, so it wasn't being processed properly). --------- Co-authored-by: Ben Liblit <[email protected]>
- Loading branch information
Showing
8 changed files
with
243 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.