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

feat(#752): Refactor MaxStack and MaxLocals classes #754

Merged
merged 11 commits into from
Oct 11, 2024

Conversation

volodya-lombrozo
Copy link
Member

@volodya-lombrozo volodya-lombrozo commented Oct 11, 2024

In this PR I significantly simplified MaxStack and MaxLocals classes.

Closes: #752, #751


PR-Codex overview

This PR focuses on refactoring the MaxStack and MaxLocals classes to improve readability and reduce cognitive complexity. It replaces the existing logic with a more streamlined approach using the InstructionsFlow class for better data-flow analysis.

Detailed summary

  • Changed instructions type in MaxStack from InstructionsFlow to List<? extends BytecodeEntry>.
  • Refactored value() method in MaxStack to use a new InstructionsFlow implementation.
  • Introduced a new Stack class for managing stack values in MaxStack.
  • Updated MaxLocals to use InstructionsFlow and simplified variable handling.
  • Removed cognitive complexity suppression annotations and related comments.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@volodya-lombrozo
Copy link
Member Author

@rultor merge

@rultor
Copy link
Contributor

rultor commented Oct 11, 2024

@rultor merge

@volodya-lombrozo OK, I'll try to merge now. You can check the progress of the merge here.

@rultor rultor merged commit 86b4e34 into objectionary:master Oct 11, 2024
11 checks passed
@rultor
Copy link
Contributor

rultor commented Oct 11, 2024

@rultor merge

@volodya-lombrozo Done! FYI, the full log is here (took me 9min).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MaxStack.java:38-41: Refactor the MaxStack class. The...
3 participants