Skip to content

Commit

Permalink
Conservatively mark wide parameter used if it can only be partially m…
Browse files Browse the repository at this point in the history
…arked.
  • Loading branch information
Oberon Swings authored and JorenHannes committed Jan 8, 2024
1 parent 7160a9e commit a7265a3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,22 @@ public void visitProgramMethod(ProgramClass programClass, ProgramMethod programM
-1L : -2L);
}

if (programMethod.processingInfo instanceof ProgramMethodOptimizationInfo
&& parameterSize >= 64) {
int parameterSizesCummulative = 0;
for (int index = 0; parameterSizesCummulative < 64; index++) {
boolean isCategory2 =
((ProgramMethodOptimizationInfo) programMethod.processingInfo).getParameterSize(index)
== 2;
if (parameterSizesCummulative == 63 && isCategory2) {
markParameterUsed(programMethod, 63);
}
parameterSizesCummulative +=
((ProgramMethodOptimizationInfo) programMethod.processingInfo)
.getParameterSize(index);
}
}

// Is it a native method?
if ((accessFlags & AccessConstants.NATIVE) != 0)
{
Expand Down
1 change: 1 addition & 0 deletions docs/md/manual/releasenotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Fix potential access issues when backporting.
- Fix potential NoClassDefFoundError when using type specialization optimization. (#373)
- Improve processing of Kotlin metadata flags to prevent unnecessary null checks for consumers of protected library artifacts.
- Prevent potential `StackGeneralizationException` during optimization when processing methods with many arguments.

## Version 7.4.1

Expand Down

0 comments on commit a7265a3

Please sign in to comment.