From 9a042f80c8c65a45245becc2f5bf50936fbd9720 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 15 Jul 1999 15:35:15 +0000 Subject: [PATCH] ConstructorOperator removed, InvokeOperator handles it all. insertStructuredBlock must be called _after_ analyzation. git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1080 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/decompiler/MethodAnalyzer.java | 50 ++++++++++-------------- 1 file changed, 20 insertions(+), 30 deletions(-) diff --git a/jode/jode/decompiler/MethodAnalyzer.java b/jode/jode/decompiler/MethodAnalyzer.java index a030da7..515043c 100644 --- a/jode/jode/decompiler/MethodAnalyzer.java +++ b/jode/jode/decompiler/MethodAnalyzer.java @@ -35,7 +35,7 @@ import jode.expr.CheckNullOperator; import jode.expr.ThisOperator; import jode.expr.LocalLoadOperator; import jode.expr.OuterLocalOperator; -import jode.expr.ConstructorOperator; +import jode.expr.InvokeOperator; import jode.flow.StructuredBlock; import jode.flow.FlowBlock; import jode.flow.TransformExceptionHandlers; @@ -79,12 +79,6 @@ public class MethodAnalyzer implements Analyzer, Scope, ClassDeclarer { LocalInfo[] param; LocalVariableTable lvt; - /** - * This is a block that will be inserted at the beginning of the - * method, when the code is analyzed. - */ - StructuredBlock insertBlock = null; - boolean isJikesConstructor; boolean hasJikesOuterValue; boolean isImplicitAnonymousConstructor; @@ -92,7 +86,7 @@ public class MethodAnalyzer implements Analyzer, Scope, ClassDeclarer { /** * This dictionary maps an anonymous ClassInfo to the - * ConstructorOperator that creates this class. + * InvokeOperator that creates this class. */ Vector anonConstructors = new Vector(); Vector innerAnalyzers; @@ -183,12 +177,17 @@ public class MethodAnalyzer implements Analyzer, Scope, ClassDeclarer { imports.useType(type); } - public void insertStructuredBlock(StructuredBlock superBlock) { - if (methodHeader != null) + public void insertStructuredBlock(StructuredBlock insertBlock) { + if (methodHeader != null) { + insertBlock.setJump(new Jump(FlowBlock.NEXT_BY_ADDR)); + FlowBlock insertFlowBlock = new FlowBlock(this, 0); + insertFlowBlock.appendBlock(insertBlock, 0); + insertFlowBlock.setNextByAddr(methodHeader); + insertFlowBlock.doT2(methodHeader); + methodHeader = insertFlowBlock; + } else { throw new IllegalStateException(); - if (insertBlock != null) - throw new jode.AssertError(); - insertBlock = superBlock; + } } public final boolean isConstructor() { @@ -312,15 +311,6 @@ public class MethodAnalyzer implements Analyzer, Scope, ClassDeclarer { } methodHeader = (FlowBlock) code.getFirstInstr().getTmpInfo(); - if (insertBlock != null) { - insertBlock.setJump(new Jump(methodHeader)); - FlowBlock insertFlowBlock = new FlowBlock(this, 0); - insertFlowBlock.appendBlock(insertBlock, 0); - insertFlowBlock.setNextByAddr(methodHeader); - methodHeader = insertFlowBlock; - insertFlowBlock = null; - } - excHandlers = new TransformExceptionHandlers(); for (int i=0; i