equals and hashcode added to model

compoundable binary op introduced
This commit is contained in:
Jindra Petřík
2021-03-12 22:12:39 +01:00
parent a26d12df65
commit e3d78aff98
182 changed files with 4533 additions and 234 deletions
@@ -37,16 +37,20 @@ import com.jpexs.decompiler.flash.abc.avm2.model.PostDecrementAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.PostIncrementAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.SetLocalAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.SetPropertyAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.operations.AddAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.operations.PreDecrementAVM2Item;
import com.jpexs.decompiler.flash.abc.avm2.model.operations.PreIncrementAVM2Item;
import com.jpexs.decompiler.flash.abc.types.MethodBody;
import com.jpexs.decompiler.graph.DottedChain;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.TranslateStack;
import com.jpexs.decompiler.graph.model.BinaryOpItem;
import com.jpexs.decompiler.graph.model.CompoundableBinaryOp;
import com.jpexs.decompiler.graph.model.DuplicateItem;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
import java.util.Stack;
/**
@@ -332,7 +336,40 @@ public class SetPropertyIns extends InstructionDefinition implements SetTypeIns
}
}
GraphTargetItem result = new SetPropertyAVM2Item(ins, localData.lineStartInstruction, obj, multiname, value);
SetPropertyAVM2Item result = new SetPropertyAVM2Item(ins, localData.lineStartInstruction, obj, multiname, value);
/*if (value instanceof LocalRegAVM2Item) {
LocalRegAVM2Item locVal = (LocalRegAVM2Item) value;
if (multiname.name instanceof LocalRegAVM2Item) {
LocalRegAVM2Item locName = (LocalRegAVM2Item) multiname.name;
if (output.size() > 2) {
if (output.get(output.size() - 1) instanceof SetLocalAVM2Item) {
SetLocalAVM2Item setLocVal = (SetLocalAVM2Item) output.get(output.size() - 1);
if (setLocVal.regIndex == locVal.regIndex) {
if (output.get(output.size() - 2) instanceof SetLocalAVM2Item) {
SetLocalAVM2Item setLocName = (SetLocalAVM2Item) output.get(output.size() - 2);
if (setLocName.regIndex == locName.regIndex) {
if (setLocVal.value instanceof CompoundableBinaryOp) {
CompoundableBinaryOp binaryOp = (CompoundableBinaryOp) setLocVal.value;
if (binaryOp.getLeftSide() instanceof GetPropertyAVM2Item) {
GetPropertyAVM2Item getProp = (GetPropertyAVM2Item) binaryOp.getLeftSide();
if (((FullMultinameAVM2Item) getProp.propertyName).compareSame(multiname) && Objects.equals(getProp.object, obj)) {
multiname.name = setLocName.value;
result.compoundValue = binaryOp.getRightSide();
result.compoundOperator = binaryOp.getOperator();
output.remove(output.size() - 2);
output.remove(output.size() - 1);
}
}
}
}
}
}
}
}
}
}*/
SetTypeIns.handleResult(value, stack, output, localData, result, -1);
}
@@ -12,7 +12,8 @@
* 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;
@@ -27,6 +28,7 @@ import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -107,4 +109,38 @@ public class AlchemyLoadAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 7;
hash = 79 * hash + Objects.hashCode(this.type);
hash = 79 * hash + this.size;
hash = 79 * hash + Objects.hashCode(this.ofs);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final AlchemyLoadAVM2Item other = (AlchemyLoadAVM2Item) obj;
if (this.size != other.size) {
return false;
}
if (!Objects.equals(this.type, other.type)) {
return false;
}
if (!Objects.equals(this.ofs, other.ofs)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -26,6 +27,7 @@ import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -73,4 +75,33 @@ public class AlchemySignExtendAVM2Item extends AVM2Item {
}
return toSourceMerge(localData, generator, value, ins(code));
}
@Override
public int hashCode() {
int hash = 7;
hash = 31 * hash + this.size;
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final AlchemySignExtendAVM2Item other = (AlchemySignExtendAVM2Item) obj;
if (this.size != other.size) {
return false;
}
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -26,6 +27,7 @@ import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -102,4 +104,41 @@ public class AlchemyStoreAVM2Item extends AVM2Item {
}
return toSourceMerge(localData, generator, ofs, ins(code));
}
@Override
public int hashCode() {
int hash = 5;
hash = 97 * hash + Objects.hashCode(this.type);
hash = 97 * hash + this.size;
hash = 97 * hash + Objects.hashCode(this.ofs);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final AlchemyStoreAVM2Item other = (AlchemyStoreAVM2Item) obj;
if (this.size != other.size) {
return false;
}
if (!Objects.equals(this.type, other.type)) {
return false;
}
if (!Objects.equals(this.ofs, other.ofs)) {
return false;
}
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -121,4 +122,5 @@ public class ApplyTypeAVM2Item extends AVM2Item {
ins(AVM2Instructions.ApplyType, params.size())
);
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -26,6 +27,7 @@ import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
import java.util.Set;
/**
@@ -72,4 +74,30 @@ public class BooleanAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 7;
hash = 79 * hash + Objects.hashCode(this.value);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final BooleanAVM2Item other = (BooleanAVM2Item) obj;
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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.ecma.EcmaScript;
@@ -27,6 +28,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
/**
@@ -231,4 +233,38 @@ public class CallAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 5;
hash = 97 * hash + Objects.hashCode(this.receiver);
hash = 97 * hash + Objects.hashCode(this.function);
hash = 97 * hash + Objects.hashCode(this.arguments);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final CallAVM2Item other = (CallAVM2Item) obj;
if (!Objects.equals(this.receiver, other.receiver)) {
return false;
}
if (!Objects.equals(this.function, other.function)) {
return false;
}
if (!Objects.equals(this.arguments, other.arguments)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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.helpers.GraphTextWriter;
@@ -22,6 +23,7 @@ import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -73,4 +75,38 @@ public class CallMethodAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 7;
hash = 61 * hash + Objects.hashCode(this.receiver);
hash = 61 * hash + Objects.hashCode(this.methodName);
hash = 61 * hash + Objects.hashCode(this.arguments);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final CallMethodAVM2Item other = (CallMethodAVM2Item) obj;
if (!Objects.equals(this.methodName, other.methodName)) {
return false;
}
if (!Objects.equals(this.receiver, other.receiver)) {
return false;
}
if (!Objects.equals(this.arguments, other.arguments)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -28,6 +29,7 @@ import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -88,4 +90,42 @@ public class CallPropertyAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 5;
hash = 17 * hash + Objects.hashCode(this.receiver);
hash = 17 * hash + Objects.hashCode(this.propertyName);
hash = 17 * hash + Objects.hashCode(this.arguments);
hash = 17 * hash + (this.isVoid ? 1 : 0);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final CallPropertyAVM2Item other = (CallPropertyAVM2Item) obj;
if (this.isVoid != other.isVoid) {
return false;
}
if (!Objects.equals(this.receiver, other.receiver)) {
return false;
}
if (!Objects.equals(this.propertyName, other.propertyName)) {
return false;
}
if (!Objects.equals(this.arguments, other.arguments)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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.helpers.GraphTextWriter;
@@ -22,6 +23,7 @@ import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -73,4 +75,38 @@ public class CallStaticAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 7;
hash = 29 * hash + Objects.hashCode(this.receiver);
hash = 29 * hash + Objects.hashCode(this.methodName);
hash = 29 * hash + Objects.hashCode(this.arguments);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final CallStaticAVM2Item other = (CallStaticAVM2Item) obj;
if (!Objects.equals(this.methodName, other.methodName)) {
return false;
}
if (!Objects.equals(this.receiver, other.receiver)) {
return false;
}
if (!Objects.equals(this.arguments, other.arguments)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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.helpers.GraphTextWriter;
@@ -22,6 +23,7 @@ import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -80,4 +82,42 @@ public class CallSuperAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return false;
}
@Override
public int hashCode() {
int hash = 7;
hash = 53 * hash + Objects.hashCode(this.receiver);
hash = 53 * hash + Objects.hashCode(this.multiname);
hash = 53 * hash + Objects.hashCode(this.arguments);
hash = 53 * hash + (this.isVoid ? 1 : 0);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final CallSuperAVM2Item other = (CallSuperAVM2Item) obj;
if (this.isVoid != other.isVoid) {
return false;
}
if (!Objects.equals(this.receiver, other.receiver)) {
return false;
}
if (!Objects.equals(this.multiname, other.multiname)) {
return false;
}
if (!Objects.equals(this.arguments, other.arguments)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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.types.Multiname;
@@ -48,4 +49,5 @@ public class ClassAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return false;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -30,6 +31,7 @@ import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
import java.util.Set;
/**
@@ -140,4 +142,33 @@ public class CoerceAVM2Item extends AVM2Item {
}
return toSourceMerge(localData, generator, value, ins);
}
@Override
public int hashCode() {
int hash = 5;
hash = 67 * hash + Objects.hashCode(this.typeObj);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final CoerceAVM2Item other = (CoerceAVM2Item) obj;
if (!Objects.equals(this.typeObj, other.typeObj)) {
return false;
}
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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.helpers.GraphTextWriter;
@@ -21,6 +22,7 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -81,4 +83,37 @@ public class ConstructAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 7;
hash = 59 * hash + Objects.hashCode(this.object);
hash = 59 * hash + Objects.hashCode(this.args);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ConstructAVM2Item other = (ConstructAVM2Item) obj;
if (!Objects.equals(this.object, other.object)) {
return false;
}
if (!Objects.equals(this.args, other.args)) {
return false;
}
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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.helpers.GraphTextWriter;
@@ -22,6 +23,7 @@ import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -77,4 +79,38 @@ public class ConstructPropAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 7;
hash = 67 * hash + Objects.hashCode(this.object);
hash = 67 * hash + Objects.hashCode(this.propertyName);
hash = 67 * hash + Objects.hashCode(this.args);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ConstructPropAVM2Item other = (ConstructPropAVM2Item) obj;
if (!Objects.equals(this.object, other.object)) {
return false;
}
if (!Objects.equals(this.propertyName, other.propertyName)) {
return false;
}
if (!Objects.equals(this.args, other.args)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -27,6 +28,7 @@ import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -83,4 +85,34 @@ public class ConstructSuperAVM2Item extends AVM2Item {
new AVM2Instruction(0, AVM2Instructions.ConstructSuper, new int[]{args.size()})
);
}
@Override
public int hashCode() {
int hash = 5;
hash = 71 * hash + Objects.hashCode(this.object);
hash = 71 * hash + Objects.hashCode(this.args);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ConstructSuperAVM2Item other = (ConstructSuperAVM2Item) obj;
if (!Objects.equals(this.object, other.object)) {
return false;
}
if (!Objects.equals(this.args, other.args)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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.ecma.EcmaScript;
@@ -21,6 +22,7 @@ import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.Objects;
import java.util.Set;
/**
@@ -100,4 +102,33 @@ public class ConvertAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 23 * hash + Objects.hashCode(this.type);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ConvertAVM2Item other = (ConvertAVM2Item) obj;
if (!Objects.equals(this.type, other.type)) {
return false;
}
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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.helpers.GraphTextWriter;
@@ -49,4 +50,30 @@ public class DecLocalAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return false;
}
@Override
public int hashCode() {
int hash = 3;
hash = 73 * hash + this.regIndex;
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final DecLocalAVM2Item other = (DecLocalAVM2Item) obj;
if (this.regIndex != other.regIndex) {
return false;
}
return true;
}
}
@@ -21,6 +21,7 @@ import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.Objects;
import java.util.Set;
/**
@@ -68,4 +69,29 @@ public class DecrementAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final GraphTargetItem other = (GraphTargetItem) obj;
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
return hash;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -26,6 +27,7 @@ import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -65,4 +67,33 @@ public class DefaultXMLNamespace extends AVM2Item {
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
return toSourceMerge(localData, generator, ns, ins(AVM2Instructions.DXNSLate));
}
@Override
public int hashCode() {
int hash = 7;
hash = 97 * hash + Objects.hashCode(this.ns);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final DefaultXMLNamespace other = (DefaultXMLNamespace) obj;
if (!Objects.equals(this.ns, other.ns)) {
return false;
}
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -25,6 +26,7 @@ import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -57,4 +59,28 @@ public class EscapeXAttrAVM2Item extends AVM2Item {
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
return toSourceMerge(localData, generator, value, ins(AVM2Instructions.EscXAttr));
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final GraphTargetItem other = (GraphTargetItem) obj;
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
return hash;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -25,6 +26,7 @@ import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -57,4 +59,28 @@ public class EscapeXElemAVM2Item extends AVM2Item {
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
return toSourceMerge(localData, generator, value, ins(AVM2Instructions.EscXElem));
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final GraphTargetItem other = (GraphTargetItem) obj;
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
return hash;
}
}
@@ -22,6 +22,7 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.Objects;
/**
*
@@ -58,4 +59,30 @@ public class FilteredCheckAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 47 * hash + Objects.hashCode(this.object);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final FilteredCheckAVM2Item other = (FilteredCheckAVM2Item) obj;
if (!Objects.equals(this.object, other.object)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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.types.Multiname;
@@ -21,6 +22,7 @@ import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.Objects;
/**
*
@@ -49,4 +51,30 @@ public class FindDefAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 5;
hash = 83 * hash + Objects.hashCode(this.propertyName);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final FindDefAVM2Item other = (FindDefAVM2Item) obj;
if (!Objects.equals(this.propertyName, other.propertyName)) {
return false;
}
return true;
}
}
@@ -29,6 +29,7 @@ import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -71,4 +72,29 @@ public class FindPropertyAVM2Item extends AVM2Item {
return toSourceMerge(localData, generator, ins(AVM2Instructions.FindProperty, ((AVM2SourceGenerator) generator).typeName(localData, propertyName)));
}
@Override
public int hashCode() {
int hash = 3;
hash = 47 * hash + Objects.hashCode(this.propertyName);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final FindPropertyAVM2Item other = (FindPropertyAVM2Item) obj;
if (!Objects.equals(this.propertyName, other.propertyName)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -28,6 +29,7 @@ import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
import java.util.Set;
/**
@@ -74,4 +76,30 @@ public class FloatValueAVM2Item extends NumberValueAVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 7;
hash = 53 * hash + Objects.hashCode(this.value);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final FloatValueAVM2Item other = (FloatValueAVM2Item) obj;
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
}
@@ -29,6 +29,7 @@ import com.jpexs.decompiler.graph.model.LocalData;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
import java.util.Set;
/**
@@ -204,4 +205,42 @@ public class FullMultinameAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 29 * hash + this.multinameIndex;
hash = 29 * hash + Objects.hashCode(this.name);
hash = 29 * hash + Objects.hashCode(this.namespace);
hash = 29 * hash + (this.property ? 1 : 0);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final FullMultinameAVM2Item other = (FullMultinameAVM2Item) obj;
if (this.multinameIndex != other.multinameIndex) {
return false;
}
if (this.property != other.property) {
return false;
}
if (!Objects.equals(this.name, other.name)) {
return false;
}
if (!Objects.equals(this.namespace, other.namespace)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -27,6 +28,7 @@ import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -82,4 +84,34 @@ public class GetDescendantsAVM2Item extends AVM2Item {
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
return ((AVM2SourceGenerator) generator).generate(localData, this);
}
@Override
public int hashCode() {
int hash = 7;
hash = 67 * hash + Objects.hashCode(this.object);
hash = 67 * hash + Objects.hashCode(this.multiname);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final GetDescendantsAVM2Item other = (GetDescendantsAVM2Item) obj;
if (!Objects.equals(this.object, other.object)) {
return false;
}
if (!Objects.equals(this.multiname, other.multiname)) {
return false;
}
return true;
}
}
@@ -25,6 +25,7 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.SimpleValue;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.Objects;
/**
*
@@ -67,4 +68,30 @@ public class GetLexAVM2Item extends AVM2Item implements SimpleValue {
public boolean isSimpleValue() {
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 29 * hash + Objects.hashCode(this.propertyName);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final GetLexAVM2Item other = (GetLexAVM2Item) obj;
if (!Objects.equals(this.propertyName, other.propertyName)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -33,6 +34,7 @@ import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
import java.util.Set;
/**
@@ -152,4 +154,33 @@ public class GetPropertyAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 97 * hash + Objects.hashCode(this.object);
hash = 97 * hash + Objects.hashCode(this.propertyName);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final GetPropertyAVM2Item other = (GetPropertyAVM2Item) obj;
if (!Objects.equals(this.object, other.object)) {
return false;
}
if (!Objects.equals(this.propertyName, other.propertyName)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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.types.Multiname;
@@ -22,6 +23,7 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.Objects;
/**
*
@@ -78,4 +80,34 @@ public class GetSlotAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 67 * hash + Objects.hashCode(this.scope);
hash = 67 * hash + this.slotIndex;
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final GetSlotAVM2Item other = (GetSlotAVM2Item) obj;
if (this.slotIndex != other.slotIndex) {
return false;
}
if (!Objects.equals(this.scope, other.scope)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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.helpers.GraphTextWriter;
@@ -21,6 +22,7 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.Objects;
/**
*
@@ -65,4 +67,34 @@ public class GetSuperAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 29 * hash + Objects.hashCode(this.object);
hash = 29 * hash + Objects.hashCode(this.propertyName);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final GetSuperAVM2Item other = (GetSuperAVM2Item) obj;
if (!Objects.equals(this.object, other.object)) {
return false;
}
if (!Objects.equals(this.propertyName, other.propertyName)) {
return false;
}
return true;
}
}
@@ -23,6 +23,7 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.HashMap;
import java.util.Objects;
/**
*
@@ -59,4 +60,23 @@ public class GlobalAVM2Item extends AVM2Item {
return new TypeItem("global");
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
return hash;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -26,6 +27,7 @@ import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -87,4 +89,34 @@ public class HasNextAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 5;
hash = 29 * hash + Objects.hashCode(this.index);
hash = 29 * hash + Objects.hashCode(this.obj);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final HasNextAVM2Item other = (HasNextAVM2Item) obj;
if (!Objects.equals(this.index, other.index)) {
return false;
}
if (!Objects.equals(this.obj, other.obj)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -26,6 +27,7 @@ import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -70,4 +72,34 @@ public class InAVM2Item extends AVM2Item {
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
return toSourceMerge(localData, generator, object, collection, ins(AVM2Instructions.In));
}
@Override
public int hashCode() {
int hash = 3;
hash = 89 * hash + Objects.hashCode(this.object);
hash = 89 * hash + Objects.hashCode(this.collection);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final InAVM2Item other = (InAVM2Item) obj;
if (!Objects.equals(this.object, other.object)) {
return false;
}
if (!Objects.equals(this.collection, other.collection)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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.helpers.GraphTextWriter;
@@ -49,4 +50,30 @@ public class IncLocalAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return false;
}
@Override
public int hashCode() {
int hash = 7;
hash = 59 * hash + this.regIndex;
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final IncLocalAVM2Item other = (IncLocalAVM2Item) obj;
if (this.regIndex != other.regIndex) {
return false;
}
return true;
}
}
@@ -21,6 +21,7 @@ import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.Objects;
import java.util.Set;
/**
@@ -68,4 +69,28 @@ public class IncrementAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final GraphTargetItem other = (GraphTargetItem) obj;
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
return hash;
}
}
@@ -12,7 +12,8 @@
* 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.model.clauses.AssignmentAVM2Item;
@@ -23,6 +24,7 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.Objects;
/**
*
@@ -85,4 +87,34 @@ public class InitPropertyAVM2Item extends AVM2Item implements SetTypeAVM2Item, A
public boolean hasReturnValue() {
return false;
}
@Override
public int hashCode() {
int hash = 3;
hash = 17 * hash + Objects.hashCode(this.object);
hash = 17 * hash + Objects.hashCode(this.propertyName);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final InitPropertyAVM2Item other = (InitPropertyAVM2Item) obj;
if (!Objects.equals(this.object, other.object)) {
return false;
}
if (!Objects.equals(this.propertyName, other.propertyName)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -35,6 +36,7 @@ import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
*
@@ -134,4 +136,34 @@ public class InitVectorAVM2Item extends AVM2Item {
}
return ret;
}
@Override
public int hashCode() {
int hash = 5;
hash = 31 * hash + Objects.hashCode(this.subtype);
hash = 31 * hash + Objects.hashCode(this.arguments);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final InitVectorAVM2Item other = (InitVectorAVM2Item) obj;
if (!Objects.equals(this.subtype, other.subtype)) {
return false;
}
if (!Objects.equals(this.arguments, other.arguments)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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,6 +33,7 @@ import com.jpexs.decompiler.graph.model.IntegerValueTypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Set;
/**
@@ -158,4 +160,30 @@ public class IntegerValueAVM2Item extends NumberValueAVM2Item implements Integer
public int intValue() {
return (int) (long) value;
}
@Override
public int hashCode() {
int hash = 3;
hash = 79 * hash + Objects.hashCode(this.value);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final IntegerValueAVM2Item other = (IntegerValueAVM2Item) obj;
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -73,4 +73,30 @@ public class NameSpaceAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 31 * hash + this.namespaceIndex;
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final NameSpaceAVM2Item other = (NameSpaceAVM2Item) obj;
if (this.namespaceIndex != other.namespaceIndex) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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.helpers.GraphTextWriter;
@@ -21,6 +22,7 @@ import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import com.jpexs.decompiler.graph.model.TernarOpItem;
import java.util.Objects;
/**
*
@@ -66,4 +68,33 @@ public class NameValuePair extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 7;
hash = 73 * hash + Objects.hashCode(this.name);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final NameValuePair other = (NameValuePair) obj;
if (!Objects.equals(this.name, other.name)) {
return false;
}
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -28,6 +29,7 @@ import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -65,4 +67,25 @@ public class NanAVM2Item extends AVM2Item implements SimpleValue {
public boolean isSimpleValue() {
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
return hash;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -26,6 +27,7 @@ import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
/**
*
@@ -58,4 +60,30 @@ public class NewActivationAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 5;
hash = 29 * hash + Objects.hashCode(this.slots);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final NewActivationAVM2Item other = (NewActivationAVM2Item) obj;
if (!Objects.equals(this.slots, other.slots)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -29,6 +30,7 @@ import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Set;
/**
@@ -108,4 +110,30 @@ public class NewArrayAVM2Item extends AVM2Item {
new AVM2Instruction(0, AVM2Instructions.NewArray, new int[]{values.size()})
);
}
@Override
public int hashCode() {
int hash = 5;
hash = 73 * hash + Objects.hashCode(this.values);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final NewArrayAVM2Item other = (NewArrayAVM2Item) obj;
if (!Objects.equals(this.values, other.values)) {
return false;
}
return true;
}
}
@@ -31,6 +31,7 @@ import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
/**
*
@@ -109,4 +110,34 @@ public class NewFunctionAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 37 * hash + Objects.hashCode(this.functionName);
hash = 37 * hash + this.methodIndex;
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final NewFunctionAVM2Item other = (NewFunctionAVM2Item) obj;
if (this.methodIndex != other.methodIndex) {
return false;
}
if (!Objects.equals(this.functionName, other.functionName)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -33,6 +34,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
/**
@@ -127,4 +129,30 @@ public class NewObjectAVM2Item extends AVM2Item {
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 67 * hash + Objects.hashCode(this.pairs);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final NewObjectAVM2Item other = (NewObjectAVM2Item) obj;
if (!Objects.equals(this.pairs, other.pairs)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -26,6 +27,7 @@ import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -74,4 +76,34 @@ public class NextNameAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 7;
hash = 89 * hash + Objects.hashCode(this.index);
hash = 89 * hash + Objects.hashCode(this.obj);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final NextNameAVM2Item other = (NextNameAVM2Item) obj;
if (!Objects.equals(this.index, other.index)) {
return false;
}
if (!Objects.equals(this.obj, other.obj)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -26,6 +27,7 @@ import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -74,4 +76,34 @@ public class NextValueAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 5;
hash = 53 * hash + Objects.hashCode(this.index);
hash = 53 * hash + Objects.hashCode(this.obj);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final NextValueAVM2Item other = (NextValueAVM2Item) obj;
if (!Objects.equals(this.index, other.index)) {
return false;
}
if (!Objects.equals(this.obj, other.obj)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -71,4 +72,24 @@ public class NullAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
return hash;
}
}
@@ -12,7 +12,8 @@
* 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.graph.GraphSourceItem;
@@ -12,7 +12,8 @@
* 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;
@@ -27,6 +28,7 @@ import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
*
@@ -82,4 +84,30 @@ public class PostDecrementAVM2Item extends AVM2Item implements AssignmentAVM2Ite
}
return new ArrayList<>(); //?
}
@Override
public int hashCode() {
int hash = 3;
hash = 67 * hash + Objects.hashCode(this.object);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final PostDecrementAVM2Item other = (PostDecrementAVM2Item) obj;
if (!Objects.equals(this.object, other.object)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -27,6 +28,7 @@ import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
*
@@ -82,4 +84,30 @@ public class PostIncrementAVM2Item extends AVM2Item implements AssignmentAVM2Ite
}
return new ArrayList<>(); //?
}
@Override
public int hashCode() {
int hash = 3;
hash = 89 * hash + Objects.hashCode(this.object);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final PostIncrementAVM2Item other = (PostIncrementAVM2Item) obj;
if (!Objects.equals(this.object, other.object)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -37,6 +38,7 @@ import com.jpexs.decompiler.graph.model.LocalData;
import com.jpexs.helpers.Helper;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -181,4 +183,34 @@ public class RegExpAvm2Item extends AVM2Item implements Callable {
public Object call(List<Object> args) {
return call("exec", args);
}
@Override
public int hashCode() {
int hash = 7;
hash = 89 * hash + Objects.hashCode(this.pattern);
hash = 89 * hash + Objects.hashCode(this.modifier);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final RegExpAvm2Item other = (RegExpAvm2Item) obj;
if (!Objects.equals(this.pattern, other.pattern)) {
return false;
}
if (!Objects.equals(this.modifier, other.modifier)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -26,6 +27,7 @@ import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.ExitItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -57,4 +59,28 @@ public class ReturnValueAVM2Item extends AVM2Item implements ExitItem {
public boolean hasReturnValue() {
return false;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final GraphTargetItem other = (GraphTargetItem) obj;
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
return hash;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -26,6 +27,7 @@ import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.ExitItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -56,4 +58,24 @@ public class ReturnVoidAVM2Item extends AVM2Item implements ExitItem {
public boolean hasReturnValue() {
return false;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
return hash;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -28,6 +29,7 @@ import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -136,4 +138,33 @@ public class SetLocalAVM2Item extends AVM2Item implements SetTypeAVM2Item, Assig
public boolean hasReturnValue() {
return false;
}
@Override
public int hashCode() {
int hash = 7;
hash = 67 * hash + this.regIndex;
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final SetLocalAVM2Item other = (SetLocalAVM2Item) obj;
if (this.regIndex != other.regIndex) {
return false;
}
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -44,6 +45,10 @@ public class SetPropertyAVM2Item extends AVM2Item implements SetTypeAVM2Item, As
public DeclarationAVM2Item declaration;
public GraphTargetItem compoundValue;
public String compoundOperator;
@Override
public DeclarationAVM2Item getDeclaration() {
return declaration;
@@ -76,6 +81,14 @@ public class SetPropertyAVM2Item extends AVM2Item implements SetTypeAVM2Item, As
@Override
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) throws InterruptedException {
formatProperty(writer, object, propertyName, localData);
if (compoundOperator != null) {
writer.append(" ");
writer.append(compoundOperator);
writer.append("= ");
return compoundValue.toString(writer, localData);
}
writer.append(" = ");
if (declaration != null && !declaration.type.equals(TypeItem.UNBOUNDED) && (value instanceof ConvertAVM2Item)) {
return value.value.toString(writer, localData);
@@ -12,7 +12,8 @@
* 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.model.clauses.AssignmentAVM2Item;
@@ -25,6 +26,7 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.Objects;
/**
*
@@ -121,4 +123,38 @@ public class SetSlotAVM2Item extends AVM2Item implements SetTypeAVM2Item, Assign
public boolean hasReturnValue() {
return false;
}
@Override
public int hashCode() {
int hash = 3;
hash = 29 * hash + Objects.hashCode(this.scope);
hash = 29 * hash + this.slotIndex;
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final SetSlotAVM2Item other = (SetSlotAVM2Item) obj;
if (this.slotIndex != other.slotIndex) {
return false;
}
if (!Objects.equals(this.scope, other.scope)) {
return false;
}
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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.model.clauses.DeclarationAVM2Item;
@@ -23,6 +24,7 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.Objects;
/**
*
@@ -104,4 +106,37 @@ public class SetSuperAVM2Item extends AVM2Item implements SetTypeAVM2Item {
public GraphTargetItem getValue() {
return value;
}
@Override
public int hashCode() {
int hash = 5;
hash = 67 * hash + Objects.hashCode(this.object);
hash = 67 * hash + Objects.hashCode(this.propertyName);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final SetSuperAVM2Item other = (SetSuperAVM2Item) obj;
if (!Objects.equals(this.object, other.object)) {
return false;
}
if (!Objects.equals(this.propertyName, other.propertyName)) {
return false;
}
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -29,6 +30,7 @@ import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import com.jpexs.helpers.Helper;
import java.util.List;
import java.util.Objects;
import java.util.Set;
/**
@@ -100,4 +102,30 @@ public class StringAVM2Item extends AVM2Item implements SimpleValue {
this.value = value;
numberValue = null;
}
@Override
public int hashCode() {
int hash = 7;
hash = 67 * hash + Objects.hashCode(this.value);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final StringAVM2Item other = (StringAVM2Item) obj;
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
}
@@ -31,6 +31,7 @@ import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
import java.util.Set;
/**
@@ -103,4 +104,24 @@ public class ThisAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
return hash;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -26,6 +27,7 @@ import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.ExitItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -57,4 +59,28 @@ public class ThrowAVM2Item extends AVM2Item implements ExitItem {
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
return ((AVM2SourceGenerator) generator).generate(localData, this);
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final GraphTargetItem other = (GraphTargetItem) obj;
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
return hash;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -76,4 +77,24 @@ public class UndefinedAVM2Item extends AVM2Item implements SimpleValue {
public boolean isSimpleValue() {
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
return hash;
}
}
@@ -12,7 +12,8 @@
* 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.helpers.GraphTextWriter;
@@ -20,6 +21,7 @@ import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.Objects;
/**
*
@@ -48,4 +50,30 @@ public class UnparsedAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return false;
}
@Override
public int hashCode() {
int hash = 5;
hash = 89 * hash + Objects.hashCode(this.value);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final UnparsedAVM2Item other = (UnparsedAVM2Item) obj;
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
}
@@ -29,6 +29,7 @@ import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
*
@@ -102,4 +103,34 @@ public class WithAVM2Item extends AVM2Item {
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
return ((AVM2SourceGenerator) generator).generate(localData, this);
}
@Override
public int hashCode() {
int hash = 5;
hash = 73 * hash + Objects.hashCode(this.scope);
hash = 73 * hash + Objects.hashCode(this.items);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final WithAVM2Item other = (WithAVM2Item) obj;
if (!Objects.equals(this.scope, other.scope)) {
return false;
}
if (!Objects.equals(this.items, other.items)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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.helpers.GraphTextWriter;
@@ -21,6 +22,7 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.Objects;
/**
*
@@ -59,4 +61,30 @@ public class WithEndAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return false;
}
@Override
public int hashCode() {
int hash = 7;
hash = 53 * hash + Objects.hashCode(this.scope);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final WithEndAVM2Item other = (WithEndAVM2Item) obj;
if (!Objects.equals(this.scope, other.scope)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -25,6 +26,7 @@ import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -63,4 +65,30 @@ public class WithObjectAVM2Item extends AVM2Item {
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
return scope.toSource(localData, generator);
}
@Override
public int hashCode() {
int hash = 7;
hash = 79 * hash + Objects.hashCode(this.scope);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final WithObjectAVM2Item other = (WithObjectAVM2Item) obj;
if (!Objects.equals(this.scope, other.scope)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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.helpers.GraphTextWriter;
@@ -23,6 +24,7 @@ import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -63,4 +65,30 @@ public class XMLAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 59 * hash + Objects.hashCode(this.parts);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final XMLAVM2Item other = (XMLAVM2Item) obj;
if (!Objects.equals(this.parts, other.parts)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
@@ -27,15 +28,17 @@ import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.BinaryOpItem;
import com.jpexs.decompiler.graph.model.CompoundableBinaryOp;
import com.jpexs.decompiler.graph.model.LocalData;
import com.jpexs.decompiler.graph.model.UnboundedTypeItem;
import java.util.List;
import java.util.Objects;
/**
*
* @author JPEXS
*/
public class AddAVM2Item extends BinaryOpItem {
public class AddAVM2Item extends BinaryOpItem implements CompoundableBinaryOp {
public AddAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_ADDITIVE, leftSide, rightSide, "+", "", ""); //?
@@ -12,7 +12,8 @@
* 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.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
@@ -23,6 +24,7 @@ import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.BinaryOpItem;
import com.jpexs.decompiler.graph.model.CompoundableBinaryOp;
import com.jpexs.decompiler.graph.model.UnboundedTypeItem;
import java.util.List;
@@ -30,7 +32,7 @@ import java.util.List;
*
* @author JPEXS
*/
public class BitAndAVM2Item extends BinaryOpItem {
public class BitAndAVM2Item extends BinaryOpItem implements CompoundableBinaryOp {
public BitAndAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_BITWISEAND, leftSide, rightSide, "&", "Number", "Number");
@@ -12,7 +12,8 @@
* 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.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
@@ -23,6 +24,7 @@ import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.BinaryOpItem;
import com.jpexs.decompiler.graph.model.CompoundableBinaryOp;
import com.jpexs.decompiler.graph.model.UnboundedTypeItem;
import java.util.List;
@@ -30,7 +32,7 @@ import java.util.List;
*
* @author JPEXS
*/
public class BitOrAVM2Item extends BinaryOpItem {
public class BitOrAVM2Item extends BinaryOpItem implements CompoundableBinaryOp {
public BitOrAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_BITWISEOR, leftSide, rightSide, "|", "Number", "Number");
@@ -12,7 +12,8 @@
* 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.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
@@ -23,6 +24,7 @@ import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.BinaryOpItem;
import com.jpexs.decompiler.graph.model.CompoundableBinaryOp;
import com.jpexs.decompiler.graph.model.UnboundedTypeItem;
import java.util.List;
@@ -30,7 +32,7 @@ import java.util.List;
*
* @author JPEXS
*/
public class BitXorAVM2Item extends BinaryOpItem {
public class BitXorAVM2Item extends BinaryOpItem implements CompoundableBinaryOp {
public BitXorAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_BITWISEXOR, leftSide, rightSide, "^", "Number", "Number");
@@ -12,7 +12,8 @@
* 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.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
@@ -33,6 +34,7 @@ import com.jpexs.decompiler.graph.TypeItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
*
@@ -104,4 +106,34 @@ public class DeletePropertyAVM2Item extends AVM2Item {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 53 * hash + Objects.hashCode(this.object);
hash = 53 * hash + Objects.hashCode(this.propertyName);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final DeletePropertyAVM2Item other = (DeletePropertyAVM2Item) obj;
if (!Objects.equals(this.object, other.object)) {
return false;
}
if (!Objects.equals(this.propertyName, other.propertyName)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
@@ -24,6 +25,7 @@ import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.BinaryOpItem;
import com.jpexs.decompiler.graph.model.CompoundableBinaryOp;
import com.jpexs.decompiler.graph.model.LocalData;
import com.jpexs.decompiler.graph.model.UnboundedTypeItem;
import java.util.List;
@@ -32,7 +34,7 @@ import java.util.List;
*
* @author JPEXS
*/
public class DivideAVM2Item extends BinaryOpItem {
public class DivideAVM2Item extends BinaryOpItem implements CompoundableBinaryOp {
public DivideAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_MULTIPLICATIVE, leftSide, rightSide, "/", "Number", "Number");
@@ -12,7 +12,8 @@
* 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.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
@@ -23,6 +24,7 @@ import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.BinaryOpItem;
import com.jpexs.decompiler.graph.model.CompoundableBinaryOp;
import com.jpexs.decompiler.graph.model.UnboundedTypeItem;
import java.util.List;
@@ -30,7 +32,7 @@ import java.util.List;
*
* @author JPEXS
*/
public class LShiftAVM2Item extends BinaryOpItem {
public class LShiftAVM2Item extends BinaryOpItem implements CompoundableBinaryOp {
public LShiftAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_BITWISESHIFT, leftSide, rightSide, "<<", "Number", "Number");
@@ -12,7 +12,8 @@
* 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.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
@@ -24,6 +25,7 @@ import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.BinaryOpItem;
import com.jpexs.decompiler.graph.model.CompoundableBinaryOp;
import com.jpexs.decompiler.graph.model.LocalData;
import com.jpexs.decompiler.graph.model.UnboundedTypeItem;
import java.util.List;
@@ -32,7 +34,7 @@ import java.util.List;
*
* @author JPEXS
*/
public class ModuloAVM2Item extends BinaryOpItem {
public class ModuloAVM2Item extends BinaryOpItem implements CompoundableBinaryOp {
public ModuloAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_MULTIPLICATIVE, leftSide, rightSide, "%", "Number", "Number");
@@ -12,7 +12,8 @@
* 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.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
@@ -24,6 +25,7 @@ import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.BinaryOpItem;
import com.jpexs.decompiler.graph.model.CompoundableBinaryOp;
import com.jpexs.decompiler.graph.model.LocalData;
import com.jpexs.decompiler.graph.model.UnboundedTypeItem;
import java.util.List;
@@ -32,7 +34,7 @@ import java.util.List;
*
* @author JPEXS
*/
public class MultiplyAVM2Item extends BinaryOpItem {
public class MultiplyAVM2Item extends BinaryOpItem implements CompoundableBinaryOp {
public MultiplyAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_MULTIPLICATIVE, leftSide, rightSide, "*", "Number", "Number");
@@ -12,7 +12,8 @@
* 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.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
@@ -23,6 +24,7 @@ import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.BinaryOpItem;
import com.jpexs.decompiler.graph.model.CompoundableBinaryOp;
import com.jpexs.decompiler.graph.model.UnboundedTypeItem;
import java.util.List;
@@ -30,7 +32,7 @@ import java.util.List;
*
* @author JPEXS
*/
public class RShiftAVM2Item extends BinaryOpItem {
public class RShiftAVM2Item extends BinaryOpItem implements CompoundableBinaryOp {
public RShiftAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_BITWISESHIFT, leftSide, rightSide, ">>", "Number", "Number");
@@ -12,7 +12,8 @@
* 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.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
@@ -25,6 +26,7 @@ import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.BinaryOpItem;
import com.jpexs.decompiler.graph.model.CompoundableBinaryOp;
import com.jpexs.decompiler.graph.model.LocalData;
import com.jpexs.decompiler.graph.model.UnboundedTypeItem;
import java.util.List;
@@ -33,7 +35,7 @@ import java.util.List;
*
* @author JPEXS
*/
public class SubtractAVM2Item extends BinaryOpItem {
public class SubtractAVM2Item extends BinaryOpItem implements CompoundableBinaryOp {
public SubtractAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_ADDITIVE, leftSide, rightSide, "-", "Number", "Number");
@@ -12,7 +12,8 @@
* 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.operations;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
@@ -23,6 +24,7 @@ import com.jpexs.decompiler.graph.GraphSourceItem;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.BinaryOpItem;
import com.jpexs.decompiler.graph.model.CompoundableBinaryOp;
import com.jpexs.decompiler.graph.model.UnboundedTypeItem;
import java.util.List;
@@ -30,7 +32,7 @@ import java.util.List;
*
* @author JPEXS
*/
public class URShiftAVM2Item extends BinaryOpItem {
public class URShiftAVM2Item extends BinaryOpItem implements CompoundableBinaryOp {
public URShiftAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem leftSide, GraphTargetItem rightSide) {
super(instruction, lineStartIns, PRECEDENCE_BITWISESHIFT, leftSide, rightSide, ">>>", "Number", "Number");
@@ -12,7 +12,8 @@
* 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;
@@ -26,6 +27,7 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -76,4 +78,28 @@ public class AsciiToCharActionItem extends ActionItem {
public boolean hasReturnValue() {
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final GraphTargetItem other = (GraphTargetItem) obj;
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
return hash;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -25,6 +26,7 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -61,4 +63,28 @@ public class CallActionItem extends ActionItem {
public boolean hasReturnValue() {
return false;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final GraphTargetItem other = (GraphTargetItem) obj;
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
return hash;
}
}
@@ -12,7 +12,8 @@
* 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.IdentifiersDeobfuscation;
@@ -12,7 +12,8 @@
* 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.IdentifiersDeobfuscation;
@@ -28,6 +29,7 @@ import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -134,4 +136,38 @@ public class CallMethodActionItem extends ActionItem {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 79 * hash + Objects.hashCode(this.methodName);
hash = 79 * hash + Objects.hashCode(this.scriptObject);
hash = 79 * hash + Objects.hashCode(this.arguments);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final CallMethodActionItem other = (CallMethodActionItem) obj;
if (!Objects.equals(this.methodName, other.methodName)) {
return false;
}
if (!Objects.equals(this.scriptObject, other.scriptObject)) {
return false;
}
if (!Objects.equals(this.arguments, other.arguments)) {
return false;
}
return true;
}
}
@@ -27,6 +27,7 @@ import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -76,4 +77,34 @@ public class CastOpActionItem extends ActionItem {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 7;
hash = 29 * hash + Objects.hashCode(this.constructor);
hash = 29 * hash + Objects.hashCode(this.object);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final CastOpActionItem other = (CastOpActionItem) obj;
if (!Objects.equals(this.constructor, other.constructor)) {
return false;
}
if (!Objects.equals(this.object, other.object)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -25,6 +26,7 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
import java.util.Set;
/**
@@ -91,4 +93,28 @@ public class CharToAsciiActionItem extends ActionItem {
public boolean hasReturnValue() {
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final GraphTargetItem other = (GraphTargetItem) obj;
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
return hash;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -42,6 +43,7 @@ public class CloneSpriteActionItem extends ActionItem {
@Override
public void visit(GraphTargetVisitorInterface visitor) {
visitor.visit(source);
visitor.visit(target);
visitor.visit(depth);
}
@@ -27,6 +27,7 @@ import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
import java.util.Set;
/**
@@ -93,4 +94,30 @@ public class DecrementActionItem extends ActionItem {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 3;
hash = 53 * hash + Objects.hashCode(this.object);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final DecrementActionItem other = (DecrementActionItem) obj;
if (!Objects.equals(this.object, other.object)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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.IdentifiersDeobfuscation;
@@ -29,6 +30,7 @@ import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -120,4 +122,33 @@ public class DefineLocalActionItem extends ActionItem implements SetTypeActionIt
public boolean hasReturnValue() {
return false;
}
@Override
public int hashCode() {
int hash = 7;
hash = 97 * hash + Objects.hashCode(this.name);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final DefineLocalActionItem other = (DefineLocalActionItem) obj;
if (!Objects.equals(this.name, other.name)) {
return false;
}
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
}
@@ -1,46 +0,0 @@
/*
* Copyright (C) 2010-2021 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.␍ */
package com.jpexs.decompiler.flash.action.model;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
import com.jpexs.decompiler.graph.model.LocalData;
/**
*
* @author JPEXS
*/
public class DefineRegisterActionItem extends ActionItem {
private final String identifier;
private final int register;
public DefineRegisterActionItem(String identifier, int register) {
super(null, null, PRECEDENCE_PRIMARY);
this.identifier = identifier;
this.register = register;
}
@Override
public GraphTextWriter appendTo(GraphTextWriter writer, LocalData localData) {
return writer.append("var ").append(identifier);
}
@Override
public boolean hasReturnValue() {
return false;
}
}
@@ -12,7 +12,8 @@
* 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.IdentifiersDeobfuscation;
@@ -28,6 +29,7 @@ import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -95,4 +97,34 @@ public class DeleteActionItem extends ActionItem {
public boolean hasReturnValue() {
return true;
}
@Override
public int hashCode() {
int hash = 7;
hash = 97 * hash + Objects.hashCode(this.object);
hash = 97 * hash + Objects.hashCode(this.propertyName);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final DeleteActionItem other = (DeleteActionItem) obj;
if (!Objects.equals(this.object, other.object)) {
return false;
}
if (!Objects.equals(this.propertyName, other.propertyName)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -27,6 +28,7 @@ import com.jpexs.decompiler.graph.GraphTargetVisitorInterface;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -72,4 +74,30 @@ public class EnumerateActionItem extends ActionItem {
public boolean hasReturnValue() {
return false;
}
@Override
public int hashCode() {
int hash = 5;
hash = 53 * hash + Objects.hashCode(this.object);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final EnumerateActionItem other = (EnumerateActionItem) obj;
if (!Objects.equals(this.object, other.object)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -27,6 +28,7 @@ import com.jpexs.decompiler.graph.model.BranchStackResistant;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
*
@@ -63,4 +65,24 @@ public class EnumeratedValueActionItem extends ActionItem implements BranchStack
public boolean hasReturnValue() {
return false;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
return hash;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -62,4 +63,24 @@ public class EnumerationAssignmentValueActionItem extends ActionItem {
public boolean hasReturnValue() {
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
return hash;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -24,6 +25,7 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -53,4 +55,28 @@ public class EvalActionItem extends ActionItem {
public boolean hasReturnValue() {
return true;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final GraphTargetItem other = (GraphTargetItem) obj;
if (!Objects.equals(this.value, other.value)) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 3;
return hash;
}
}
@@ -12,7 +12,8 @@
* 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.helpers.GraphTextWriter;
@@ -21,6 +22,7 @@ import com.jpexs.decompiler.graph.GraphSourceItemPos;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -57,4 +59,34 @@ public class ExtendsActionItem extends ActionItem {
public boolean hasReturnValue() {
return false;
}
@Override
public int hashCode() {
int hash = 7;
hash = 29 * hash + Objects.hashCode(this.subclass);
hash = 29 * hash + Objects.hashCode(this.superclass);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ExtendsActionItem other = (ExtendsActionItem) obj;
if (!Objects.equals(this.subclass, other.subclass)) {
return false;
}
if (!Objects.equals(this.superclass, other.superclass)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -28,6 +29,7 @@ import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
*
@@ -35,8 +37,6 @@ import java.util.List;
*/
public class FSCommand2ActionItem extends ActionItem {
public String target;
public List<GraphTargetItem> arguments;
public GraphTargetItem command;
@@ -92,4 +92,34 @@ public class FSCommand2ActionItem extends ActionItem {
public boolean hasReturnValue() {
return true; //FIXME ?
}
@Override
public int hashCode() {
int hash = 3;
hash = 71 * hash + Objects.hashCode(this.arguments);
hash = 71 * hash + Objects.hashCode(this.command);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final FSCommand2ActionItem other = (FSCommand2ActionItem) obj;
if (!Objects.equals(this.arguments, other.arguments)) {
return false;
}
if (!Objects.equals(this.command, other.command)) {
return false;
}
return true;
}
}
@@ -12,7 +12,8 @@
* 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;
@@ -27,6 +28,7 @@ import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.SourceGenerator;
import com.jpexs.decompiler.graph.model.LocalData;
import java.util.List;
import java.util.Objects;
/**
*
@@ -63,4 +65,30 @@ public class FSCommandActionItem extends ActionItem {
public boolean hasReturnValue() {
return false;
}
@Override
public int hashCode() {
int hash = 5;
hash = 97 * hash + Objects.hashCode(this.command);
return hash;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final FSCommandActionItem other = (FSCommandActionItem) obj;
if (!Objects.equals(this.command, other.command)) {
return false;
}
return true;
}
}

Some files were not shown because too many files have changed in this diff Show More