Pass StructMethod to processBlock()

This will allow us to get at the OriginalPcTable.
master
Graham 5 years ago
parent 391e495e5e
commit 19cae4fa08
  1. 2
      src/org/jetbrains/java/decompiler/main/rels/MethodProcessorRunnable.java
  2. 7
      src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java
  3. 2
      src/org/jetbrains/java/decompiler/modules/decompiler/FinallyProcessor.java

@ -131,7 +131,7 @@ public class MethodProcessorRunnable implements Runnable {
ClearStructHelper.clearStatements(root); ClearStructHelper.clearStatements(root);
ExprProcessor proc = new ExprProcessor(md, varProc); ExprProcessor proc = new ExprProcessor(md, varProc);
proc.processStatement(root, cl); proc.processStatement(root, mt, cl);
SequenceHelper.condenseSequences(root); SequenceHelper.condenseSequences(root);

@ -15,6 +15,7 @@ import org.jetbrains.java.decompiler.modules.decompiler.sforms.FlattenStatements
import org.jetbrains.java.decompiler.modules.decompiler.stats.*; import org.jetbrains.java.decompiler.modules.decompiler.stats.*;
import org.jetbrains.java.decompiler.modules.decompiler.vars.VarProcessor; import org.jetbrains.java.decompiler.modules.decompiler.vars.VarProcessor;
import org.jetbrains.java.decompiler.struct.StructClass; import org.jetbrains.java.decompiler.struct.StructClass;
import org.jetbrains.java.decompiler.struct.StructMethod;
import org.jetbrains.java.decompiler.struct.attr.StructBootstrapMethodsAttribute; import org.jetbrains.java.decompiler.struct.attr.StructBootstrapMethodsAttribute;
import org.jetbrains.java.decompiler.struct.attr.StructGeneralAttribute; import org.jetbrains.java.decompiler.struct.attr.StructGeneralAttribute;
import org.jetbrains.java.decompiler.struct.consts.ConstantPool; import org.jetbrains.java.decompiler.struct.consts.ConstantPool;
@ -102,7 +103,7 @@ public class ExprProcessor implements CodeConstants {
varProcessor = varProc; varProcessor = varProc;
} }
public void processStatement(RootStatement root, StructClass cl) { public void processStatement(RootStatement root, StructMethod mt, StructClass cl) {
FlattenStatementsHelper flatthelper = new FlattenStatementsHelper(); FlattenStatementsHelper flatthelper = new FlattenStatementsHelper();
DirectGraph dgraph = flatthelper.buildDirectGraph(root); DirectGraph dgraph = flatthelper.buildDirectGraph(root);
@ -151,7 +152,7 @@ public class ExprProcessor implements CodeConstants {
BasicBlockStatement block = node.block; BasicBlockStatement block = node.block;
if (block != null) { if (block != null) {
processBlock(block, data, cl); processBlock(block, data, mt, cl);
block.setExprents(data.getLstExprents()); block.setExprents(data.getLstExprents());
} }
@ -266,7 +267,7 @@ public class ExprProcessor implements CodeConstants {
} }
} }
public void processBlock(BasicBlockStatement stat, PrimitiveExprsList data, StructClass cl) { public void processBlock(BasicBlockStatement stat, PrimitiveExprsList data, StructMethod mt, StructClass cl) {
ConstantPool pool = cl.getPool(); ConstantPool pool = cl.getPool();
StructBootstrapMethodsAttribute bootstrap = cl.getAttribute(StructGeneralAttribute.ATTRIBUTE_BOOTSTRAP_METHODS); StructBootstrapMethodsAttribute bootstrap = cl.getAttribute(StructGeneralAttribute.ATTRIBUTE_BOOTSTRAP_METHODS);

@ -138,7 +138,7 @@ public class FinallyProcessor {
} }
ExprProcessor proc = new ExprProcessor(methodDescriptor, varProcessor); ExprProcessor proc = new ExprProcessor(methodDescriptor, varProcessor);
proc.processStatement(root, mt.getClassStruct()); proc.processStatement(root, mt, mt.getClassStruct());
SSAConstructorSparseEx ssa = new SSAConstructorSparseEx(); SSAConstructorSparseEx ssa = new SSAConstructorSparseEx();
ssa.splitVariables(root, mt); ssa.splitVariables(root, mt);

Loading…
Cancel
Save