Refactorings in AVM2 instructions, float, decimal, etc.

Documentation for AVM2 instruction set stub
This commit is contained in:
Jindra Petřík
2016-03-26 20:13:03 +01:00
parent 610b3b6f3b
commit d54dafcbd9
81 changed files with 2059 additions and 133 deletions

View File

@@ -154,10 +154,10 @@ public class ABCOutputStream extends OutputStream {
}
public void writeFloat4(Float4 value) throws IOException {
writeFloat(value.value1);
writeFloat(value.value2);
writeFloat(value.value3);
writeFloat(value.value4);
writeFloat(value.values[0]);
writeFloat(value.values[1]);
writeFloat(value.values[2]);
writeFloat(value.values[3]);
}
public void writeU8(int value) throws IOException {

View File

@@ -29,6 +29,7 @@ import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2Graph;
import com.jpexs.decompiler.flash.abc.avm2.graph.AVM2GraphSource;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instructions;
import com.jpexs.decompiler.flash.abc.avm2.instructions.IfTypeIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
@@ -170,6 +171,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.other2.CoerceOIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other2.CoerceUIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other2.ConcatIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other2.ConvertF4Ins;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other2.ConvertFIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other2.ConvertMIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other2.ConvertMPIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other2.DecLocalPIns;
@@ -190,6 +192,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.other2.ModuloPIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other2.MultiplyPIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other2.NegatePIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other2.PrologueIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other2.PushConstantIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other2.PushFloatIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other2.PushDNanIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other2.PushDecimalIns;
@@ -200,6 +203,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.other2.Sf32x4Ins;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other2.SubtractPIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other2.SweepIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other2.TimestampIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other2.UnPlusIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other2.VerifyOpIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other2.VerifyPassIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other2.WbIns;
@@ -385,6 +389,8 @@ public class AVM2Code implements Cloneable {
public static final int DAT_FLOAT4_INDEX = OPT_U30 + 0x16;
public static final int DAT_NAMESPACE_INDEX = OPT_U30 + 0x17;
public static String operandTypeSizeToString(int ot) {
int sizeType = ot & 0xff00;
switch (sizeType) {
@@ -406,22 +412,23 @@ public class AVM2Code implements Cloneable {
private static Map<Integer, String> operandDataTypeIdentifiers = ReflectionTools.getConstNamesMap(AVM2Code.class, Integer.class, "^DAT_(.*)$");
public static String operandTypeToString(int ot) {
public static String operandTypeToString(int ot, boolean withTypeSize) {
String typeSize = operandTypeSizeToString(ot);
if (ot == OPT_CASE_OFFSETS) {
return "numOffsets (U30), offset1 (S24), offset2 (S24), ...";
return "number" + (withTypeSize ? "(U30)" : "") + ", offset" + (withTypeSize ? "(S24)" : "") + ", offset" + (withTypeSize ? "(S24)" : "") + ", ...";
}
if (operandDataTypeIdentifiers.containsKey(ot)) {
String dataType = operandDataTypeIdentifiers.get(ot);
return dataType + " (" + typeSize + ")";
return dataType + (withTypeSize ? "(" + typeSize + ")" : "");
} else {
return typeSize;
}
}
public static final InstructionDefinition[] instructionSet = new InstructionDefinition[]{
/*0x00*//*0x00*/null,
public static final InstructionDefinition[] instructionSet = new InstructionDefinition[256];
public static final InstructionDefinition[] allInstructionSet = new InstructionDefinition[]{
/*0x00*/null,
/*0x01*/ new BkptIns(),
/*0x02*/ new NopIns(),
/*0x03*/ new ThrowIns(),
@@ -455,7 +462,8 @@ public class AVM2Code implements Cloneable {
/*0x1F*/ new HasNextIns(),
/*0x20*/ new PushNullIns(),
/*0x21*/ new PushUndefinedIns(),
/*0x22*/ new PushFloatIns(), //major 47+, pushuninitialized(U30) before
/*0x22*/ new PushFloatIns(), //major 47+
/*0x22*/ new PushConstantIns(), //before major 47
/*0x23*/ new NextValueIns(),
/*0x24*/ new PushByteIns(),
/*0x25*/ new PushShortIns(),
@@ -472,7 +480,7 @@ public class AVM2Code implements Cloneable {
/*0x30*/ new PushScopeIns(),
/*0x31*/ new PushNamespaceIns(),
/*0x32*/ new HasNext2Ins(),
/*0x33*/ new PushDecimalIns(), //pushdecimal(minor 17), lix8 (internal-only) according to Tamarin
/*0x33*/ new PushDecimalIns(), //pushdecimal(minor 17), lix8 (internal-only) according to Tamarin
/*0x34*/ new PushDNanIns(), //pushdnan according to Flex SDK, lix16 (internal-only) according to Tamarin
/*0x35*/ new Li8Ins(),
/*0x36*/ new Li16Ins(),
@@ -542,9 +550,11 @@ public class AVM2Code implements Cloneable {
/*0x76*/ new ConvertBIns(),
/*0x77*/ new ConvertOIns(),
/*0x78*/ new CheckFilterIns(),
/*0x79*/ new ConvertMIns(), // convert_m according to Flex (minor 17), convert_f (major 47+)
/*0x7A*/ new ConvertMPIns(), //convert_m_p according to Flex (minor 17), unplus (major 47+)
/*0x7B*/ new ConvertF4Ins(), // (major 47+)
/*0x79*/ new ConvertMIns(), //minor 17 (Flex)
/*0x79*/ new ConvertFIns(), //major 47+, SWF 15+
/*0x7A*/ new ConvertMPIns(), //minor 17 (Flex)
/*0x7A*/ new UnPlusIns(), //major 47+, SWF 15+
/*0x7B*/ new ConvertF4Ins(), //major 47+, SWF 15+
/*0x7C*/ null,
/*0x7D*/ null,
/*0x7E*/ null,
@@ -680,24 +690,29 @@ public class AVM2Code implements Cloneable {
// endoflist
static {
for (int i = 0; i < instructionSet.length; i++) {
for (int i = 0; i < allInstructionSet.length; i++) {
if (allInstructionSet[i] != null) {
int opCode = allInstructionSet[i].instructionCode;
if (instructionSet[opCode] == null) {
instructionSet[opCode] = allInstructionSet[i];
} else if (instructionSet[opCode].hasFlag(AVM2InstructionFlag.NO_FLASH_PLAYER) && !allInstructionSet[i].hasFlag(AVM2InstructionFlag.NO_FLASH_PLAYER)) {
instructionSet[opCode] = allInstructionSet[i];
} //Prefer without decimal:
else if (instructionSet[opCode].hasFlag(AVM2InstructionFlag.ES4_NUMERICS_MINOR) && !allInstructionSet[i].hasFlag(AVM2InstructionFlag.ES4_NUMERICS_MINOR)) {
instructionSet[opCode] = allInstructionSet[i];
} //Prefer without float:
else if (instructionSet[opCode].hasFlag(AVM2InstructionFlag.FLOAT_MAJOR) && !allInstructionSet[i].hasFlag(AVM2InstructionFlag.FLOAT_MAJOR)) {
instructionSet[opCode] = allInstructionSet[i];
}
}
}
for (int i = 0;
i < instructionSet.length;
i++) {
if (instructionSet[i] == null) {
instructionSet[i] = new UnknownInstruction(i);
} else {
/*System.out.println("instruction." + instructionSet[i].instructionName + ".shortDescription = ");
System.out.println("instruction." + instructionSet[i].instructionName + ".description = ");
System.out.println("instruction." + instructionSet[i].instructionName + ".stackBefore = ");
System.out.println("instruction." + instructionSet[i].instructionName + ".stackAfter = ");
System.out.print("instruction." + instructionSet[i].instructionName + ".operands = ");
for (int j = 0; j < instructionSet[i].operands.length; j++) {
if (j > 0) {
System.out.print(" ");
}
System.out.print("operand" + (j + 1));
}
System.out.println("");
System.out.println("");*/
}
}
@@ -2145,8 +2160,7 @@ public class AVM2Code implements Cloneable {
ins.operands[j] = updater.updateOperandOffset(target, ins.operands[j]);
}
}*/ //Faster, but not so universal
{
if (ins.definition instanceof IfTypeIns) {
if (ins.definition instanceof IfTypeIns) {
long target = ins.getTargetAddress();
try {
ins.operands[0] = updater.updateOperandOffset(ins.getAddress(), target, ins.operands[0]);
@@ -2154,7 +2168,6 @@ public class AVM2Code implements Cloneable {
throw new ConvertException("Invalid offset (" + ins + ")", i);
}
}
}
ins.setAddress(updater.updateInstructionOffset(ins.getAddress()));
}

View File

@@ -482,6 +482,14 @@ public class AVM2ConstantPool implements Cloneable {
return constant_double.indexOf(value);
}
private int getFloatId(float value) {
return constant_float.indexOf(value);
}
private int getFloat4Id(Float4 value) {
return constant_float4.indexOf(value);
}
private int getStringId(String value) {
return constant_string.indexOf(value);
}
@@ -581,6 +589,22 @@ public class AVM2ConstantPool implements Cloneable {
return id;
}
public int getFloatId(float val, boolean add) {
int id = getFloatId(val);
if (add && id == -1) {
id = addFloat(val);
}
return id;
}
public int getFloat4Id(Float4 val, boolean add) {
int id = getFloat4Id(val);
if (add && id == -1) {
id = addFloat4(val);
}
return id;
}
public DottedChain getDottedChain(int index) {
String str = getString(index);
DottedChain chain = dottedChainCache.get(str);

View File

@@ -26,7 +26,9 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.jumps.LookupSwitchIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.ReturnValueIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.ReturnVoidIns;
import com.jpexs.decompiler.flash.abc.avm2.instructions.other.ThrowIns;
import com.jpexs.decompiler.flash.abc.types.Float4;
import com.jpexs.decompiler.flash.abc.types.Multiname;
import com.jpexs.decompiler.flash.abc.types.Namespace;
import com.jpexs.decompiler.flash.helpers.GraphTextWriter;
import com.jpexs.decompiler.graph.DottedChain;
import com.jpexs.decompiler.graph.GraphSource;
@@ -223,6 +225,14 @@ public class AVM2Instruction implements Cloneable, GraphSourceItem {
StringBuilder s = new StringBuilder();
for (int i = 0; i < definition.operands.length; i++) {
switch (definition.operands[i]) {
case AVM2Code.DAT_NAMESPACE_INDEX:
if (operands[i] == 0) {
s.append(" null");
} else {
s.append(" ");
s.append(Multiname.namespaceToString(constants, operands[i]));
}
break;
case AVM2Code.DAT_MULTINAME_INDEX:
if (operands[i] == 0) {
s.append(" null");
@@ -279,6 +289,33 @@ public class AVM2Instruction implements Cloneable, GraphSourceItem {
s.append(constants.getDouble(operands[i]));
}
break;
case AVM2Code.DAT_FLOAT_INDEX:
if (operands[i] == 0) {
s.append(" null");
} else {
s.append(" ");
s.append(constants.getFloat(operands[i]));
}
break;
case AVM2Code.DAT_FLOAT4_INDEX:
if (operands[i] == 0) {
s.append(" null");
} else {
Float4 f4 = constants.getFloat4(operands[i]);
s.append(" ").append(f4.values[0]);
s.append(" ").append(f4.values[1]);
s.append(" ").append(f4.values[2]);
s.append(" ").append(f4.values[3]);
}
break;
case AVM2Code.DAT_DECIMAL_INDEX:
if (operands[i] == 0) {
s.append(" null");
} else {
s.append(" ");
s.append(constants.getDecimal(operands[i]));
}
break;
case AVM2Code.DAT_OFFSET:
s.append(" ");
s.append("ofs");

View File

@@ -0,0 +1,16 @@
package com.jpexs.decompiler.flash.abc.avm2.instructions;
/**
*
* @author JPEXS
*/
public enum AVM2InstructionFlag {
UNDOCUMENTED,
UNKNOWN_STACK,
ES4_NUMERICS_MINOR,
FLOAT_MAJOR,
UNKNOWN_OPERANDS,
NO_FLASH_PLAYER,
DEPRECATED,
DOMAIN_MEMORY
}

View File

@@ -90,6 +90,8 @@ public class AVM2Instructions {
public static final int PushConstant = 0x22;
public static final int PushFloat = 0x22;
public static final int NextValue = 0x23;
public static final int PushByte = 0x24;
@@ -264,8 +266,6 @@ public class AVM2Instructions {
public static final int ConvertMP = 0x7A;
public static final int ConvertF4 = 0x7B;
public static final int Coerce = 0x80;
public static final int CoerceB = 0x81;
@@ -426,8 +426,12 @@ public class AVM2Instructions {
public static final int SendEnter = 0xFA;
public static final int UnPlus = 0xFA;
public static final int DoubleToAtom = 0xFB;
public static final int ConvertF4 = 0x7B;
public static final int Sweep = 0xFC;
public static final int CodeGenOp = 0xFD;

View File

@@ -63,11 +63,23 @@ public abstract class InstructionDefinition implements Serializable {
public boolean canThrow;
public InstructionDefinition(int instructionCode, String instructionName, int[] operands, boolean canThrow) {
public AVM2InstructionFlag[] flags;
public InstructionDefinition(int instructionCode, String instructionName, int[] operands, boolean canThrow, AVM2InstructionFlag... flags) {
this.instructionCode = instructionCode;
this.instructionName = instructionName;
this.operands = operands;
this.canThrow = canThrow;
this.flags = flags;
}
public boolean hasFlag(AVM2InstructionFlag flag) {
for (AVM2InstructionFlag f : flags) {
if (f == flag) {
return true;
}
}
return false;
}
@Override
@@ -75,7 +87,7 @@ public abstract class InstructionDefinition implements Serializable {
StringBuilder s = new StringBuilder();
s.append(instructionName);
for (int i = 0; i < operands.length; i++) {
s.append(AVM2Code.operandTypeToString(operands[i]));
s.append(AVM2Code.operandTypeToString(operands[i], true));
}
return s.toString();
}
@@ -108,6 +120,26 @@ public abstract class InstructionDefinition implements Serializable {
if (idx <= 0 || idx >= constants.getStringCount()) {
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, lda.isDebug(), new Object[]{idx, constants.getStringCount()});
}
} else if (operand == AVM2Code.DAT_NAMESPACE_INDEX) {
int idx = ins.operands[i];
if (idx <= 0 || idx >= constants.getNamespaceCount()) {
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, lda.isDebug(), new Object[]{idx, constants.getStringCount()});
}
} else if (operand == AVM2Code.DAT_FLOAT_INDEX) {
int idx = ins.operands[i];
if (idx <= 0 || idx >= constants.getFloatCount()) {
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, lda.isDebug(), new Object[]{idx, constants.getStringCount()});
}
} else if (operand == AVM2Code.DAT_FLOAT4_INDEX) {
int idx = ins.operands[i];
if (idx <= 0 || idx >= constants.getFloat4Count()) {
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, lda.isDebug(), new Object[]{idx, constants.getStringCount()});
}
} else if (operand == AVM2Code.DAT_DECIMAL_INDEX) {
int idx = ins.operands[i];
if (idx <= 0 || idx >= constants.getDecimalCount()) {
throw new AVM2VerifyErrorException(AVM2VerifyErrorException.CPOOL_INDEX_OUT_OF_RANGE, lda.isDebug(), new Object[]{idx, constants.getStringCount()});
}
}
}
}

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2RangeErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.model.AlchemyLoadAVM2Item;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -36,7 +37,7 @@ import java.util.List;
public class Lf32Ins extends InstructionDefinition implements AlchemyTypeIns {
public Lf32Ins() {
super(0x38, "lf32", new int[]{}, true);
super(0x38, "lf32", new int[]{}, true, AVM2InstructionFlag.DOMAIN_MEMORY);
}
@Override
@@ -55,7 +56,7 @@ public class Lf32Ins extends InstructionDefinition implements AlchemyTypeIns {
@Override
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
GraphTargetItem ofs = stack.pop();
stack.push(new AlchemyLoadAVM2Item(ins, localData.lineStartInstruction, ofs, 'f', 32));
stack.push(new AlchemyLoadAVM2Item(ins, localData.lineStartInstruction, ofs, "f", 32));
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2RangeErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.model.AlchemyLoadAVM2Item;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -36,7 +37,7 @@ import java.util.List;
public class Lf64Ins extends InstructionDefinition implements AlchemyTypeIns {
public Lf64Ins() {
super(0x39, "lf64", new int[]{}, true);
super(0x39, "lf64", new int[]{}, true, AVM2InstructionFlag.DOMAIN_MEMORY);
}
@Override
@@ -55,7 +56,7 @@ public class Lf64Ins extends InstructionDefinition implements AlchemyTypeIns {
@Override
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
GraphTargetItem ofs = stack.pop();
stack.push(new AlchemyLoadAVM2Item(ins, localData.lineStartInstruction, ofs, 'f', 64));
stack.push(new AlchemyLoadAVM2Item(ins, localData.lineStartInstruction, ofs, "f", 64));
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2RangeErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.model.AlchemyLoadAVM2Item;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -36,7 +37,7 @@ import java.util.List;
public class Li16Ins extends InstructionDefinition implements AlchemyTypeIns {
public Li16Ins() {
super(0x36, "li16", new int[]{}, true);
super(0x36, "li16", new int[]{}, true, AVM2InstructionFlag.DOMAIN_MEMORY);
}
@Override
@@ -55,7 +56,7 @@ public class Li16Ins extends InstructionDefinition implements AlchemyTypeIns {
@Override
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
GraphTargetItem ofs = stack.pop();
stack.push(new AlchemyLoadAVM2Item(ins, localData.lineStartInstruction, ofs, 'i', 16));
stack.push(new AlchemyLoadAVM2Item(ins, localData.lineStartInstruction, ofs, "i", 16));
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2RangeErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.model.AlchemyLoadAVM2Item;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -36,7 +37,7 @@ import java.util.List;
public class Li32Ins extends InstructionDefinition implements AlchemyTypeIns {
public Li32Ins() {
super(0x37, "li32", new int[]{}, true);
super(0x37, "li32", new int[]{}, true, AVM2InstructionFlag.DOMAIN_MEMORY);
}
@Override
@@ -55,7 +56,7 @@ public class Li32Ins extends InstructionDefinition implements AlchemyTypeIns {
@Override
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
GraphTargetItem ofs = stack.pop();
stack.push(new AlchemyLoadAVM2Item(ins, localData.lineStartInstruction, ofs, 'i', 32));
stack.push(new AlchemyLoadAVM2Item(ins, localData.lineStartInstruction, ofs, "i", 32));
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2RangeErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.model.AlchemyLoadAVM2Item;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -36,7 +37,7 @@ import java.util.List;
public class Li8Ins extends InstructionDefinition implements AlchemyTypeIns {
public Li8Ins() {
super(0x35, "li8", new int[]{}, true);
super(0x35, "li8", new int[]{}, true, AVM2InstructionFlag.DOMAIN_MEMORY);
}
@Override
@@ -54,7 +55,7 @@ public class Li8Ins extends InstructionDefinition implements AlchemyTypeIns {
@Override
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
GraphTargetItem ofs = stack.pop();
stack.push(new AlchemyLoadAVM2Item(ins, localData.lineStartInstruction, ofs, 'i', 8));
stack.push(new AlchemyLoadAVM2Item(ins, localData.lineStartInstruction, ofs, "i", 8));
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2RangeErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.model.AlchemyStoreAVM2Item;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -36,7 +37,7 @@ import java.util.List;
public class Sf32Ins extends InstructionDefinition implements AlchemyTypeIns {
public Sf32Ins() {
super(0x3D, "sf32", new int[]{}, true);
super(0x3D, "sf32", new int[]{}, true, AVM2InstructionFlag.DOMAIN_MEMORY);
}
@Override
@@ -57,7 +58,7 @@ public class Sf32Ins extends InstructionDefinition implements AlchemyTypeIns {
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
GraphTargetItem ofs = stack.pop();
GraphTargetItem value = stack.pop();
output.add(new AlchemyStoreAVM2Item(ins, localData.lineStartInstruction, value, ofs, 'f', 32));
output.add(new AlchemyStoreAVM2Item(ins, localData.lineStartInstruction, value, ofs, "f", 32));
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2RangeErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.model.AlchemyStoreAVM2Item;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -36,7 +37,7 @@ import java.util.List;
public class Sf64Ins extends InstructionDefinition implements AlchemyTypeIns {
public Sf64Ins() {
super(0x3E, "sf64", new int[]{}, true);
super(0x3E, "sf64", new int[]{}, true, AVM2InstructionFlag.DOMAIN_MEMORY);
}
@Override
@@ -57,7 +58,7 @@ public class Sf64Ins extends InstructionDefinition implements AlchemyTypeIns {
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
GraphTargetItem ofs = stack.pop();
GraphTargetItem value = stack.pop();
output.add(new AlchemyStoreAVM2Item(ins, localData.lineStartInstruction, value, ofs, 'f', 64));
output.add(new AlchemyStoreAVM2Item(ins, localData.lineStartInstruction, value, ofs, "f", 64));
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2RangeErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.model.AlchemyStoreAVM2Item;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -36,7 +37,7 @@ import java.util.List;
public class Si16Ins extends InstructionDefinition implements AlchemyTypeIns {
public Si16Ins() {
super(0x3B, "si16", new int[]{}, true);
super(0x3B, "si16", new int[]{}, true, AVM2InstructionFlag.DOMAIN_MEMORY);
}
@Override
@@ -57,7 +58,7 @@ public class Si16Ins extends InstructionDefinition implements AlchemyTypeIns {
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
GraphTargetItem ofs = stack.pop();
GraphTargetItem value = stack.pop();
output.add(new AlchemyStoreAVM2Item(ins, localData.lineStartInstruction, value, ofs, 'i', 16));
output.add(new AlchemyStoreAVM2Item(ins, localData.lineStartInstruction, value, ofs, "i", 16));
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2RangeErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.model.AlchemyStoreAVM2Item;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -36,7 +37,7 @@ import java.util.List;
public class Si32Ins extends InstructionDefinition implements AlchemyTypeIns {
public Si32Ins() {
super(0x3C, "si32", new int[]{}, true);
super(0x3C, "si32", new int[]{}, true, AVM2InstructionFlag.DOMAIN_MEMORY);
}
@Override
@@ -57,7 +58,7 @@ public class Si32Ins extends InstructionDefinition implements AlchemyTypeIns {
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
GraphTargetItem ofs = stack.pop();
GraphTargetItem value = stack.pop();
output.add(new AlchemyStoreAVM2Item(ins, localData.lineStartInstruction, value, ofs, 'i', 32));
output.add(new AlchemyStoreAVM2Item(ins, localData.lineStartInstruction, value, ofs, "i", 32));
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2RangeErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.model.AlchemyStoreAVM2Item;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -36,7 +37,7 @@ import java.util.List;
public class Si8Ins extends InstructionDefinition implements AlchemyTypeIns {
public Si8Ins() {
super(0x3A, "si8", new int[]{}, true);
super(0x3A, "si8", new int[]{}, true, AVM2InstructionFlag.DOMAIN_MEMORY);
}
@Override
@@ -57,7 +58,7 @@ public class Si8Ins extends InstructionDefinition implements AlchemyTypeIns {
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
GraphTargetItem ofs = stack.pop();
GraphTargetItem value = stack.pop();
output.add(new AlchemyStoreAVM2Item(ins, localData.lineStartInstruction, value, ofs, 'i', 8));
output.add(new AlchemyStoreAVM2Item(ins, localData.lineStartInstruction, value, ofs, "i", 8));
}
@Override

View File

@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.abc.AVM2LocalData;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.model.AlchemySignExtendAVM2Item;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -35,7 +36,7 @@ import java.util.List;
public class Sxi16Ins extends InstructionDefinition implements AlchemyTypeIns {
public Sxi16Ins() {
super(0x52, "sxi16", new int[]{}, false);
super(0x52, "sxi16", new int[]{}, false, AVM2InstructionFlag.DOMAIN_MEMORY);
}
@Override

View File

@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.abc.AVM2LocalData;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.model.AlchemySignExtendAVM2Item;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -35,7 +36,7 @@ import java.util.List;
public class Sxi1Ins extends InstructionDefinition implements AlchemyTypeIns {
public Sxi1Ins() {
super(0x50, "sxi1", new int[]{}, false);
super(0x50, "sxi1", new int[]{}, false, AVM2InstructionFlag.DOMAIN_MEMORY);
}
@Override

View File

@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.abc.AVM2LocalData;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.model.AlchemySignExtendAVM2Item;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -35,7 +36,7 @@ import java.util.List;
public class Sxi8Ins extends InstructionDefinition implements AlchemyTypeIns {
public Sxi8Ins() {
super(0x51, "sxi8", new int[]{}, false);
super(0x51, "sxi8", new int[]{}, false, AVM2InstructionFlag.DOMAIN_MEMORY);
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class AbsJumpIns extends InstructionDefinition {
public AbsJumpIns() {
super(0xEE, "abs_jump", new int[]{}, false /*?*/);
super(0xEE, "abs_jump", new int[]{}, false /*?*/, AVM2InstructionFlag.UNDOCUMENTED, AVM2InstructionFlag.UNKNOWN_OPERANDS, AVM2InstructionFlag.NO_FLASH_PLAYER);
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class AddDIns extends InstructionDefinition {
public AddDIns() {
super(0x9B, "add_d", new int[]{}, true /*?*/);
super(0x9B, "add_d", new int[]{}, true /*?*/, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.UNKNOWN_OPERANDS, AVM2InstructionFlag.UNKNOWN_STACK);
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class AddPIns extends InstructionDefinition {
public AddPIns() {
super(0xB5, "add_p", new int[]{AVM2Code.DAT_NUMBER_CONTEXT}, true /*?*/);
super(0xB5, "add_p", new int[]{AVM2Code.DAT_NUMBER_CONTEXT}, true /*?*/, AVM2InstructionFlag.ES4_NUMERICS_MINOR, AVM2InstructionFlag.NO_FLASH_PLAYER);
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class AllocIns extends InstructionDefinition {
public AllocIns() {
super(0xF6, "alloc", new int[]{}, true /*?*/);
super(0xF6, "alloc", new int[]{}, true /*?*/, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.UNDOCUMENTED, AVM2InstructionFlag.UNKNOWN_OPERANDS, AVM2InstructionFlag.UNKNOWN_STACK);
}
@Override

View File

@@ -30,7 +30,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class BkptLineIns extends InstructionDefinition {
public BkptLineIns() {
super(0xF2, "bkptline", new int[]{AVM2Code.OPT_U30}, false /*?*/);
super(0xF2, "bkptline", new int[]{AVM2Code.DAT_LINENUM}, false /*?*/);
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class CallInterfaceIns extends InstructionDefinition {
public CallInterfaceIns() {
super(0x4D, "callinterface", new int[]{AVM2Code.DAT_CLASS_INDEX}, true);
super(0x4D, "callinterface", new int[]{AVM2Code.DAT_CLASS_INDEX}, true, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.UNKNOWN_STACK, AVM2InstructionFlag.UNDOCUMENTED);
}
@Override

View File

@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -30,7 +31,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class CallSuperIdIns extends InstructionDefinition {
public CallSuperIdIns() {
super(0x4B, "callsuperid", new int[]{}, true);
super(0x4B, "callsuperid", new int[]{}, true, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.UNDOCUMENTED, AVM2InstructionFlag.UNKNOWN_OPERANDS, AVM2InstructionFlag.UNKNOWN_STACK);
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class CodeGenOpIns extends InstructionDefinition {
public CodeGenOpIns() {
super(0xFD, "codegenop", new int[]{}, false /*?*/);
super(0xFD, "codegenop", new int[]{}, false /*?*/, AVM2InstructionFlag.UNDOCUMENTED, AVM2InstructionFlag.UNKNOWN_OPERANDS, AVM2InstructionFlag.UNKNOWN_STACK, AVM2InstructionFlag.NO_FLASH_PLAYER);
}
@Override

View File

@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.CoerceOrConvertTypeIns;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -34,7 +35,7 @@ import com.jpexs.decompiler.graph.TypeItem;
public class CoerceBIns extends InstructionDefinition implements CoerceOrConvertTypeIns {
public CoerceBIns() {
super(0x81, "coerce_b", new int[]{}, true); // stack: -1+1
super(0x81, "coerce_b", new int[]{}, true, AVM2InstructionFlag.DEPRECATED); // stack: -1+1
}
@Override

View File

@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.CoerceOrConvertTypeIns;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -34,7 +35,7 @@ import com.jpexs.decompiler.graph.TypeItem;
public class CoerceDIns extends InstructionDefinition implements CoerceOrConvertTypeIns {
public CoerceDIns() {
super(0x84, "coerce_d", new int[]{}, true); // stack: -1+1
super(0x84, "coerce_d", new int[]{}, true, AVM2InstructionFlag.DEPRECATED); // stack: -1+1
}
@Override

View File

@@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.instructions.types.CoerceOrConvertTypeIns;
import com.jpexs.decompiler.flash.ecma.EcmaScript;
@@ -34,7 +35,7 @@ import com.jpexs.decompiler.graph.TypeItem;
public class CoerceIIns extends InstructionDefinition implements CoerceOrConvertTypeIns {
public CoerceIIns() {
super(0x83, "coerce_i", new int[]{}, true); // stack: -1+1
super(0x83, "coerce_i", new int[]{}, true, AVM2InstructionFlag.DEPRECATED); // stack: -1+1
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class ConcatIns extends InstructionDefinition {
public ConcatIns() {
super(0x9A, "concat", new int[]{}, true /*?*/);
super(0x9A, "concat", new int[]{}, true /*?*/, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.UNDOCUMENTED, AVM2InstructionFlag.UNKNOWN_OPERANDS, AVM2InstructionFlag.UNKNOWN_STACK);
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class ConvertF4Ins extends InstructionDefinition {
public ConvertF4Ins() {
super(0x7B, "convert_f4", new int[]{}, true);
super(0x7B, "convert_f4", new int[]{}, true, AVM2InstructionFlag.FLOAT_MAJOR, AVM2InstructionFlag.NO_FLASH_PLAYER);
}
@Override

View File

@@ -0,0 +1,56 @@
/*
* Copyright (C) 2010-2016 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.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
*
* @author JPEXS
*/
public class ConvertFIns extends InstructionDefinition {
public ConvertFIns() {
super(0x79, "convert_f", new int[]{}, true, AVM2InstructionFlag.FLOAT_MAJOR, AVM2InstructionFlag.NO_FLASH_PLAYER);
}
@Override
public void verify(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) throws AVM2VerifyErrorException {
if (lda.getRuntime() == AVM2Runtime.ADOBE_FLASH) {
illegalOpCode(lda, ins);
}
super.verify(lda, constants, ins);
}
@Override
public int getStackPopCount(AVM2Instruction ins, ABC abc) {
return 1;
}
@Override
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
return 1;
}
}

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class ConvertMIns extends InstructionDefinition {
public ConvertMIns() {
super(0x79, "convert_m", new int[]{}, true); // -1 +1
super(0x79, "convert_m", new int[]{}, true, AVM2InstructionFlag.ES4_NUMERICS_MINOR, AVM2InstructionFlag.NO_FLASH_PLAYER); // -1 +1
}
@Override

View File

@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -32,7 +33,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class ConvertMPIns extends InstructionDefinition {
public ConvertMPIns() {
super(0x7A, "convert_m_p", new int[]{AVM2Code.DAT_NUMBER_CONTEXT}, true);
super(0x7A, "convert_m_p", new int[]{AVM2Code.DAT_NUMBER_CONTEXT}, true, AVM2InstructionFlag.ES4_NUMERICS_MINOR, AVM2InstructionFlag.NO_FLASH_PLAYER);
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class DecLocalPIns extends InstructionDefinition {
public DecLocalPIns() {
super(0x9F, "declocal_p", new int[]{AVM2Code.DAT_NUMBER_CONTEXT, AVM2Code.DAT_LOCAL_REG_INDEX}, false /*?*/);
super(0x9F, "declocal_p", new int[]{AVM2Code.DAT_NUMBER_CONTEXT, AVM2Code.DAT_LOCAL_REG_INDEX}, false /*?*/, AVM2InstructionFlag.ES4_NUMERICS_MINOR, AVM2InstructionFlag.NO_FLASH_PLAYER);
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class DecodeIns extends InstructionDefinition {
public DecodeIns() {
super(0xFF, "decode", new int[]{}, false /*?*/);
super(0xFF, "decode", new int[]{}, false /*?*/, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.UNDOCUMENTED, AVM2InstructionFlag.UNKNOWN_OPERANDS, AVM2InstructionFlag.UNKNOWN_STACK);
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class DecrementPIns extends InstructionDefinition {
public DecrementPIns() {
super(0x9E, "decrement_p", new int[]{AVM2Code.DAT_NUMBER_CONTEXT}, true /*?*/);
super(0x9E, "decrement_p", new int[]{AVM2Code.DAT_NUMBER_CONTEXT}, true /*?*/, AVM2InstructionFlag.ES4_NUMERICS_MINOR, AVM2InstructionFlag.NO_FLASH_PLAYER);
}
@Override

View File

@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -32,7 +33,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class DelDescendantsIns extends InstructionDefinition {
public DelDescendantsIns() {
super(0x5B, "deldescendants", new int[]{AVM2Code.DAT_MULTINAME_INDEX}, true);
super(0x5B, "deldescendants", new int[]{AVM2Code.DAT_MULTINAME_INDEX}, true, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.UNKNOWN_STACK, AVM2InstructionFlag.UNDOCUMENTED);
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class DeletePropertyLateIns extends InstructionDefinition {
public DeletePropertyLateIns() {
super(0x6B, "deletepropertylate", new int[]{}, true /*?*/);
super(0x6B, "deletepropertylate", new int[]{}, true /*?*/, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.UNDOCUMENTED, AVM2InstructionFlag.UNKNOWN_STACK);
}
@Override

View File

@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -32,7 +33,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class DividePIns extends InstructionDefinition {
public DividePIns() {
super(0xB8, "divide_p", new int[]{AVM2Code.DAT_NUMBER_CONTEXT}, true /*?*/);
super(0xB8, "divide_p", new int[]{AVM2Code.DAT_NUMBER_CONTEXT}, true /*?*/, AVM2InstructionFlag.ES4_NUMERICS_MINOR, AVM2InstructionFlag.NO_FLASH_PLAYER);
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class DoubleToAtomIns extends InstructionDefinition {
public DoubleToAtomIns() {
super(0xFB, "doubletoatom", new int[]{}, true /*?*/);
super(0xFB, "doubletoatom", new int[]{}, true /*?*/, AVM2InstructionFlag.UNDOCUMENTED, AVM2InstructionFlag.UNKNOWN_OPERANDS, AVM2InstructionFlag.UNKNOWN_STACK, AVM2InstructionFlag.NO_FLASH_PLAYER);
}
@Override

View File

@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -32,7 +33,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class FindPropGlobalIns extends InstructionDefinition {
public FindPropGlobalIns() {
super(0x5C, "findpropglobal", new int[]{AVM2Code.DAT_MULTINAME_INDEX}, true);
super(0x5C, "findpropglobal", new int[]{AVM2Code.DAT_MULTINAME_INDEX}, true, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.UNKNOWN_STACK);
}
@Override

View File

@@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -28,7 +29,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class FindPropGlobalStrictIns extends InstructionDefinition {
public FindPropGlobalStrictIns() {
super(0x5B, "findpropglobalstrict", new int[]{AVM2Code.DAT_MULTINAME_INDEX}, true);
super(0x5B, "findpropglobalstrict", new int[]{AVM2Code.DAT_MULTINAME_INDEX}, true, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.UNKNOWN_STACK);
}
@Override

View File

@@ -28,7 +28,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class GetOuterScopeIns extends InstructionDefinition {
public GetOuterScopeIns() {
super(0x67, "getouterscope", new int[]{AVM2Code.DAT_MULTINAME_INDEX}, false);
super(0x67, "getouterscope", new int[]{AVM2Code.DAT_SCOPE_INDEX}, false);
}
@Override

View File

@@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -27,7 +28,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class GetPropertyLateIns extends InstructionDefinition {
public GetPropertyLateIns() {
super(0x67, "getpropertylate", new int[]{}, true /*?*/);
super(0x67, "getpropertylate", new int[]{}, true /*?*/, AVM2InstructionFlag.UNDOCUMENTED, AVM2InstructionFlag.UNKNOWN_STACK, AVM2InstructionFlag.NO_FLASH_PLAYER);
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class IncLocalPIns extends InstructionDefinition {
public IncLocalPIns() {
super(0x9D, "inclocal_p", new int[]{AVM2Code.DAT_NUMBER_CONTEXT, AVM2Code.DAT_LOCAL_REG_INDEX}, true /*?*/);
super(0x9D, "inclocal_p", new int[]{AVM2Code.DAT_NUMBER_CONTEXT, AVM2Code.DAT_LOCAL_REG_INDEX}, true /*?*/, AVM2InstructionFlag.ES4_NUMERICS_MINOR, AVM2InstructionFlag.NO_FLASH_PLAYER);
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class IncrementPIns extends InstructionDefinition {
public IncrementPIns() {
super(0x9C, "increment_p", new int[]{AVM2Code.DAT_NUMBER_CONTEXT}, true /*?*/);
super(0x9C, "increment_p", new int[]{AVM2Code.DAT_NUMBER_CONTEXT}, true /*?*/, AVM2InstructionFlag.ES4_NUMERICS_MINOR, AVM2InstructionFlag.NO_FLASH_PLAYER);
}
@Override

View File

@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -30,7 +31,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class InvalidIns extends InstructionDefinition {
public InvalidIns() {
super(0xED, "invalid", new int[]{}, false);
super(0xED, "invalid", new int[]{}, false, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.UNKNOWN_OPERANDS, AVM2InstructionFlag.UNKNOWN_STACK, AVM2InstructionFlag.UNDOCUMENTED);
}
@Override

View File

@@ -16,12 +16,19 @@
*/
package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.AVM2LocalData;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import com.jpexs.decompiler.flash.abc.avm2.model.AlchemyLoadAVM2Item;
import com.jpexs.decompiler.graph.GraphTargetItem;
import com.jpexs.decompiler.graph.TranslateStack;
import java.util.List;
/**
*
@@ -30,7 +37,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class Lf32x4Ins extends InstructionDefinition {
public Lf32x4Ins() {
super(0x0A, "lf32x4", new int[]{}, true);
super(0x0A, "lf32x4", new int[]{}, true, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.DOMAIN_MEMORY, AVM2InstructionFlag.FLOAT_MAJOR);
}
@Override
@@ -41,4 +48,20 @@ public class Lf32x4Ins extends InstructionDefinition {
super.verify(lda, constants, ins);
}
@Override
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
GraphTargetItem ofs = stack.pop();
stack.push(new AlchemyLoadAVM2Item(ins, localData.lineStartInstruction, ofs, "f4", 32));
}
@Override
public int getStackPopCount(AVM2Instruction ins, ABC abc) {
return 1;
}
@Override
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
return 1;
}
}

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class MarkIns extends InstructionDefinition {
public MarkIns() {
super(0xF7, "mark", new int[]{}, false /*?*/);
super(0xF7, "mark", new int[]{}, false /*?*/, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.UNDOCUMENTED, AVM2InstructionFlag.UNKNOWN_STACK, AVM2InstructionFlag.UNKNOWN_OPERANDS);
}
@Override

View File

@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -32,7 +33,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class ModuloPIns extends InstructionDefinition {
public ModuloPIns() {
super(0xB9, "modulo_p", new int[]{AVM2Code.DAT_NUMBER_CONTEXT}, true /*?*/);
super(0xB9, "modulo_p", new int[]{AVM2Code.DAT_NUMBER_CONTEXT}, true /*?*/, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.ES4_NUMERICS_MINOR);
}
@Override

View File

@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -32,7 +33,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class MultiplyPIns extends InstructionDefinition {
public MultiplyPIns() {
super(0xB7, "multiply_p", new int[]{AVM2Code.DAT_NUMBER_CONTEXT}, true /*?*/);
super(0xB7, "multiply_p", new int[]{AVM2Code.DAT_NUMBER_CONTEXT}, true /*?*/, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.ES4_NUMERICS_MINOR);
}
@Override

View File

@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -32,7 +33,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class NegatePIns extends InstructionDefinition {
public NegatePIns() {
super(0x8F, "negate_p", new int[]{AVM2Code.DAT_NUMBER_CONTEXT}, true /*?*/);
super(0x8F, "negate_p", new int[]{AVM2Code.DAT_NUMBER_CONTEXT}, true /*?*/, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.ES4_NUMERICS_MINOR);
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class PrologueIns extends InstructionDefinition {
public PrologueIns() {
super(0xF9, "prologue", new int[]{}, false /*?*/);
super(0xF9, "prologue", new int[]{}, false /*?*/, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.UNKNOWN_STACK, AVM2InstructionFlag.UNKNOWN_OPERANDS, AVM2InstructionFlag.UNDOCUMENTED);
}
@Override

View File

@@ -19,16 +19,17 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
*
* @author JPEXS
*/
public class PushUninitializedIns extends InstructionDefinition {
public class PushConstantIns extends InstructionDefinition {
public PushUninitializedIns() {
super(0x22, "pushuninitialized", new int[]{AVM2Code.OPT_U30}, false /*?*/);
public PushConstantIns() {
super(0x22, "pushconstant", new int[]{AVM2Code.OPT_U30}, false /*?*/, AVM2InstructionFlag.UNDOCUMENTED, AVM2InstructionFlag.UNKNOWN_STACK);
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class PushDNanIns extends InstructionDefinition {
public PushDNanIns() {
super(0x34, "pushdnan", new int[]{}, true);
super(0x34, "pushdnan", new int[]{}, true, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.ES4_NUMERICS_MINOR, AVM2InstructionFlag.UNKNOWN_STACK);
}
@Override

View File

@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -32,7 +33,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class PushDecimalIns extends InstructionDefinition {
public PushDecimalIns() {
super(0x33, "pushdecimal", new int[]{AVM2Code.DAT_DECIMAL_INDEX}, true);
super(0x33, "pushdecimal", new int[]{AVM2Code.DAT_DECIMAL_INDEX}, true, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.ES4_NUMERICS_MINOR);
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class PushFloat4Ins extends InstructionDefinition {
public PushFloat4Ins() {
super(0x54, "pushfloat4", new int[]{AVM2Code.DAT_FLOAT4_INDEX}, false);
super(0x54, "pushfloat4", new int[]{AVM2Code.DAT_FLOAT4_INDEX}, false, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.FLOAT_MAJOR);
}
@Override

View File

@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -32,7 +33,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class PushFloatIns extends InstructionDefinition {
public PushFloatIns() {
super(0x22, "pushfloat", new int[]{AVM2Code.DAT_FLOAT_INDEX}, false /*?*/);
super(0x22, "pushfloat", new int[]{AVM2Code.DAT_FLOAT_INDEX}, false /*?*/, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.FLOAT_MAJOR);
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class SendEnterIns extends InstructionDefinition {
public SendEnterIns() {
super(0xFA, "sendenter", new int[]{}, false /*?*/);
super(0xFA, "sendenter", new int[]{}, false /*?*/, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.UNDOCUMENTED, AVM2InstructionFlag.UNKNOWN_OPERANDS, AVM2InstructionFlag.UNKNOWN_STACK);
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class SetPropertyLateIns extends InstructionDefinition {
public SetPropertyLateIns() {
super(0x69, "setpropertylate", new int[]{}, true /*?*/);
super(0x69, "setpropertylate", new int[]{}, true /*?*/, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.UNKNOWN_OPERANDS, AVM2InstructionFlag.UNKNOWN_STACK, AVM2InstructionFlag.UNDOCUMENTED);
}
@Override

View File

@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -30,7 +31,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class Sf32x4Ins extends InstructionDefinition {
public Sf32x4Ins() {
super(0x0B, "sf32x4", new int[]{}, true);
super(0x0B, "sf32x4", new int[]{}, true, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.DOMAIN_MEMORY, AVM2InstructionFlag.FLOAT_MAJOR);
}
@Override

View File

@@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -32,7 +33,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class SubtractPIns extends InstructionDefinition {
public SubtractPIns() {
super(0xB6, "subtract_p", new int[]{AVM2Code.DAT_NUMBER_CONTEXT}, true /*?*/);
super(0xB6, "subtract_p", new int[]{AVM2Code.DAT_NUMBER_CONTEXT}, true /*?*/, AVM2InstructionFlag.ES4_NUMERICS_MINOR, AVM2InstructionFlag.NO_FLASH_PLAYER);
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class SweepIns extends InstructionDefinition {
public SweepIns() {
super(0xFC, "sweep", new int[]{}, false /*?*/);
super(0xFC, "sweep", new int[]{}, false /*?*/, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.UNKNOWN_OPERANDS, AVM2InstructionFlag.UNKNOWN_STACK, AVM2InstructionFlag.UNDOCUMENTED);
}
@Override

View File

@@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -28,7 +29,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class TimestampIns extends InstructionDefinition {
public TimestampIns() {
super(0xF3, "timestamp", new int[]{}, false /*?*/);
super(0xF3, "timestamp", new int[]{}, false /*?*/, AVM2InstructionFlag.UNDOCUMENTED);
}
@Override

View File

@@ -0,0 +1,45 @@
/*
* Copyright (C) 2010-2016 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.abc.avm2.instructions.other2;
import com.jpexs.decompiler.flash.abc.ABC;
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
*
* @author JPEXS
*/
public class UnPlusIns extends InstructionDefinition {
public UnPlusIns() {
super(0x7A, "unplus", new int[]{}, true, AVM2InstructionFlag.FLOAT_MAJOR, AVM2InstructionFlag.NO_FLASH_PLAYER);
}
@Override
public int getStackPopCount(AVM2Instruction ins, ABC abc) {
return 1;
}
@Override
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
return 1;
}
}

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class VerifyOpIns extends InstructionDefinition {
public VerifyOpIns() {
super(0xFE, "verifyop", new int[]{}, false /*?*/);
super(0xFE, "verifyop", new int[]{}, false /*?*/, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.UNKNOWN_OPERANDS, AVM2InstructionFlag.UNKNOWN_STACK, AVM2InstructionFlag.UNDOCUMENTED);
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class VerifyPassIns extends InstructionDefinition {
public VerifyPassIns() {
super(0xF5, "verifypass", new int[]{}, false /*?*/);
super(0xF5, "verifypass", new int[]{}, false /*?*/, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.UNDOCUMENTED, AVM2InstructionFlag.UNKNOWN_OPERANDS, AVM2InstructionFlag.UNKNOWN_STACK);
}
@Override

View File

@@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2Runtime;
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
import com.jpexs.decompiler.flash.abc.avm2.exceptions.AVM2VerifyErrorException;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
/**
@@ -31,7 +32,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
public class WbIns extends InstructionDefinition {
public WbIns() {
super(0xF8, "wb", new int[]{}, false /*?*/);
super(0xF8, "wb", new int[]{}, false /*?*/, AVM2InstructionFlag.NO_FLASH_PLAYER, AVM2InstructionFlag.UNDOCUMENTED, AVM2InstructionFlag.UNKNOWN_OPERANDS, AVM2InstructionFlag.UNKNOWN_STACK);
}
@Override

View File

@@ -33,7 +33,7 @@ import java.util.List;
public class PushNamespaceIns extends InstructionDefinition {
public PushNamespaceIns() {
super(0x31, "pushnamespace", new int[]{AVM2Code.OPT_U30}, false);
super(0x31, "pushnamespace", new int[]{AVM2Code.DAT_NAMESPACE_INDEX}, false);
}
@Override

View File

@@ -34,13 +34,13 @@ import java.util.List;
*/
public class AlchemyLoadAVM2Item extends AVM2Item {
private final char type;
private final String type;
private final int size;
private final GraphTargetItem ofs;
public AlchemyLoadAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem ofs, char type, int size) {
public AlchemyLoadAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem ofs, String type, int size) {
super(instruction, lineStartIns, PRECEDENCE_PRIMARY);
this.ofs = ofs;
this.type = type;
@@ -56,7 +56,11 @@ public class AlchemyLoadAVM2Item extends AVM2Item {
@Override
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
String ts = "" + type + size;
if (type.equals("f4")) {
ts = "f32x4";
}
int code = 0;
switch (ts) {
case "i8":
@@ -74,6 +78,9 @@ public class AlchemyLoadAVM2Item extends AVM2Item {
case "f32":
code = AVM2Instructions.Lf64;
break;
case "f32x4":
code = AVM2Instructions.Lf32x4;
break;
}
return toSourceMerge(localData, generator, ofs, ins(code));
}
@@ -81,10 +88,12 @@ public class AlchemyLoadAVM2Item extends AVM2Item {
@Override
public GraphTargetItem returnType() {
switch (type) {
case 'i':
case "i":
return new TypeItem(DottedChain.INT);
case 'f':
case "f":
return new TypeItem(DottedChain.NUMBER);
case "f4":
return new TypeItem("float4");
}
return TypeItem.UNBOUNDED;
}

View File

@@ -33,13 +33,13 @@ import java.util.List;
*/
public class AlchemyStoreAVM2Item extends AVM2Item {
private final char type;
private final String type;
private final int size;
private final GraphTargetItem ofs;
public AlchemyStoreAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem value, GraphTargetItem ofs, char type, int size) {
public AlchemyStoreAVM2Item(GraphSourceItem instruction, GraphSourceItem lineStartIns, GraphTargetItem value, GraphTargetItem ofs, String type, int size) {
super(instruction, lineStartIns, PRECEDENCE_PRIMARY, value);
this.ofs = ofs;
this.type = type;
@@ -68,6 +68,9 @@ public class AlchemyStoreAVM2Item extends AVM2Item {
@Override
public List<GraphSourceItem> toSource(SourceGeneratorLocalData localData, SourceGenerator generator) throws CompilationException {
String ts = "" + type + size;
if (type.equals("f4")) {
ts = "f32x4";
}
int code = 0;
switch (ts) {
case "i8":
@@ -82,6 +85,9 @@ public class AlchemyStoreAVM2Item extends AVM2Item {
case "f32":
code = AVM2Instructions.Sf32;
break;
case "f32x4":
code = AVM2Instructions.Sf32x4;
break;
case "f64":
code = AVM2Instructions.Sf64;
break;

View File

@@ -25,6 +25,7 @@ import com.jpexs.decompiler.flash.abc.avm2.instructions.UnknownInstruction;
import com.jpexs.decompiler.flash.abc.avm2.instructions.stack.PushShortIns;
import com.jpexs.decompiler.flash.abc.avm2.parser.AVM2ParseException;
import com.jpexs.decompiler.flash.abc.types.ABCException;
import com.jpexs.decompiler.flash.abc.types.Float4;
import com.jpexs.decompiler.flash.abc.types.MethodBody;
import com.jpexs.decompiler.flash.abc.types.MethodInfo;
import com.jpexs.decompiler.flash.abc.types.Multiname;
@@ -764,11 +765,10 @@ public class ASM3Parser {
case AVM2Code.DAT_MULTINAME_INDEX:
lexer.pushback(parsedOperand);
operandsList.add(parseMultiName(constants, lexer));
/*if (parsedOperand.type == ParsedSymbol.TYPE_MULTINAME) {
operandsList.add(checkMultinameIndex(constants, (int) (long) (Long) parsedOperand.value, lexer.yyline()));
} else {
throw new ParseException("Multiname expected", lexer.yyline());
}*/
break;
case AVM2Code.DAT_NAMESPACE_INDEX:
lexer.pushback(parsedOperand);
operandsList.add(parseNamespace(constants, lexer));
break;
case AVM2Code.DAT_STRING_INDEX:
if (parsedOperand.type == ParsedSymbol.TYPE_KEYWORD_NULL) {
@@ -845,10 +845,69 @@ public class ASM3Parser {
}
}
operandsList.add(did);
} else {
throw new AVM2ParseException("Double or null expected", lexer.yyline());
}
break;
case AVM2Code.DAT_FLOAT_INDEX:
if (parsedOperand.type == ParsedSymbol.TYPE_KEYWORD_NULL) {
operandsList.add(0);
} else if ((parsedOperand.type == ParsedSymbol.TYPE_INTEGER) || (parsedOperand.type == ParsedSymbol.TYPE_FLOAT)) {
float floatVal = 0;
if (parsedOperand.type == ParsedSymbol.TYPE_INTEGER) {
floatVal = (Long) parsedOperand.value;
}
if (parsedOperand.type == ParsedSymbol.TYPE_FLOAT) {
floatVal = (float) (double) (Double) parsedOperand.value;
}
int fid = constants.getFloatId(floatVal, false);
if (fid == -1) {
if ((missingHandler != null) && (missingHandler.missingFloat(floatVal))) {
fid = constants.addFloat(floatVal);
} else {
throw new AVM2ParseException("Unknown float", lexer.yyline());
}
}
operandsList.add(fid);
} else {
throw new AVM2ParseException("Float or null expected", lexer.yyline());
}
break;
case AVM2Code.DAT_FLOAT4_INDEX:
if (parsedOperand.type == ParsedSymbol.TYPE_KEYWORD_NULL) {
operandsList.add(0);
} else {
float[] float4Vals = new float[4];
for (int k = 0; k < 4; k++) {
if ((parsedOperand.type == ParsedSymbol.TYPE_INTEGER) || (parsedOperand.type == ParsedSymbol.TYPE_FLOAT)) {
float floatVal = 0;
if (parsedOperand.type == ParsedSymbol.TYPE_INTEGER) {
floatVal = (Long) parsedOperand.value;
}
if (parsedOperand.type == ParsedSymbol.TYPE_FLOAT) {
floatVal = (float) (double) (Double) parsedOperand.value;
}
float4Vals[k] = floatVal;
} else {
throw new AVM2ParseException("4 floats or null expected", lexer.yyline());
}
if (k + 1 < 4) { //not last one
parsedOperand = lexer.lex();
}
}
Float4 float4Val = new Float4(float4Vals);
int f4id = constants.getFloat4Id(float4Val, false);
if (f4id == -1) {
if ((missingHandler != null) && (missingHandler.missingFloat4(float4Val))) {
f4id = constants.addFloat4(float4Val);
} else {
throw new AVM2ParseException("Unknown float4", lexer.yyline());
}
}
operandsList.add(f4id);
}
break;
case AVM2Code.DAT_OFFSET:
if (parsedOperand.type == ParsedSymbol.TYPE_IDENTIFIER) {
offsetItems.add(new OffsetItem((String) parsedOperand.value, code.code.size(), i));

View File

@@ -16,6 +16,9 @@
*/
package com.jpexs.decompiler.flash.abc.avm2.parser.pcode;
import com.jpexs.decompiler.flash.abc.types.Decimal;
import com.jpexs.decompiler.flash.abc.types.Float4;
/**
*
* @author JPEXS
@@ -29,4 +32,10 @@ public interface MissingSymbolHandler {
public boolean missingUInt(long value);
public boolean missingDouble(double value);
public boolean missingFloat(float value);
public boolean missingFloat4(Float4 value);
public boolean missingDecimal(Decimal value);
}

View File

@@ -2,16 +2,20 @@ package com.jpexs.decompiler.flash.abc.types;
public class Float4 {
public float value1;
public float value2;
public float value3;
public float value4;
public float values[] = new float[4];
public Float4(float value1, float value2, float value3, float value4) {
this.value1 = value1;
this.value2 = value2;
this.value3 = value3;
this.value4 = value4;
this.values = new float[]{value1, value2, value3, value4};
}
public Float4(float[] values) {
if (values == null || values.length < 4) {
throw new IllegalArgumentException("Invalid values size");
}
this.values[0] = values[0];
this.values[1] = values[1];
this.values[2] = values[2];
this.values[3] = values[3];
}
}

View File

@@ -36,7 +36,7 @@ public class InstanceInfo {
public int super_index;
public int flags; // 1 = sealed, 0 = dynamic, 2 = final, 4 = interface, 8 = ProtectedNs
public int flags; // 1 = sealed, 0 = dynamic, 2 = final, 4 = interface, 8 = ProtectedNs, 16 = non nullable
public int protectedNS; //if flags & 8
@@ -54,6 +54,8 @@ public class InstanceInfo {
public static final int CLASS_PROTECTEDNS = 8;
public static final int CLASS_NON_NULLABLE = 16; //This is somehow used in Flex, propably through annotations or something with Vector datatype (?)
@Internal
public boolean deleted;
@@ -144,4 +146,8 @@ public class InstanceInfo {
public boolean isFinal() {
return (flags & CLASS_FINAL) == CLASS_FINAL;
}
public boolean isNullable() {
return (flags & CLASS_NON_NULLABLE) != CLASS_NON_NULLABLE;
}
}

View File

@@ -219,7 +219,7 @@ public class Multiname {
}
private static String namespaceToString(AVM2ConstantPool constants, int index) {
public static String namespaceToString(AVM2ConstantPool constants, int index) {
if (index == 0) {
return "null";
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,134 @@
package com.jpexs.decompiler.flash.locales.docs.pcode;
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2InstructionFlag;
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
/**
* Generator for AVM2 instruction set documentation. TODO: use this somehow in
* GUI
*
* @author JPEXS
*/
public class AS3Generator {
private static String makeIdent(String name) {
StringBuilder identName = new StringBuilder();
boolean cap = false;
for (int i = 0; i < name.length(); i++) {
char c = name.charAt(i);
if (c == '_') {
cap = true;
continue;
}
if (cap) {
identName.append(c);
cap = false;
} else {
identName.append(Character.toLowerCase(c));
}
}
return identName.toString();
}
public static void main(String[] args) throws IOException {
Properties prop = new Properties();
prop.load(AS3Generator.class.getClassLoader().getResourceAsStream("com/jpexs/decompiler/flash/locales/docs/pcode/AS3.properties"));
Map<AVM2InstructionFlag, String> flagDescriptions = new HashMap<>();
for (AVM2InstructionFlag flg : AVM2InstructionFlag.values()) {
String flagIdent = makeIdent(flg.toString());
String flagDescription = prop.getProperty("instructionFlag." + flagIdent);
flagDescriptions.put(flg, flagDescription);
}
for (InstructionDefinition def : AVM2Code.allInstructionSet) {
if (def == null) {
continue;
}
System.out.println("=========================");
String insName = def.instructionName;
String insShortDescription = prop.getProperty("instruction." + insName + ".shortDescription");
String insDescription = prop.getProperty("instruction." + insName + ".description");
String stackBefore = def.hasFlag(AVM2InstructionFlag.UNKNOWN_STACK) ? "???" : prop.getProperty("instruction." + insName + ".stackBefore");
String stackAfter = def.hasFlag(AVM2InstructionFlag.UNKNOWN_STACK) ? "???" : prop.getProperty("instruction." + insName + ".stackAfter");
String operandsDoc = def.hasFlag(AVM2InstructionFlag.UNKNOWN_OPERANDS) ? "???" : prop.getProperty("instruction." + insName + ".operands");
System.out.println(String.format("0x%02X", def.instructionCode) + " " + insName + ": " + insShortDescription);
if (!insDescription.trim().isEmpty()) {
System.out.println("Description: " + insDescription);
}
System.out.println("Stack before: " + stackBefore);
System.out.println("Stack after: " + stackAfter);
boolean flagsPrinted = false;
System.out.print("Operands: ");
if (def.hasFlag(AVM2InstructionFlag.UNKNOWN_OPERANDS)) {
System.out.println("???");
} else {
String[] operandsDocs = operandsDoc.split(", ?");
boolean first = true;
for (int i = 0; i < def.operands.length; i++) {
int op = def.operands[i];
String opDoc = operandsDocs[i];
String operandTypeRaw = AVM2Code.operandTypeToString(op, false);
String operandTypeCombined = AVM2Code.operandTypeToString(op, true);
if (operandTypeCombined.contains(", ")) {
String operandTypesCombined[] = operandTypeCombined.split(", ?");
for (int j = 0; j < operandTypesCombined.length; j++) {
if (!first) {
System.out.print(", ");
} else {
first = false;
}
opDoc = operandsDocs[i + j];
operandTypeCombined = operandTypesCombined[j];
if (opDoc.equals("...")) {
System.out.print("...");
} else {
System.out.print(opDoc + ":" + operandTypeCombined);
}
}
} else {
if (!first) {
System.out.print(", ");
} else {
first = false;
}
if (opDoc.equals(operandTypeRaw)) {
System.out.print(operandTypeCombined);
} else {
System.out.print(opDoc + ":" + operandTypeCombined);
}
}
}
if (def.operands.length == 0) {
//System.out.print("");
}
System.out.println("");
}
AVM2InstructionFlag flags[] = def.flags.clone();
Arrays.sort(flags, Enum::compareTo);
for (AVM2InstructionFlag fl : flags) {
if (fl != AVM2InstructionFlag.UNKNOWN_OPERANDS && fl != AVM2InstructionFlag.UNKNOWN_STACK) {
if (!flagsPrinted) {
flagsPrinted = true;
System.out.println("Flags:");
}
System.out.println(" - " + flagDescriptions.get(fl));
}
}
}
}
}