Skip to content

Stack usage optimization for TAC-to-Java bytecode translation#358

Open
leraroden wants to merge 149 commits intoopalj:developfrom
leraroden:backward-stack-simulation
Open

Stack usage optimization for TAC-to-Java bytecode translation#358
leraroden wants to merge 149 commits intoopalj:developfrom
leraroden:backward-stack-simulation

Conversation

@leraroden
Copy link
Copy Markdown

This pull request introduces a stack optimization for the translation from Three-Address Code to Java bytecode, developed in the context of a bachelor’s thesis. The approach performs a backward analysis of TAC instructions combined with a recursive depth-first traversal.

The implementation was evaluated using:

  • 23 single tests
  • 113 mutation tests

The following TAC instructions are currently not supported:

  • MonitorEnter
  • MonitorExit
  • CaughtException
  • ThrowException
  • Switch

The evaluation shows that the backward analysis consistently produces correct bytecode and significantly reduces the total number of instructions as well as load/store operations compared to the baseline translation.

added parameters for: path to dir where the .class files are and for the path to dir where the new .class files are going to be located
They just have to be treated as reference types
leraroden added 30 commits June 29, 2025 14:23
…calling because after "return" goes "goto", which breaks the correct bytecode order.
# Conflicts:
#	OPAL/ProjectDependencies.mmd
#	build.sbt
  - delayStmtVisit and nestedStmt flags to control label emission and nested statement handling
  - handling for variables with multiple def-sites
…mulation

# Conflicts:
#	OPAL/tac2bc/src/main/scala/org/opalj/tac2bc/ExprProcessor.scala
#	OPAL/tac2bc/src/main/scala/org/opalj/tac2bc/StmtProcessor.scala
#	OPAL/tac2bc/src/main/scala/org/opalj/tac2bc/Tac2BcContext.scala
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.

4 participants