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(#540): Compute Max Locals And Stack #744

Merged
merged 54 commits into from
Oct 10, 2024

Conversation

volodya-lombrozo
Copy link
Member

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

Instead of relying on Java ASM library, we can count max_locals and max_stack values ourselves.
This changes allow to remove the ad-hoc solution related to switching computation modes in Java ASM library.

Closes: #540.


PR-Codex overview

This PR primarily focuses on refactoring the BytecodeInstructionEntry to BytecodeInstruction, adding methods for calculating the impact on stack and local variables, and enhancing the BytecodeMethod class to manage instructions and compute max stack and locals.

Detailed summary

  • Renamed BytecodeInstructionEntry to BytecodeInstruction.
  • Added impact() method to calculate stack impact.
  • Introduced MaxStack and MaxLocals classes for computing maximum stack and local variables.
  • Added new methods in BytecodeMethod for managing instructions and computing maxs.
  • Updated tests to reflect changes in the instruction handling.

The following files were skipped due to too many changes: src/test/resources/maxs/Maxs.java

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

@volodya-lombrozo volodya-lombrozo marked this pull request as ready for review October 10, 2024 15:42
@volodya-lombrozo
Copy link
Member Author

@rultor merge

@rultor
Copy link
Contributor

rultor commented Oct 10, 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 12ea088 into objectionary:master Oct 10, 2024
11 checks passed
@rultor
Copy link
Contributor

rultor commented Oct 10, 2024

@rultor merge

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

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.

CustomClassWriter.java:127-134: Remove ad-hoc solution...
3 participants