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 26 years ago
parent 6acf478de4
commit 28514944da
  1. 2
      jode/jode/flow/CreateAssignExpression.java
  2. 24
      jode/jode/flow/TransformConstructors.java

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

@ -75,6 +75,9 @@ public class TransformConstructors implements OuterValueListener {
boolean isStatic; boolean isStatic;
MethodAnalyzer[] cons; MethodAnalyzer[] cons;
/**
* @see jode.decompiler.ClassAnalyzer#outerValues
*/
Expression[] outerValues; Expression[] outerValues;
/** /**
* The minimal first slot number after the outerValues. This is because * The minimal first slot number after the outerValues. This is because
@ -167,7 +170,10 @@ public class TransformConstructors implements OuterValueListener {
return -1; return -1;
} }
public boolean checkAnonymousConstructor(MethodAnalyzer constr, /**
* This will be
*/
private boolean checkAnonymousConstructor(MethodAnalyzer constr,
InstructionBlock superBlock) { InstructionBlock superBlock) {
if (clazzAnalyzer.getName() != null) if (clazzAnalyzer.getName() != null)
@ -288,7 +294,7 @@ public class TransformConstructors implements OuterValueListener {
* The outerValues[0] parameter is the normal this of the * The outerValues[0] parameter is the normal this of the
* surrounding method (but what is the surrounding method? * surrounding method (but what is the surrounding method?
* That can't be determined in some cases). If the * 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! * disappears!
* *
* Move optional super to method constructor$? * Move optional super to method constructor$?
@ -531,6 +537,8 @@ public class TransformConstructors implements OuterValueListener {
} }
public void initSyntheticFields() { public void initSyntheticFields() {
if ((Decompiler.options & Decompiler.OPTION_CONTRAFO) == 0)
return;
if (isStatic) if (isStatic)
return; return;
@ -831,8 +839,16 @@ public class TransformConstructors implements OuterValueListener {
} }
/** /**
* This does the transformations. It will set the field initializers * This does the normal constructor transformations.
* and removing the initializers from all constructors. *
* 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() { public void transform() {
if (cons.length == 0) if (cons.length == 0)

Loading…
Cancel
Save