Skip to content

Ruby: add API node representing a module/class object#12841

Merged
asgerf merged 5 commits intogithub:mainfrom
asgerf:rb/api-graph-class-nodes
Apr 21, 2023
Merged

Ruby: add API node representing a module/class object#12841
asgerf merged 5 commits intogithub:mainfrom
asgerf:rb/api-graph-class-nodes

Conversation

@asgerf
Copy link
Contributor

@asgerf asgerf commented Apr 17, 2023

Adds a new kind of API node, MkModuleObject to represent a module/class object, (MkModuleInstance is coming in a future PR).

This also refactors the generation of subclass edge so that subclass edges target the MkModuleObject node. The use predicate associates uses with a MkModuleObject. (This is similar to how MkClassInstance works in JS)

This is a mostly semantics-preserving change, except we now perform a trackUseNode step to the subclass edge generation.

Also contains a bugfix in DataFlow::ModuleNode.getAnImmediateReference that was needed to associate MkModuleObject to its uses.

Evaluation shows good performance and 3 new sinks (which are due to the addition of trackUseNode mentioned above).

@github-actions github-actions bot added the Ruby label Apr 17, 2023
@asgerf asgerf force-pushed the rb/api-graph-class-nodes branch from d45d638 to b9e3b7b Compare April 17, 2023 07:59
@asgerf asgerf force-pushed the rb/api-graph-class-nodes branch from b9e3b7b to 8c0c335 Compare April 17, 2023 10:48
@asgerf asgerf added the no-change-note-required This PR does not need a change note label Apr 17, 2023
@asgerf asgerf changed the title Ruby: add MkModuleObject Ruby: add API node representing a module/class object Apr 17, 2023
@asgerf asgerf marked this pull request as ready for review April 17, 2023 11:50
@asgerf asgerf requested a review from a team as a code owner April 17, 2023 11:50
@asgerf asgerf merged commit f3b14e1 into github:main Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-change-note-required This PR does not need a change note Ruby

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants