Skip to content

Commit

Permalink
Removed obsolete method and code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rPraml committed Sep 15, 2021
1 parent 5ebfa5d commit 18dcbbd
Showing 1 changed file with 3 additions and 31 deletions.
34 changes: 3 additions & 31 deletions src/org/mozilla/classfile/ClassFileWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -1487,35 +1487,6 @@ private boolean isSuperBlockEnd(int opcode) {
}
}

/**
* Calculate partial dependencies for super blocks.
*
* <p>This is used as a workaround for dead code that is generated. Only one dependency per
* super block is given.
*/
private SuperBlock[] getSuperBlockDependencies() {
SuperBlock[] deps = new SuperBlock[superBlocks.length];

for (int i = 0; i < itsExceptionTableTop; i++) {
ExceptionTableEntry ete = itsExceptionTable[i];
int startPC = getLabelPC(ete.itsStartLabel);
int handlerPC = getLabelPC(ete.itsHandlerLabel);
SuperBlock handlerSB = getSuperBlockFromOffset(handlerPC);
SuperBlock dep = getSuperBlockFromOffset(startPC);
deps[handlerSB.getIndex()] = dep;
}
int[] targetPCs = itsJumpFroms.getKeys();
for (int i = 0; i < targetPCs.length; i++) {
int targetPC = targetPCs[i];
int branchPC = itsJumpFroms.getInt(targetPC, -1);
SuperBlock branchSB = getSuperBlockFromOffset(branchPC);
SuperBlock targetSB = getSuperBlockFromOffset(targetPC);
deps[targetSB.getIndex()] = branchSB;
}

return deps;
}

/**
* Get the target super block of a branch instruction.
*
Expand Down Expand Up @@ -4461,10 +4432,11 @@ public String toString() {

private String generatedClassName;

private ExceptionTableEntry itsExceptionTable[];
private ExceptionTableEntry[] itsExceptionTable;

private int itsExceptionTableTop;

private int itsLineNumberTable[]; // pack start_pc & line_number together
private int[] itsLineNumberTable; // pack start_pc & line_number together
private int itsLineNumberTableTop;

private byte[] itsCodeBuffer = new byte[256];
Expand Down

0 comments on commit 18dcbbd

Please sign in to comment.