From aa912facad5e14d2c1762237a264783b86ea0096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Tue, 26 Feb 2013 22:44:46 +0100 Subject: [PATCH] adapting AS3 decompilation to common method --- .../decompiler/flash/abc/avm2/AVM2Code.java | 135 +----- .../flash/abc/avm2/graph/AVM2Graph.java | 417 +++++++++++++++++- .../flash/abc/avm2/graph/AVM2GraphSource.java | 2 +- .../instructions/InstructionDefinition.java | 8 +- .../avm2/instructions/arithmetic/AddIIns.java | 5 +- .../avm2/instructions/arithmetic/AddIns.java | 5 +- .../arithmetic/DecrementIIns.java | 3 +- .../instructions/arithmetic/DecrementIns.java | 3 +- .../instructions/arithmetic/DivideIns.java | 5 +- .../arithmetic/IncrementIIns.java | 3 +- .../instructions/arithmetic/IncrementIns.java | 3 +- .../instructions/arithmetic/ModuloIns.java | 5 +- .../instructions/arithmetic/MultiplyIIns.java | 5 +- .../instructions/arithmetic/MultiplyIns.java | 5 +- .../instructions/arithmetic/NegateIIns.java | 3 +- .../instructions/arithmetic/NegateIns.java | 3 +- .../avm2/instructions/arithmetic/NotIns.java | 3 +- .../instructions/arithmetic/SubtractIIns.java | 5 +- .../instructions/arithmetic/SubtractIns.java | 5 +- .../avm2/instructions/bitwise/BitAndIns.java | 5 +- .../avm2/instructions/bitwise/BitNotIns.java | 3 +- .../avm2/instructions/bitwise/BitOrIns.java | 5 +- .../avm2/instructions/bitwise/BitXorIns.java | 5 +- .../avm2/instructions/bitwise/LShiftIns.java | 5 +- .../avm2/instructions/bitwise/RShiftIns.java | 5 +- .../avm2/instructions/bitwise/URShiftIns.java | 5 +- .../instructions/comparsion/EqualsIns.java | 5 +- .../comparsion/GreaterEqualsIns.java | 5 +- .../comparsion/GreaterThanIns.java | 5 +- .../comparsion/LessEqualsIns.java | 5 +- .../instructions/comparsion/LessThanIns.java | 5 +- .../comparsion/StrictEqualsIns.java | 5 +- .../construction/ConstructIns.java | 13 +- .../construction/ConstructPropIns.java | 11 +- .../construction/ConstructSuperIns.java | 7 +- .../construction/NewArrayIns.java | 5 +- .../construction/NewObjectIns.java | 5 +- .../avm2/instructions/executing/CallIns.java | 9 +- .../instructions/executing/CallMethodIns.java | 7 +- .../executing/CallPropLexIns.java | 7 +- .../executing/CallPropVoidIns.java | 7 +- .../executing/CallPropertyIns.java | 7 +- .../instructions/executing/CallStaticIns.java | 7 +- .../instructions/executing/CallSuperIns.java | 7 +- .../executing/CallSuperVoidIns.java | 7 +- .../abc/avm2/instructions/jumps/IfEqIns.java | 8 +- .../avm2/instructions/jumps/IfFalseIns.java | 2 +- .../abc/avm2/instructions/jumps/IfGeIns.java | 8 +- .../abc/avm2/instructions/jumps/IfGtIns.java | 8 +- .../abc/avm2/instructions/jumps/IfLeIns.java | 8 +- .../abc/avm2/instructions/jumps/IfLtIns.java | 8 +- .../abc/avm2/instructions/jumps/IfNGeIns.java | 8 +- .../abc/avm2/instructions/jumps/IfNGtIns.java | 8 +- .../abc/avm2/instructions/jumps/IfNLeIns.java | 8 +- .../abc/avm2/instructions/jumps/IfNLtIns.java | 8 +- .../abc/avm2/instructions/jumps/IfNeIns.java | 8 +- .../instructions/jumps/IfStrictEqIns.java | 8 +- .../instructions/jumps/IfStrictNeIns.java | 8 +- .../avm2/instructions/jumps/IfTrueIns.java | 2 +- .../localregs/SetLocalTypeIns.java | 2 +- .../instructions/other/DeletePropertyIns.java | 3 +- .../instructions/other/GetDescendantsIns.java | 3 +- .../instructions/other/GetGlobalSlotIns.java | 3 +- .../instructions/other/GetPropertyIns.java | 3 +- .../avm2/instructions/other/GetSlotIns.java | 4 +- .../avm2/instructions/other/GetSuperIns.java | 3 +- .../avm2/instructions/other/HasNextIns.java | 5 +- .../abc/avm2/instructions/other/InIns.java | 5 +- .../instructions/other/InitPropertyIns.java | 5 +- .../instructions/other/ReturnValueIns.java | 3 +- .../instructions/other/SetGlobalSlotIns.java | 2 +- .../instructions/other/SetPropertyIns.java | 6 +- .../avm2/instructions/other/SetSlotIns.java | 10 +- .../avm2/instructions/other/SetSuperIns.java | 4 +- .../abc/avm2/instructions/other/ThrowIns.java | 3 +- .../abc/avm2/instructions/stack/DupIns.java | 3 +- .../avm2/instructions/stack/PopScopeIns.java | 3 +- .../avm2/instructions/stack/PushByteIns.java | 2 +- .../avm2/instructions/stack/PushIntIns.java | 2 +- .../stack/PushIntegerTypeIns.java | 8 + .../avm2/instructions/stack/PushShortIns.java | 2 +- .../avm2/instructions/stack/PushUIntIns.java | 2 +- .../avm2/instructions/stack/PushWithIns.java | 3 +- .../avm2/instructions/types/AsTypeIns.java | 3 +- .../instructions/types/AsTypeLateIns.java | 5 +- .../avm2/instructions/types/CoerceAIns.java | 3 +- .../avm2/instructions/types/CoerceIns.java | 3 +- .../avm2/instructions/types/CoerceSIns.java | 3 +- .../avm2/instructions/types/ConvertBIns.java | 3 +- .../avm2/instructions/types/ConvertDIns.java | 3 +- .../avm2/instructions/types/ConvertIIns.java | 3 +- .../avm2/instructions/types/ConvertOIns.java | 3 +- .../avm2/instructions/types/ConvertSIns.java | 3 +- .../avm2/instructions/types/ConvertUIns.java | 3 +- .../instructions/types/InstanceOfIns.java | 5 +- .../avm2/instructions/types/IsTypeIns.java | 3 +- .../instructions/types/IsTypeLateIns.java | 5 +- .../avm2/instructions/types/TypeOfIns.java | 3 +- .../avm2/treemodel/CallMethodTreeItem.java | 10 +- .../avm2/treemodel/CallPropertyTreeItem.java | 7 +- .../avm2/treemodel/CallStaticTreeItem.java | 10 +- .../abc/avm2/treemodel/CallSuperTreeItem.java | 7 +- .../abc/avm2/treemodel/CallTreeItem.java | 9 +- .../abc/avm2/treemodel/CoerceTreeItem.java | 4 +- .../avm2/treemodel/ConstructPropTreeItem.java | 7 +- .../treemodel/ConstructSuperTreeItem.java | 7 +- .../abc/avm2/treemodel/ConstructTreeItem.java | 7 +- .../abc/avm2/treemodel/ConvertTreeItem.java | 4 +- .../abc/avm2/treemodel/DecrementTreeItem.java | 5 +- .../avm2/treemodel/FullMultinameTreeItem.java | 8 +- .../treemodel/GetDescendantsTreeItem.java | 5 +- .../avm2/treemodel/GetPropertyTreeItem.java | 5 +- .../abc/avm2/treemodel/GetSlotTreeItem.java | 5 +- .../abc/avm2/treemodel/GetSuperTreeItem.java | 5 +- .../flash/abc/avm2/treemodel/InTreeItem.java | 7 +- .../abc/avm2/treemodel/IncrementTreeItem.java | 5 +- .../avm2/treemodel/InitPropertyTreeItem.java | 11 +- .../abc/avm2/treemodel/NameValuePair.java | 9 +- .../avm2/treemodel/NewActivationTreeItem.java | 3 + .../abc/avm2/treemodel/NewArrayTreeItem.java | 5 +- .../avm2/treemodel/ReturnValueTreeItem.java | 5 +- .../avm2/treemodel/SetGlobalSlotTreeItem.java | 5 +- .../abc/avm2/treemodel/SetLocalTreeItem.java | 9 +- .../avm2/treemodel/SetPropertyTreeItem.java | 11 +- .../abc/avm2/treemodel/SetSlotTreeItem.java | 11 +- .../abc/avm2/treemodel/SetSuperTreeItem.java | 7 +- .../abc/avm2/treemodel/SetTypeTreeItem.java | 6 +- .../abc/avm2/treemodel/ThrowTreeItem.java | 5 +- .../flash/abc/avm2/treemodel/TreeItem.java | 11 +- .../abc/avm2/treemodel/WithEndTreeItem.java | 5 +- .../avm2/treemodel/WithObjectTreeItem.java | 5 +- .../abc/avm2/treemodel/WithTreeItem.java | 13 +- .../flash/abc/avm2/treemodel/XMLTreeItem.java | 7 +- .../treemodel/clauses/FilterTreeItem.java | 7 +- .../treemodel/clauses/ForEachInTreeItem.java | 15 +- .../avm2/treemodel/clauses/ForInTreeItem.java | 15 +- .../treemodel/clauses/TernarOpTreeItem.java | 9 +- .../avm2/treemodel/clauses/TryTreeItem.java | 9 + .../treemodel/operations/AddTreeItem.java | 4 +- .../treemodel/operations/AndTreeItem.java | 4 +- .../treemodel/operations/AsTypeTreeItem.java | 4 +- .../operations/BinaryOpTreeItem.java | 7 +- .../treemodel/operations/BitAndTreeItem.java | 4 +- .../treemodel/operations/BitNotTreeItem.java | 4 +- .../treemodel/operations/BitOrTreeItem.java | 4 +- .../treemodel/operations/BitXorTreeItem.java | 4 +- .../operations/DeletePropertyTreeItem.java | 5 +- .../treemodel/operations/DivideTreeItem.java | 4 +- .../avm2/treemodel/operations/EqTreeItem.java | 3 +- .../avm2/treemodel/operations/GeTreeItem.java | 3 +- .../avm2/treemodel/operations/GtTreeItem.java | 3 +- .../avm2/treemodel/operations/InTreeItem.java | 4 +- .../operations/InstanceOfTreeItem.java | 4 +- .../treemodel/operations/IsTypeTreeItem.java | 4 +- .../treemodel/operations/LShiftTreeItem.java | 4 +- .../avm2/treemodel/operations/LeTreeItem.java | 3 +- .../avm2/treemodel/operations/LtTreeItem.java | 3 +- .../treemodel/operations/ModuloTreeItem.java | 4 +- .../operations/MultiplyTreeItem.java | 4 +- .../treemodel/operations/NegTreeItem.java | 4 +- .../treemodel/operations/NeqTreeItem.java | 3 +- .../avm2/treemodel/operations/OrTreeItem.java | 4 +- .../treemodel/operations/RShiftTreeItem.java | 4 +- .../operations/StrictEqTreeItem.java | 3 +- .../operations/StrictNeqTreeItem.java | 3 +- .../operations/SubtractTreeItem.java | 4 +- .../treemodel/operations/TypeOfTreeItem.java | 4 +- .../treemodel/operations/URShiftTreeItem.java | 4 +- .../abc/types/traits/TraitSlotConst.java | 4 +- .../jpexs/decompiler/flash/action/Action.java | 121 +---- .../decompiler/flash/action/ActionGraph.java | 21 +- .../action/treemodel/FunctionTreeItem.java | 6 +- .../treemodel/clauses/ClassTreeItem.java | 21 +- .../treemodel/clauses/ForEachTreeItem.java | 14 +- .../treemodel/clauses/ForInTreeItem.java | 13 +- .../treemodel/clauses/InterfaceTreeItem.java | 2 +- .../action/treemodel/clauses/TryTreeItem.java | 9 + .../jpexs/decompiler/flash/graph/Block.java | 2 + .../decompiler/flash/graph/DoWhileItem.java | 6 + .../decompiler/flash/graph/ForTreeItem.java | 8 + .../jpexs/decompiler/flash/graph/Graph.java | 219 +++++++-- .../flash/graph/GraphTargetItem.java | 16 +- .../jpexs/decompiler/flash/graph/IfItem.java | 8 + .../decompiler/flash/graph/SwitchItem.java | 18 +- .../decompiler/flash/graph/WhileItem.java | 7 + 185 files changed, 1181 insertions(+), 755 deletions(-) create mode 100644 trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushIntegerTypeIns.java diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java index 7d97d7f94..a2b579e46 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java @@ -48,6 +48,7 @@ import com.jpexs.decompiler.flash.abc.types.Multiname; import com.jpexs.decompiler.flash.abc.types.traits.Trait; import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst; import com.jpexs.decompiler.flash.abc.types.traits.Traits; +import com.jpexs.decompiler.flash.graph.Graph; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import com.jpexs.decompiler.flash.helpers.Helper; import com.jpexs.decompiler.flash.helpers.Highlighting; @@ -819,15 +820,6 @@ public class AVM2Code implements Serializable { cacheActual = false; } - public static String listToString(List stack, ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { - StringBuffer ret = new StringBuffer(); - for (int d = 0; d < stack.size(); d++) { - GraphTargetItem o = stack.get(d); - ret.append(o.toStringSemicoloned(Helper.toList(constants, localRegNames, fullyQualifiedNames)) + "\r\n"); - } - return ret.toString(); - } - private static String innerStackToString(List stack) { String ret = ""; for (int d = 0; d < stack.size(); d++) { @@ -1003,7 +995,7 @@ public class AVM2Code implements Serializable { return localRegNames; } - public List clearTemporaryRegisters(List output) { + public List clearTemporaryRegisters(List output) { for (int i = 0; i < output.size(); i++) { if (output.get(i) instanceof SetLocalTreeItem) { if (isKilled(((SetLocalTreeItem) output.get(i)).regIndex, 0, code.size() - 1)) { @@ -1017,7 +1009,7 @@ public class AVM2Code implements Serializable { return output; } - private int fixIPAfterDebugLine(int ip) { + public int fixIPAfterDebugLine(int ip) { if (ip >= code.size()) { return code.size() - 1; } @@ -1209,15 +1201,15 @@ public class AVM2Code implements Serializable { } } - if ((ip + 2 < code.size()) && (ins.definition instanceof NewCatchIns)) { //Filling local register in catch clause - if (code.get(ip + 1).definition instanceof DupIns) { - if (code.get(ip + 2).definition instanceof SetLocalTypeIns) { - ins.definition.translate(isStatic, classIndex, localRegs, stack, scopeStack, constants, ins, method_info, output, body, abc, localRegNames, fullyQualifiedNames); - ip += 3; - continue; - } - } - } + /*if ((ip + 2 < code.size()) && (ins.definition instanceof NewCatchIns)) { //Filling local register in catch clause + if (code.get(ip + 1).definition instanceof DupIns) { + if (code.get(ip + 2).definition instanceof SetLocalTypeIns) { + ins.definition.translate(isStatic, classIndex, localRegs, stack, scopeStack, constants, ins, method_info, output, body, abc, localRegNames, fullyQualifiedNames); + ip += 3; + continue; + } + } + }*/ if ((ins.definition instanceof SetLocalTypeIns) && (ip + 1 <= end) && (isKilled(((SetLocalTypeIns) ins.definition).getRegisterId(ins), ip, end))) { //set_local_x,get_local_x..kill x @@ -1408,10 +1400,10 @@ public class AVM2Code implements Serializable { private class Slot { - public TreeItem scope; + public GraphTargetItem scope; public Multiname multiname; - public Slot(TreeItem scope, Multiname multiname) { + public Slot(GraphTargetItem scope, Multiname multiname) { this.scope = scope; this.multiname = multiname; } @@ -1477,7 +1469,7 @@ public class AVM2Code implements Serializable { GraphTargetItem ti = list.get(i); if ((ti instanceof InitPropertyTreeItem) || (ti instanceof SetPropertyTreeItem)) { int multinameIndex = 0; - TreeItem value = null; + GraphTargetItem value = null; if (ti instanceof InitPropertyTreeItem) { multinameIndex = ((InitPropertyTreeItem) ti).propertyName.multinameIndex; value = ((InitPropertyTreeItem) ti).value; @@ -1553,103 +1545,12 @@ public class AVM2Code implements Serializable { } } - s = listToString(list, constants, localRegNames, fullyQualifiedNames); - /*} catch (Exception ex) { - Logger.getLogger(AVM2Code.class.getName()).log(Level.SEVERE, "Error in method "+path, ex); - s = "/ *\r\n * Decompilation error\r\n * Code may be obfuscated\r\n * Error Message: " + ex.getMessage() + "\r\n * /"; - return s; - }*/ - - - StringBuffer sub = new StringBuffer(); - int level = 0; - - String parts[] = s.split("\r\n"); - - boolean processLoops = true; - - if (processLoops) { - try { - Stack loopStack = new Stack(); - for (int p = 0; p < parts.length; p++) { - String stripped = Highlighting.stripHilights(parts[p]); - if (stripped.endsWith(":") && (!stripped.startsWith("case ")) && (!stripped.equals("default:"))) { - loopStack.add(stripped.substring(0, stripped.length() - 1)); - } - if (stripped.startsWith("break ")) { - if (stripped.equals("break " + loopStack.peek() + ";")) { - parts[p] = parts[p].replace(" " + loopStack.peek(), ""); - } - } - if (stripped.startsWith("continue ")) { - if (loopStack.size() > 0) { - if (stripped.equals("continue " + loopStack.peek() + ";")) { - parts[p] = parts[p].replace(" " + loopStack.peek(), ""); - } - } - } - if (stripped.startsWith(":")) { - loopStack.pop(); - } - } - } catch (Exception ex) { - } - } - for (int p = 0; p < parts.length; p++) { - if (p == parts.length - 1) { - if (parts[p].equals("")) { - continue; - } - } - String strippedP = Highlighting.stripHilights(parts[p]).trim(); - if (processLoops) { - if (strippedP.endsWith(":") && (!strippedP.startsWith("case ")) && (!strippedP.equals("default:"))) { - String loopname = strippedP.substring(0, strippedP.length() - 1); - boolean dorefer = false; - for (int q = p + 1; q < parts.length; q++) { - String strippedQ = Highlighting.stripHilights(parts[q]); - if (strippedQ.equals("break " + loopname + ";")) { - dorefer = true; - break; - } - if (strippedQ.equals("continue " + loopname + ";")) { - dorefer = true; - break; - } - if (strippedQ.equals(":" + loopname)) { - break; - } - } - if (!dorefer) { - continue; - } - } - if (strippedP.startsWith(":")) { - continue; - } - } - if (strippedP.equals(IDENTOPEN)) { - level++; - } else if (strippedP.equals(IDENTCLOSE)) { - level--; - } else if (strippedP.equals("{")) { - level++; - sub.append(tabString(level) + parts[p] + "\r\n"); - level++; - } else if (strippedP.equals("}") || strippedP.equals("};")) { - level--; - sub.append(tabString(level) + parts[p] + "\r\n"); - level--; - } else { - sub.append(tabString(level) + parts[p] + "\r\n"); - } - } + s = Graph.graphToString(list, constants, localRegNames, fullyQualifiedNames); if (!hilighted) { - return Highlighting.stripHilights(sub.toString()); + return Highlighting.stripHilights(s); } - String ret = sub.toString(); - return ret; + return s; } public void removeInstruction(int pos, MethodBody body) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java index 7fb08a16a..da7f51fd5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java @@ -18,12 +18,35 @@ package com.jpexs.decompiler.flash.abc.avm2.graph; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; +import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfStrictEqIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.IfStrictNeIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.JumpIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.LookupSwitchIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.GetLocalTypeIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.localregs.KillIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.other.ReturnValueIns; +import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushIntegerTypeIns; +import com.jpexs.decompiler.flash.abc.avm2.treemodel.NullTreeItem; +import com.jpexs.decompiler.flash.abc.avm2.treemodel.ReturnValueTreeItem; +import com.jpexs.decompiler.flash.abc.avm2.treemodel.SetLocalTreeItem; +import com.jpexs.decompiler.flash.abc.avm2.treemodel.SetTypeTreeItem; +import com.jpexs.decompiler.flash.abc.avm2.treemodel.clauses.ExceptionTreeItem; +import com.jpexs.decompiler.flash.abc.avm2.treemodel.clauses.TryTreeItem; +import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.StrictEqTreeItem; +import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.StrictNeqTreeItem; +import com.jpexs.decompiler.flash.abc.types.ABCException; import com.jpexs.decompiler.flash.abc.types.MethodBody; +import com.jpexs.decompiler.flash.graph.BreakItem; import com.jpexs.decompiler.flash.graph.Graph; import com.jpexs.decompiler.flash.graph.GraphPart; +import com.jpexs.decompiler.flash.graph.GraphPartMulti; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import com.jpexs.decompiler.flash.graph.Loop; +import com.jpexs.decompiler.flash.graph.SwitchItem; import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Stack; @@ -40,6 +63,9 @@ public class AVM2Graph extends Graph { public AVM2Graph(AVM2Code code, ABC abc, MethodBody body, boolean isStatic, int classIndex, HashMap localRegs, Stack scopeStack, HashMap localRegNames, List fullyQualifiedNames) { super(new AVM2GraphSource(code, isStatic, classIndex, localRegs, scopeStack, abc, body, localRegNames, fullyQualifiedNames), body.getExceptionEntries()); + this.code = code; + this.abc = abc; + this.body = body; /*heads = makeGraph(code, new ArrayList(), body); this.code = code; this.abc = abc; @@ -50,6 +76,19 @@ public class AVM2Graph extends Graph { }*/ } + public static final int DATA_ISSTATIC = 0; + public static final int DATA_CLASSINDEX = 1; + public static final int DATA_LOCALREGS = 2; + public static final int DATA_SCOPESTACK = 3; + public static final int DATA_CONSTANTS = 4; + public static final int DATA_METHOD_INFO = 5; + public static final int DATA_BODY = 6; + public static final int DATA_ABC = 7; + public static final int DATA_LOCALREGNAMES = 8; + public static final int DATA_FQN = 9; + public static final int DATA_PARSEDEXCEPTIONS = 10; + public static final int DATA_FINALLYJUMPS = 11; + public static final int DATA_IGNOREDSWITCHES = 12; public static List translateViaGraph(String path, AVM2Code code, ABC abc, MethodBody body, boolean isStatic, int classIndex, HashMap localRegs, Stack scopeStack, HashMap localRegNames, List fullyQualifiedNames) { AVM2Graph g = new AVM2Graph(code, abc, body, isStatic, classIndex, localRegs, scopeStack, localRegNames, fullyQualifiedNames); @@ -68,7 +107,10 @@ public class AVM2Graph extends Graph { localData.add(abc); localData.add(localRegNames); localData.add(fullyQualifiedNames); - return g.printGraph(localData, new Stack(), allParts, null, g.heads.get(0), null, new ArrayList(), new HashMap>()); + localData.add(new ArrayList()); + localData.add(new ArrayList()); + localData.add(new ArrayList()); + return g.translate(localData); } /* public GraphPart getNextNoJump(GraphPart part) { @@ -1089,4 +1131,377 @@ public class AVM2Graph extends Graph { }; return ret; }*/ + + @Override + protected List check(List localData, List allParts, Stack stack, GraphPart parent, GraphPart part, GraphPart stopPart, List loops, List output, HashMap> forFinalCommands) { + List ret = null; + + + + List parsedExceptions = (List) localData.get(DATA_PARSEDEXCEPTIONS); + List finallyJumps = (List) localData.get(DATA_FINALLYJUMPS); + List ignoredSwitches = (List) localData.get(DATA_IGNOREDSWITCHES); + int ip = part.start; + int addr = code.fixAddrAfterDebugLine(code.pos2adr(part.start)); + int maxend = -1; + List catchedExceptions = new ArrayList(); + for (int e = 0; e < body.exceptions.length; e++) { + if (addr == code.fixAddrAfterDebugLine(body.exceptions[e].start)) { + if (!body.exceptions[e].isFinally()) { + if (((body.exceptions[e].end) > maxend) && (!parsedExceptions.contains(body.exceptions[e]))) { + catchedExceptions.clear(); + maxend = code.fixAddrAfterDebugLine(body.exceptions[e].end); + catchedExceptions.add(body.exceptions[e]); + } else if (code.fixAddrAfterDebugLine(body.exceptions[e].end) == maxend) { + catchedExceptions.add(body.exceptions[e]); + } + } + } + } + if (catchedExceptions.size() > 0) { + parsedExceptions.addAll(catchedExceptions); + int endpos = code.adr2pos(code.fixAddrAfterDebugLine(catchedExceptions.get(0).end)); + int endposStartBlock = code.adr2pos(catchedExceptions.get(0).end); + + + List> catchedCommands = new ArrayList>(); + if (code.code.get(endpos).definition instanceof JumpIns) { + int afterCatchAddr = code.pos2adr(endpos + 1) + code.code.get(endpos).operands[0]; + int afterCatchPos = code.adr2pos(afterCatchAddr); + Collections.sort(catchedExceptions, new Comparator() { + @Override + public int compare(ABCException o1, ABCException o2) { + return code.fixAddrAfterDebugLine(o1.target) - code.fixAddrAfterDebugLine(o2.target); + } + }); + + + List finallyCommands = new ArrayList(); + int returnPos = afterCatchPos; + for (int e = 0; e < body.exceptions.length; e++) { + if (body.exceptions[e].isFinally()) { + if (addr == code.fixAddrAfterDebugLine(body.exceptions[e].start)) { + if (afterCatchPos + 1 == code.adr2pos(code.fixAddrAfterDebugLine(body.exceptions[e].end))) { + AVM2Instruction jmpIns = code.code.get(code.adr2pos(code.fixAddrAfterDebugLine(body.exceptions[e].end))); + if (jmpIns.definition instanceof JumpIns) { + int finStart = code.adr2pos(code.fixAddrAfterDebugLine(body.exceptions[e].end) + jmpIns.getBytes().length + jmpIns.operands[0]); + + boolean switchFound = false; + GraphPart fpart = null; + for (GraphPart p : allParts) { + if (p.start == finStart) { + fpart = p; + break; + } + } + for (int f = finStart; f < code.code.size(); f++) { + if (code.code.get(f).definition instanceof LookupSwitchIns) { + AVM2Instruction swins = code.code.get(f); + if (swins.operands.length >= 3) { + if (swins.operands[0] == swins.getBytes().length) { + if (code.adr2pos(code.pos2adr(f) + swins.operands[2]) < finStart) { + stack.push(new ExceptionTreeItem(body.exceptions[e])); + GraphPart fepart = null; + for (GraphPart p : allParts) { + if (p.start == f + 1) { + fepart = p; + break; + } + } + //code.code.get(f).ignored = true; + ignoredSwitches.add(f); + finallyCommands = printGraph(localData, stack, allParts, parent, fpart, fepart, loops, forFinalCommands); + returnPos = f + 1; + break; + } + } + } + } + } + if (!switchFound) { + finallyCommands = printGraph(localData, stack, allParts, parent, fpart, null, loops, forFinalCommands); + } + finallyJumps.add(finStart); + break; + } + } + } + } + } + + for (int e = 0; e < catchedExceptions.size(); e++) { + int eendpos; + if (e < catchedExceptions.size() - 1) { + eendpos = code.adr2pos(code.fixAddrAfterDebugLine(catchedExceptions.get(e + 1).target)) - 2; + } else { + eendpos = afterCatchPos - 1; + } + + GraphPart npart = null; + int findpos = code.adr2pos(catchedExceptions.get(e).target); + for (GraphPart p : allParts) { + if (p.start == findpos) { + npart = p; + break; + } + } + + GraphPart nepart = null; + for (GraphPart p : allParts) { + if (p.start == eendpos + 1) { + nepart = p; + break; + } + } + stack.add(new ExceptionTreeItem(catchedExceptions.get(e))); + List localData2 = new ArrayList(); + localData2.addAll(localData); + localData2.set(DATA_SCOPESTACK, new Stack()); + catchedCommands.add(printGraph(localData2, stack, allParts, parent, npart, nepart, loops, forFinalCommands)); + } + + GraphPart nepart = null; + + for (GraphPart p : allParts) { + if (p.start == endposStartBlock) { + nepart = p; + break; + } + } + List tryCommands = printGraph(localData, stack, allParts, parent, part, nepart, loops, forFinalCommands); + + output.clear(); + output.add(new TryTreeItem(tryCommands, catchedExceptions, catchedCommands, finallyCommands)); + ip = returnPos; + } + + } + + if (ip != part.start) { + part = null; + for (GraphPart p : allParts) { + List ps = p.getSubParts(); + for (GraphPart p2 : ps) { + if (p2.start == ip) { + part = p2; + break; + } + } + } + ret = new ArrayList(); + ret.addAll(output); + GraphTargetItem lop = checkLoop(part, stopPart, loops); + if (lop == null) { + ret.addAll(printGraph(localData, stack, allParts, null, part, stopPart, loops, forFinalCommands)); + } else { + ret.add(lop); + } + return ret; + } + + if (part.nextParts.isEmpty()) { + if (code.code.get(part.end).definition instanceof ReturnValueIns) { //returns in finally clause + if (part.getHeight() >= 3) { + if (code.code.get(part.getPosAt(part.getHeight() - 2)).definition instanceof KillIns) { + if (code.code.get(part.getPosAt(part.getHeight() - 3)).definition instanceof GetLocalTypeIns) { + if (!output.isEmpty()) { + if (output.get(output.size() - 2) instanceof SetLocalTreeItem) { + ret = new ArrayList(); + ret.addAll(output); + ret.remove(ret.size() - 1); + ret.add(new ReturnValueTreeItem(code.code.get(part.end), ((SetLocalTreeItem) output.get(output.size() - 2)).value)); + return ret; + } + } + } + } + } + } + } + if (code.code.get(part.end).definition instanceof LookupSwitchIns) { + ret = new ArrayList(); + ret.addAll(output); + return ret; + } + + if (((part.nextParts.size() == 2) + && (!stack.isEmpty()) + && (stack.peek() instanceof StrictEqTreeItem) + && (part.nextParts.get(0).getHeight() >= 2) + && (code.code.get(code.fixIPAfterDebugLine(part.nextParts.get(0).start)).definition instanceof PushIntegerTypeIns) + && (code.code.get(part.nextParts.get(0).nextParts.get(0).end).definition instanceof LookupSwitchIns)) + || ((part.nextParts.size() == 2) + && (!stack.isEmpty()) + && (stack.peek() instanceof StrictNeqTreeItem) + && (part.nextParts.get(1).getHeight() >= 2) + && (code.code.get(code.fixIPAfterDebugLine(part.nextParts.get(1).start)).definition instanceof PushIntegerTypeIns) + && (code.code.get(part.nextParts.get(1).nextParts.get(0).end).definition instanceof LookupSwitchIns))) { + ret = new ArrayList(); + ret.addAll(output); + boolean reversed = false; + if (stack.peek() instanceof StrictEqTreeItem) { + reversed = true; + } + GraphTargetItem switchedObject = null; + if (!output.isEmpty()) { + if (output.get(output.size() - 1) instanceof SetLocalTreeItem) { + switchedObject = ((SetLocalTreeItem) output.get(output.size() - 1)).value; + } + } + if (switchedObject == null) { + switchedObject = new NullTreeItem(null); + } + HashMap caseValuesMap = new HashMap(); + + GraphTargetItem tar = stack.pop(); + if (tar instanceof StrictEqTreeItem) { + tar = ((StrictEqTreeItem) tar).leftSide; + } + if (tar instanceof StrictNeqTreeItem) { + tar = ((StrictNeqTreeItem) tar).leftSide; + } + caseValuesMap.put(code.code.get(part.nextParts.get(reversed ? 0 : 1).start).operands[0], tar); + + GraphPart switchLoc = part.nextParts.get(reversed ? 0 : 1).nextParts.get(0); + + + while ((code.code.get(part.nextParts.get(reversed ? 1 : 0).end).definition instanceof IfStrictNeIns) + || (code.code.get(part.nextParts.get(reversed ? 1 : 0).end).definition instanceof IfStrictEqIns)) { + part = part.nextParts.get(reversed ? 1 : 0); + translatePart(localData, part, stack); + tar = stack.pop(); + if (tar instanceof StrictEqTreeItem) { + tar = ((StrictEqTreeItem) tar).leftSide; + } + if (tar instanceof StrictNeqTreeItem) { + tar = ((StrictNeqTreeItem) tar).leftSide; + } + if (code.code.get(part.end).definition instanceof IfStrictNeIns) { + reversed = false; + } else { + reversed = true; + } + caseValuesMap.put(code.code.get(code.fixIPAfterDebugLine(part.nextParts.get(reversed ? 0 : 1).start)).operands[0], tar); + + } + boolean hasDefault = false; + GraphPart dp = part.nextParts.get(reversed ? 1 : 0); + while (code.code.get(dp.start).definition instanceof JumpIns) { + if (dp instanceof GraphPartMulti) { + dp = ((GraphPartMulti) dp).parts.get(0); + } + dp = dp.nextParts.get(0); + } + if (code.code.get(dp.start).definition instanceof PushIntegerTypeIns) { + hasDefault = true; + } + List caseValues = new ArrayList(); + for (int i = 0; i < switchLoc.nextParts.size() - 1; i++) { + if (caseValuesMap.containsKey(i)) { + caseValues.add(caseValuesMap.get(i)); + } else { + continue; + } + } + + List> caseCommands = new ArrayList>(); + GraphPart next = null; + + List loopContinues = getLoopsContinues(loops); + + next = switchLoc.getNextPartPath(loopContinues); + if (next == null) { + next = switchLoc.getNextSuperPartPath(loopContinues); + } + + GraphTargetItem ti = checkLoop(next, stopPart, loops); + Loop currentLoop = new Loop(null, next); + loops.add(currentLoop); + //switchLoc.getNextPartPath(new ArrayList()); + List valuesMapping = new ArrayList(); + List caseBodies = new ArrayList(); + for (int i = 0; i < caseValues.size(); i++) { + GraphPart cur = switchLoc.nextParts.get(1 + i); + if (!caseBodies.contains(cur)) { + caseBodies.add(cur); + } + valuesMapping.add(caseBodies.indexOf(cur)); + } + + List defaultCommands = new ArrayList(); + GraphPart defaultPart = null; + if (hasDefault) { + defaultPart = switchLoc.nextParts.get(switchLoc.nextParts.size() - 1); + defaultCommands = printGraph(localData, stack, allParts, switchLoc, defaultPart, next, loops, forFinalCommands); + } + + List ignored = new ArrayList(); + for (Loop l : loops) { + ignored.add(l.loopContinue); + } + + for (int i = 0; i < caseBodies.size(); i++) { + List cc = new ArrayList(); + GraphPart nextCase = null; + nextCase = next; + if (next != null) { + if (i < caseBodies.size() - 1) { + if (!caseBodies.get(i).leadsTo(caseBodies.get(i + 1), ignored)) { + cc.add(new BreakItem(null, currentLoop.id)); + } else { + nextCase = caseBodies.get(i + 1); + } + } else if (hasDefault) { + if (!caseBodies.get(i).leadsTo(defaultPart, ignored)) { + cc.add(new BreakItem(null, currentLoop.id)); + } else { + nextCase = defaultPart; + } + } + } + cc.addAll(0, printGraph(localData, stack, allParts, switchLoc, caseBodies.get(i), nextCase, loops, forFinalCommands)); + caseCommands.add(cc); + } + + SwitchItem sti = new SwitchItem(null, currentLoop, switchedObject, caseValues, caseCommands, defaultCommands, valuesMapping); + ret.add(sti); + loops.remove(currentLoop); + if (next != null) { + if (ti != null) { + ret.add(ti); + } else { + ret.addAll(printGraph(localData, stack, allParts, null, next, stopPart, loops, forFinalCommands)); + } + } + } + return ret; + } + + @Override + protected GraphPart checkPart(List localData, GraphPart next) { + List finallyJumps = (List) localData.get(DATA_FINALLYJUMPS); + for (int f : finallyJumps) { + if (next.start == f) { + return null; + } + } + return next; + } + + @Override + protected void finalProcess(List list) { + List ret = code.clearTemporaryRegisters(list); + if (ret != list) { + list.clear(); + list.addAll(ret); + } + for (int i = 0; i < list.size(); i++) { + if (list.get(i) instanceof SetTypeTreeItem) { + if (((SetTypeTreeItem) list.get(i)).getValue() instanceof ExceptionTreeItem) { + list.remove(i); + i--; + } + } + } + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2GraphSource.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2GraphSource.java index d6fff8854..3d9447139 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2GraphSource.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2GraphSource.java @@ -58,7 +58,7 @@ public class AVM2GraphSource extends GraphSource { @Override public List translatePart(List localData, Stack stack, int start, int end) { List ret = new ArrayList(); - ConvertOutput co = code.toSourceOutput(false, isStatic, classIndex, localRegs, stack, scopeStack, abc, abc.constants, abc.method_info, body, start, end, localRegNames, fullyQualifiedNames, new boolean[size()]); + ConvertOutput co = code.toSourceOutput(false, isStatic, classIndex, localRegs, stack, (Stack) localData.get(AVM2Graph.DATA_SCOPESTACK), abc, abc.constants, abc.method_info, body, start, end, localRegNames, fullyQualifiedNames, new boolean[size()]); ret.addAll(co.output); return ret; } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java index 4d3c2a1f2..f9abc21df 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java @@ -76,13 +76,13 @@ public class InstructionDefinition implements Serializable { } protected FullMultinameTreeItem resolveMultiname(Stack stack, ConstantPool constants, int multinameIndex, AVM2Instruction ins) { - TreeItem ns = null; - TreeItem name = null; + GraphTargetItem ns = null; + GraphTargetItem name = null; if (constants.constant_multiname[multinameIndex].needsName()) { - name = (TreeItem) stack.pop(); + name = (GraphTargetItem) stack.pop(); } if (constants.constant_multiname[multinameIndex].needsNs()) { - ns = (TreeItem) stack.pop(); + ns = (GraphTargetItem) stack.pop(); } return new FullMultinameTreeItem(ins, multinameIndex, name, ns); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIIns.java index 73761062d..603dc24ff 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIIns.java @@ -19,7 +19,6 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.arithmetic; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.AddTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -36,8 +35,8 @@ public class AddIIns extends AddIns { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new AddTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIns.java index a70d46286..fc2ad22c7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIns.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.AddTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -59,8 +58,8 @@ public class AddIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new AddTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIIns.java index 6fe60a47b..6792ecb8c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIIns.java @@ -22,7 +22,6 @@ import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.DecrementTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; @@ -55,7 +54,7 @@ public class DecrementIIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - stack.push(new DecrementTreeItem(ins, (TreeItem) stack.pop())); + stack.push(new DecrementTreeItem(ins, (GraphTargetItem) stack.pop())); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIns.java index c3bf10e19..0bf9362c7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DecrementIns.java @@ -22,7 +22,6 @@ import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.DecrementTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; @@ -55,7 +54,7 @@ public class DecrementIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - stack.push(new DecrementTreeItem(ins, (TreeItem) stack.pop())); + stack.push(new DecrementTreeItem(ins, (GraphTargetItem) stack.pop())); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DivideIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DivideIns.java index c13a498e0..4438fcd00 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DivideIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/DivideIns.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.DivideTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -58,8 +57,8 @@ public class DivideIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new DivideTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/IncrementIIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/IncrementIIns.java index a10922e4e..2ef0632dc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/IncrementIIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/IncrementIIns.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.IncrementTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; @@ -36,7 +35,7 @@ public class IncrementIIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - stack.push(new IncrementTreeItem(ins, (TreeItem) stack.pop())); + stack.push(new IncrementTreeItem(ins, (GraphTargetItem) stack.pop())); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/IncrementIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/IncrementIns.java index cd1d8e139..ae1d43374 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/IncrementIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/IncrementIns.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.IncrementTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; @@ -36,7 +35,7 @@ public class IncrementIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - stack.push(new IncrementTreeItem(ins, (TreeItem) stack.pop())); + stack.push(new IncrementTreeItem(ins, (GraphTargetItem) stack.pop())); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/ModuloIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/ModuloIns.java index 60df8c5f7..827bb350e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/ModuloIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/ModuloIns.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.ModuloTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -50,8 +49,8 @@ public class ModuloIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new ModuloTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIIns.java index 671cbfb9c..82bdebb98 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIIns.java @@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.MultiplyTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -36,8 +35,8 @@ public class MultiplyIIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new MultiplyTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIns.java index 412686697..66cc65f64 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/MultiplyIns.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.MultiplyTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -58,8 +57,8 @@ public class MultiplyIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new MultiplyTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NegateIIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NegateIIns.java index 0f056ccb1..19e74cacc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NegateIIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NegateIIns.java @@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.NegTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -36,7 +35,7 @@ public class NegateIIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v = (TreeItem) stack.pop(); + GraphTargetItem v = (GraphTargetItem) stack.pop(); stack.push(new NegTreeItem(ins, v)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NegateIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NegateIns.java index bf206f5a4..bd147368e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NegateIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NegateIns.java @@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.NegTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -36,7 +35,7 @@ public class NegateIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v = (TreeItem) stack.pop(); + GraphTargetItem v = (GraphTargetItem) stack.pop(); stack.push(new NegTreeItem(ins, v)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NotIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NotIns.java index 322cabd5c..997415f2c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NotIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/NotIns.java @@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.NotTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -36,7 +35,7 @@ public class NotIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v = (TreeItem) stack.pop(); + GraphTargetItem v = (GraphTargetItem) stack.pop(); stack.push(new NotTreeItem(ins, v)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/SubtractIIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/SubtractIIns.java index f61ce8642..08afa27be 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/SubtractIIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/SubtractIIns.java @@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.SubtractTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -36,8 +35,8 @@ public class SubtractIIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new SubtractTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/SubtractIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/SubtractIns.java index b3e530af2..4aee49f89 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/SubtractIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/SubtractIns.java @@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.SubtractTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -36,8 +35,8 @@ public class SubtractIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new SubtractTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitAndIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitAndIns.java index 89c5040b4..e3f287c71 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitAndIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitAndIns.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.BitAndTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -45,8 +44,8 @@ public class BitAndIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new BitAndTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitNotIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitNotIns.java index 21bb8bf45..1a3a1e285 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitNotIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitNotIns.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.BitNotTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -44,7 +43,7 @@ public class BitNotIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v = (TreeItem) stack.pop(); + GraphTargetItem v = (GraphTargetItem) stack.pop(); stack.push(new BitNotTreeItem(ins, v)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitOrIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitOrIns.java index 5d7af41cb..d16a93e4a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitOrIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitOrIns.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.BitOrTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -45,8 +44,8 @@ public class BitOrIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new BitOrTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitXorIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitXorIns.java index 4a3ff506c..7ee8b2379 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitXorIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitXorIns.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.BitXorTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -45,8 +44,8 @@ public class BitXorIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new BitXorTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/LShiftIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/LShiftIns.java index 97bff4946..7f37e85d7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/LShiftIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/LShiftIns.java @@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.LShiftTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -36,8 +35,8 @@ public class LShiftIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new LShiftTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/RShiftIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/RShiftIns.java index 1dccd84f7..4334bf555 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/RShiftIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/RShiftIns.java @@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.RShiftTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -36,8 +35,8 @@ public class RShiftIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new RShiftTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/URShiftIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/URShiftIns.java index f24ee37c1..69642937c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/URShiftIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/URShiftIns.java @@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.URShiftTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -36,8 +35,8 @@ public class URShiftIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new URShiftTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparsion/EqualsIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparsion/EqualsIns.java index 8b0d0c616..3d20df5f4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparsion/EqualsIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparsion/EqualsIns.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.EqTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -45,8 +44,8 @@ public class EqualsIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new EqTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparsion/GreaterEqualsIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparsion/GreaterEqualsIns.java index f31717578..dd73ebda1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparsion/GreaterEqualsIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparsion/GreaterEqualsIns.java @@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.GeTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -36,8 +35,8 @@ public class GreaterEqualsIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new GeTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparsion/GreaterThanIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparsion/GreaterThanIns.java index 4cc4d3c02..0d5caa228 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparsion/GreaterThanIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparsion/GreaterThanIns.java @@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.LtTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -36,8 +35,8 @@ public class GreaterThanIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new LtTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparsion/LessEqualsIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparsion/LessEqualsIns.java index 2b367cda1..4c287a79d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparsion/LessEqualsIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparsion/LessEqualsIns.java @@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.LeTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -36,8 +35,8 @@ public class LessEqualsIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new LeTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparsion/LessThanIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparsion/LessThanIns.java index db731255a..146aa6f3f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparsion/LessThanIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparsion/LessThanIns.java @@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.GtTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -36,8 +35,8 @@ public class LessThanIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new GtTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparsion/StrictEqualsIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparsion/StrictEqualsIns.java index 5850fec3d..a2e570aff 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparsion/StrictEqualsIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/comparsion/StrictEqualsIns.java @@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.StrictEqTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -36,8 +35,8 @@ public class StrictEqualsIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new StrictEqTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructIns.java index 0d8437239..5f12be8fc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructIns.java @@ -30,7 +30,6 @@ import com.jpexs.decompiler.flash.abc.avm2.treemodel.FullMultinameTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.GetLexTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.GetPropertyTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.StringTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.XMLTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.AddTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; @@ -59,7 +58,7 @@ public class ConstructIns extends InstructionDefinition { //push new instance } - public static boolean walkXML(TreeItem item, List list) { + public static boolean walkXML(GraphTargetItem item, List list) { boolean ret = true; if (item instanceof StringTreeItem) { list.add(item); @@ -77,11 +76,11 @@ public class ConstructIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int argCount = ins.operands[0]; - List args = new ArrayList(); + List args = new ArrayList(); for (int a = 0; a < argCount; a++) { - args.add(0, (TreeItem) stack.pop()); + args.add(0, (GraphTargetItem) stack.pop()); } - TreeItem obj = (TreeItem) stack.pop(); + GraphTargetItem obj = (GraphTargetItem) stack.pop(); FullMultinameTreeItem xmlMult = null; boolean isXML = false; @@ -100,8 +99,8 @@ public class ConstructIns extends InstructionDefinition { if (isXML) { if (args.size() == 1) { - TreeItem arg = args.get(0); - List xmlLines = new ArrayList(); + GraphTargetItem arg = args.get(0); + List xmlLines = new ArrayList(); if (walkXML(arg, xmlLines)) { stack.push(new XMLTreeItem(ins, xmlLines)); return; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructPropIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructPropIns.java index 7555ce160..c1a9b37f1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructPropIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructPropIns.java @@ -24,7 +24,6 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.ConstructPropTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.FullMultinameTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.XMLTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -58,17 +57,17 @@ public class ConstructPropIns extends InstructionDefinition { public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int multinameIndex = ins.operands[0]; int argCount = ins.operands[1]; - List args = new ArrayList(); + List args = new ArrayList(); for (int a = 0; a < argCount; a++) { - args.add(0, (TreeItem) stack.pop()); + args.add(0, (GraphTargetItem) stack.pop()); } FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); - TreeItem obj = (TreeItem) stack.pop(); + GraphTargetItem obj = (GraphTargetItem) stack.pop(); if (multiname.isXML(constants, localRegNames, fullyQualifiedNames)) { if (args.size() == 1) { - TreeItem arg = args.get(0); - List xmlLines = new ArrayList(); + GraphTargetItem arg = args.get(0); + List xmlLines = new ArrayList(); if (ConstructIns.walkXML(arg, xmlLines)) { stack.push(new XMLTreeItem(ins, xmlLines)); return; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructSuperIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructSuperIns.java index e676debab..5c3400a6d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructSuperIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/ConstructSuperIns.java @@ -23,7 +23,6 @@ import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.ConstructSuperTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.ArrayList; @@ -53,11 +52,11 @@ public class ConstructSuperIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int argCount = ins.operands[0]; - List args = new ArrayList(); + List args = new ArrayList(); for (int a = 0; a < argCount; a++) { - args.add(0, (TreeItem) stack.pop()); + args.add(0, (GraphTargetItem) stack.pop()); } - TreeItem obj = (TreeItem) stack.pop(); + GraphTargetItem obj = (GraphTargetItem) stack.pop(); output.add(new ConstructSuperTreeItem(ins, obj, args)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewArrayIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewArrayIns.java index 6bc02ed7d..9d7da8459 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewArrayIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewArrayIns.java @@ -22,7 +22,6 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.NewArrayTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.ArrayList; @@ -39,9 +38,9 @@ public class NewArrayIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int argCount = ins.operands[0]; - List args = new ArrayList(); + List args = new ArrayList(); for (int a = 0; a < argCount; a++) { - args.add(0, (TreeItem) stack.pop()); + args.add(0, (GraphTargetItem) stack.pop()); } stack.push(new NewArrayTreeItem(ins, args)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewObjectIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewObjectIns.java index 8bf8306b5..7f5d9b1db 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewObjectIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewObjectIns.java @@ -23,7 +23,6 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.NameValuePair; import com.jpexs.decompiler.flash.abc.avm2.treemodel.NewObjectTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.ArrayList; @@ -42,8 +41,8 @@ public class NewObjectIns extends InstructionDefinition { int argCount = ins.operands[0]; List args = new ArrayList(); for (int a = 0; a < argCount; a++) { - TreeItem value = (TreeItem) stack.pop(); - TreeItem name = (TreeItem) stack.pop(); + GraphTargetItem value = (GraphTargetItem) stack.pop(); + GraphTargetItem name = (GraphTargetItem) stack.pop(); args.add(0, new NameValuePair(name, value)); } stack.push(new NewObjectTreeItem(ins, args)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallIns.java index dd1430f36..2c7d16acc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallIns.java @@ -23,7 +23,6 @@ import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.CallTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.ArrayList; @@ -53,12 +52,12 @@ public class CallIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int argCount = ins.operands[0]; - List args = new ArrayList(); + List args = new ArrayList(); for (int a = 0; a < argCount; a++) { - args.add(0, (TreeItem) stack.pop()); + args.add(0, (GraphTargetItem) stack.pop()); } - TreeItem receiver = (TreeItem) stack.pop(); - TreeItem function = (TreeItem) stack.pop(); + GraphTargetItem receiver = (GraphTargetItem) stack.pop(); + GraphTargetItem function = (GraphTargetItem) stack.pop(); stack.push(new CallTreeItem(ins, receiver, function, args)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallMethodIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallMethodIns.java index f20979e9e..445f5095c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallMethodIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallMethodIns.java @@ -23,7 +23,6 @@ import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.CallMethodTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.ArrayList; @@ -54,11 +53,11 @@ public class CallMethodIns extends InstructionDefinition { public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int methodIndex = ins.operands[0]; int argCount = ins.operands[1]; - List args = new ArrayList(); + List args = new ArrayList(); for (int a = 0; a < argCount; a++) { - args.add(0, (TreeItem) stack.pop()); + args.add(0, (GraphTargetItem) stack.pop()); } - TreeItem receiver = (TreeItem) stack.pop(); + GraphTargetItem receiver = (GraphTargetItem) stack.pop(); String methodName = method_info[methodIndex].getName(constants); stack.push(new CallMethodTreeItem(ins, receiver, methodName, args)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropLexIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropLexIns.java index f20593476..6864c920f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropLexIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropLexIns.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.treemodel.CallPropertyTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.FullMultinameTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.ArrayList; @@ -40,12 +39,12 @@ public class CallPropLexIns extends CallPropertyIns { public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int multinameIndex = ins.operands[0]; int argCount = ins.operands[1]; - List args = new ArrayList(); + List args = new ArrayList(); for (int a = 0; a < argCount; a++) { - args.add(0, (TreeItem) stack.pop()); + args.add(0, (GraphTargetItem) stack.pop()); } FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); - TreeItem receiver = (TreeItem) stack.pop(); + GraphTargetItem receiver = (GraphTargetItem) stack.pop(); stack.push(new CallPropertyTreeItem(ins, false, receiver, multiname, args)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropVoidIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropVoidIns.java index 794a11d65..87f0e8190 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropVoidIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropVoidIns.java @@ -24,7 +24,6 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.CallPropertyTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.FullMultinameTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.ArrayList; @@ -59,13 +58,13 @@ public class CallPropVoidIns extends InstructionDefinition { public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int multinameIndex = ins.operands[0]; int argCount = ins.operands[1]; - List args = new ArrayList(); + List args = new ArrayList(); for (int a = 0; a < argCount; a++) { - args.add(0, (TreeItem) stack.pop()); + args.add(0, (GraphTargetItem) stack.pop()); } FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); - TreeItem receiver = (TreeItem) stack.pop(); + GraphTargetItem receiver = (GraphTargetItem) stack.pop(); output.add(new CallPropertyTreeItem(ins, true, receiver, multiname, args)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropertyIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropertyIns.java index fc2d9ad24..aa1bd35e5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropertyIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropertyIns.java @@ -24,7 +24,6 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.CallPropertyTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.FullMultinameTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.ArrayList; @@ -57,13 +56,13 @@ public class CallPropertyIns extends InstructionDefinition { public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int multinameIndex = ins.operands[0]; int argCount = ins.operands[1]; - List args = new ArrayList(); + List args = new ArrayList(); for (int a = 0; a < argCount; a++) { - args.add(0, (TreeItem) stack.pop()); + args.add(0, (GraphTargetItem) stack.pop()); } FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); - TreeItem receiver = (TreeItem) stack.pop(); + GraphTargetItem receiver = (GraphTargetItem) stack.pop(); stack.push(new CallPropertyTreeItem(ins, false, receiver, multiname, args)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallStaticIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallStaticIns.java index 258629769..e0866878c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallStaticIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallStaticIns.java @@ -23,7 +23,6 @@ import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.CallStaticTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.ArrayList; @@ -54,11 +53,11 @@ public class CallStaticIns extends InstructionDefinition { public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int methodIndex = ins.operands[0]; int argCount = ins.operands[1]; - List args = new ArrayList(); + List args = new ArrayList(); for (int a = 0; a < argCount; a++) { - args.add(0, (TreeItem) stack.pop()); + args.add(0, (GraphTargetItem) stack.pop()); } - TreeItem receiver = (TreeItem) stack.pop(); + GraphTargetItem receiver = (GraphTargetItem) stack.pop(); String methodName = method_info[methodIndex].getName(constants); stack.push(new CallStaticTreeItem(ins, receiver, methodName, args)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperIns.java index bcf25ff02..b136adfe7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperIns.java @@ -24,7 +24,6 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.CallSuperTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.FullMultinameTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.ArrayList; @@ -57,12 +56,12 @@ public class CallSuperIns extends InstructionDefinition { public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int multinameIndex = ins.operands[0]; int argCount = ins.operands[1]; - List args = new ArrayList(); + List args = new ArrayList(); for (int a = 0; a < argCount; a++) { - args.add(0, (TreeItem) stack.pop()); + args.add(0, (GraphTargetItem) stack.pop()); } FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); - TreeItem receiver = (TreeItem) stack.pop(); + GraphTargetItem receiver = (GraphTargetItem) stack.pop(); stack.push(new CallSuperTreeItem(ins, false, receiver, multiname, args)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperVoidIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperVoidIns.java index 639c5ef45..08493196a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperVoidIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallSuperVoidIns.java @@ -24,7 +24,6 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.CallSuperTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.FullMultinameTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.ArrayList; @@ -57,12 +56,12 @@ public class CallSuperVoidIns extends InstructionDefinition { public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int multinameIndex = ins.operands[0]; int argCount = ins.operands[1]; - List args = new ArrayList(); + List args = new ArrayList(); for (int a = 0; a < argCount; a++) { - args.add(0, (TreeItem) stack.pop()); + args.add(0, (GraphTargetItem) stack.pop()); } FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); - TreeItem receiver = (TreeItem) stack.pop(); + GraphTargetItem receiver = (GraphTargetItem) stack.pop(); output.add(new CallSuperTreeItem(ins, true, receiver, multiname, args)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfEqIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfEqIns.java index a30dd92f3..324014e46 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfEqIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfEqIns.java @@ -39,14 +39,14 @@ public class IfEqIns extends InstructionDefinition implements IfTypeIns { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new EqTreeItem(ins, v1, v2)); } public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new NeqTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfFalseIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfFalseIns.java index 2869cb986..d96d4d173 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfFalseIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfFalseIns.java @@ -38,7 +38,7 @@ public class IfFalseIns extends InstructionDefinition implements IfTypeIns { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new NotTreeItem(ins, v1)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfGeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfGeIns.java index 2bba2bdb4..eefc4894a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfGeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfGeIns.java @@ -39,14 +39,14 @@ public class IfGeIns extends InstructionDefinition implements IfTypeIns { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new GeTreeItem(ins, v1, v2)); } public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new LtTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfGtIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfGtIns.java index c5dbe9992..eeb87a9b1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfGtIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfGtIns.java @@ -39,14 +39,14 @@ public class IfGtIns extends InstructionDefinition implements IfTypeIns { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new GtTreeItem(ins, v1, v2)); } public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new LeTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfLeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfLeIns.java index 401443574..dc7d25688 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfLeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfLeIns.java @@ -39,14 +39,14 @@ public class IfLeIns extends InstructionDefinition implements IfTypeIns { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new LeTreeItem(ins, v1, v2)); } public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new GtTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfLtIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfLtIns.java index 302c9e19c..d768707d3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfLtIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfLtIns.java @@ -39,14 +39,14 @@ public class IfLtIns extends InstructionDefinition implements IfTypeIns { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new LtTreeItem(ins, v1, v2)); } public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new GeTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGeIns.java index 81ca505c5..d5cbaac7c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGeIns.java @@ -39,14 +39,14 @@ public class IfNGeIns extends InstructionDefinition implements IfTypeIns { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new LtTreeItem(ins, v1, v2)); } public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new GeTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGtIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGtIns.java index 42c25e3e7..88324d997 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGtIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGtIns.java @@ -39,14 +39,14 @@ public class IfNGtIns extends InstructionDefinition implements IfTypeIns { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new LeTreeItem(ins, v1, v2)); } public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new GtTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNLeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNLeIns.java index f7e60d1e9..f4fdbf76a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNLeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNLeIns.java @@ -39,14 +39,14 @@ public class IfNLeIns extends InstructionDefinition implements IfTypeIns { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new GtTreeItem(ins, v1, v2)); } public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new LeTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNLtIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNLtIns.java index ca76417aa..2b87c4875 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNLtIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNLtIns.java @@ -39,14 +39,14 @@ public class IfNLtIns extends InstructionDefinition implements IfTypeIns { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new GeTreeItem(ins, v1, v2)); } public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new LtTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNeIns.java index c7c6ce58f..6a5c00462 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNeIns.java @@ -39,14 +39,14 @@ public class IfNeIns extends InstructionDefinition implements IfTypeIns { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new NeqTreeItem(ins, v1, v2)); } public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new EqTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfStrictEqIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfStrictEqIns.java index 86d61df47..7a98998c1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfStrictEqIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfStrictEqIns.java @@ -39,14 +39,14 @@ public class IfStrictEqIns extends InstructionDefinition implements IfTypeIns { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new StrictEqTreeItem(ins, v1, v2)); } public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new StrictNeqTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfStrictNeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfStrictNeIns.java index 5d2fed3ae..213c30c8d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfStrictNeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfStrictNeIns.java @@ -39,14 +39,14 @@ public class IfStrictNeIns extends InstructionDefinition implements IfTypeIns { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new StrictNeqTreeItem(ins, v1, v2)); } public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { - TreeItem v2 = (TreeItem) stack.pop(); - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v2 = (GraphTargetItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new StrictEqTreeItem(ins, v1, v2)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfTrueIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfTrueIns.java index f5d9fc6b8..5f959d5fc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfTrueIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfTrueIns.java @@ -43,7 +43,7 @@ public class IfTrueIns extends InstructionDefinition implements IfTypeIns { } public void translateInverted(java.util.HashMap localRegs, Stack stack, AVM2Instruction ins) { - TreeItem v1 = (TreeItem) stack.pop(); + GraphTargetItem v1 = (GraphTargetItem) stack.pop(); stack.push(new NotTreeItem(ins, v1)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java index 028569bfc..232ce0596 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java @@ -47,7 +47,7 @@ public abstract class SetLocalTypeIns extends InstructionDefinition implements S @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int regId = getRegisterId(ins); - TreeItem value = (TreeItem) stack.pop(); + GraphTargetItem value = (GraphTargetItem) stack.pop(); localRegs.put(regId, value); if (value instanceof NewActivationTreeItem) { return; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/DeletePropertyIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/DeletePropertyIns.java index aff153d01..e2e902cca 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/DeletePropertyIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/DeletePropertyIns.java @@ -24,7 +24,6 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.BooleanTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.FullMultinameTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.DeletePropertyTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -53,7 +52,7 @@ public class DeletePropertyIns extends InstructionDefinition { public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int multinameIndex = ins.operands[0]; FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); - TreeItem obj = (TreeItem) stack.pop(); + GraphTargetItem obj = (GraphTargetItem) stack.pop(); stack.add(new BooleanTreeItem(ins, Boolean.TRUE));//property successfully deleted output.add(new DeletePropertyTreeItem(ins, obj, multiname)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetDescendantsIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetDescendantsIns.java index 48086020f..d92972fd9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetDescendantsIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetDescendantsIns.java @@ -24,7 +24,6 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.FullMultinameTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.GetDescendantsTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; @@ -50,7 +49,7 @@ public class GetDescendantsIns extends InstructionDefinition { public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int multinameIndex = ins.operands[0]; FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); - TreeItem obj = (TreeItem) stack.pop(); + GraphTargetItem obj = (GraphTargetItem) stack.pop(); stack.push(new GetDescendantsTreeItem(ins, obj, multiname)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalSlotIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalSlotIns.java index a46086281..b736918ca 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalSlotIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetGlobalSlotIns.java @@ -22,7 +22,6 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.GetSlotTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.clauses.ExceptionTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.abc.types.Multiname; @@ -41,7 +40,7 @@ public class GetGlobalSlotIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int slotIndex = ins.operands[0]; - TreeItem obj = (TreeItem) scopeStack.get(0); //scope + GraphTargetItem obj = (GraphTargetItem) scopeStack.get(0); //scope Multiname slotname = null; if (obj instanceof ExceptionTreeItem) { slotname = constants.constant_multiname[((ExceptionTreeItem) obj).exception.name_index]; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetPropertyIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetPropertyIns.java index 5ec19ab0d..b60144368 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetPropertyIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetPropertyIns.java @@ -23,7 +23,6 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.FullMultinameTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.GetPropertyTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; @@ -40,7 +39,7 @@ public class GetPropertyIns extends InstructionDefinition { public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int multinameIndex = ins.operands[0]; FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); - TreeItem obj = (TreeItem) stack.pop(); + GraphTargetItem obj = (GraphTargetItem) stack.pop(); stack.push(new GetPropertyTreeItem(ins, obj, multiname)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSlotIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSlotIns.java index 732fbbd42..d0178c384 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSlotIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSlotIns.java @@ -24,7 +24,6 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.ClassTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.GetSlotTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.ThisTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.clauses.ExceptionTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.abc.types.Multiname; @@ -43,7 +42,8 @@ public class GetSlotIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int slotIndex = ins.operands[0]; - TreeItem obj = (TreeItem) stack.pop(); //scope + GraphTargetItem obj = (GraphTargetItem) stack.pop(); //scope + obj = obj.getThroughRegister(); Multiname slotname = null; if (obj instanceof ExceptionTreeItem) { slotname = constants.constant_multiname[((ExceptionTreeItem) obj).exception.name_index]; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSuperIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSuperIns.java index 19ca0876e..6b441a7bf 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSuperIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetSuperIns.java @@ -23,7 +23,6 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.FullMultinameTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.GetSuperTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; @@ -40,7 +39,7 @@ public class GetSuperIns extends InstructionDefinition { public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int multinameIndex = ins.operands[0]; FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); - TreeItem obj = (TreeItem) stack.pop(); + GraphTargetItem obj = (GraphTargetItem) stack.pop(); stack.push(new GetSuperTreeItem(ins, obj, multiname)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/HasNextIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/HasNextIns.java index 1cfaf3fcf..a7970f884 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/HasNextIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/HasNextIns.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.HasNextTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; @@ -36,8 +35,8 @@ public class HasNextIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem curIndex = (TreeItem) stack.pop(); - TreeItem obj = (TreeItem) stack.pop(); + GraphTargetItem curIndex = (GraphTargetItem) stack.pop(); + GraphTargetItem obj = (GraphTargetItem) stack.pop(); stack.push(new HasNextTreeItem(ins, curIndex, obj)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InIns.java index 2a35153ad..8285d743a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InIns.java @@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.InTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -36,8 +35,8 @@ public class InIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem obj = (TreeItem) stack.pop(); - TreeItem name = (TreeItem) stack.pop(); + GraphTargetItem obj = (GraphTargetItem) stack.pop(); + GraphTargetItem name = (GraphTargetItem) stack.pop(); stack.push(new InTreeItem(ins, name, obj)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InitPropertyIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InitPropertyIns.java index 9b8f2212c..f4e0184b5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InitPropertyIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InitPropertyIns.java @@ -23,7 +23,6 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.FullMultinameTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.InitPropertyTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; @@ -40,9 +39,9 @@ public class InitPropertyIns extends InstructionDefinition { public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int multinameIndex = ins.operands[0]; - TreeItem val = (TreeItem) stack.pop(); + GraphTargetItem val = (GraphTargetItem) stack.pop(); FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); - TreeItem obj = (TreeItem) stack.pop(); + GraphTargetItem obj = (GraphTargetItem) stack.pop(); output.add(new InitPropertyTreeItem(ins, obj, multiname, val)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnValueIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnValueIns.java index 1e0e8cd8e..e65ba46fa 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnValueIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ReturnValueIns.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.ReturnValueTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; @@ -36,7 +35,7 @@ public class ReturnValueIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - output.add(new ReturnValueTreeItem(ins, (TreeItem) stack.pop())); + output.add(new ReturnValueTreeItem(ins, (GraphTargetItem) stack.pop())); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetGlobalSlotIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetGlobalSlotIns.java index 4d3aa08a8..ff162c26e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetGlobalSlotIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetGlobalSlotIns.java @@ -38,7 +38,7 @@ public class SetGlobalSlotIns extends InstructionDefinition implements SetTypeIn @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - output.add(new SetGlobalSlotTreeItem(ins, ins.operands[0], (TreeItem) stack.pop())); + output.add(new SetGlobalSlotTreeItem(ins, ins.operands[0], (GraphTargetItem) stack.pop())); } public String getObject(Stack stack, ABC abc, AVM2Instruction ins, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, HashMap localRegNames, List fullyQualifiedNames) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetPropertyIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetPropertyIns.java index b35a9d728..ad17b88c5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetPropertyIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetPropertyIns.java @@ -48,9 +48,9 @@ public class SetPropertyIns extends InstructionDefinition implements SetTypeIns @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int multinameIndex = ins.operands[0]; - TreeItem value = (TreeItem) stack.pop(); + GraphTargetItem value = (GraphTargetItem) stack.pop(); FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); - TreeItem obj = (TreeItem) stack.pop(); + GraphTargetItem obj = (GraphTargetItem) stack.pop(); if (value.getThroughRegister() instanceof IncrementTreeItem) { GraphTargetItem inside = ((IncrementTreeItem) value.getThroughRegister()).object.getThroughRegister().getNotCoerced(); if (inside instanceof GetPropertyTreeItem) { @@ -116,7 +116,7 @@ public class SetPropertyIns extends InstructionDefinition implements SetTypeIns public String getObject(Stack stack, ABC abc, AVM2Instruction ins, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, HashMap localRegNames, List fullyQualifiedNames) { int multinameIndex = ins.operands[0]; String multiname = resolveMultinameNoPop(0, stack, abc.constants, multinameIndex, ins, fullyQualifiedNames); - TreeItem obj = stack.get(1 + resolvedCount(abc.constants, multinameIndex)); //pod vrcholem + GraphTargetItem obj = stack.get(1 + resolvedCount(abc.constants, multinameIndex)); //pod vrcholem if ((!obj.toString().equals(""))) { multiname = "." + multiname; } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSlotIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSlotIns.java index 987e46d5f..8d24973ec 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSlotIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSlotIns.java @@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.abc.avm2.treemodel.ClassTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.DecrementTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.GetSlotTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.IncrementTreeItem; +import com.jpexs.decompiler.flash.abc.avm2.treemodel.NewActivationTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.PostDecrementTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.PostIncrementTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.SetSlotTreeItem; @@ -51,9 +52,13 @@ public class SetSlotIns extends InstructionDefinition implements SetTypeIns { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int slotIndex = ins.operands[0]; - TreeItem value = (TreeItem) stack.pop(); - TreeItem obj = (TreeItem) stack.pop(); //scopeId + GraphTargetItem value = (GraphTargetItem) stack.pop(); + GraphTargetItem obj = (GraphTargetItem) stack.pop(); //scopeId + obj = obj.getThroughRegister(); Multiname slotname = null; + if (obj instanceof NewActivationTreeItem) { + ((NewActivationTreeItem) obj).slots.put(slotIndex, value); + } if (obj instanceof ExceptionTreeItem) { slotname = constants.constant_multiname[((ExceptionTreeItem) obj).exception.name_index]; } else if (obj instanceof ClassTreeItem) { @@ -62,7 +67,6 @@ public class SetSlotIns extends InstructionDefinition implements SetTypeIns { slotname = ((ThisTreeItem) obj).className; } else { //if(value.startsWith("catched ")) return; - for (int t = 0; t < body.traits.traits.length; t++) { if (body.traits.traits[t] instanceof TraitSlotConst) { if (((TraitSlotConst) body.traits.traits[t]).slot_id == slotIndex) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSuperIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSuperIns.java index 1c232246c..b3bbb43ba 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSuperIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetSuperIns.java @@ -41,9 +41,9 @@ public class SetSuperIns extends InstructionDefinition implements SetTypeIns { public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int multinameIndex = ins.operands[0]; - TreeItem value = (TreeItem) stack.pop(); + GraphTargetItem value = (GraphTargetItem) stack.pop(); FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins); - TreeItem obj = (TreeItem) stack.pop(); + GraphTargetItem obj = (GraphTargetItem) stack.pop(); output.add(new SetSuperTreeItem(ins, value, obj, multiname)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ThrowIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ThrowIns.java index e77805933..d669f62e2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ThrowIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/ThrowIns.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.ThrowTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodBody; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -37,7 +36,7 @@ public class ThrowIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - output.add(new ThrowTreeItem(ins, (TreeItem) stack.pop())); + output.add(new ThrowTreeItem(ins, (GraphTargetItem) stack.pop())); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/DupIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/DupIns.java index c36fcf1db..46ad5a976 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/DupIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/DupIns.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; @@ -43,7 +42,7 @@ public class DupIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem v = (TreeItem) stack.pop(); + GraphTargetItem v = stack.pop(); stack.push(v); stack.push(v); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopScopeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopScopeIns.java index 53cf3bb11..337566ad8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopScopeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PopScopeIns.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.WithEndTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.WithObjectTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodBody; @@ -44,7 +43,7 @@ public class PopScopeIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem scope = (TreeItem) scopeStack.pop(); + GraphTargetItem scope = (GraphTargetItem) scopeStack.pop(); if (scope instanceof WithObjectTreeItem) { scope = ((WithObjectTreeItem) scope).scope; output.add(new WithEndTreeItem(ins, scope)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushByteIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushByteIns.java index 363c19553..5ec6b9f87 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushByteIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushByteIns.java @@ -29,7 +29,7 @@ import java.util.HashMap; import java.util.List; import java.util.Stack; -public class PushByteIns extends InstructionDefinition { +public class PushByteIns extends InstructionDefinition implements PushIntegerTypeIns { public PushByteIns() { super(0x24, "pushbyte", new int[]{AVM2Code.OPT_BYTE}); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushIntIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushIntIns.java index 85b992926..eb7c2a07b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushIntIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushIntIns.java @@ -29,7 +29,7 @@ import java.util.HashMap; import java.util.List; import java.util.Stack; -public class PushIntIns extends InstructionDefinition { +public class PushIntIns extends InstructionDefinition implements PushIntegerTypeIns { public PushIntIns() { super(0x2d, "pushint", new int[]{AVM2Code.DAT_INT_INDEX}); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushIntegerTypeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushIntegerTypeIns.java new file mode 100644 index 000000000..46e4dc7d7 --- /dev/null +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushIntegerTypeIns.java @@ -0,0 +1,8 @@ +package com.jpexs.decompiler.flash.abc.avm2.instructions.stack; + +/** + * + * @author JPEXS + */ +public interface PushIntegerTypeIns { +} diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushShortIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushShortIns.java index 19cef12a3..8d2415afc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushShortIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushShortIns.java @@ -29,7 +29,7 @@ import java.util.HashMap; import java.util.List; import java.util.Stack; -public class PushShortIns extends InstructionDefinition { +public class PushShortIns extends InstructionDefinition implements PushIntegerTypeIns { public PushShortIns() { super(0x25, "pushshort", new int[]{AVM2Code.OPT_U30}); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushUIntIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushUIntIns.java index 9872ab0cd..13e243cd9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushUIntIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushUIntIns.java @@ -29,7 +29,7 @@ import java.util.HashMap; import java.util.List; import java.util.Stack; -public class PushUIntIns extends InstructionDefinition { +public class PushUIntIns extends InstructionDefinition implements PushIntegerTypeIns { public PushUIntIns() { super(0x2e, "pushuint", new int[]{AVM2Code.DAT_UINT_INDEX}); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushWithIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushWithIns.java index 40c61756a..554e1faa4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushWithIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushWithIns.java @@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.WithObjectTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.WithTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodBody; @@ -38,7 +37,7 @@ public class PushWithIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem w = (TreeItem) stack.pop(); + GraphTargetItem w = (GraphTargetItem) stack.pop(); WithObjectTreeItem wot = new WithObjectTreeItem(ins, w); scopeStack.push(wot); output.add(new WithTreeItem(ins, w)); diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeIns.java index c7763efc4..61f0c7ab5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeIns.java @@ -23,7 +23,6 @@ import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.FullMultinameTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.AsTypeTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -49,7 +48,7 @@ public class AsTypeIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem val = (TreeItem) stack.pop(); + GraphTargetItem val = (GraphTargetItem) stack.pop(); stack.push(new AsTypeTreeItem(ins, val, new FullMultinameTreeItem(ins, ins.operands[0]))); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeLateIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeLateIns.java index b1aed6759..0ac0f0786 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeLateIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeLateIns.java @@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.AsTypeTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -46,8 +45,8 @@ public class AsTypeLateIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem cls = (TreeItem) stack.pop(); - TreeItem val = (TreeItem) stack.pop(); + GraphTargetItem cls = (GraphTargetItem) stack.pop(); + GraphTargetItem val = (GraphTargetItem) stack.pop(); stack.push(new AsTypeTreeItem(ins, val, cls)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceAIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceAIns.java index e0710e405..443948564 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceAIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceAIns.java @@ -22,7 +22,6 @@ import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.CoerceTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; @@ -46,7 +45,7 @@ public class CoerceAIns extends InstructionDefinition implements CoerceOrConvert @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - stack.push(new CoerceTreeItem(ins, (TreeItem) stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); + stack.push(new CoerceTreeItem(ins, (GraphTargetItem) stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceIns.java index 01604f825..01358bdcb 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceIns.java @@ -23,7 +23,6 @@ import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.CoerceTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; @@ -45,7 +44,7 @@ public class CoerceIns extends InstructionDefinition implements CoerceOrConvertT @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int multinameIndex = ins.operands[0]; - stack.push(new CoerceTreeItem(ins, (TreeItem) stack.pop(), constants.constant_multiname[multinameIndex].getName(constants, fullyQualifiedNames))); + stack.push(new CoerceTreeItem(ins, (GraphTargetItem) stack.pop(), constants.constant_multiname[multinameIndex].getName(constants, fullyQualifiedNames))); } public String getTargetType(ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java index c43e6b6a7..12d07ff5b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java @@ -22,7 +22,6 @@ import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.CoerceTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; @@ -43,7 +42,7 @@ public class CoerceSIns extends InstructionDefinition implements CoerceOrConvert @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - stack.push(new CoerceTreeItem(ins, (TreeItem) stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); + stack.push(new CoerceTreeItem(ins, (GraphTargetItem) stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertBIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertBIns.java index 3048e64d7..7d3542c9e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertBIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertBIns.java @@ -22,7 +22,6 @@ import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.ConvertTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; @@ -53,7 +52,7 @@ public class ConvertBIns extends InstructionDefinition implements CoerceOrConver @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - stack.push(new ConvertTreeItem(ins, (TreeItem) stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); + stack.push(new ConvertTreeItem(ins, (GraphTargetItem) stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertDIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertDIns.java index 740d6e004..58816108c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertDIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertDIns.java @@ -22,7 +22,6 @@ import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.ConvertTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; @@ -61,7 +60,7 @@ public class ConvertDIns extends InstructionDefinition implements CoerceOrConver @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - stack.push(new ConvertTreeItem(ins, (TreeItem) stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); + stack.push(new ConvertTreeItem(ins, (GraphTargetItem) stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java index 56e60d6d1..67c1fe93c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java @@ -22,7 +22,6 @@ import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.ConvertTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; @@ -59,7 +58,7 @@ public class ConvertIIns extends InstructionDefinition implements CoerceOrConver @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - stack.push(new ConvertTreeItem(ins, (TreeItem) stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); + stack.push(new ConvertTreeItem(ins, (GraphTargetItem) stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertOIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertOIns.java index a440db938..bf270e89c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertOIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertOIns.java @@ -22,7 +22,6 @@ import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.ConvertTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; @@ -42,7 +41,7 @@ public class ConvertOIns extends InstructionDefinition implements CoerceOrConver @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - stack.push(new ConvertTreeItem(ins, (TreeItem) stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); + stack.push(new ConvertTreeItem(ins, (GraphTargetItem) stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertSIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertSIns.java index 9326fc5e0..887956b3b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertSIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertSIns.java @@ -22,7 +22,6 @@ import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.ConvertTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; @@ -43,7 +42,7 @@ public class ConvertSIns extends InstructionDefinition implements CoerceOrConver @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - stack.push(new ConvertTreeItem(ins, (TreeItem) stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); + stack.push(new ConvertTreeItem(ins, (GraphTargetItem) stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertUIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertUIns.java index 894f8eb4a..eb79658aa 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertUIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertUIns.java @@ -22,7 +22,6 @@ import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.ConvertTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; @@ -42,7 +41,7 @@ public class ConvertUIns extends InstructionDefinition implements CoerceOrConver @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - stack.push(new ConvertTreeItem(ins, (TreeItem) stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); + stack.push(new ConvertTreeItem(ins, (GraphTargetItem) stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/InstanceOfIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/InstanceOfIns.java index 5a38441cd..21c1fade6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/InstanceOfIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/InstanceOfIns.java @@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.InstanceOfTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -36,8 +35,8 @@ public class InstanceOfIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem type = (TreeItem) stack.pop(); - TreeItem value = (TreeItem) stack.pop(); + GraphTargetItem type = (GraphTargetItem) stack.pop(); + GraphTargetItem value = (GraphTargetItem) stack.pop(); stack.push(new InstanceOfTreeItem(ins, value, type)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/IsTypeIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/IsTypeIns.java index 0fbbb985a..7800f7c92 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/IsTypeIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/IsTypeIns.java @@ -22,7 +22,6 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; import com.jpexs.decompiler.flash.abc.avm2.treemodel.FullMultinameTreeItem; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.IsTypeTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -39,7 +38,7 @@ public class IsTypeIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { int multinameIndex = ins.operands[0]; - TreeItem value = (TreeItem) stack.pop(); + GraphTargetItem value = (GraphTargetItem) stack.pop(); stack.push(new IsTypeTreeItem(ins, value, new FullMultinameTreeItem(ins, multinameIndex))); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/IsTypeLateIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/IsTypeLateIns.java index 4cf6d1906..e11ec89cb 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/IsTypeLateIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/IsTypeLateIns.java @@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.IsTypeTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -36,8 +35,8 @@ public class IsTypeLateIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - TreeItem type = (TreeItem) stack.pop(); - TreeItem value = (TreeItem) stack.pop(); + GraphTargetItem type = (GraphTargetItem) stack.pop(); + GraphTargetItem value = (GraphTargetItem) stack.pop(); stack.push(new IsTypeTreeItem(ins, value, type)); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/TypeOfIns.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/TypeOfIns.java index 9cb4f6dda..6813162b0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/TypeOfIns.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/TypeOfIns.java @@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.operations.TypeOfTreeItem; import com.jpexs.decompiler.flash.abc.types.MethodInfo; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -36,7 +35,7 @@ public class TypeOfIns extends InstructionDefinition { @Override public void translate(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, java.util.Stack scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List output, com.jpexs.decompiler.flash.abc.types.MethodBody body, com.jpexs.decompiler.flash.abc.ABC abc, HashMap localRegNames, List fullyQualifiedNames) { - stack.push(new TypeOfTreeItem(ins, (TreeItem) stack.pop())); + stack.push(new TypeOfTreeItem(ins, (GraphTargetItem) stack.pop())); } @Override diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/CallMethodTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/CallMethodTreeItem.java index ed566fce9..d82b163cf 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/CallMethodTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/CallMethodTreeItem.java @@ -18,16 +18,18 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; +import com.jpexs.decompiler.flash.helpers.Helper; import java.util.HashMap; import java.util.List; public class CallMethodTreeItem extends TreeItem { - public TreeItem receiver; + public GraphTargetItem receiver; public String methodName; - public List arguments; + public List arguments; - public CallMethodTreeItem(AVM2Instruction instruction, TreeItem receiver, String methodName, List arguments) { + public CallMethodTreeItem(AVM2Instruction instruction, GraphTargetItem receiver, String methodName, List arguments) { super(instruction, PRECEDENCE_PRIMARY); this.receiver = receiver; this.methodName = methodName; @@ -43,6 +45,6 @@ public class CallMethodTreeItem extends TreeItem { } args = args + arguments.get(a).toString(constants, localRegNames, fullyQualifiedNames); } - return receiver.toString(constants, localRegNames, fullyQualifiedNames) + hilight(".") + methodName + hilight("(") + args + hilight(")"); + return receiver.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)) + hilight(".") + methodName + hilight("(") + args + hilight(")"); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/CallPropertyTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/CallPropertyTreeItem.java index 7ecd82085..9116d17a1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/CallPropertyTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/CallPropertyTreeItem.java @@ -18,17 +18,18 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class CallPropertyTreeItem extends TreeItem { - public TreeItem receiver; + public GraphTargetItem receiver; public FullMultinameTreeItem propertyName; - public List arguments; + public List arguments; public boolean isVoid; - public CallPropertyTreeItem(AVM2Instruction instruction, boolean isVoid, TreeItem receiver, FullMultinameTreeItem propertyName, List arguments) { + public CallPropertyTreeItem(AVM2Instruction instruction, boolean isVoid, GraphTargetItem receiver, FullMultinameTreeItem propertyName, List arguments) { super(instruction, PRECEDENCE_PRIMARY); this.receiver = receiver; this.propertyName = propertyName; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/CallStaticTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/CallStaticTreeItem.java index 13dc16557..5386e7e3f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/CallStaticTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/CallStaticTreeItem.java @@ -18,16 +18,18 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; +import com.jpexs.decompiler.flash.helpers.Helper; import java.util.HashMap; import java.util.List; public class CallStaticTreeItem extends TreeItem { - public TreeItem receiver; + public GraphTargetItem receiver; public String methodName; - public List arguments; + public List arguments; - public CallStaticTreeItem(AVM2Instruction instruction, TreeItem receiver, String methodName, List arguments) { + public CallStaticTreeItem(AVM2Instruction instruction, GraphTargetItem receiver, String methodName, List arguments) { super(instruction, PRECEDENCE_PRIMARY); this.receiver = receiver; this.methodName = methodName; @@ -43,6 +45,6 @@ public class CallStaticTreeItem extends TreeItem { } args = args + arguments.get(a).toString(constants, localRegNames, fullyQualifiedNames); } - return receiver.toString(constants, localRegNames, fullyQualifiedNames) + hilight(".") + methodName + hilight("(") + args + hilight(")"); + return receiver.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)) + hilight(".") + methodName + hilight("(") + args + hilight(")"); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/CallSuperTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/CallSuperTreeItem.java index e0c4ff652..133145ea0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/CallSuperTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/CallSuperTreeItem.java @@ -18,18 +18,19 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import com.jpexs.decompiler.flash.helpers.Highlighting; import java.util.HashMap; import java.util.List; public class CallSuperTreeItem extends TreeItem { - public TreeItem receiver; + public GraphTargetItem receiver; public FullMultinameTreeItem multiname; - public List arguments; + public List arguments; public boolean isVoid; - public CallSuperTreeItem(AVM2Instruction instruction, boolean isVoid, TreeItem receiver, FullMultinameTreeItem multiname, List arguments) { + public CallSuperTreeItem(AVM2Instruction instruction, boolean isVoid, GraphTargetItem receiver, FullMultinameTreeItem multiname, List arguments) { super(instruction, PRECEDENCE_PRIMARY); this.receiver = receiver; this.multiname = multiname; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/CallTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/CallTreeItem.java index 11ce5a67a..33bb2c9f6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/CallTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/CallTreeItem.java @@ -18,16 +18,17 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class CallTreeItem extends TreeItem { - public TreeItem receiver; - public TreeItem function; - public List arguments; + public GraphTargetItem receiver; + public GraphTargetItem function; + public List arguments; - public CallTreeItem(AVM2Instruction instruction, TreeItem receiver, TreeItem function, List arguments) { + public CallTreeItem(AVM2Instruction instruction, GraphTargetItem receiver, GraphTargetItem function, List arguments) { super(instruction, PRECEDENCE_PRIMARY); this.receiver = receiver; this.function = function; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/CoerceTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/CoerceTreeItem.java index d0f49cb83..2d81b1ca1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/CoerceTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/CoerceTreeItem.java @@ -24,10 +24,10 @@ import java.util.List; public class CoerceTreeItem extends TreeItem { - public TreeItem value; + public GraphTargetItem value; public String type; - public CoerceTreeItem(AVM2Instruction instruction, TreeItem value, String type) { + public CoerceTreeItem(AVM2Instruction instruction, GraphTargetItem value, String type) { super(instruction, NOPRECEDENCE); this.value = value; this.type = type; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/ConstructPropTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/ConstructPropTreeItem.java index 7264456f2..016eba28a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/ConstructPropTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/ConstructPropTreeItem.java @@ -18,16 +18,17 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class ConstructPropTreeItem extends TreeItem { - public TreeItem object; + public GraphTargetItem object; public FullMultinameTreeItem propertyName; - public List args; + public List args; - public ConstructPropTreeItem(AVM2Instruction instruction, TreeItem object, FullMultinameTreeItem propertyName, List args) { + public ConstructPropTreeItem(AVM2Instruction instruction, GraphTargetItem object, FullMultinameTreeItem propertyName, List args) { super(instruction, PRECEDENCE_PRIMARY); this.object = object; this.propertyName = propertyName; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/ConstructSuperTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/ConstructSuperTreeItem.java index 63dc7b7b6..b91fc3dbd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/ConstructSuperTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/ConstructSuperTreeItem.java @@ -18,16 +18,17 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import com.jpexs.decompiler.flash.helpers.Highlighting; import java.util.HashMap; import java.util.List; public class ConstructSuperTreeItem extends TreeItem { - public TreeItem object; - public List args; + public GraphTargetItem object; + public List args; - public ConstructSuperTreeItem(AVM2Instruction instruction, TreeItem object, List args) { + public ConstructSuperTreeItem(AVM2Instruction instruction, GraphTargetItem object, List args) { super(instruction, PRECEDENCE_PRIMARY); this.object = object; this.args = args; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/ConstructTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/ConstructTreeItem.java index 76fe708a3..a9068f69f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/ConstructTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/ConstructTreeItem.java @@ -18,15 +18,16 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class ConstructTreeItem extends TreeItem { - public TreeItem object; - public List args; + public GraphTargetItem object; + public List args; - public ConstructTreeItem(AVM2Instruction instruction, TreeItem object, List args) { + public ConstructTreeItem(AVM2Instruction instruction, GraphTargetItem object, List args) { super(instruction, PRECEDENCE_PRIMARY); this.object = object; this.args = args; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/ConvertTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/ConvertTreeItem.java index 1d7d95da8..c99bc9d26 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/ConvertTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/ConvertTreeItem.java @@ -24,10 +24,10 @@ import java.util.List; public class ConvertTreeItem extends TreeItem { - public TreeItem value; + public GraphTargetItem value; public String type; - public ConvertTreeItem(AVM2Instruction instruction, TreeItem value, String type) { + public ConvertTreeItem(AVM2Instruction instruction, GraphTargetItem value, String type) { super(instruction, NOPRECEDENCE); this.value = value; this.type = type; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/DecrementTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/DecrementTreeItem.java index 56c1ae061..1e6957ded 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/DecrementTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/DecrementTreeItem.java @@ -18,14 +18,15 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class DecrementTreeItem extends TreeItem { - public TreeItem object; + public GraphTargetItem object; - public DecrementTreeItem(AVM2Instruction instruction, TreeItem object) { + public DecrementTreeItem(AVM2Instruction instruction, GraphTargetItem object) { super(instruction, PRECEDENCE_ADDITIVE); this.object = object; } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/FullMultinameTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/FullMultinameTreeItem.java index 165b8a7a9..bca5b2660 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/FullMultinameTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/FullMultinameTreeItem.java @@ -26,10 +26,10 @@ import java.util.List; public class FullMultinameTreeItem extends TreeItem { public int multinameIndex; - public TreeItem name; - public TreeItem namespace; + public GraphTargetItem name; + public GraphTargetItem namespace; - public FullMultinameTreeItem(AVM2Instruction instruction, int multinameIndex, TreeItem name) { + public FullMultinameTreeItem(AVM2Instruction instruction, int multinameIndex, GraphTargetItem name) { super(instruction, PRECEDENCE_PRIMARY); this.multinameIndex = multinameIndex; this.name = name; @@ -43,7 +43,7 @@ public class FullMultinameTreeItem extends TreeItem { this.namespace = null; } - public FullMultinameTreeItem(AVM2Instruction instruction, int multinameIndex, TreeItem name, TreeItem namespace) { + public FullMultinameTreeItem(AVM2Instruction instruction, int multinameIndex, GraphTargetItem name, GraphTargetItem namespace) { super(instruction, PRECEDENCE_PRIMARY); this.multinameIndex = multinameIndex; this.name = name; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/GetDescendantsTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/GetDescendantsTreeItem.java index 8734fe5e9..227b3a7da 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/GetDescendantsTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/GetDescendantsTreeItem.java @@ -18,15 +18,16 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class GetDescendantsTreeItem extends TreeItem { - public TreeItem object; + public GraphTargetItem object; public FullMultinameTreeItem multiname; - public GetDescendantsTreeItem(AVM2Instruction instruction, TreeItem object, FullMultinameTreeItem multiname) { + public GetDescendantsTreeItem(AVM2Instruction instruction, GraphTargetItem object, FullMultinameTreeItem multiname) { super(instruction, PRECEDENCE_PRIMARY); this.object = object; this.multiname = multiname; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/GetPropertyTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/GetPropertyTreeItem.java index 7cc9b8d48..824004ba4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/GetPropertyTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/GetPropertyTreeItem.java @@ -18,15 +18,16 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class GetPropertyTreeItem extends TreeItem { - public TreeItem object; + public GraphTargetItem object; public FullMultinameTreeItem propertyName; - public GetPropertyTreeItem(AVM2Instruction instruction, TreeItem object, FullMultinameTreeItem propertyName) { + public GetPropertyTreeItem(AVM2Instruction instruction, GraphTargetItem object, FullMultinameTreeItem propertyName) { super(instruction, PRECEDENCE_PRIMARY); this.object = object; this.propertyName = propertyName; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/GetSlotTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/GetSlotTreeItem.java index dd63e4ef0..53748ea17 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/GetSlotTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/GetSlotTreeItem.java @@ -19,15 +19,16 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.types.Multiname; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class GetSlotTreeItem extends TreeItem { public Multiname slotName; - public TreeItem scope; + public GraphTargetItem scope; - public GetSlotTreeItem(AVM2Instruction instruction, TreeItem scope, Multiname slotName) { + public GetSlotTreeItem(AVM2Instruction instruction, GraphTargetItem scope, Multiname slotName) { super(instruction, PRECEDENCE_PRIMARY); this.slotName = slotName; this.scope = scope; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/GetSuperTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/GetSuperTreeItem.java index 089fbda5e..7af00d9db 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/GetSuperTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/GetSuperTreeItem.java @@ -18,16 +18,17 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import com.jpexs.decompiler.flash.helpers.Highlighting; import java.util.HashMap; import java.util.List; public class GetSuperTreeItem extends TreeItem { - public TreeItem object; + public GraphTargetItem object; public FullMultinameTreeItem propertyName; - public GetSuperTreeItem(AVM2Instruction instruction, TreeItem object, FullMultinameTreeItem propertyName) { + public GetSuperTreeItem(AVM2Instruction instruction, GraphTargetItem object, FullMultinameTreeItem propertyName) { super(instruction, PRECEDENCE_PRIMARY); this.object = object; this.propertyName = propertyName; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/InTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/InTreeItem.java index 163559a13..7b5df5d6a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/InTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/InTreeItem.java @@ -18,15 +18,16 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class InTreeItem extends TreeItem { - public TreeItem object; - public TreeItem collection; + public GraphTargetItem object; + public GraphTargetItem collection; - public InTreeItem(AVM2Instruction instruction, TreeItem object, TreeItem collection) { + public InTreeItem(AVM2Instruction instruction, GraphTargetItem object, GraphTargetItem collection) { super(instruction, NOPRECEDENCE); this.object = object; this.collection = collection; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/IncrementTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/IncrementTreeItem.java index a651e5989..33aa293c6 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/IncrementTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/IncrementTreeItem.java @@ -18,14 +18,15 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class IncrementTreeItem extends TreeItem { - public TreeItem object; + public GraphTargetItem object; - public IncrementTreeItem(AVM2Instruction instruction, TreeItem object) { + public IncrementTreeItem(AVM2Instruction instruction, GraphTargetItem object) { super(instruction, PRECEDENCE_ADDITIVE); this.object = object; } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/InitPropertyTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/InitPropertyTreeItem.java index f6f831b9f..c5051ce4e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/InitPropertyTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/InitPropertyTreeItem.java @@ -19,16 +19,17 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.treemodel.clauses.AssignmentTreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class InitPropertyTreeItem extends TreeItem implements SetTypeTreeItem, AssignmentTreeItem { - public TreeItem object; + public GraphTargetItem object; public FullMultinameTreeItem propertyName; - public TreeItem value; + public GraphTargetItem value; - public InitPropertyTreeItem(AVM2Instruction instruction, TreeItem object, FullMultinameTreeItem propertyName, TreeItem value) { + public InitPropertyTreeItem(AVM2Instruction instruction, GraphTargetItem object, FullMultinameTreeItem propertyName, GraphTargetItem value) { super(instruction, PRECEDENCE_ASSIGMENT); this.object = object; this.propertyName = propertyName; @@ -40,11 +41,11 @@ public class InitPropertyTreeItem extends TreeItem implements SetTypeTreeItem, A return formatProperty(constants, object, propertyName, localRegNames, fullyQualifiedNames) + hilight("=") + value.toString(constants, localRegNames, fullyQualifiedNames); } - public TreeItem getObject() { + public GraphTargetItem getObject() { return new GetPropertyTreeItem(instruction, object, propertyName); } - public TreeItem getValue() { + public GraphTargetItem getValue() { return value; } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/NameValuePair.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/NameValuePair.java index 802d38d51..d80228e10 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/NameValuePair.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/NameValuePair.java @@ -17,16 +17,17 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class NameValuePair extends TreeItem { - public TreeItem name; - public TreeItem value; + public GraphTargetItem name; + public GraphTargetItem value; - public NameValuePair(TreeItem name, TreeItem value) { - super(name.instruction, NOPRECEDENCE); + public NameValuePair(GraphTargetItem name, GraphTargetItem value) { + super(name.src, NOPRECEDENCE); this.name = name; this.value = value; } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/NewActivationTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/NewActivationTreeItem.java index 637f07ecb..949d5606f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/NewActivationTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/NewActivationTreeItem.java @@ -18,11 +18,14 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class NewActivationTreeItem extends TreeItem { + public HashMap slots = new HashMap(); + public NewActivationTreeItem(AVM2Instruction instruction) { super(instruction, NOPRECEDENCE); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/NewArrayTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/NewArrayTreeItem.java index 8cae3393d..e05740b61 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/NewArrayTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/NewArrayTreeItem.java @@ -18,14 +18,15 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class NewArrayTreeItem extends TreeItem { - public List values; + public List values; - public NewArrayTreeItem(AVM2Instruction instruction, List values) { + public NewArrayTreeItem(AVM2Instruction instruction, List values) { super(instruction, PRECEDENCE_PRIMARY); this.values = values; } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/ReturnValueTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/ReturnValueTreeItem.java index 7845db49e..3ab2d2734 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/ReturnValueTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/ReturnValueTreeItem.java @@ -18,14 +18,15 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class ReturnValueTreeItem extends TreeItem { - public TreeItem value; + public GraphTargetItem value; - public ReturnValueTreeItem(AVM2Instruction instruction, TreeItem value) { + public ReturnValueTreeItem(AVM2Instruction instruction, GraphTargetItem value) { super(instruction, NOPRECEDENCE); this.value = value; } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/SetGlobalSlotTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/SetGlobalSlotTreeItem.java index ff8eb2203..b258b28a8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/SetGlobalSlotTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/SetGlobalSlotTreeItem.java @@ -18,15 +18,16 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class SetGlobalSlotTreeItem extends TreeItem { public int slotId; - public TreeItem value; + public GraphTargetItem value; - public SetGlobalSlotTreeItem(AVM2Instruction instruction, int slotId, TreeItem value) { + public SetGlobalSlotTreeItem(AVM2Instruction instruction, int slotId, GraphTargetItem value) { super(instruction, PRECEDENCE_ASSIGMENT); this.slotId = slotId; this.value = value; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/SetLocalTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/SetLocalTreeItem.java index 8d1edcf03..2187128c5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/SetLocalTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/SetLocalTreeItem.java @@ -19,15 +19,16 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.treemodel.clauses.AssignmentTreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class SetLocalTreeItem extends TreeItem implements SetTypeTreeItem, AssignmentTreeItem { public int regIndex; - public TreeItem value; + public GraphTargetItem value; - public SetLocalTreeItem(AVM2Instruction instruction, int regIndex, TreeItem value) { + public SetLocalTreeItem(AVM2Instruction instruction, int regIndex, GraphTargetItem value) { super(instruction, PRECEDENCE_ASSIGMENT); this.regIndex = regIndex; this.value = value; @@ -38,11 +39,11 @@ public class SetLocalTreeItem extends TreeItem implements SetTypeTreeItem, Assig return hilight(localRegName(localRegNames, regIndex) + "=") + value.toString(constants, localRegNames, fullyQualifiedNames); } - public TreeItem getObject() { + public GraphTargetItem getObject() { return new LocalRegTreeItem(instruction, regIndex, null); } - public TreeItem getValue() { + public GraphTargetItem getValue() { return value; } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/SetPropertyTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/SetPropertyTreeItem.java index ada9ecf9e..8294dbed9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/SetPropertyTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/SetPropertyTreeItem.java @@ -19,16 +19,17 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.treemodel.clauses.AssignmentTreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class SetPropertyTreeItem extends TreeItem implements SetTypeTreeItem, AssignmentTreeItem { - public TreeItem object; + public GraphTargetItem object; public FullMultinameTreeItem propertyName; - public TreeItem value; + public GraphTargetItem value; - public SetPropertyTreeItem(AVM2Instruction instruction, TreeItem object, FullMultinameTreeItem propertyName, TreeItem value) { + public SetPropertyTreeItem(AVM2Instruction instruction, GraphTargetItem object, FullMultinameTreeItem propertyName, GraphTargetItem value) { super(instruction, PRECEDENCE_ASSIGMENT); this.object = object; this.propertyName = propertyName; @@ -40,11 +41,11 @@ public class SetPropertyTreeItem extends TreeItem implements SetTypeTreeItem, As return formatProperty(constants, object, propertyName, localRegNames, fullyQualifiedNames) + hilight("=") + value.toString(constants, localRegNames, fullyQualifiedNames); } - public TreeItem getObject() { + public GraphTargetItem getObject() { return new GetPropertyTreeItem(instruction, object, propertyName); } - public TreeItem getValue() { + public GraphTargetItem getValue() { return value; } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/SetSlotTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/SetSlotTreeItem.java index e74a77300..add353608 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/SetSlotTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/SetSlotTreeItem.java @@ -20,16 +20,17 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.treemodel.clauses.AssignmentTreeItem; import com.jpexs.decompiler.flash.abc.types.Multiname; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class SetSlotTreeItem extends TreeItem implements SetTypeTreeItem, AssignmentTreeItem { public Multiname slotName; - public TreeItem value; - public TreeItem scope; + public GraphTargetItem value; + public GraphTargetItem scope; - public SetSlotTreeItem(AVM2Instruction instruction, TreeItem scope, Multiname slotName, TreeItem value) { + public SetSlotTreeItem(AVM2Instruction instruction, GraphTargetItem scope, Multiname slotName, GraphTargetItem value) { super(instruction, PRECEDENCE_ASSIGMENT); this.slotName = slotName; this.value = value; @@ -62,11 +63,11 @@ public class SetSlotTreeItem extends TreeItem implements SetTypeTreeItem, Assign return ret + hilight(slotName.getName(constants, fullyQualifiedNames)); } - public TreeItem getObject() { + public GraphTargetItem getObject() { return new GetSlotTreeItem(instruction, scope, slotName); } - public TreeItem getValue() { + public GraphTargetItem getValue() { return value; } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/SetSuperTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/SetSuperTreeItem.java index d97cff22b..e562e82db 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/SetSuperTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/SetSuperTreeItem.java @@ -18,17 +18,18 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import com.jpexs.decompiler.flash.helpers.Highlighting; import java.util.HashMap; import java.util.List; public class SetSuperTreeItem extends TreeItem { - public TreeItem value; - public TreeItem object; + public GraphTargetItem value; + public GraphTargetItem object; public FullMultinameTreeItem propertyName; - public SetSuperTreeItem(AVM2Instruction instruction, TreeItem value, TreeItem object, FullMultinameTreeItem propertyName) { + public SetSuperTreeItem(AVM2Instruction instruction, GraphTargetItem value, GraphTargetItem object, FullMultinameTreeItem propertyName) { super(instruction, PRECEDENCE_ASSIGMENT); this.value = value; this.object = object; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/SetTypeTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/SetTypeTreeItem.java index 87f63d7a8..c9cf072f8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/SetTypeTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/SetTypeTreeItem.java @@ -16,13 +16,15 @@ */ package com.jpexs.decompiler.flash.abc.avm2.treemodel; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; + /** * * @author JPEXS */ public interface SetTypeTreeItem { - public TreeItem getObject(); + public GraphTargetItem getObject(); - public TreeItem getValue(); + public GraphTargetItem getValue(); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/ThrowTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/ThrowTreeItem.java index dccd3004c..ae108e376 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/ThrowTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/ThrowTreeItem.java @@ -18,14 +18,15 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class ThrowTreeItem extends TreeItem { - public TreeItem value; + public GraphTargetItem value; - public ThrowTreeItem(AVM2Instruction instruction, TreeItem value) { + public ThrowTreeItem(AVM2Instruction instruction, GraphTargetItem value) { super(instruction, NOPRECEDENCE); this.value = value; } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/TreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/TreeItem.java index 5a1d15223..d6031ee5f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/TreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/TreeItem.java @@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.graph.GraphSourceItem; import com.jpexs.decompiler.flash.graph.GraphTargetItem; +import com.jpexs.decompiler.flash.helpers.Helper; import com.jpexs.decompiler.flash.helpers.Highlighting; import java.util.HashMap; import java.util.List; @@ -71,8 +72,8 @@ public abstract class TreeItem extends GraphTargetItem { return false; } - protected String formatProperty(ConstantPool constants, TreeItem object, TreeItem propertyName, HashMap localRegNames, List fullyQualifiedNames) { - String obStr = object.toString(constants, localRegNames, fullyQualifiedNames); + protected String formatProperty(ConstantPool constants, GraphTargetItem object, GraphTargetItem propertyName, HashMap localRegNames, List fullyQualifiedNames) { + String obStr = object.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)); if (object.precedence > PRECEDENCE_PRIMARY) { obStr = "(" + obStr + ")"; } @@ -82,16 +83,16 @@ public abstract class TreeItem extends GraphTargetItem { } } if (obStr.equals("")) { - return propertyName.toString(constants, localRegNames, fullyQualifiedNames); + return propertyName.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)); } if (propertyName instanceof FullMultinameTreeItem) { if (((FullMultinameTreeItem) propertyName).isRuntime()) { - return joinProperty(obStr, propertyName.toString(constants, localRegNames, fullyQualifiedNames)); + return joinProperty(obStr, propertyName.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames))); } else { return joinProperty(obStr, ((FullMultinameTreeItem) propertyName).toString(constants, localRegNames, fullyQualifiedNames)); } } else { - return obStr + "[" + propertyName.toString(constants, localRegNames, fullyQualifiedNames) + "]"; + return obStr + "[" + propertyName.toString(Helper.toList(constants, localRegNames, fullyQualifiedNames)) + "]"; } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/WithEndTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/WithEndTreeItem.java index cad827c67..4b5daa7f2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/WithEndTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/WithEndTreeItem.java @@ -18,14 +18,15 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class WithEndTreeItem extends TreeItem { - public TreeItem scope; + public GraphTargetItem scope; - public WithEndTreeItem(AVM2Instruction instruction, TreeItem scope) { + public WithEndTreeItem(AVM2Instruction instruction, GraphTargetItem scope) { super(instruction, PRECEDENCE_PRIMARY); this.scope = scope; } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/WithObjectTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/WithObjectTreeItem.java index c68bb03de..e31c30f4e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/WithObjectTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/WithObjectTreeItem.java @@ -18,14 +18,15 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class WithObjectTreeItem extends TreeItem { - public TreeItem scope; + public GraphTargetItem scope; - public WithObjectTreeItem(AVM2Instruction instruction, TreeItem scope) { + public WithObjectTreeItem(AVM2Instruction instruction, GraphTargetItem scope) { super(instruction, PRECEDENCE_PRIMARY); this.scope = scope; } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/WithTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/WithTreeItem.java index 61768fdbd..f4cdeb248 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/WithTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/WithTreeItem.java @@ -18,32 +18,33 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.ArrayList; import java.util.HashMap; import java.util.List; public class WithTreeItem extends TreeItem { - public TreeItem scope; - public List items; + public GraphTargetItem scope; + public List items; - public WithTreeItem(AVM2Instruction instruction, TreeItem scope, List items) { + public WithTreeItem(AVM2Instruction instruction, GraphTargetItem scope, List items) { super(instruction, NOPRECEDENCE); this.scope = scope; this.items = items; } - public WithTreeItem(AVM2Instruction instruction, TreeItem scope) { + public WithTreeItem(AVM2Instruction instruction, GraphTargetItem scope) { super(instruction, NOPRECEDENCE); this.scope = scope; - this.items = new ArrayList(); + this.items = new ArrayList(); } @Override public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { String ret; ret = hilight("with(") + scope.toString(constants, localRegNames, fullyQualifiedNames) + hilight(")\r\n{\r\n"); - /*for (TreeItem ti : items) { + /*for (GraphTargetItem ti : items) { ret += ti.toString(constants, localRegNames, fullyQualifiedNames) + "\r\n"; } ret += hilight("}");*/ diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/XMLTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/XMLTreeItem.java index 6a27d2879..48a75b199 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/XMLTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/XMLTreeItem.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; @@ -27,9 +28,9 @@ import java.util.List; */ public class XMLTreeItem extends TreeItem { - public List parts; + public List parts; - public XMLTreeItem(AVM2Instruction instruction, List parts) { + public XMLTreeItem(AVM2Instruction instruction, List parts) { super(instruction, NOPRECEDENCE); this.parts = parts; } @@ -37,7 +38,7 @@ public class XMLTreeItem extends TreeItem { @Override public String toString(ConstantPool constants, HashMap localRegNames, List fullyQualifiedNames) { String ret = ""; - for (TreeItem part : parts) { + for (GraphTargetItem part : parts) { if (part instanceof StringTreeItem) { ret += ((StringTreeItem) part).value; } else { diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/clauses/FilterTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/clauses/FilterTreeItem.java index 622bcc6df..8be6de6d7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/clauses/FilterTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/clauses/FilterTreeItem.java @@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.clauses; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; @@ -28,10 +29,10 @@ import java.util.List; */ public class FilterTreeItem extends TreeItem { - public TreeItem expression; - public TreeItem collection; + public GraphTargetItem expression; + public GraphTargetItem collection; - public FilterTreeItem(AVM2Instruction instruction, TreeItem collection, TreeItem expression) { + public FilterTreeItem(AVM2Instruction instruction, GraphTargetItem collection, GraphTargetItem expression) { super(instruction, NOPRECEDENCE); this.expression = expression; this.collection = collection; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/clauses/ForEachInTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/clauses/ForEachInTreeItem.java index 8931db9c0..dc9e72e47 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/clauses/ForEachInTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/clauses/ForEachInTreeItem.java @@ -29,12 +29,19 @@ import java.util.List; public class ForEachInTreeItem extends LoopTreeItem implements Block { public InTreeItem expression; - public List commands; + public List commands; - public ForEachInTreeItem(AVM2Instruction instruction, long loopId, int loopContinue, InTreeItem expression, List commands) { + @Override + public List> getSubs() { + List> ret = new ArrayList>(); + ret.add(commands); + return ret; + } + + public ForEachInTreeItem(AVM2Instruction instruction, long loopId, int loopContinue, InTreeItem expression, List commands) { super(instruction, loopId, loopContinue); if (!commands.isEmpty()) { - TreeItem firstAssign = commands.get(0); + GraphTargetItem firstAssign = commands.get(0); if (firstAssign instanceof SetTypeTreeItem) { if (expression.object instanceof LocalRegTreeItem) { if (((SetTypeTreeItem) firstAssign).getValue().getNotCoerced() instanceof LocalRegTreeItem) { @@ -62,7 +69,7 @@ public class ForEachInTreeItem extends LoopTreeItem implements Block { String ret = ""; ret += "loop" + loopId + ":\r\n"; ret += hilight("for each (") + expression.toString(constants, localRegNames, fullyQualifiedNames) + ")\r\n{\r\n"; - for (TreeItem ti : commands) { + for (GraphTargetItem ti : commands) { ret += ti.toStringSemicoloned(constants, localRegNames, fullyQualifiedNames) + "\r\n"; } ret += hilight("}") + "\r\n"; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/clauses/ForInTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/clauses/ForInTreeItem.java index bb97aec49..ebf7c8920 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/clauses/ForInTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/clauses/ForInTreeItem.java @@ -29,12 +29,19 @@ import java.util.List; public class ForInTreeItem extends LoopTreeItem implements Block { public InTreeItem expression; - public List commands; + public List commands; - public ForInTreeItem(AVM2Instruction instruction, long loopId, int loopContinue, InTreeItem expression, List commands) { + @Override + public List> getSubs() { + List> ret = new ArrayList>(); + ret.add(commands); + return ret; + } + + public ForInTreeItem(AVM2Instruction instruction, long loopId, int loopContinue, InTreeItem expression, List commands) { super(instruction, loopId, loopContinue); if (!commands.isEmpty()) { - TreeItem firstAssign = commands.get(0); + GraphTargetItem firstAssign = commands.get(0); if (firstAssign instanceof SetTypeTreeItem) { if (expression.object instanceof LocalRegTreeItem) { if (((SetTypeTreeItem) firstAssign).getValue().getNotCoerced() instanceof LocalRegTreeItem) { @@ -62,7 +69,7 @@ public class ForInTreeItem extends LoopTreeItem implements Block { String ret = ""; ret += "loop" + loopId + ":\r\n"; ret += hilight("for (") + expression.toString(constants, localRegNames, fullyQualifiedNames) + hilight(")") + "\r\n{\r\n"; - for (TreeItem ti : commands) { + for (GraphTargetItem ti : commands) { ret += ti.toStringSemicoloned(constants, localRegNames, fullyQualifiedNames) + "\r\n"; } ret += hilight("}") + "\r\n"; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/clauses/TernarOpTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/clauses/TernarOpTreeItem.java index 686d4ad09..9f328368d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/clauses/TernarOpTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/clauses/TernarOpTreeItem.java @@ -19,16 +19,17 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.clauses; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class TernarOpTreeItem extends TreeItem { - public TreeItem expression; - public TreeItem onTrue; - public TreeItem onFalse; + public GraphTargetItem expression; + public GraphTargetItem onTrue; + public GraphTargetItem onFalse; - public TernarOpTreeItem(AVM2Instruction instruction, TreeItem expression, TreeItem onTrue, TreeItem onFalse) { + public TernarOpTreeItem(AVM2Instruction instruction, GraphTargetItem expression, GraphTargetItem onTrue, GraphTargetItem onFalse) { super(instruction, PRECEDENCE_CONDITIONAL); this.expression = expression; this.onTrue = onTrue; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/clauses/TryTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/clauses/TryTreeItem.java index ffaab3bba..b0baeb414 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/clauses/TryTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/clauses/TryTreeItem.java @@ -34,6 +34,15 @@ public class TryTreeItem extends TreeItem implements Block { public List> catchCommands; public List finallyCommands; + @Override + public List> getSubs() { + List> ret = new ArrayList>(); + ret.add(tryCommands); + ret.addAll(catchCommands); + ret.add(finallyCommands); + return ret; + } + public TryTreeItem(List tryCommands, List catchExceptions, List> catchCommands, List finallyCommands) { super(null, NOPRECEDENCE); this.tryCommands = tryCommands; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/AddTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/AddTreeItem.java index 464372673..07e8e8f22 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/AddTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/AddTreeItem.java @@ -18,13 +18,13 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class AddTreeItem extends BinaryOpTreeItem { - public AddTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + public AddTreeItem(AVM2Instruction instruction, GraphTargetItem leftSide, GraphTargetItem rightSide) { super(instruction, PRECEDENCE_ADDITIVE, leftSide, rightSide, "+"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/AndTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/AndTreeItem.java index 6c2117bc5..67c8f4e6c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/AndTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/AndTreeItem.java @@ -17,14 +17,14 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.graph.GraphPart; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; public class AndTreeItem extends BinaryOpTreeItem { public GraphPart firstPart; - public AndTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + public AndTreeItem(AVM2Instruction instruction, GraphTargetItem leftSide, GraphTargetItem rightSide) { super(instruction, PRECEDENCE_LOGICALAND, leftSide, rightSide, "&&"); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/AsTypeTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/AsTypeTreeItem.java index 3471d9317..07c764285 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/AsTypeTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/AsTypeTreeItem.java @@ -17,11 +17,11 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; public class AsTypeTreeItem extends BinaryOpTreeItem { - public AsTypeTreeItem(AVM2Instruction instruction, TreeItem value, TreeItem type) { + public AsTypeTreeItem(AVM2Instruction instruction, GraphTargetItem value, GraphTargetItem type) { super(instruction, PRECEDENCE_RELATIONAL, value, type, " as "); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/BinaryOpTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/BinaryOpTreeItem.java index cc5c4f1d4..eb2408931 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/BinaryOpTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/BinaryOpTreeItem.java @@ -19,16 +19,17 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public abstract class BinaryOpTreeItem extends TreeItem { - public TreeItem leftSide; - public TreeItem rightSide; + public GraphTargetItem leftSide; + public GraphTargetItem rightSide; protected String operator = ""; - public BinaryOpTreeItem(AVM2Instruction instruction, int precedence, TreeItem leftSide, TreeItem rightSide, String operator) { + public BinaryOpTreeItem(AVM2Instruction instruction, int precedence, GraphTargetItem leftSide, GraphTargetItem rightSide, String operator) { super(instruction, precedence); this.leftSide = leftSide; this.rightSide = rightSide; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/BitAndTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/BitAndTreeItem.java index 3ca8cf250..1581721d2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/BitAndTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/BitAndTreeItem.java @@ -17,11 +17,11 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; public class BitAndTreeItem extends BinaryOpTreeItem { - public BitAndTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + public BitAndTreeItem(AVM2Instruction instruction, GraphTargetItem leftSide, GraphTargetItem rightSide) { super(instruction, PRECEDENCE_BITWISEAND, leftSide, rightSide, "&"); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/BitNotTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/BitNotTreeItem.java index 171dcb207..4b12b4471 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/BitNotTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/BitNotTreeItem.java @@ -17,11 +17,11 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; public class BitNotTreeItem extends UnaryOpTreeItem { - public BitNotTreeItem(AVM2Instruction instruction, TreeItem value) { + public BitNotTreeItem(AVM2Instruction instruction, GraphTargetItem value) { super(instruction, PRECEDENCE_UNARY, value, "~"); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/BitOrTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/BitOrTreeItem.java index 14f8dcc7f..bf57f4a95 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/BitOrTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/BitOrTreeItem.java @@ -17,11 +17,11 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; public class BitOrTreeItem extends BinaryOpTreeItem { - public BitOrTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + public BitOrTreeItem(AVM2Instruction instruction, GraphTargetItem leftSide, GraphTargetItem rightSide) { super(instruction, PRECEDENCE_BITWISEOR, leftSide, rightSide, "|"); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/BitXorTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/BitXorTreeItem.java index 3c46c3853..4f4609c98 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/BitXorTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/BitXorTreeItem.java @@ -17,11 +17,11 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; public class BitXorTreeItem extends BinaryOpTreeItem { - public BitXorTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + public BitXorTreeItem(AVM2Instruction instruction, GraphTargetItem leftSide, GraphTargetItem rightSide) { super(instruction, PRECEDENCE_BITWISEXOR, leftSide, rightSide, "^"); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/DeletePropertyTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/DeletePropertyTreeItem.java index 5fe31bcb7..df88c7949 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/DeletePropertyTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/DeletePropertyTreeItem.java @@ -20,15 +20,16 @@ import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.treemodel.FullMultinameTreeItem; import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.HashMap; import java.util.List; public class DeletePropertyTreeItem extends TreeItem { - public TreeItem object; + public GraphTargetItem object; public FullMultinameTreeItem propertyName; - public DeletePropertyTreeItem(AVM2Instruction instruction, TreeItem object, FullMultinameTreeItem propertyName) { + public DeletePropertyTreeItem(AVM2Instruction instruction, GraphTargetItem object, FullMultinameTreeItem propertyName) { super(instruction, PRECEDENCE_UNARY); this.object = object; this.propertyName = propertyName; diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/DivideTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/DivideTreeItem.java index fa521c158..17f4ff367 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/DivideTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/DivideTreeItem.java @@ -17,11 +17,11 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; public class DivideTreeItem extends BinaryOpTreeItem { - public DivideTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + public DivideTreeItem(AVM2Instruction instruction, GraphTargetItem leftSide, GraphTargetItem rightSide) { super(instruction, PRECEDENCE_MULTIPLICATIVE, leftSide, rightSide, "/"); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/EqTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/EqTreeItem.java index 2a1524c80..6a8b4a394 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/EqTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/EqTreeItem.java @@ -17,13 +17,12 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import com.jpexs.decompiler.flash.graph.LogicalOpItem; public class EqTreeItem extends BinaryOpTreeItem implements LogicalOpItem { - public EqTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + public EqTreeItem(AVM2Instruction instruction, GraphTargetItem leftSide, GraphTargetItem rightSide) { super(instruction, PRECEDENCE_EQUALITY, leftSide, rightSide, "=="); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/GeTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/GeTreeItem.java index d71968c45..c6f95a2b4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/GeTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/GeTreeItem.java @@ -17,13 +17,12 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import com.jpexs.decompiler.flash.graph.LogicalOpItem; public class GeTreeItem extends BinaryOpTreeItem implements LogicalOpItem { - public GeTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + public GeTreeItem(AVM2Instruction instruction, GraphTargetItem leftSide, GraphTargetItem rightSide) { super(instruction, PRECEDENCE_RELATIONAL, leftSide, rightSide, ">="); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/GtTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/GtTreeItem.java index c36f58242..d5bb298d5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/GtTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/GtTreeItem.java @@ -17,13 +17,12 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import com.jpexs.decompiler.flash.graph.LogicalOpItem; public class GtTreeItem extends BinaryOpTreeItem implements LogicalOpItem { - public GtTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + public GtTreeItem(AVM2Instruction instruction, GraphTargetItem leftSide, GraphTargetItem rightSide) { super(instruction, PRECEDENCE_RELATIONAL, leftSide, rightSide, ">"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/InTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/InTreeItem.java index 13049ff54..f40f1ddd2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/InTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/InTreeItem.java @@ -17,11 +17,11 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; public class InTreeItem extends BinaryOpTreeItem { - public InTreeItem(AVM2Instruction instruction, TreeItem name, TreeItem object) { + public InTreeItem(AVM2Instruction instruction, GraphTargetItem name, GraphTargetItem object) { super(instruction, PRECEDENCE_RELATIONAL, name, object, " in "); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/InstanceOfTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/InstanceOfTreeItem.java index 1b097c127..99a634ee7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/InstanceOfTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/InstanceOfTreeItem.java @@ -17,11 +17,11 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; public class InstanceOfTreeItem extends BinaryOpTreeItem { - public InstanceOfTreeItem(AVM2Instruction instruction, TreeItem value, TreeItem type) { + public InstanceOfTreeItem(AVM2Instruction instruction, GraphTargetItem value, GraphTargetItem type) { super(instruction, PRECEDENCE_RELATIONAL, value, type, " instanceof "); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/IsTypeTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/IsTypeTreeItem.java index fcfb3c9af..799949be5 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/IsTypeTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/IsTypeTreeItem.java @@ -17,11 +17,11 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; public class IsTypeTreeItem extends BinaryOpTreeItem { - public IsTypeTreeItem(AVM2Instruction instruction, TreeItem value, TreeItem type) { + public IsTypeTreeItem(AVM2Instruction instruction, GraphTargetItem value, GraphTargetItem type) { super(instruction, PRECEDENCE_RELATIONAL, value, type, " is "); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/LShiftTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/LShiftTreeItem.java index 096888864..32738cd4a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/LShiftTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/LShiftTreeItem.java @@ -17,11 +17,11 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; public class LShiftTreeItem extends BinaryOpTreeItem { - public LShiftTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + public LShiftTreeItem(AVM2Instruction instruction, GraphTargetItem leftSide, GraphTargetItem rightSide) { super(instruction, PRECEDENCE_BITWISESHIFT, leftSide, rightSide, "<<"); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/LeTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/LeTreeItem.java index 1456ce909..85da0b269 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/LeTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/LeTreeItem.java @@ -17,13 +17,12 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import com.jpexs.decompiler.flash.graph.LogicalOpItem; public class LeTreeItem extends BinaryOpTreeItem implements LogicalOpItem { - public LeTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + public LeTreeItem(AVM2Instruction instruction, GraphTargetItem leftSide, GraphTargetItem rightSide) { super(instruction, PRECEDENCE_RELATIONAL, leftSide, rightSide, "<="); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/LtTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/LtTreeItem.java index 85038f999..873c1f693 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/LtTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/LtTreeItem.java @@ -17,13 +17,12 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import com.jpexs.decompiler.flash.graph.LogicalOpItem; public class LtTreeItem extends BinaryOpTreeItem implements LogicalOpItem { - public LtTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + public LtTreeItem(AVM2Instruction instruction, GraphTargetItem leftSide, GraphTargetItem rightSide) { super(instruction, PRECEDENCE_RELATIONAL, leftSide, rightSide, "<"); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/ModuloTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/ModuloTreeItem.java index 17ba0543e..561087b4c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/ModuloTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/ModuloTreeItem.java @@ -17,11 +17,11 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; public class ModuloTreeItem extends BinaryOpTreeItem { - public ModuloTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + public ModuloTreeItem(AVM2Instruction instruction, GraphTargetItem leftSide, GraphTargetItem rightSide) { super(instruction, PRECEDENCE_MULTIPLICATIVE, leftSide, rightSide, "%"); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/MultiplyTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/MultiplyTreeItem.java index 57798d1ae..24fd6f879 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/MultiplyTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/MultiplyTreeItem.java @@ -17,11 +17,11 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; public class MultiplyTreeItem extends BinaryOpTreeItem { - public MultiplyTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + public MultiplyTreeItem(AVM2Instruction instruction, GraphTargetItem leftSide, GraphTargetItem rightSide) { super(instruction, PRECEDENCE_MULTIPLICATIVE, leftSide, rightSide, "*"); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/NegTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/NegTreeItem.java index 0189518af..952a41f94 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/NegTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/NegTreeItem.java @@ -17,11 +17,11 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; public class NegTreeItem extends UnaryOpTreeItem { - public NegTreeItem(AVM2Instruction instruction, TreeItem value) { + public NegTreeItem(AVM2Instruction instruction, GraphTargetItem value) { super(instruction, PRECEDENCE_UNARY, value, "-"); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/NeqTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/NeqTreeItem.java index 19445ef37..9a3d22a35 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/NeqTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/NeqTreeItem.java @@ -17,13 +17,12 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import com.jpexs.decompiler.flash.graph.LogicalOpItem; public class NeqTreeItem extends BinaryOpTreeItem implements LogicalOpItem { - public NeqTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + public NeqTreeItem(AVM2Instruction instruction, GraphTargetItem leftSide, GraphTargetItem rightSide) { super(instruction, PRECEDENCE_EQUALITY, leftSide, rightSide, "!="); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/OrTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/OrTreeItem.java index e32b6069c..3a3b5ec60 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/OrTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/OrTreeItem.java @@ -17,14 +17,14 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.graph.GraphPart; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; public class OrTreeItem extends BinaryOpTreeItem { public GraphPart firstPart; - public OrTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + public OrTreeItem(AVM2Instruction instruction, GraphTargetItem leftSide, GraphTargetItem rightSide) { super(instruction, PRECEDENCE_LOGICALOR, leftSide, rightSide, "||"); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/RShiftTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/RShiftTreeItem.java index eeb0d78f6..968fea3f9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/RShiftTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/RShiftTreeItem.java @@ -17,11 +17,11 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; public class RShiftTreeItem extends BinaryOpTreeItem { - public RShiftTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + public RShiftTreeItem(AVM2Instruction instruction, GraphTargetItem leftSide, GraphTargetItem rightSide) { super(instruction, PRECEDENCE_BITWISESHIFT, leftSide, rightSide, ">>"); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/StrictEqTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/StrictEqTreeItem.java index 322c611da..5f159678f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/StrictEqTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/StrictEqTreeItem.java @@ -17,13 +17,12 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import com.jpexs.decompiler.flash.graph.LogicalOpItem; public class StrictEqTreeItem extends BinaryOpTreeItem implements LogicalOpItem { - public StrictEqTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + public StrictEqTreeItem(AVM2Instruction instruction, GraphTargetItem leftSide, GraphTargetItem rightSide) { super(instruction, PRECEDENCE_EQUALITY, leftSide, rightSide, "==="); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/StrictNeqTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/StrictNeqTreeItem.java index d84c7f4f9..4910384cd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/StrictNeqTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/StrictNeqTreeItem.java @@ -17,13 +17,12 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import com.jpexs.decompiler.flash.graph.LogicalOpItem; public class StrictNeqTreeItem extends BinaryOpTreeItem implements LogicalOpItem { - public StrictNeqTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + public StrictNeqTreeItem(AVM2Instruction instruction, GraphTargetItem leftSide, GraphTargetItem rightSide) { super(instruction, PRECEDENCE_EQUALITY, leftSide, rightSide, "!=="); } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/SubtractTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/SubtractTreeItem.java index 9d1d8e399..89885c939 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/SubtractTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/SubtractTreeItem.java @@ -17,11 +17,11 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; public class SubtractTreeItem extends BinaryOpTreeItem { - public SubtractTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + public SubtractTreeItem(AVM2Instruction instruction, GraphTargetItem leftSide, GraphTargetItem rightSide) { super(instruction, PRECEDENCE_ADDITIVE, leftSide, rightSide, "-"); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/TypeOfTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/TypeOfTreeItem.java index e030512b3..2eb09f628 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/TypeOfTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/TypeOfTreeItem.java @@ -17,11 +17,11 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; public class TypeOfTreeItem extends UnaryOpTreeItem { - public TypeOfTreeItem(AVM2Instruction instruction, TreeItem value) { + public TypeOfTreeItem(AVM2Instruction instruction, GraphTargetItem value) { super(instruction, PRECEDENCE_UNARY, value, "typeof "); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/URShiftTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/URShiftTreeItem.java index 921bd3d5a..8cf7f4083 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/URShiftTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/avm2/treemodel/operations/URShiftTreeItem.java @@ -17,11 +17,11 @@ package com.jpexs.decompiler.flash.abc.avm2.treemodel.operations; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; public class URShiftTreeItem extends BinaryOpTreeItem { - public URShiftTreeItem(AVM2Instruction instruction, TreeItem leftSide, TreeItem rightSide) { + public URShiftTreeItem(AVM2Instruction instruction, GraphTargetItem leftSide, GraphTargetItem rightSide) { super(instruction, PRECEDENCE_BITWISESHIFT, leftSide, rightSide, ">>>"); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java index 143b27e33..29e79e121 100644 --- a/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java +++ b/trunk/src/com/jpexs/decompiler/flash/abc/types/traits/TraitSlotConst.java @@ -18,10 +18,10 @@ package com.jpexs.decompiler.flash.abc.types.traits; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.avm2.ConstantPool; -import com.jpexs.decompiler.flash.abc.avm2.treemodel.TreeItem; import com.jpexs.decompiler.flash.abc.types.Multiname; import com.jpexs.decompiler.flash.abc.types.Namespace; import com.jpexs.decompiler.flash.abc.types.ValueKind; +import com.jpexs.decompiler.flash.graph.GraphTargetItem; import com.jpexs.decompiler.flash.helpers.Helper; import com.jpexs.decompiler.flash.helpers.Highlighting; import com.jpexs.decompiler.flash.tags.DoABCTag; @@ -34,7 +34,7 @@ public class TraitSlotConst extends Trait { public int type_index; public int value_index; public int value_kind; - public TreeItem assignedValue; + public GraphTargetItem assignedValue; @Override public String toString(ABC abc, List fullyQualifiedNames) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/Action.java b/trunk/src/com/jpexs/decompiler/flash/action/Action.java index 30042daf9..684a88b14 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/Action.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/Action.java @@ -29,6 +29,7 @@ import com.jpexs.decompiler.flash.action.swf7.ActionTry; import com.jpexs.decompiler.flash.action.treemodel.*; import com.jpexs.decompiler.flash.action.treemodel.clauses.*; import com.jpexs.decompiler.flash.action.treemodel.operations.NotTreeItem; +import com.jpexs.decompiler.flash.graph.Graph; import com.jpexs.decompiler.flash.graph.GraphSource; import com.jpexs.decompiler.flash.graph.GraphSourceItem; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -57,14 +58,6 @@ public class Action implements GraphSourceItem { */ public int actionLength; private long address; - /** - * String used to indent line when converting to string - */ - public static final String INDENTOPEN = "INDENTOPEN"; - /** - * String used to unindent line when converting to string - */ - public static final String INDENTCLOSE = "INDENTCLOSE"; /** * Names of ActionScript properties */ @@ -473,112 +466,6 @@ public class Action implements GraphSourceItem { return -1; } - /** - * Converts list of TreeItems to string - * - * @param tree List of TreeItem - * @return String - */ - public static String treeToString(List tree) { - String ret = ""; - List localData = new ArrayList(); - for (GraphTargetItem ti : tree) { - ret += ti.toStringSemicoloned(localData) + "\r\n"; - } - String parts[] = ret.split("\r\n"); - ret = ""; - - - try { - Stack loopStack = new Stack(); - for (int p = 0; p < parts.length; p++) { - String stripped = Highlighting.stripHilights(parts[p]); - if (stripped.endsWith(":") && (!stripped.startsWith("case ")) && (!stripped.equals("default:"))) { - loopStack.add(stripped.substring(0, stripped.length() - 1)); - } - if (stripped.startsWith("break ")) { - if (stripped.equals("break " + loopStack.peek().replace("switch", "") + ";")) { - parts[p] = parts[p].replace(" " + loopStack.peek().replace("switch", ""), ""); - } - } - if (stripped.startsWith("continue ")) { - if (loopStack.size() > 0) { - int pos = loopStack.size() - 1; - String loopname = ""; - do { - loopname = loopStack.get(pos); - pos--; - } while ((pos >= 0) && (loopname.startsWith("loopswitch"))); - if (stripped.equals("continue " + loopname + ";")) { - parts[p] = parts[p].replace(" " + loopname, ""); - } - } - } - if (stripped.startsWith(":")) { - loopStack.pop(); - } - } - } catch (Exception ex) { - } - - int level = 0; - for (int p = 0; p < parts.length; p++) { - String strippedP = Highlighting.stripHilights(parts[p]).trim(); - if (strippedP.endsWith(":") && (!strippedP.startsWith("case ")) && (!strippedP.equals("default:"))) { - String loopname = strippedP.substring(0, strippedP.length() - 1); - boolean dorefer = false; - for (int q = p + 1; q < parts.length; q++) { - String strippedQ = Highlighting.stripHilights(parts[q]).trim(); - if (strippedQ.equals("break " + loopname + ";")) { - dorefer = true; - break; - } - if (strippedQ.equals("continue " + loopname + ";")) { - dorefer = true; - break; - } - if (strippedQ.equals(":" + loopname)) { - break; - } - } - if (!dorefer) { - continue; - } - } - if (strippedP.startsWith(":")) { - continue; - } - if (Highlighting.stripHilights(parts[p]).equals(INDENTOPEN)) { - level++; - continue; - } - if (Highlighting.stripHilights(parts[p]).equals(INDENTCLOSE)) { - level--; - continue; - } - if (Highlighting.stripHilights(parts[p]).equals("}")) { - level--; - } - if (Highlighting.stripHilights(parts[p]).equals("};")) { - level--; - } - ret += tabString(level) + parts[p] + "\r\n"; - if (Highlighting.stripHilights(parts[p]).equals("{")) { - level++; - } - } - return ret; - } - private static final String INDENT_STRING = " "; - - private static String tabString(int len) { - String ret = ""; - for (int i = 0; i < len; i++) { - ret += INDENT_STRING; - } - return ret; - } - /** * Converts list of actions to ActionScript source code * @@ -592,7 +479,7 @@ public class Action implements GraphSourceItem { List tree = actionsToTree(new HashMap(), actions, version); - return treeToString(tree); + return Graph.graphToString(tree); } catch (Exception ex) { Logger.getLogger(Action.class.getName()).log(Level.SEVERE, null, ex); return "//Decompilation error :" + ex.getLocalizedMessage(); @@ -914,8 +801,8 @@ public class Action implements GraphSourceItem { public static List checkClass(List output) { List ret = new ArrayList(); - List functions = new ArrayList(); - List staticFunctions = new ArrayList(); + List functions = new ArrayList(); + List staticFunctions = new ArrayList(); HashMap vars = new HashMap(); HashMap staticVars = new HashMap(); GraphTargetItem className; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/ActionGraph.java b/trunk/src/com/jpexs/decompiler/flash/action/ActionGraph.java index 7b06acf3a..ce8f94fe4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/ActionGraph.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/ActionGraph.java @@ -57,19 +57,24 @@ public class ActionGraph extends Graph { public static List translateViaGraph(HashMap registerNames, List code, int version) { ActionGraph g = new ActionGraph(code, registerNames, version); - List allParts = new ArrayList(); - for (GraphPart head : g.heads) { - populateParts(head, allParts); - } List localData = new ArrayList(); localData.add(registerNames); - List output = g.printGraph(localData, new Stack(), allParts, null, g.heads.get(0), null, new ArrayList(), new HashMap>()); - return Action.checkClass(output); + return g.translate(localData); } - protected List check(List localData, List allParts, Stack stack, GraphPart part, GraphPart stopPart, List loops, List output, HashMap> forFinalCommands) { + @Override + protected void finalProcess(List list) { + List ret = Action.checkClass(list); + if (ret != list) { + list.clear(); + list.addAll(ret); + } + } + + @Override + protected List check(List localData, List allParts, Stack stack, GraphPart parent, GraphPart part, GraphPart stopPart, List loops, List output, HashMap> forFinalCommands) { List ret = null; - if (stack.peek() instanceof StrictEqTreeItem) { + if ((part.nextParts.size() == 2) && (stack.peek() instanceof StrictEqTreeItem)) { GraphTargetItem switchedObject = null; if (!output.isEmpty()) { diff --git a/trunk/src/com/jpexs/decompiler/flash/action/treemodel/FunctionTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/action/treemodel/FunctionTreeItem.java index 47362b973..68b3876c8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/treemodel/FunctionTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/treemodel/FunctionTreeItem.java @@ -16,7 +16,7 @@ */ package com.jpexs.decompiler.flash.action.treemodel; -import com.jpexs.decompiler.flash.action.Action; +import com.jpexs.decompiler.flash.graph.Graph; import com.jpexs.decompiler.flash.graph.GraphSourceItem; import com.jpexs.decompiler.flash.graph.GraphTargetItem; import java.util.List; @@ -58,7 +58,7 @@ public class FunctionTreeItem extends TreeItem { } ret += hilight(pname); } - ret += hilight(")") + "\r\n{\r\n" + Action.treeToString(actions) + "}"; + ret += hilight(")") + "\r\n{\r\n" + Graph.graphToString(actions, constants) + "}"; return ret; } @@ -75,6 +75,4 @@ public class FunctionTreeItem extends TreeItem { public boolean needsSemicolon() { return false; } - - } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/treemodel/clauses/ClassTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/action/treemodel/clauses/ClassTreeItem.java index bf2f9d365..cc9276bad 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/treemodel/clauses/ClassTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/treemodel/clauses/ClassTreeItem.java @@ -18,7 +18,6 @@ package com.jpexs.decompiler.flash.action.treemodel.clauses; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.treemodel.ConstantPool; -import com.jpexs.decompiler.flash.action.treemodel.FunctionTreeItem; import com.jpexs.decompiler.flash.action.treemodel.TreeItem; import com.jpexs.decompiler.flash.graph.Block; import com.jpexs.decompiler.flash.graph.ContinueItem; @@ -30,15 +29,23 @@ import java.util.List; public class ClassTreeItem extends TreeItem implements Block { - public List functions; - public List staticFunctions; + public List functions; + public List staticFunctions; public GraphTargetItem extendsOp; public List implementsOp; public GraphTargetItem className; public HashMap vars; public HashMap staticVars; - public ClassTreeItem(GraphTargetItem className, GraphTargetItem extendsOp, List implementsOp, List functions, HashMap vars, List staticFunctions, HashMap staticVars) { + @Override + public List> getSubs() { + List> ret = new ArrayList>(); + ret.add(functions); + ret.add(staticFunctions); + return ret; + } + + public ClassTreeItem(GraphTargetItem className, GraphTargetItem extendsOp, List implementsOp, List functions, HashMap vars, List staticFunctions, HashMap staticVars) { super(null, NOPRECEDENCE); this.className = className; this.functions = functions; @@ -68,10 +75,10 @@ public class ClassTreeItem extends TreeItem implements Block { } } ret += "\r\n{\r\n"; - for (FunctionTreeItem f : functions) { + for (GraphTargetItem f : functions) { ret += f.toString(constants) + "\r\n"; } - for (FunctionTreeItem f : staticFunctions) { + for (GraphTargetItem f : staticFunctions) { ret += "static " + f.toString(constants) + "\r\n"; } for (GraphTargetItem v : vars.keySet()) { @@ -94,6 +101,4 @@ public class ClassTreeItem extends TreeItem implements Block { public boolean needsSemicolon() { return false; } - - } diff --git a/trunk/src/com/jpexs/decompiler/flash/action/treemodel/clauses/ForEachTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/action/treemodel/clauses/ForEachTreeItem.java index 2f46a5d8a..3a275ef0e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/treemodel/clauses/ForEachTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/treemodel/clauses/ForEachTreeItem.java @@ -19,7 +19,6 @@ package com.jpexs.decompiler.flash.action.treemodel.clauses; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.treemodel.ConstantPool; import com.jpexs.decompiler.flash.action.treemodel.EachTreeItem; -import com.jpexs.decompiler.flash.action.treemodel.TreeItem; import com.jpexs.decompiler.flash.graph.Block; import com.jpexs.decompiler.flash.graph.ContinueItem; import com.jpexs.decompiler.flash.graph.GraphTargetItem; @@ -30,9 +29,16 @@ import java.util.List; public class ForEachTreeItem extends LoopTreeItem implements Block { public EachTreeItem expression; - public List commands; + public List commands; - public ForEachTreeItem(Action instruction, Loop loop, EachTreeItem expression, List commands) { + @Override + public List> getSubs() { + List> ret = new ArrayList>(); + ret.add(commands); + return ret; + } + + public ForEachTreeItem(Action instruction, Loop loop, EachTreeItem expression, List commands) { super(instruction, loop); this.expression = expression; this.commands = commands; @@ -43,7 +49,7 @@ public class ForEachTreeItem extends LoopTreeItem implements Block { String ret = ""; ret += "loop" + loop.id + ":\r\n"; ret += hilight("for ") + expression.toString(constants) + "\r\n{\r\n"; - for (TreeItem ti : commands) { + for (GraphTargetItem ti : commands) { ret += ti.toString(constants) + "\r\n"; } ret += hilight("}") + "\r\n"; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/treemodel/clauses/ForInTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/action/treemodel/clauses/ForInTreeItem.java index 061efb282..e557402ce 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/treemodel/clauses/ForInTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/treemodel/clauses/ForInTreeItem.java @@ -30,9 +30,16 @@ public class ForInTreeItem extends LoopTreeItem implements Block { public TreeItem variableName; public TreeItem enumVariable; - public List commands; + public List commands; - public ForInTreeItem(Action instruction, Loop loop, TreeItem variableName, TreeItem enumVariable, List commands) { + @Override + public List> getSubs() { + List> ret = new ArrayList>(); + ret.add(commands); + return ret; + } + + public ForInTreeItem(Action instruction, Loop loop, TreeItem variableName, TreeItem enumVariable, List commands) { super(instruction, loop); this.variableName = variableName; this.enumVariable = enumVariable; @@ -44,7 +51,7 @@ public class ForInTreeItem extends LoopTreeItem implements Block { String ret = ""; ret += "loop" + loop.id + ":\r\n"; ret += hilight("for(") + stripQuotes(variableName) + " in " + enumVariable.toString(constants) + ")\r\n{\r\n"; - for (TreeItem ti : commands) { + for (GraphTargetItem ti : commands) { ret += ti.toString(constants) + "\r\n"; } ret += hilight("}") + "\r\n"; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/treemodel/clauses/InterfaceTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/action/treemodel/clauses/InterfaceTreeItem.java index 1ba9e8ddc..f16c32ba7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/treemodel/clauses/InterfaceTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/treemodel/clauses/InterfaceTreeItem.java @@ -55,7 +55,7 @@ public class InterfaceTreeItem extends TreeItem { ret += "\r\n{\r\n}\r\n"; return ret; } - + @Override public boolean needsSemicolon() { return false; diff --git a/trunk/src/com/jpexs/decompiler/flash/action/treemodel/clauses/TryTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/action/treemodel/clauses/TryTreeItem.java index 84b2ed9d0..474f76ffd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/treemodel/clauses/TryTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/treemodel/clauses/TryTreeItem.java @@ -31,6 +31,15 @@ public class TryTreeItem extends TreeItem implements Block { public List> catchCommands; public List finallyCommands; + @Override + public List> getSubs() { + List> ret = new ArrayList>(); + ret.add(tryCommands); + ret.addAll(catchCommands); + ret.add(finallyCommands); + return ret; + } + public TryTreeItem(List tryCommands, List catchExceptions, List> catchCommands, List finallyCommands) { super(null, NOPRECEDENCE); this.tryCommands = tryCommands; diff --git a/trunk/src/com/jpexs/decompiler/flash/graph/Block.java b/trunk/src/com/jpexs/decompiler/flash/graph/Block.java index 072300663..021694848 100644 --- a/trunk/src/com/jpexs/decompiler/flash/graph/Block.java +++ b/trunk/src/com/jpexs/decompiler/flash/graph/Block.java @@ -21,4 +21,6 @@ import java.util.List; public interface Block { public List getContinues(); + + public List> getSubs(); } diff --git a/trunk/src/com/jpexs/decompiler/flash/graph/DoWhileItem.java b/trunk/src/com/jpexs/decompiler/flash/graph/DoWhileItem.java index 64c14d09f..398203bf9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/graph/DoWhileItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/graph/DoWhileItem.java @@ -29,6 +29,12 @@ public class DoWhileItem extends LoopItem implements Block { return false; } + public List> getSubs() { + List> ret = new ArrayList>(); + ret.add(commands); + return ret; + } + public DoWhileItem(GraphSourceItem src, Loop loop, List commands, GraphTargetItem expression) { super(src, loop); this.expression = expression; diff --git a/trunk/src/com/jpexs/decompiler/flash/graph/ForTreeItem.java b/trunk/src/com/jpexs/decompiler/flash/graph/ForTreeItem.java index 03a372027..fdd4c3d2a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/graph/ForTreeItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/graph/ForTreeItem.java @@ -26,6 +26,14 @@ public class ForTreeItem extends LoopItem implements Block { public List finalCommands; public List commands; + public List> getSubs() { + List> ret = new ArrayList>(); + ret.add(firstCommands); + ret.add(commands); + ret.add(finalCommands); + return ret; + } + public ForTreeItem(GraphSourceItem src, Loop loop, List firstCommands, GraphTargetItem expression, List finalCommands, List commands) { super(src, loop); this.firstCommands = firstCommands; diff --git a/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java b/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java index 68178347a..563828b24 100644 --- a/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java +++ b/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.graph; +import com.jpexs.decompiler.flash.helpers.Highlighting; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -281,14 +282,35 @@ public class Graph { public static List translateViaGraph(List localData, String path, GraphSource code, List alternateEntries) { Graph g = new Graph(code, alternateEntries); - List allParts = new ArrayList(); - for (GraphPart head : g.heads) { - populateParts(head, allParts); - } - return g.printGraph(localData, new Stack(), allParts, null, g.heads.get(0), null, new ArrayList(), new HashMap>()); + return g.translate(localData); } - private List getLoopsContinues(List loops) { + public List translate(List localData) { + List allParts = new ArrayList(); + for (GraphPart head : heads) { + populateParts(head, allParts); + } + List ret = printGraph(localData, new Stack(), allParts, null, heads.get(0), null, new ArrayList(), new HashMap>()); + finalProcessAll(ret); + return ret; + } + + private void finalProcessAll(List list) { + finalProcess(list); + for (GraphTargetItem item : list) { + if (item instanceof Block) { + List> subs = ((Block) item).getSubs(); + for (List sub : subs) { + finalProcessAll(sub); + } + } + } + } + + protected void finalProcess(List list) { + } + + protected List getLoopsContinues(List loops) { List ret = new ArrayList(); for (Loop l : loops) { if (l.loopContinue != null) { @@ -323,10 +345,14 @@ public class Graph { } } - protected List check(List localData, List allParts, Stack stack, GraphPart part, GraphPart stopPart, List loops, List output, HashMap> forFinalCommands) { + protected List check(List localData, List allParts, Stack stack, GraphPart parent, GraphPart part, GraphPart stopPart, List loops, List output, HashMap> forFinalCommands) { return null; } + protected GraphPart checkPart(List localData, GraphPart part) { + return part; + } + protected GraphTargetItem translatePartGetStack(List localData, GraphPart part, Stack stack) { stack = (Stack) stack.clone(); translatePart(localData, part, stack); @@ -366,6 +392,14 @@ public class Graph { if (part == stopPart) { return ret; } + if (part == null) { + //return ret; + } + part = checkPart(localData, part); + if (part == null) { + return ret; + } + if (part.ignored) { return ret; } @@ -395,7 +429,7 @@ public class Graph { } if (part.nextParts.size() == 2) { - List retChecked = null; + if ((stack.size() >= 2) && (stack.get(stack.size() - 1) instanceof NotItem) && (((NotItem) (stack.get(stack.size() - 1))).getOriginal() == stack.get(stack.size() - 2))) { ret.addAll(output); @@ -494,9 +528,6 @@ public class Graph { } } - return ret; - } else if ((retChecked = check(localData, allParts, stack, part, stopPart, loops, output, forFinalCommands)) != null) { - ret.addAll(retChecked); return ret; } /*if ((((ins.definition instanceof IfStrictNeIns)) && ((part.nextParts.get(1).getHeight() == 2) && (code.code.get(part.nextParts.get(1).start).definition instanceof PushByteIns) && (code.code.get(part.nextParts.get(1).nextParts.get(0).end).definition instanceof LookupSwitchIns))) || (((ins.definition instanceof IfStrictEqIns)) && ((part.nextParts.get(0).getHeight() == 2) && (code.code.get(part.nextParts.get(0).start).definition instanceof PushByteIns) && (code.code.get(part.nextParts.get(0).nextParts.get(0).end).definition instanceof LookupSwitchIns)))) { @@ -787,6 +818,11 @@ public class Graph { return ret; }*/ + List retChecked = null; + if ((retChecked = check(localData, allParts, stack, parent, part, stopPart, loops, output, forFinalCommands)) != null) { + ret.addAll(retChecked); + return ret; + } List loopContinues = getLoopsContinues(loops); boolean loop = false; boolean reversed = false; @@ -842,9 +878,9 @@ public class Graph { } } if (loop) { - GraphTargetItem expr2=expr; - if(expr2 instanceof NotItem){ - expr2=((NotItem)expr2).getOriginal(); + GraphTargetItem expr2 = expr; + if (expr2 instanceof NotItem) { + expr2 = ((NotItem) expr2).getOriginal(); } if (expr2 instanceof AndItem) { currentLoop.loopContinue = ((AndItem) expr2).firstPart; @@ -955,9 +991,6 @@ public class Graph { List finalCommands = null; GraphPart finalPart = null; GraphTargetItem ti; - if (loopBodyStart != null) { - System.err.println("ji"); //TODO: - } if ((loopBodyStart != null) && ((ti = checkLoop(loopBodyStart, stopPart, loops)) != null)) { loopBody.add(ti); } else { @@ -1037,27 +1070,19 @@ public class Graph { next = null; } if (next != null) { - boolean finallyJump = false; - /*for (int f : finallyJumps) { - if (next.start == f) { - finallyJump = true; - break; - } - }*/ - if (!finallyJump) { - GraphTargetItem ti = checkLoop(next, stopPart, loops); - if (ti != null) { - ret.add(ti); - } else { - if (debugMode) { - System.err.println("NEXT: (inside " + part + ")"); - } - ret.addAll(printGraph(localData, stack, allParts, part, next, stopPart, loops, forFinalCommands)); - if (debugMode) { - System.err.println("/NEXT: (inside " + part + ")"); - } + GraphTargetItem ti = checkLoop(next, stopPart, loops); + if (ti != null) { + ret.add(ti); + } else { + if (debugMode) { + System.err.println("NEXT: (inside " + part + ")"); + } + ret.addAll(printGraph(localData, stack, allParts, part, next, stopPart, loops, forFinalCommands)); + if (debugMode) { + System.err.println("/NEXT: (inside " + part + ")"); } } + } } else { ret.addAll(output); @@ -1209,7 +1234,7 @@ public class Graph { for (int pos : alternateEntries) { GraphPart e1 = new GraphPart(-1, -1); e1.path = "e"; - makeGraph(e1, "e", code, pos, pos, allBlocks, refs, visited); + ret.add(makeGraph(e1, "e", code, pos, pos, allBlocks, refs, visited)); } return ret; } @@ -1299,4 +1324,124 @@ public class Graph { } return ret; } + /** + * String used to indent line when converting to string + */ + public static final String INDENTOPEN = "INDENTOPEN"; + /** + * String used to unindent line when converting to string + */ + public static final String INDENTCLOSE = "INDENTCLOSE"; + private static final String INDENT_STRING = " "; + + private static String tabString(int len) { + String ret = ""; + for (int i = 0; i < len; i++) { + ret += INDENT_STRING; + } + return ret; + } + + /** + * Converts list of TreeItems to string + * + * @param tree List of TreeItem + * @return String + */ + public static String graphToString(List tree, Object... localData) { + StringBuilder ret = new StringBuilder(); + List localDataList = new ArrayList(); + for (Object o : localData) { + localDataList.add(o); + } + for (GraphTargetItem ti : tree) { + ret.append(ti.toStringSemicoloned(localDataList)); + ret.append("\r\n"); + } + String parts[] = ret.toString().split("\r\n"); + ret = new StringBuilder(); + + + try { + Stack loopStack = new Stack(); + for (int p = 0; p < parts.length; p++) { + String stripped = Highlighting.stripHilights(parts[p]); + if (stripped.endsWith(":") && (!stripped.startsWith("case ")) && (!stripped.equals("default:"))) { + loopStack.add(stripped.substring(0, stripped.length() - 1)); + } + if (stripped.startsWith("break ")) { + if (stripped.equals("break " + loopStack.peek().replace("switch", "") + ";")) { + parts[p] = parts[p].replace(" " + loopStack.peek().replace("switch", ""), ""); + } + } + if (stripped.startsWith("continue ")) { + if (loopStack.size() > 0) { + int pos = loopStack.size() - 1; + String loopname = ""; + do { + loopname = loopStack.get(pos); + pos--; + } while ((pos >= 0) && (loopname.startsWith("loopswitch"))); + if (stripped.equals("continue " + loopname + ";")) { + parts[p] = parts[p].replace(" " + loopname, ""); + } + } + } + if (stripped.startsWith(":")) { + loopStack.pop(); + } + } + } catch (Exception ex) { + } + + int level = 0; + for (int p = 0; p < parts.length; p++) { + String strippedP = Highlighting.stripHilights(parts[p]).trim(); + if (strippedP.endsWith(":") && (!strippedP.startsWith("case ")) && (!strippedP.equals("default:"))) { + String loopname = strippedP.substring(0, strippedP.length() - 1); + boolean dorefer = false; + for (int q = p + 1; q < parts.length; q++) { + String strippedQ = Highlighting.stripHilights(parts[q]).trim(); + if (strippedQ.equals("break " + loopname + ";")) { + dorefer = true; + break; + } + if (strippedQ.equals("continue " + loopname + ";")) { + dorefer = true; + break; + } + if (strippedQ.equals(":" + loopname)) { + break; + } + } + if (!dorefer) { + continue; + } + } + if (strippedP.startsWith(":")) { + continue; + } + if (Highlighting.stripHilights(parts[p]).equals(INDENTOPEN)) { + level++; + continue; + } + if (Highlighting.stripHilights(parts[p]).equals(INDENTCLOSE)) { + level--; + continue; + } + if (Highlighting.stripHilights(parts[p]).equals("}")) { + level--; + } + if (Highlighting.stripHilights(parts[p]).equals("};")) { + level--; + } + ret.append(tabString(level)); + ret.append(parts[p]); + ret.append("\r\n"); + if (Highlighting.stripHilights(parts[p]).equals("{")) { + level++; + } + } + return ret.toString(); + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/graph/GraphTargetItem.java b/trunk/src/com/jpexs/decompiler/flash/graph/GraphTargetItem.java index 096da49a6..5f6b26491 100644 --- a/trunk/src/com/jpexs/decompiler/flash/graph/GraphTargetItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/graph/GraphTargetItem.java @@ -56,6 +56,14 @@ public abstract class GraphTargetItem { return toString(localData) + (needsSemicolon() ? ";" : ""); } + public String toStringSemicoloned(Object... localData) { + List localData2 = new ArrayList(); + for (Object o : localData) { + localData2.add(o); + } + return toStringSemicoloned(localData2); + } + public boolean needsSemicolon() { return true; } @@ -67,8 +75,12 @@ public abstract class GraphTargetItem { public abstract String toString(List localData); - public String toString(Object o) { - return toString(Helper.toList(o)); + public String toString(Object... localData) { + List localData2 = new ArrayList(); + for (Object o : localData) { + localData2.add(o); + } + return toString(localData2); } public int getPrecedence() { diff --git a/trunk/src/com/jpexs/decompiler/flash/graph/IfItem.java b/trunk/src/com/jpexs/decompiler/flash/graph/IfItem.java index a527d9b28..086e84ec9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/graph/IfItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/graph/IfItem.java @@ -25,6 +25,14 @@ public class IfItem extends GraphTargetItem implements Block { public List onTrue; public List onFalse; + @Override + public List> getSubs() { + List> ret = new ArrayList>(); + ret.add(onTrue); + ret.add(onFalse); + return ret; + } + public IfItem(GraphSourceItem src, GraphTargetItem expression, List onTrue, List onFalse) { super(src, NOPRECEDENCE); this.expression = expression; diff --git a/trunk/src/com/jpexs/decompiler/flash/graph/SwitchItem.java b/trunk/src/com/jpexs/decompiler/flash/graph/SwitchItem.java index 01a20bfc9..7f9c50fd2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/graph/SwitchItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/graph/SwitchItem.java @@ -16,7 +16,6 @@ */ package com.jpexs.decompiler.flash.graph; -import com.jpexs.decompiler.flash.action.Action; import java.util.ArrayList; import java.util.List; @@ -28,7 +27,14 @@ public class SwitchItem extends LoopItem implements Block { public List defaultCommands; public List valuesMapping; - public SwitchItem(Action instruction, Loop loop, GraphTargetItem switchedObject, List caseValues, List> caseCommands, List defaultCommands, List valuesMapping) { + public List> getSubs() { + List> ret = new ArrayList>(); + ret.addAll(caseCommands); + ret.add(defaultCommands); + return ret; + } + + public SwitchItem(GraphSourceItem instruction, Loop loop, GraphTargetItem switchedObject, List caseValues, List> caseCommands, List defaultCommands, List valuesMapping) { super(instruction, loop); this.switchedObject = switchedObject; this.caseValues = caseValues; @@ -48,20 +54,20 @@ public class SwitchItem extends LoopItem implements Block { ret += "case " + caseValues.get(k).toString(localData) + ":\r\n"; } } - ret += Action.INDENTOPEN + "\r\n"; + ret += Graph.INDENTOPEN + "\r\n"; for (int j = 0; j < caseCommands.get(i).size(); j++) { ret += caseCommands.get(i).get(j).toStringSemicoloned(localData) + "\r\n"; } - ret += Action.INDENTCLOSE + "\r\n"; + ret += Graph.INDENTCLOSE + "\r\n"; } if (defaultCommands != null) { if (defaultCommands.size() > 0) { ret += hilight("default") + ":\r\n"; - ret += Action.INDENTOPEN + "\r\n"; + ret += Graph.INDENTOPEN + "\r\n"; for (int j = 0; j < defaultCommands.size(); j++) { ret += defaultCommands.get(j).toStringSemicoloned(localData) + "\r\n"; } - ret += Action.INDENTCLOSE + "\r\n"; + ret += Graph.INDENTCLOSE + "\r\n"; } } ret += hilight("}") + "\r\n"; diff --git a/trunk/src/com/jpexs/decompiler/flash/graph/WhileItem.java b/trunk/src/com/jpexs/decompiler/flash/graph/WhileItem.java index 2128d43a6..74c1285f2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/graph/WhileItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/graph/WhileItem.java @@ -24,6 +24,13 @@ public class WhileItem extends LoopItem implements Block { public GraphTargetItem expression; public List commands; + @Override + public List> getSubs() { + List> ret = new ArrayList>(); + ret.add(commands); + return ret; + } + public WhileItem(GraphSourceItem src, Loop loop, GraphTargetItem expression, List commands) { super(src, loop); this.expression = expression;