-
Notifications
You must be signed in to change notification settings - Fork 433
Stabilize BytecodeMethod registration and equality #4307
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
Stabilize BytecodeMethod registration and equality #4307
Conversation
✅ ByteCodeTranslator Quality ReportTest & Coverage
Benchmark Results
Static Analysis
Generated automatically by the PR CI workflow. |
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| public class MethodDependencyGraph { | ||
| private final Map<String, Set<BytecodeMethod>> callersByLookupSignature = new HashMap<String, Set<BytecodeMethod>>(); | ||
| private final Map<BytecodeMethod, Set<String>> methodToCalls = new HashMap<BytecodeMethod, Set<String>>(); | ||
| private final Map<String, Set<BytecodeMethod>> methodsByClass = new HashMap<String, Set<BytecodeMethod>>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep dependency graph keys class-qualified
MethodDependencyGraph stores caller edges in a HashMap keyed by BytecodeMethod (MethodDependencyGraph.java:40), but BytecodeMethod.equals/hashCode (BytecodeMethod.java:981‑1023) purposely ignore the declaring class. Two methods in different classes with the same name/descriptor therefore collapse to the same key: the second registration overwrites the first, and removeMethod/removeClass will strip call edges for both. When getCallers() is then used to drive elimination, live methods can be treated as unused because their remaining callers were dropped. The graph needs class-qualified keys or identity-based keys to keep per-class methods distinct.
Useful? React with 👍 / 👎.






Summary
Testing
Codex Task