diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewObjectIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewObjectIns.java index edf2d852f..3e8a9db08 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewObjectIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/construction/NewObjectIns.java @@ -39,10 +39,15 @@ public class NewObjectIns extends InstructionDefinition { } @Override - public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { + public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) throws InterruptedException { int argCount = ins.operands[0]; - List args = new ArrayList<>(); + List args = new ArrayList<>(argCount); for (int a = 0; a < argCount; a++) { + if (Thread.currentThread().isInterrupted()) { + // int obfuscated method argCount can be 16M + throw new InterruptedException(); + } + GraphTargetItem value = stack.pop(); GraphTargetItem name = stack.pop(); args.add(0, new NameValuePair(name, value)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AVM2Item.java index 113243933..47ddf1194 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AVM2Item.java @@ -44,6 +44,13 @@ public abstract class AVM2Item extends GraphTargetItem { } } + public AVM2Item(GraphSourceItem instruction, int precedence, GraphTargetItem value) { + super(instruction, precedence, value); + if (instruction instanceof AVM2Instruction) { + this.instruction = (AVM2Instruction) instruction; + } + } + public AVM2Instruction getInstruction() { return instruction; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java index ebc015ead..db2675cb0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemySignExtendAVM2Item.java @@ -39,8 +39,7 @@ public class AlchemySignExtendAVM2Item extends AVM2Item { private final int size; public AlchemySignExtendAVM2Item(GraphSourceItem instruction, GraphTargetItem value, int size) { - super(instruction, PRECEDENCE_PRIMARY); - this.value = value; + super(instruction, PRECEDENCE_PRIMARY, value); this.size = size; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyStoreAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyStoreAVM2Item.java index b7de46ed9..aeb925bbe 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyStoreAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AlchemyStoreAVM2Item.java @@ -45,9 +45,8 @@ public class AlchemyStoreAVM2Item extends AVM2Item { private final GraphTargetItem ofs; public AlchemyStoreAVM2Item(GraphSourceItem instruction, GraphTargetItem value, GraphTargetItem ofs, char type, int size) { - super(instruction, PRECEDENCE_PRIMARY); + super(instruction, PRECEDENCE_PRIMARY, value); this.ofs = ofs; - this.value = value; this.type = type; this.size = size; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/CoerceAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/CoerceAVM2Item.java index 545e27e59..3ce33aadc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/CoerceAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/CoerceAVM2Item.java @@ -50,8 +50,7 @@ public class CoerceAVM2Item extends AVM2Item { this.type = type; }*/ public CoerceAVM2Item(AVM2Instruction instruction, GraphTargetItem value, GraphTargetItem typeObj) { - super(instruction, value.getPrecedence()); - this.value = value; + super(instruction, value.getPrecedence(), value); this.typeObj = typeObj; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/ConvertAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/ConvertAVM2Item.java index c6903ee60..9d0efb1a8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/ConvertAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/ConvertAVM2Item.java @@ -1,16 +1,16 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library. */ @@ -29,8 +29,7 @@ public class ConvertAVM2Item extends AVM2Item { public GraphTargetItem type; public ConvertAVM2Item(AVM2Instruction instruction, GraphTargetItem value, GraphTargetItem type) { - super(instruction, NOPRECEDENCE); - this.value = value; + super(instruction, NOPRECEDENCE, value); this.type = type; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/DecrementAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/DecrementAVM2Item.java index 3fcb658b7..3bdcfd139 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/DecrementAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/DecrementAVM2Item.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; @@ -26,8 +27,7 @@ import java.util.Set; public class DecrementAVM2Item extends AVM2Item { public DecrementAVM2Item(AVM2Instruction instruction, GraphTargetItem object) { - super(instruction, PRECEDENCE_ADDITIVE); - this.value = object; + super(instruction, PRECEDENCE_ADDITIVE, object); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXAttrAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXAttrAVM2Item.java index 329920172..0652c7679 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXAttrAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXAttrAVM2Item.java @@ -1,16 +1,16 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library. */ @@ -35,8 +35,7 @@ import java.util.List; public class EscapeXAttrAVM2Item extends AVM2Item { public EscapeXAttrAVM2Item(AVM2Instruction instruction, GraphTargetItem expression) { - super(instruction, NOPRECEDENCE); - this.value = expression; + super(instruction, NOPRECEDENCE, expression); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXElemAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXElemAVM2Item.java index b1279d26c..932298837 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXElemAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/EscapeXElemAVM2Item.java @@ -35,8 +35,7 @@ import java.util.List; public class EscapeXElemAVM2Item extends AVM2Item { public EscapeXElemAVM2Item(AVM2Instruction instruction, GraphTargetItem expression) { - super(instruction, NOPRECEDENCE); - this.value = expression; + super(instruction, NOPRECEDENCE, expression); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/IncrementAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/IncrementAVM2Item.java index 76e46ff61..771d54b2e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/IncrementAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/IncrementAVM2Item.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; @@ -26,8 +27,7 @@ import java.util.Set; public class IncrementAVM2Item extends AVM2Item { public IncrementAVM2Item(AVM2Instruction instruction, GraphTargetItem object) { - super(instruction, PRECEDENCE_ADDITIVE); - this.value = object; + super(instruction, PRECEDENCE_ADDITIVE, object); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/InitPropertyAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/InitPropertyAVM2Item.java index 8a5ddcfdb..adaf5c31c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/InitPropertyAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/InitPropertyAVM2Item.java @@ -31,10 +31,9 @@ public class InitPropertyAVM2Item extends AVM2Item implements SetTypeAVM2Item, A //public GraphTargetItem value; public InitPropertyAVM2Item(AVM2Instruction instruction, GraphTargetItem object, FullMultinameAVM2Item propertyName, GraphTargetItem value) { - super(instruction, PRECEDENCE_ASSIGMENT); + super(instruction, PRECEDENCE_ASSIGMENT, value); this.object = object; this.propertyName = propertyName; - this.value = value; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NameValuePair.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NameValuePair.java index ef5fbea81..c4b82ca97 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NameValuePair.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/NameValuePair.java @@ -28,9 +28,8 @@ public class NameValuePair extends AVM2Item { //public GraphTargetItem value; public NameValuePair(GraphTargetItem name, GraphTargetItem value) { - super(name.getSrc(), NOPRECEDENCE); + super(name.getSrc(), NOPRECEDENCE, value); this.name = name; - this.value = value; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/ReturnValueAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/ReturnValueAVM2Item.java index cb59eb3b5..a86dcb285 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/ReturnValueAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/ReturnValueAVM2Item.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -32,8 +33,7 @@ public class ReturnValueAVM2Item extends AVM2Item implements ExitItem { //public GraphTargetItem value; public ReturnValueAVM2Item(AVM2Instruction instruction, GraphTargetItem value) { - super(instruction, NOPRECEDENCE); - this.value = value; + super(instruction, NOPRECEDENCE, value); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetGlobalSlotAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetGlobalSlotAVM2Item.java index 172caa23e..e76bd3afd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetGlobalSlotAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetGlobalSlotAVM2Item.java @@ -34,9 +34,8 @@ public class SetGlobalSlotAVM2Item extends AVM2Item { } public SetGlobalSlotAVM2Item(AVM2Instruction instruction, int slotId, GraphTargetItem value) { - super(instruction, PRECEDENCE_ASSIGMENT); + super(instruction, PRECEDENCE_ASSIGMENT, value); this.slotId = slotId; - this.value = value; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetLocalAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetLocalAVM2Item.java index fcb604b96..c36dd682e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetLocalAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetLocalAVM2Item.java @@ -40,9 +40,8 @@ public class SetLocalAVM2Item extends AVM2Item implements SetTypeAVM2Item, Assig //public GraphTargetItem value; public SetLocalAVM2Item(AVM2Instruction instruction, int regIndex, GraphTargetItem value) { - super(instruction, PRECEDENCE_ASSIGMENT); + super(instruction, PRECEDENCE_ASSIGMENT, value); this.regIndex = regIndex; - this.value = value; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSlotAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSlotAVM2Item.java index 69da8f87e..905c523ea 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSlotAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSlotAVM2Item.java @@ -33,9 +33,8 @@ public class SetSlotAVM2Item extends AVM2Item implements SetTypeAVM2Item, Assign public GraphTargetItem scope; public SetSlotAVM2Item(AVM2Instruction instruction, GraphTargetItem scope, Multiname slotName, GraphTargetItem value) { - super(instruction, PRECEDENCE_ASSIGMENT); + super(instruction, PRECEDENCE_ASSIGMENT, value); this.slotName = slotName; - this.value = value; this.scope = scope; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSuperAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSuperAVM2Item.java index a82e3c9ac..c7b03f298 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSuperAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/SetSuperAVM2Item.java @@ -36,8 +36,7 @@ public class SetSuperAVM2Item extends AVM2Item { } public SetSuperAVM2Item(AVM2Instruction instruction, GraphTargetItem value, GraphTargetItem object, FullMultinameAVM2Item propertyName) { - super(instruction, PRECEDENCE_ASSIGMENT); - this.value = value; + super(instruction, PRECEDENCE_ASSIGMENT, value); this.object = object; this.propertyName = propertyName; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/ThrowAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/ThrowAVM2Item.java index 7ae818eb8..074569b55 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/ThrowAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/ThrowAVM2Item.java @@ -33,8 +33,7 @@ public class ThrowAVM2Item extends AVM2Item implements ExitItem { //public GraphTargetItem value; public ThrowAVM2Item(AVM2Instruction instruction, GraphTargetItem value) { - super(instruction, NOPRECEDENCE); - this.value = value; + super(instruction, NOPRECEDENCE, value); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ConstAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ConstAVM2Item.java index 16748cc2a..cb646c105 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ConstAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ConstAVM2Item.java @@ -50,11 +50,10 @@ public class ConstAVM2Item extends AVM2Item { } public ConstAVM2Item(String pkg, String customNamespace, boolean isStatic, int namespace, String var, GraphTargetItem type, GraphTargetItem value, int line) { - super(null, NOPRECEDENCE); + super(null, NOPRECEDENCE, value); this.pkg = pkg; this.line = line; this.namespace = namespace; - this.value = value; this.isStatic = isStatic; this.var = var; this.type = type; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SlotAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SlotAVM2Item.java index a68d9b21d..287d4648e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SlotAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/SlotAVM2Item.java @@ -50,11 +50,10 @@ public class SlotAVM2Item extends AVM2Item { } public SlotAVM2Item(String pkg, String customNamespace, boolean isStatic, int namespace, String var, GraphTargetItem type, GraphTargetItem value, int line) { - super(null, NOPRECEDENCE); + super(null, NOPRECEDENCE, value); this.pkg = pkg; this.line = line; this.namespace = namespace; - this.value = value; this.isStatic = isStatic; this.var = var; this.type = type; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLAVM2Item.java index 9a2d34df6..c881a6a72 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLAVM2Item.java @@ -39,8 +39,7 @@ import java.util.List; public class XMLAVM2Item extends AVM2Item { public XMLAVM2Item(GraphTargetItem value) { - super(null, PRECEDENCE_PRIMARY); - this.value = value; + super(null, PRECEDENCE_PRIMARY, value); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLFilterAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLFilterAVM2Item.java index 4329422f5..7f18cf4f2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLFilterAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/XMLFilterAVM2Item.java @@ -38,8 +38,7 @@ public class XMLFilterAVM2Item extends AVM2Item { public GraphTargetItem object; public XMLFilterAVM2Item(GraphTargetItem object, GraphTargetItem value, List openedNamespaces) { - super(null, NOPRECEDENCE); - this.value = value; + super(null, NOPRECEDENCE, value); this.openedNamespaces = openedNamespaces; this.object = object; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ActionItem.java index 2f446a30b..3e7296ef2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ActionItem.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -39,6 +40,10 @@ public abstract class ActionItem extends GraphTargetItem implements Serializable super(instruction, precedence); } + public ActionItem(GraphSourceItem instruction, int precedence, GraphTargetItem value) { + super(instruction, precedence, value); + } + protected boolean isEmptyString(GraphTargetItem target) { if (target instanceof DirectValueActionItem) { if (((DirectValueActionItem) target).value instanceof String) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/AsciiToCharActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/AsciiToCharActionItem.java index 3d8875f55..345b946d2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/AsciiToCharActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/AsciiToCharActionItem.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -29,8 +30,7 @@ import java.util.List; public class AsciiToCharActionItem extends ActionItem { public AsciiToCharActionItem(GraphSourceItem instruction, GraphTargetItem value) { - super(instruction, PRECEDENCE_PRIMARY); - this.value = value; + super(instruction, PRECEDENCE_PRIMARY, value); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CallActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CallActionItem.java index 2608181ec..d8022f972 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CallActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CallActionItem.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -29,8 +30,7 @@ import java.util.List; public class CallActionItem extends ActionItem { public CallActionItem(GraphSourceItem instruction, GraphTargetItem value) { - super(instruction, PRECEDENCE_PRIMARY); - this.value = value; + super(instruction, PRECEDENCE_PRIMARY, value); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CharToAsciiActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CharToAsciiActionItem.java index 81e30a23a..85a46a521 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CharToAsciiActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/CharToAsciiActionItem.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -30,8 +31,7 @@ import java.util.Set; public class CharToAsciiActionItem extends ActionItem { public CharToAsciiActionItem(GraphSourceItem instruction, GraphTargetItem value) { - super(instruction, PRECEDENCE_PRIMARY); - this.value = value; + super(instruction, PRECEDENCE_PRIMARY, value); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DefineLocalActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DefineLocalActionItem.java index 04689dfa9..419672305 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DefineLocalActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DefineLocalActionItem.java @@ -68,9 +68,8 @@ public class DefineLocalActionItem extends ActionItem implements SetTypeActionIt } public DefineLocalActionItem(GraphSourceItem instruction, GraphTargetItem name, GraphTargetItem value) { - super(instruction, PRECEDENCE_PRIMARY); + super(instruction, PRECEDENCE_PRIMARY, value); this.name = name; - this.value = value; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java index bb317a57c..feeb5402c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java @@ -43,6 +43,8 @@ public class DirectValueActionItem extends ActionItem implements SimpleValue { public GraphTargetItem computedRegValue; + public int pos = -1; + public DirectValueActionItem(Object o) { this(null, 0, o, new ArrayList<>()); } @@ -54,6 +56,11 @@ public class DirectValueActionItem extends ActionItem implements SimpleValue { this.pos = instructionPos; } + @Override + protected int getPos() { + return pos; + } + @Override public boolean isVariableComputed() { if (computedRegValue != null) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/EvalActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/EvalActionItem.java index d72465718..a94f2bd32 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/EvalActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/EvalActionItem.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -32,8 +33,7 @@ import java.util.List; public class EvalActionItem extends ActionItem { public EvalActionItem(GraphSourceItem instruction, GraphTargetItem value) { - super(instruction, PRECEDENCE_PRIMARY); - this.value = value; + super(instruction, PRECEDENCE_PRIMARY, value); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBAsciiToCharActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBAsciiToCharActionItem.java index 977e787a7..2a8e1ee13 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBAsciiToCharActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBAsciiToCharActionItem.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -29,8 +30,7 @@ import java.util.List; public class MBAsciiToCharActionItem extends ActionItem { public MBAsciiToCharActionItem(GraphSourceItem instruction, GraphTargetItem value) { - super(instruction, PRECEDENCE_PRIMARY); - this.value = value; + super(instruction, PRECEDENCE_PRIMARY, value); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBCharToAsciiActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBCharToAsciiActionItem.java index 1cc6d1d0f..bc4160941 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBCharToAsciiActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBCharToAsciiActionItem.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -29,8 +30,7 @@ import java.util.List; public class MBCharToAsciiActionItem extends ActionItem { public MBCharToAsciiActionItem(GraphSourceItem instruction, GraphTargetItem value) { - super(instruction, PRECEDENCE_PRIMARY); - this.value = value; + super(instruction, PRECEDENCE_PRIMARY, value); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBStringExtractActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBStringExtractActionItem.java index cd0b9df3c..88a192f3b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBStringExtractActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBStringExtractActionItem.java @@ -45,8 +45,7 @@ public class MBStringExtractActionItem extends ActionItem { } public MBStringExtractActionItem(GraphSourceItem instruction, GraphTargetItem value, GraphTargetItem index, GraphTargetItem count) { - super(instruction, PRECEDENCE_PRIMARY); - this.value = value; + super(instruction, PRECEDENCE_PRIMARY, value); this.index = index; this.count = count; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBStringLengthActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBStringLengthActionItem.java index a3d7c4dc5..42788bc2f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBStringLengthActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/MBStringLengthActionItem.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -30,8 +31,7 @@ public class MBStringLengthActionItem extends ActionItem { //public GraphTargetItem value; public MBStringLengthActionItem(GraphSourceItem instruction, GraphTargetItem value) { - super(instruction, PRECEDENCE_PRIMARY); - this.value = value; + super(instruction, PRECEDENCE_PRIMARY, value); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java index f53cafc8d..c9c5b6d77 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/RandomNumberActionItem.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -29,8 +30,7 @@ import java.util.List; public class RandomNumberActionItem extends ActionItem { public RandomNumberActionItem(GraphSourceItem instruction, GraphTargetItem maximum) { - super(instruction, PRECEDENCE_PRIMARY); - this.value = maximum; + super(instruction, PRECEDENCE_PRIMARY, maximum); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/RemoveSpriteActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/RemoveSpriteActionItem.java index 201896399..54319ebfd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/RemoveSpriteActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/RemoveSpriteActionItem.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -29,8 +30,7 @@ import java.util.List; public class RemoveSpriteActionItem extends ActionItem { public RemoveSpriteActionItem(GraphSourceItem instruction, GraphTargetItem target) { - super(instruction, PRECEDENCE_PRIMARY); - this.value = target; + super(instruction, PRECEDENCE_PRIMARY, target); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ReturnActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ReturnActionItem.java index 3ac88d2e0..00e3dd357 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ReturnActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ReturnActionItem.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.SWF; @@ -42,8 +43,7 @@ public class ReturnActionItem extends ActionItem implements ExitItem { //public GraphTargetItem value; public ReturnActionItem(GraphSourceItem instruction, GraphTargetItem value) { - super(instruction, PRECEDENCE_PRIMARY); - this.value = value; + super(instruction, PRECEDENCE_PRIMARY, value); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetMemberActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetMemberActionItem.java index 694536da3..a21941205 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetMemberActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetMemberActionItem.java @@ -77,10 +77,9 @@ public class SetMemberActionItem extends ActionItem implements SetTypeActionItem } public SetMemberActionItem(GraphSourceItem instruction, GraphTargetItem object, GraphTargetItem objectName, GraphTargetItem value) { - super(instruction, PRECEDENCE_ASSIGMENT); + super(instruction, PRECEDENCE_ASSIGMENT, value); this.object = object; this.objectName = objectName; - this.value = value; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java index 5fac12c17..d1f5909d5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetPropertyActionItem.java @@ -68,10 +68,9 @@ public class SetPropertyActionItem extends ActionItem implements SetTypeActionIt } public SetPropertyActionItem(GraphSourceItem instruction, GraphTargetItem target, int propertyIndex, GraphTargetItem value) { - super(instruction, PRECEDENCE_ASSIGMENT); + super(instruction, PRECEDENCE_ASSIGMENT, value); this.target = target; this.propertyIndex = propertyIndex; - this.value = value; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetVariableActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetVariableActionItem.java index 33d06e523..3f7b37b6b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetVariableActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/SetVariableActionItem.java @@ -67,9 +67,8 @@ public class SetVariableActionItem extends ActionItem implements SetTypeActionIt } public SetVariableActionItem(GraphSourceItem instruction, GraphTargetItem name, GraphTargetItem value) { - super(instruction, PRECEDENCE_ASSIGMENT); + super(instruction, PRECEDENCE_ASSIGMENT, value); this.name = name; - this.value = value; } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java index b778d0c8b..a2b5fcadf 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StoreRegisterActionItem.java @@ -67,8 +67,7 @@ public class StoreRegisterActionItem extends ActionItem implements SetTypeAction } public StoreRegisterActionItem(GraphSourceItem instruction, RegisterNumber register, GraphTargetItem value, boolean define) { - super(instruction, PRECEDENCE_ASSIGMENT); - this.value = value; + super(instruction, PRECEDENCE_ASSIGMENT, value); this.register = register; this.define = define; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StringExtractActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StringExtractActionItem.java index 7844bae52..3169789de 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StringExtractActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StringExtractActionItem.java @@ -35,8 +35,7 @@ public class StringExtractActionItem extends ActionItem { public GraphTargetItem count; public StringExtractActionItem(GraphSourceItem instruction, GraphTargetItem value, GraphTargetItem index, GraphTargetItem count) { - super(instruction, PRECEDENCE_PRIMARY); - this.value = value; + super(instruction, PRECEDENCE_PRIMARY, value); this.index = index; this.count = count; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StringLengthActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StringLengthActionItem.java index b239e9798..006c06fb8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StringLengthActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/StringLengthActionItem.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -30,8 +31,7 @@ public class StringLengthActionItem extends ActionItem { //public GraphTargetItem value; public StringLengthActionItem(GraphSourceItem instruction, GraphTargetItem value) { - super(instruction, PRECEDENCE_PRIMARY); - this.value = value; + super(instruction, PRECEDENCE_PRIMARY, value); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TargetPathActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TargetPathActionItem.java index 4774f922e..5dc1a14ab 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TargetPathActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TargetPathActionItem.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -29,8 +30,7 @@ import java.util.List; public class TargetPathActionItem extends ActionItem { public TargetPathActionItem(GraphSourceItem instruction, GraphTargetItem object) { - super(instruction, PRECEDENCE_PRIMARY); - this.value = object; + super(instruction, PRECEDENCE_PRIMARY, object); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TemporaryRegister.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TemporaryRegister.java index 93c989c0e..86f66c90a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TemporaryRegister.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TemporaryRegister.java @@ -31,8 +31,7 @@ public class TemporaryRegister extends ActionItem { private final int regId; public TemporaryRegister(int regId, GraphTargetItem value) { - super(value.getSrc(), value.getPrecedence()); - this.value = value; + super(value.getSrc(), value.getPrecedence(), value); this.regId = regId; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ThrowActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ThrowActionItem.java index 56d7b7870..1126753de 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ThrowActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ThrowActionItem.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -29,8 +30,7 @@ import java.util.List; public class ThrowActionItem extends ActionItem { public ThrowActionItem(GraphSourceItem instruction, GraphTargetItem object) { - super(instruction, PRECEDENCE_PRIMARY); - this.value = object; + super(instruction, PRECEDENCE_PRIMARY, object); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ToIntegerActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ToIntegerActionItem.java index 63ce3132a..11e24d9c7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ToIntegerActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ToIntegerActionItem.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -29,8 +30,7 @@ import java.util.List; public class ToIntegerActionItem extends ActionItem { public ToIntegerActionItem(GraphSourceItem instruction, GraphTargetItem value) { - super(instruction, PRECEDENCE_PRIMARY); - this.value = value; + super(instruction, PRECEDENCE_PRIMARY, value); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ToNumberActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ToNumberActionItem.java index f5985f64c..862b526bd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ToNumberActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ToNumberActionItem.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -29,8 +30,7 @@ import java.util.List; public class ToNumberActionItem extends ActionItem { public ToNumberActionItem(GraphSourceItem instruction, GraphTargetItem value) { - super(instruction, PRECEDENCE_PRIMARY); - this.value = value; + super(instruction, PRECEDENCE_PRIMARY, value); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ToStringActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ToStringActionItem.java index 918ab3b57..459549a06 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ToStringActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/ToStringActionItem.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -29,8 +30,7 @@ import java.util.List; public class ToStringActionItem extends ActionItem { public ToStringActionItem(GraphSourceItem instruction, GraphTargetItem value) { - super(instruction, PRECEDENCE_PRIMARY); - this.value = value; + super(instruction, PRECEDENCE_PRIMARY, value); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TraceActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TraceActionItem.java index 51f266bff..5fdb70fd9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TraceActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TraceActionItem.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -29,8 +30,7 @@ import java.util.List; public class TraceActionItem extends ActionItem { public TraceActionItem(GraphSourceItem instruction, GraphTargetItem value) { - super(instruction, PRECEDENCE_PRIMARY); - this.value = value; + super(instruction, PRECEDENCE_PRIMARY, value); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TypeOfActionItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TypeOfActionItem.java index 9f550815d..8b71de962 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TypeOfActionItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/model/TypeOfActionItem.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.action.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -32,8 +33,7 @@ import java.util.Set; public class TypeOfActionItem extends ActionItem { public TypeOfActionItem(GraphSourceItem instruction, GraphTargetItem value) { - super(instruction, PRECEDENCE_PRIMARY); - this.value = value; + super(instruction, PRECEDENCE_PRIMARY, value); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphTargetItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphTargetItem.java index 0bc314a28..349beae41 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphTargetItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/GraphTargetItem.java @@ -72,8 +72,6 @@ public abstract class GraphTargetItem implements Serializable, Cloneable { private GraphSourceItem src; - public int pos = -1; - protected int precedence; private List moreSrc; @@ -118,6 +116,12 @@ public abstract class GraphTargetItem implements Serializable, Cloneable { this.precedence = precedence; } + public GraphTargetItem(GraphSourceItem src, int precedence, GraphTargetItem value) { + this.src = src; + this.precedence = precedence; + this.value = value; + } + public GraphSourceItem getSrc() { return src; } @@ -138,9 +142,13 @@ public abstract class GraphTargetItem implements Serializable, Cloneable { return srcData; } + protected int getPos() { + return 0; + } + public List getNeededSources() { List ret = new ArrayList<>(); - ret.add(new GraphSourceItemPos(src, pos)); + ret.add(new GraphSourceItemPos(src, getPos())); if (moreSrc != null) { ret.addAll(moreSrc); } @@ -153,7 +161,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable { } public GraphTextWriter toStringSemicoloned(GraphTextWriter writer, LocalData localData) throws InterruptedException { - writer.startOffset(src, pos, srcData); + writer.startOffset(src, getPos(), srcData); appendTo(writer, localData); if (needsSemicolon()) { writer.appendNoHilight(";"); @@ -176,7 +184,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable { throw new InterruptedException(); } - writer.startOffset(src, pos, srcData); + writer.startOffset(src, getPos(), srcData); appendTo(writer, localData); writer.endOffset(); return writer; @@ -221,7 +229,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable { } public GraphTextWriter toStringNoQuotes(GraphTextWriter writer, LocalData localData) throws InterruptedException { - writer.startOffset(src, pos, srcData); + writer.startOffset(src, getPos(), srcData); appendToNoQuotes(writer, localData); writer.endOffset(); return writer; @@ -244,7 +252,7 @@ public abstract class GraphTargetItem implements Serializable, Cloneable { } public GraphTextWriter toStringNL(GraphTextWriter writer, LocalData localData) throws InterruptedException { - writer.startOffset(src, pos, srcData); + writer.startOffset(src, getPos(), srcData); appendTo(writer, localData); if (needsNewLine()) { writer.newLine(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TranslateStack.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TranslateStack.java index 92c5c2f98..5614a4b04 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TranslateStack.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/TranslateStack.java @@ -27,7 +27,7 @@ import java.util.logging.Logger; */ public class TranslateStack extends Stack { - private static PopItem pop = new PopItem(null); + private static PopItem pop; private final String path; @@ -39,12 +39,20 @@ public class TranslateStack extends Stack { return path; } + private PopItem getPop() { + if (pop == null) { + pop = new PopItem(null); + } + + return pop; + } + @Override public synchronized GraphTargetItem get(int index) { if (path != null) { if (index >= this.size() || index < 0) { Logger.getLogger(TranslateStack.class.getName()).log(Level.FINE, "{0}: Attemp to Get item outside of bounds of stack", path); - return pop; + return getPop(); } } return super.get(index); @@ -55,7 +63,7 @@ public class TranslateStack extends Stack { if (path != null) { if (this.isEmpty()) { Logger.getLogger(TranslateStack.class.getName()).log(Level.FINE, "{0}: Attemp to Peek empty stack", path); - return pop; + return getPop(); } } return super.peek(); @@ -65,8 +73,8 @@ public class TranslateStack extends Stack { public synchronized GraphTargetItem pop() { if (path != null) { if (this.isEmpty()) { - PopItem oldpop = pop; - pop = new PopItem(null); + PopItem oldpop = getPop(); + pop = null; Logger.getLogger(TranslateStack.class.getName()).log(Level.FINE, "{0}: Attemp to Pop empty stack", path); return oldpop; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/DuplicateItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/DuplicateItem.java index fff0d7e05..a8913c328 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/DuplicateItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/DuplicateItem.java @@ -34,8 +34,7 @@ import java.util.Set; public class DuplicateItem extends GraphTargetItem implements SimpleValue { public DuplicateItem(GraphSourceItem src, GraphTargetItem value) { - super(src, value.getPrecedence()); - this.value = value; + super(src, value.getPrecedence(), value); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/ParenthesisItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/ParenthesisItem.java index 6bba9a773..4c5f380bc 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/ParenthesisItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/ParenthesisItem.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.graph.model; import com.jpexs.decompiler.flash.SourceGeneratorLocalData; @@ -30,8 +31,7 @@ import java.util.List; public class ParenthesisItem extends GraphTargetItem { public ParenthesisItem(GraphSourceItem src, GraphTargetItem value) { - super(src, PRECEDENCE_PRIMARY); - this.value = value; + super(src, PRECEDENCE_PRIMARY, value); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/PushItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/PushItem.java index b87a0b0a2..af6d23b77 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/PushItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/PushItem.java @@ -25,9 +25,8 @@ import com.jpexs.decompiler.graph.GraphTargetItem; */ public class PushItem extends GraphTargetItem { - public PushItem(GraphTargetItem val) { - super(val.getSrc(), val.getPrecedence()); - this.value = val; + public PushItem(GraphTargetItem value) { + super(value.getSrc(), value.getPrecedence(), value); } @Override diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/UnaryOpItem.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/UnaryOpItem.java index d9fa93719..40616c91a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/UnaryOpItem.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/model/UnaryOpItem.java @@ -28,8 +28,7 @@ public abstract class UnaryOpItem extends GraphTargetItem implements UnaryOp { public String operator; public UnaryOpItem(GraphSourceItem instruction, int precedence, GraphTargetItem value, String operator) { - super(instruction, precedence); - this.value = value; + super(instruction, precedence, value); this.operator = operator; }