added some comments

don't do simple trafos, if contrafo is not set


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1152 379699f6-c40d-0410-875b-85095c16579e
branch_1_1
jochen 25 years ago
parent 6acf478de4
commit 28514944da
  1. 2
      jode/jode/flow/CreateAssignExpression.java
  2. 26
      jode/jode/flow/TransformConstructors.java

@ -81,6 +81,7 @@ public class CreateAssignExpression {
Operator expr = (Operator) ib.getInstruction();
if (expr.getFreeOperandCount() != lvalueCount)
return false;
Type rvalueType = expr.getType();
SpecialBlock dup = null;
@ -176,6 +177,7 @@ public class CreateAssignExpression {
dup.removeBlock();
ib.setInstruction(rightHandSide);
store.getLValue().setType(rvalueType);
store.makeOpAssign(store.OPASSIGN_OP + opIndex);
if (isAssignOp)

@ -75,6 +75,9 @@ public class TransformConstructors implements OuterValueListener {
boolean isStatic;
MethodAnalyzer[] cons;
/**
* @see jode.decompiler.ClassAnalyzer#outerValues
*/
Expression[] outerValues;
/**
* The minimal first slot number after the outerValues. This is because
@ -159,7 +162,7 @@ public class TransformConstructors implements OuterValueListener {
*/
public int getOuterValueIndex(int slot) {
int ovSlot = 1; // slot of first outerValue
for (int i=0; i< outerValues.length; i++) {
for (int i=0; i < outerValues.length; i++) {
if (ovSlot == slot)
return i;
ovSlot += outerValues[i].getType().stackSize();
@ -167,7 +170,10 @@ public class TransformConstructors implements OuterValueListener {
return -1;
}
public boolean checkAnonymousConstructor(MethodAnalyzer constr,
/**
* This will be
*/
private boolean checkAnonymousConstructor(MethodAnalyzer constr,
InstructionBlock superBlock) {
if (clazzAnalyzer.getName() != null)
@ -288,7 +294,7 @@ public class TransformConstructors implements OuterValueListener {
* The outerValues[0] parameter is the normal this of the
* surrounding method (but what is the surrounding method?
* That can't be determined in some cases). If the
* surrounding method is static, the outerValues[0] parameter
s * surrounding method is static, the outerValues[0] parameter
* disappears!
*
* Move optional super to method constructor$?
@ -531,6 +537,8 @@ public class TransformConstructors implements OuterValueListener {
}
public void initSyntheticFields() {
if ((Decompiler.options & Decompiler.OPTION_CONTRAFO) == 0)
return;
if (isStatic)
return;
@ -831,8 +839,16 @@ public class TransformConstructors implements OuterValueListener {
}
/**
* This does the transformations. It will set the field initializers
* and removing the initializers from all constructors.
* This does the normal constructor transformations.
*
* javac copies the field initializers to each constructor. This
* will undo the transformation: it will tell the fields about the
* initial value and removes the initialization from all constructors.
*
* There are of course many checks necessary: All field
* initializers must be equal in all constructors, and there
* mustn't be locals that used in field initialization (except
* outerValue - locals).
*/
public void transform() {
if (cons.length == 0)

Loading…
Cancel
Save