mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-24 22:11:39 +00:00
Fixed saving Bit values
AS3: Automatic Calculating Body parameters
This commit is contained in:
@@ -342,20 +342,12 @@ public class SWFInputStream extends InputStream {
|
|||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public long readSB(int nBits) throws IOException {
|
public long readSB(int nBits) throws IOException {
|
||||||
long uval = readUB(nBits);
|
int uval = (int)readUB(nBits);
|
||||||
|
|
||||||
if ((uval & (1 << (nBits - 1))) > 0) uval |= (0xffffffff << nBits);
|
int shift = 32-nBits;
|
||||||
|
// sign extension
|
||||||
|
uval = (uval << shift) >> shift;
|
||||||
return uval;
|
return uval;
|
||||||
/*int sign = (int) (uval >> (nBits - 1));
|
|
||||||
if (sign == 1) {
|
|
||||||
long mask = 0;
|
|
||||||
for (int k = 0; k < nBits; k++) {
|
|
||||||
mask = mask + (1 << k);
|
|
||||||
}
|
|
||||||
return -(((~uval) & mask) + 1);
|
|
||||||
} else {
|
|
||||||
return uval;
|
|
||||||
} */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -728,8 +720,8 @@ public class SWFInputStream extends InputStream {
|
|||||||
}
|
}
|
||||||
int NTranslateBits = (int) readUB(5);
|
int NTranslateBits = (int) readUB(5);
|
||||||
ret.translateNBits = NTranslateBits;
|
ret.translateNBits = NTranslateBits;
|
||||||
ret.translateX = readSB(NTranslateBits);
|
ret.translateX = (int)readSB(NTranslateBits);
|
||||||
ret.translateY = readSB(NTranslateBits);
|
ret.translateY = (int)readSB(NTranslateBits);
|
||||||
alignByte();
|
alignByte();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -369,27 +369,40 @@ public class SWFOutputStream extends OutputStream {
|
|||||||
write(data);
|
write(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get needed bits
|
||||||
|
* @param number
|
||||||
|
* @param bits 1 for signed,0 if unsigned
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static int getNeededBits(int number, int bits)
|
||||||
|
{
|
||||||
|
number=Math.abs(number);
|
||||||
|
int val = 1;
|
||||||
|
for (int x = 1; val <= number && !(bits > 32); x <<= 1)
|
||||||
|
{
|
||||||
|
val = val | x;
|
||||||
|
bits++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bits > 32)
|
||||||
|
{
|
||||||
|
assert false : ("minBits " + bits + " must not exceed 32");
|
||||||
|
}
|
||||||
|
return bits;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates number of bits needed for representing unsigned value
|
* Calculates number of bits needed for representing unsigned value
|
||||||
*
|
*
|
||||||
* @param v Unsigned value
|
* @param v Unsigned value
|
||||||
* @return Number of bits
|
* @return Number of bits
|
||||||
*/
|
*/
|
||||||
public static int getNeededBitsU(long v) {
|
public static int getNeededBitsU(int v) {
|
||||||
|
|
||||||
int n = 32;
|
return getNeededBits(v,0);
|
||||||
long m = 0x80000000;
|
|
||||||
if (v == 0x00000000) n = 0;
|
|
||||||
else
|
|
||||||
while (!((v & m) > 0)) {
|
|
||||||
n--;
|
|
||||||
m >>= 1;
|
|
||||||
}
|
|
||||||
return n;
|
|
||||||
/*if (value == 0) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return Long.toBinaryString(value).length();*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -398,42 +411,8 @@ public class SWFOutputStream extends OutputStream {
|
|||||||
* @param v Signed value
|
* @param v Signed value
|
||||||
* @return Number of bits
|
* @return Number of bits
|
||||||
*/
|
*/
|
||||||
public static int getNeededBitsS(long v) {
|
public static int getNeededBitsS(int v) {
|
||||||
int n = 33;
|
return getNeededBits(v,1);
|
||||||
long m = 0x80000000;
|
|
||||||
if ((v & m) == m) {
|
|
||||||
if (v == 0xffffffff) n = 1;
|
|
||||||
else
|
|
||||||
while ((v & m) == m) {
|
|
||||||
n--;
|
|
||||||
m >>= 1;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (v == 0x00000000) n = 1;
|
|
||||||
else
|
|
||||||
while ((v & m) == 0) {
|
|
||||||
n--;
|
|
||||||
m >>= 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return n;
|
|
||||||
/*if (value == 0) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
if (value == -1) {
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
if (value < 0) {
|
|
||||||
String str = Long.toBinaryString(value);
|
|
||||||
for (int i = 0; i < str.length(); i++) {
|
|
||||||
if (str.charAt(i) == '0') {
|
|
||||||
return str.length() - 1 - i + 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
} else {
|
|
||||||
return Long.toBinaryString(value).length() + 1;
|
|
||||||
} */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -455,17 +434,17 @@ public class SWFOutputStream extends OutputStream {
|
|||||||
*/
|
*/
|
||||||
public static int getNeededBitsF(double value) {
|
public static int getNeededBitsF(double value) {
|
||||||
if (value == -1) return 18;
|
if (value == -1) return 18;
|
||||||
long val = (long) (value * (1 << 16));
|
int val = (int) (value * (1 << 16));
|
||||||
return getNeededBitsS(val);
|
return getNeededBitsS(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
private int enlargeBitCountU(int currentBitCount, long value) {
|
private int enlargeBitCountU(int currentBitCount, int value) {
|
||||||
int neededNew = getNeededBitsU(value);
|
int neededNew = getNeededBitsU(value);
|
||||||
if (neededNew > currentBitCount) return neededNew;
|
if (neededNew > currentBitCount) return neededNew;
|
||||||
return currentBitCount;
|
return currentBitCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int enlargeBitCountS(int currentBitCount, long value) {
|
private int enlargeBitCountS(int currentBitCount, int value) {
|
||||||
int neededNew = getNeededBitsS(value);
|
int neededNew = getNeededBitsS(value);
|
||||||
if (neededNew > currentBitCount) return neededNew;
|
if (neededNew > currentBitCount) return neededNew;
|
||||||
return currentBitCount;
|
return currentBitCount;
|
||||||
@@ -545,7 +524,7 @@ public class SWFOutputStream extends OutputStream {
|
|||||||
writeSB(Nbits, value.greenMultTerm);
|
writeSB(Nbits, value.greenMultTerm);
|
||||||
writeSB(Nbits, value.blueMultTerm);
|
writeSB(Nbits, value.blueMultTerm);
|
||||||
writeSB(Nbits, value.alphaMultTerm);
|
writeSB(Nbits, value.alphaMultTerm);
|
||||||
}
|
}
|
||||||
if (value.hasAddTerms) {
|
if (value.hasAddTerms) {
|
||||||
writeSB(Nbits, value.redAddTerm);
|
writeSB(Nbits, value.redAddTerm);
|
||||||
writeSB(Nbits, value.greenAddTerm);
|
writeSB(Nbits, value.greenAddTerm);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -88,7 +88,14 @@ public class AVM2Code {
|
|||||||
public static final int DAT_CASE_BASEOFFSET = OPT_S24 + 0x12;
|
public static final int DAT_CASE_BASEOFFSET = OPT_S24 + 0x12;
|
||||||
public static InstructionDefinition instructionSet[] = new InstructionDefinition[]{
|
public static InstructionDefinition instructionSet[] = new InstructionDefinition[]{
|
||||||
new AddIns(),
|
new AddIns(),
|
||||||
new InstructionDefinition(0x9b,"add_d",new int[]{}),
|
new InstructionDefinition(0x9b,"add_d",new int[]{}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1; //?
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
new AddIIns(),
|
new AddIIns(),
|
||||||
new InstructionDefinition(0xb5,"add_p",new int[]{AVM2Code.OPT_U30}),
|
new InstructionDefinition(0xb5,"add_p",new int[]{AVM2Code.OPT_U30}),
|
||||||
new ApplyTypeIns(),
|
new ApplyTypeIns(),
|
||||||
@@ -113,13 +120,20 @@ public class AVM2Code {
|
|||||||
new CheckFilterIns(),
|
new CheckFilterIns(),
|
||||||
new CoerceIns(),
|
new CoerceIns(),
|
||||||
new CoerceAIns(),
|
new CoerceAIns(),
|
||||||
new InstructionDefinition(0x81,"coerce_b",new int[]{}),
|
new InstructionDefinition(0x81,"coerce_b",new int[]{}), //stack:-1+1
|
||||||
new InstructionDefinition(0x84,"coerce_d",new int[]{}),
|
new InstructionDefinition(0x84,"coerce_d",new int[]{}), //stack:-1+1
|
||||||
new InstructionDefinition(0x83,"coerce_i",new int[]{}),
|
new InstructionDefinition(0x83,"coerce_i",new int[]{}), //stack:-1+1
|
||||||
new InstructionDefinition(0x89,"coerce_o",new int[]{}),
|
new InstructionDefinition(0x89,"coerce_o",new int[]{}), //stack:-1+1
|
||||||
new CoerceSIns(),
|
new CoerceSIns(),
|
||||||
new InstructionDefinition(0x88,"coerce_u",new int[]{}),
|
new InstructionDefinition(0x88,"coerce_u",new int[]{}), //stack:-1+1
|
||||||
new InstructionDefinition(0x9a,"concat",new int[]{}),
|
new InstructionDefinition(0x9a,"concat",new int[]{}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1; //?
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
new ConstructIns(),
|
new ConstructIns(),
|
||||||
new ConstructPropIns(),
|
new ConstructPropIns(),
|
||||||
new ConstructSuperIns(),
|
new ConstructSuperIns(),
|
||||||
@@ -129,8 +143,15 @@ public class AVM2Code {
|
|||||||
new ConvertOIns(),
|
new ConvertOIns(),
|
||||||
new ConvertUIns(),
|
new ConvertUIns(),
|
||||||
new ConvertSIns(),
|
new ConvertSIns(),
|
||||||
new InstructionDefinition(0x79,"convert_m",new int[]{}),
|
new InstructionDefinition(0x79,"convert_m",new int[]{}), //-1 +1
|
||||||
new InstructionDefinition(0x7a,"convert_m_p",new int[]{AVM2Code.OPT_U30 /*param (?)*/}),
|
new InstructionDefinition(0x7a,"convert_m_p",new int[]{AVM2Code.OPT_U30 /*param (?)*/}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
new DebugIns(),
|
new DebugIns(),
|
||||||
new DebugFileIns(),
|
new DebugFileIns(),
|
||||||
new DebugLineIns(),
|
new DebugLineIns(),
|
||||||
@@ -138,11 +159,32 @@ public class AVM2Code {
|
|||||||
new DecLocalIIns(),
|
new DecLocalIIns(),
|
||||||
new DecrementIns(),
|
new DecrementIns(),
|
||||||
new DecrementIIns(),
|
new DecrementIIns(),
|
||||||
new InstructionDefinition(0x5b,"deldescendants",new int[]{}),
|
new InstructionDefinition(0x5b,"deldescendants",new int[]{}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
new DeletePropertyIns(),
|
new DeletePropertyIns(),
|
||||||
new InstructionDefinition(0x6b,"deletepropertylate",new int[]{}),
|
new InstructionDefinition(0x6b,"deletepropertylate",new int[]{}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
new DivideIns(),
|
new DivideIns(),
|
||||||
new InstructionDefinition(0xb8,"divide_p",new int[]{AVM2Code.OPT_U30}),
|
new InstructionDefinition(0xb8,"divide_p",new int[]{AVM2Code.OPT_U30}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1; //?
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
new DupIns(),
|
new DupIns(),
|
||||||
new DXNSIns(),
|
new DXNSIns(),
|
||||||
new DXNSLateIns(),
|
new DXNSLateIns(),
|
||||||
@@ -150,8 +192,32 @@ public class AVM2Code {
|
|||||||
new EscXAttrIns(),
|
new EscXAttrIns(),
|
||||||
new EscXElemIns(),
|
new EscXElemIns(),
|
||||||
new InstructionDefinition(0x5f,"finddef",new int[]{AVM2Code.DAT_MULTINAME_INDEX}),
|
new InstructionDefinition(0x5f,"finddef",new int[]{AVM2Code.DAT_MULTINAME_INDEX}),
|
||||||
new InstructionDefinition(0x5b,"findpropglobalstrict",new int[]{AVM2Code.DAT_MULTINAME_INDEX}),
|
new InstructionDefinition(0x5b,"findpropglobalstrict",new int[]{AVM2Code.DAT_MULTINAME_INDEX}){
|
||||||
new InstructionDefinition(0x5c,"findpropglobal",new int[]{AVM2Code.DAT_MULTINAME_INDEX}),
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
new InstructionDefinition(0x5c,"findpropglobal",new int[]{AVM2Code.DAT_MULTINAME_INDEX}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
new FindPropertyIns(),
|
new FindPropertyIns(),
|
||||||
new FindPropertyStrictIns(),
|
new FindPropertyStrictIns(),
|
||||||
new GetDescendantsIns(),
|
new GetDescendantsIns(),
|
||||||
@@ -163,7 +229,19 @@ public class AVM2Code {
|
|||||||
new GetLocal1Ins(),
|
new GetLocal1Ins(),
|
||||||
new GetLocal2Ins(),
|
new GetLocal2Ins(),
|
||||||
new GetLocal3Ins(),
|
new GetLocal3Ins(),
|
||||||
new InstructionDefinition(0x67,"getouterscope",new int[]{AVM2Code.DAT_MULTINAME_INDEX}),
|
new InstructionDefinition(0x67,"getouterscope",new int[]{AVM2Code.DAT_MULTINAME_INDEX}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
new GetPropertyIns(),
|
new GetPropertyIns(),
|
||||||
new GetScopeObjectIns(),
|
new GetScopeObjectIns(),
|
||||||
new GetSlotIns(),
|
new GetSlotIns(),
|
||||||
@@ -207,13 +285,39 @@ public class AVM2Code {
|
|||||||
new LookupSwitchIns(),
|
new LookupSwitchIns(),
|
||||||
new LShiftIns(),
|
new LShiftIns(),
|
||||||
new ModuloIns(),
|
new ModuloIns(),
|
||||||
new InstructionDefinition(0xb9,"modulo_p",new int[]{AVM2Code.OPT_U30}),
|
new InstructionDefinition(0xb9,"modulo_p",new int[]{AVM2Code.OPT_U30}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1; //?
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
new MultiplyIns(),
|
new MultiplyIns(),
|
||||||
new MultiplyIIns(),
|
new MultiplyIIns(),
|
||||||
new InstructionDefinition(0xb7,"multiply_p",new int[]{AVM2Code.OPT_U30}),
|
new InstructionDefinition(0xb7,"multiply_p",new int[]{AVM2Code.OPT_U30}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1; //?
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
new NegateIns(),
|
new NegateIns(),
|
||||||
new NegateIIns(),
|
new NegateIIns(),
|
||||||
new InstructionDefinition(0x8f,"negate_p",new int[]{AVM2Code.OPT_U30 /* param */}),
|
new InstructionDefinition(0x8f,"negate_p",new int[]{AVM2Code.OPT_U30 /* param */}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
new NewActivationIns(),
|
new NewActivationIns(),
|
||||||
new NewArrayIns(),
|
new NewArrayIns(),
|
||||||
new NewCatchIns(),
|
new NewCatchIns(),
|
||||||
@@ -227,9 +331,30 @@ public class AVM2Code {
|
|||||||
new PopIns(),
|
new PopIns(),
|
||||||
new PopScopeIns(),
|
new PopScopeIns(),
|
||||||
new PushByteIns(),
|
new PushByteIns(),
|
||||||
new InstructionDefinition(0x22,"pushconstant",new int[]{AVM2Code.DAT_STRING_INDEX}),
|
new InstructionDefinition(0x22,"pushconstant",new int[]{AVM2Code.DAT_STRING_INDEX}){
|
||||||
new InstructionDefinition(0x33,"pushdecimal",new int[]{AVM2Code.DAT_DECIMAL_INDEX}),
|
|
||||||
new InstructionDefinition(0x34,"pushdnan",new int[]{}),
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return 1; //?
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
new InstructionDefinition(0x33,"pushdecimal",new int[]{AVM2Code.DAT_DECIMAL_INDEX}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return 1; //?
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
new InstructionDefinition(0x34,"pushdnan",new int[]{}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return 1; //?
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
new PushDoubleIns(),
|
new PushDoubleIns(),
|
||||||
new PushFalseIns(),
|
new PushFalseIns(),
|
||||||
new PushIntIns(),
|
new PushIntIns(),
|
||||||
@@ -253,31 +378,211 @@ public class AVM2Code {
|
|||||||
new SetLocal3Ins(),
|
new SetLocal3Ins(),
|
||||||
new SetGlobalSlotIns(),
|
new SetGlobalSlotIns(),
|
||||||
new SetPropertyIns(),
|
new SetPropertyIns(),
|
||||||
new InstructionDefinition(0x69,"setpropertylate",new int[]{}),
|
new InstructionDefinition(0x69,"setpropertylate",new int[]{}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
new SetSlotIns(),
|
new SetSlotIns(),
|
||||||
new SetSuperIns(),
|
new SetSuperIns(),
|
||||||
new StrictEqualsIns(),
|
new StrictEqualsIns(),
|
||||||
new SubtractIns(),
|
new SubtractIns(),
|
||||||
new SubtractIIns(),
|
new SubtractIIns(),
|
||||||
new InstructionDefinition(0xb6,"subtract_p",new int[]{AVM2Code.OPT_U30}),
|
new InstructionDefinition(0xb6,"subtract_p",new int[]{AVM2Code.OPT_U30}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
new SwapIns(),
|
new SwapIns(),
|
||||||
new ThrowIns(),
|
new ThrowIns(),
|
||||||
new InstructionDefinition(0xf3,"timestamp",new int[]{}),
|
new InstructionDefinition(0xf3,"timestamp",new int[]{}),
|
||||||
new TypeOfIns(),
|
new TypeOfIns(),
|
||||||
new URShiftIns(),
|
new URShiftIns(),
|
||||||
new InstructionDefinition(0x35,"li8",new int[]{}),
|
new InstructionDefinition(0x35,"li8",new int[]{}){
|
||||||
new InstructionDefinition(0x36,"li16",new int[]{}),
|
|
||||||
new InstructionDefinition(0x37,"li32",new int[]{}),
|
@Override
|
||||||
new InstructionDefinition(0x38,"lf32",new int[]{}),
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
new InstructionDefinition(0x39,"lf64",new int[]{}),
|
throw new UnsupportedOperationException();
|
||||||
new InstructionDefinition(0x3A,"si8",new int[]{}),
|
}
|
||||||
new InstructionDefinition(0x3B,"si16",new int[]{}),
|
|
||||||
new InstructionDefinition(0x3C,"si32",new int[]{}),
|
@Override
|
||||||
new InstructionDefinition(0x3D,"sf32",new int[]{}),
|
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
new InstructionDefinition(0x3E,"sf64",new int[]{}),
|
throw new UnsupportedOperationException();
|
||||||
new InstructionDefinition(0x50,"sxi1",new int[]{}),
|
}
|
||||||
new InstructionDefinition(0x51,"sxi8",new int[]{}),
|
|
||||||
new InstructionDefinition(0x52,"sxi16",new int[]{})
|
},
|
||||||
|
new InstructionDefinition(0x36,"li16",new int[]{}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
new InstructionDefinition(0x37,"li32",new int[]{}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
new InstructionDefinition(0x38,"lf32",new int[]{}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
new InstructionDefinition(0x39,"lf64",new int[]{}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
new InstructionDefinition(0x3A,"si8",new int[]{}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
new InstructionDefinition(0x3B,"si16",new int[]{}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
new InstructionDefinition(0x3C,"si32",new int[]{}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
new InstructionDefinition(0x3D,"sf32",new int[]{}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
new InstructionDefinition(0x3E,"sf64",new int[]{}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
new InstructionDefinition(0x50,"sxi1",new int[]{}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
new InstructionDefinition(0x51,"sxi8",new int[]{}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
new InstructionDefinition(0x52,"sxi16",new int[]{}){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
//endoflist
|
//endoflist
|
||||||
@@ -1937,4 +2242,89 @@ public HashMap<Integer,String> getLocalRegNamesFromDebug(ABC abc){
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void handleRegister(CodeStats stats,int reg){
|
||||||
|
if(reg+1>stats.maxlocal){
|
||||||
|
stats.maxlocal=reg+1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean walkCode(CodeStats stats,int pos,int stack,int scope,ABC abc) {
|
||||||
|
while(pos<code.size()){
|
||||||
|
if(stats.instructionStats[pos].seen){
|
||||||
|
//check stack mismatch here
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
stats.instructionStats[pos].seen=true;
|
||||||
|
stats.instructionStats[pos].stackpos=stack;
|
||||||
|
stats.instructionStats[pos].scopepos=scope;
|
||||||
|
AVM2Instruction ins=code.get(pos);
|
||||||
|
stack+=ins.definition.getStackDelta(ins, abc);
|
||||||
|
scope+=ins.definition.getScopeStackDelta(ins, abc);
|
||||||
|
if(stack>stats.maxstack) stats.maxstack=stack;
|
||||||
|
if(scope>stats.maxscope) stats.maxscope=scope;
|
||||||
|
if((ins.definition instanceof DXNSIns)||(ins.definition instanceof DXNSLateIns)){
|
||||||
|
stats.has_set_dxns=true;
|
||||||
|
}
|
||||||
|
if(ins.definition instanceof NewActivationIns){
|
||||||
|
stats.has_activation=true;
|
||||||
|
}
|
||||||
|
if(ins.definition instanceof SetLocalTypeIns){
|
||||||
|
handleRegister(stats,((SetLocalTypeIns)ins.definition).getRegisterId(ins));
|
||||||
|
}else{
|
||||||
|
for(int i=0;i<ins.definition.operands.length;i++){
|
||||||
|
if(ins.definition.operands[i]==DAT_REGISTER_INDEX){
|
||||||
|
handleRegister(stats,ins.operands[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(ins.definition instanceof ReturnValueIns){
|
||||||
|
//check stack=1
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if(ins.definition instanceof ReturnVoidIns){
|
||||||
|
//check stack=0
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if(ins.definition instanceof JumpIns){
|
||||||
|
try {
|
||||||
|
pos = adr2pos(pos2adr(pos) + ins.getBytes().length + ins.operands[0]);
|
||||||
|
continue;
|
||||||
|
} catch (ConvertException ex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}else
|
||||||
|
if(ins.definition instanceof IfTypeIns){
|
||||||
|
try {
|
||||||
|
int newpos = adr2pos(pos2adr(pos) + ins.getBytes().length + ins.operands[0]);
|
||||||
|
walkCode(stats, newpos, stack, scope, abc);
|
||||||
|
} catch (ConvertException ex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(ins.definition instanceof LookupSwitchIns){
|
||||||
|
for(int i=0;i<ins.operands.length;i++){
|
||||||
|
try {
|
||||||
|
int newpos = adr2pos(pos2adr(pos) + ins.operands[i]);
|
||||||
|
if(!walkCode(stats, newpos, stack, scope, abc)){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} catch (ConvertException ex) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pos++;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CodeStats getStats(ABC abc)
|
||||||
|
{
|
||||||
|
CodeStats stats=new CodeStats(this);
|
||||||
|
if(!walkCode(stats,0,0,0,abc)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return stats;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 JPEXS
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.jpexs.asdec.abc.avm2;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author JPEXS
|
||||||
|
*/
|
||||||
|
public class CodeStats {
|
||||||
|
public int maxstack=0;
|
||||||
|
public int maxscope=0;
|
||||||
|
public int maxlocal=0;
|
||||||
|
public boolean has_set_dxns=false;
|
||||||
|
public boolean has_activation=false;
|
||||||
|
public InstructionStats instructionStats[];
|
||||||
|
|
||||||
|
public String toString(ABC abc) {
|
||||||
|
String ret="Stats: maxstack="+maxstack+", maxscope="+maxscope+", maxlocal="+maxlocal+"\r\n";
|
||||||
|
int i=0;
|
||||||
|
int ms=0;
|
||||||
|
for(InstructionStats stats:instructionStats){
|
||||||
|
int deltastack=stats.ins.definition.getStackDelta(stats.ins, abc);
|
||||||
|
if(stats.stackpos>ms) ms=stats.stackpos;
|
||||||
|
ret+=""+i+":"+stats.stackpos+(deltastack>=0?"+"+deltastack:deltastack)+","+stats.scopepos+" "+stats.ins.toString(abc.constants)+"\r\n";
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public CodeStats(AVM2Code code) {
|
||||||
|
instructionStats=new InstructionStats[code.code.size()];
|
||||||
|
for(int i=0;i<code.code.size();i++){
|
||||||
|
instructionStats[i]=new InstructionStats(code.code.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2011 JPEXS
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program 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 General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.jpexs.asdec.abc.avm2;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author JPEXS
|
||||||
|
*/
|
||||||
|
public class InstructionStats {
|
||||||
|
public boolean seen=false;
|
||||||
|
public int stackpos=0;
|
||||||
|
public int scopepos=0;
|
||||||
|
public AVM2Instruction ins;
|
||||||
|
|
||||||
|
public InstructionStats(AVM2Instruction ins) {
|
||||||
|
this.ins = ins;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions;
|
package com.jpexs.asdec.abc.avm2.instructions;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
@@ -121,4 +122,12 @@ public class InstructionDefinition {
|
|||||||
}
|
}
|
||||||
return name + ns;
|
return name + ns;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getStackDelta(AVM2Instruction ins,ABC abc){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getScopeStackDelta(AVM2Instruction ins,ABC abc){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
import com.jpexs.asdec.abc.avm2.treemodel.TreeItem;
|
import com.jpexs.asdec.abc.avm2.treemodel.TreeItem;
|
||||||
@@ -41,4 +42,11 @@ public class AddIIns extends AddIns {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new AddTreeItem(ins, v1, v2));
|
stack.push(new AddTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -64,4 +65,9 @@ public class AddIns extends InstructionDefinition {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new AddTreeItem(ins, v1, v2));
|
stack.push(new AddTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -58,4 +59,11 @@ public class DecrementIIns extends InstructionDefinition {
|
|||||||
public void translate(boolean isStatic, int classIndex, java.util.HashMap<Integer, TreeItem> localRegs, Stack<TreeItem> stack, java.util.Stack<TreeItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<TreeItem> output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) {
|
public void translate(boolean isStatic, int classIndex, java.util.HashMap<Integer, TreeItem> localRegs, Stack<TreeItem> stack, java.util.Stack<TreeItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<TreeItem> output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) {
|
||||||
stack.push(new DecrementTreeItem(ins, (TreeItem) stack.pop()));
|
stack.push(new DecrementTreeItem(ins, (TreeItem) stack.pop()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -1+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -58,4 +59,9 @@ public class DecrementIns extends InstructionDefinition {
|
|||||||
public void translate(boolean isStatic, int classIndex, java.util.HashMap<Integer, TreeItem> localRegs, Stack<TreeItem> stack, java.util.Stack<TreeItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<TreeItem> output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) {
|
public void translate(boolean isStatic, int classIndex, java.util.HashMap<Integer, TreeItem> localRegs, Stack<TreeItem> stack, java.util.Stack<TreeItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<TreeItem> output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) {
|
||||||
stack.push(new DecrementTreeItem(ins, (TreeItem) stack.pop()));
|
stack.push(new DecrementTreeItem(ins, (TreeItem) stack.pop()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -1+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -63,4 +64,9 @@ public class DivideIns extends InstructionDefinition {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new DivideTreeItem(ins, v1, v2));
|
stack.push(new DivideTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
||||||
@@ -39,4 +40,9 @@ public class IncrementIIns extends InstructionDefinition {
|
|||||||
public void translate(boolean isStatic, int classIndex, java.util.HashMap<Integer, TreeItem> localRegs, Stack<TreeItem> stack, java.util.Stack<TreeItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<TreeItem> output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) {
|
public void translate(boolean isStatic, int classIndex, java.util.HashMap<Integer, TreeItem> localRegs, Stack<TreeItem> stack, java.util.Stack<TreeItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<TreeItem> output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) {
|
||||||
stack.push(new IncrementTreeItem(ins, (TreeItem) stack.pop()));
|
stack.push(new IncrementTreeItem(ins, (TreeItem) stack.pop()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -1+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
||||||
@@ -39,4 +40,9 @@ public class IncrementIns extends InstructionDefinition {
|
|||||||
public void translate(boolean isStatic, int classIndex, java.util.HashMap<Integer, TreeItem> localRegs, Stack<TreeItem> stack, java.util.Stack<TreeItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<TreeItem> output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) {
|
public void translate(boolean isStatic, int classIndex, java.util.HashMap<Integer, TreeItem> localRegs, Stack<TreeItem> stack, java.util.Stack<TreeItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<TreeItem> output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) {
|
||||||
stack.push(new IncrementTreeItem(ins, (TreeItem) stack.pop()));
|
stack.push(new IncrementTreeItem(ins, (TreeItem) stack.pop()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -1+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -55,4 +56,9 @@ public class ModuloIns extends InstructionDefinition {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new ModuloTreeItem(ins, v1, v2));
|
stack.push(new ModuloTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
||||||
@@ -41,4 +42,9 @@ public class MultiplyIIns extends InstructionDefinition {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new MultiplyTreeItem(ins, v1, v2));
|
stack.push(new MultiplyTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -63,4 +64,9 @@ public class MultiplyIns extends InstructionDefinition {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new MultiplyTreeItem(ins, v1, v2));
|
stack.push(new MultiplyTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
||||||
@@ -40,4 +41,9 @@ public class NegateIIns extends InstructionDefinition {
|
|||||||
TreeItem v = (TreeItem) stack.pop();
|
TreeItem v = (TreeItem) stack.pop();
|
||||||
stack.push(new NegTreeItem(ins, v));
|
stack.push(new NegTreeItem(ins, v));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -1+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
||||||
@@ -40,4 +41,9 @@ public class NegateIns extends InstructionDefinition {
|
|||||||
TreeItem v = (TreeItem) stack.pop();
|
TreeItem v = (TreeItem) stack.pop();
|
||||||
stack.push(new NegTreeItem(ins, v));
|
stack.push(new NegTreeItem(ins, v));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -1+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
||||||
@@ -40,4 +41,9 @@ public class NotIns extends InstructionDefinition {
|
|||||||
TreeItem v = (TreeItem) stack.pop();
|
TreeItem v = (TreeItem) stack.pop();
|
||||||
stack.push(new NotTreeItem(ins, v));
|
stack.push(new NotTreeItem(ins, v));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -1+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
||||||
@@ -41,4 +42,9 @@ public class SubtractIIns extends InstructionDefinition {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new SubtractTreeItem(ins, v1, v2));
|
stack.push(new SubtractTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
package com.jpexs.asdec.abc.avm2.instructions.arithmetic;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
||||||
@@ -41,4 +42,9 @@ public class SubtractIns extends InstructionDefinition {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new SubtractTreeItem(ins, v1, v2));
|
stack.push(new SubtractTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.bitwise;
|
package com.jpexs.asdec.abc.avm2.instructions.bitwise;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -50,4 +51,9 @@ public class BitAndIns extends InstructionDefinition {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new BitAndTreeItem(ins, v1, v2));
|
stack.push(new BitAndTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.bitwise;
|
package com.jpexs.asdec.abc.avm2.instructions.bitwise;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -48,4 +49,9 @@ public class BitNotIns extends InstructionDefinition {
|
|||||||
TreeItem v = (TreeItem) stack.pop();
|
TreeItem v = (TreeItem) stack.pop();
|
||||||
stack.push(new BitNotTreeItem(ins, v));
|
stack.push(new BitNotTreeItem(ins, v));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -1+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.bitwise;
|
package com.jpexs.asdec.abc.avm2.instructions.bitwise;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -50,4 +51,9 @@ public class BitOrIns extends InstructionDefinition {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new BitOrTreeItem(ins, v1, v2));
|
stack.push(new BitOrTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.bitwise;
|
package com.jpexs.asdec.abc.avm2.instructions.bitwise;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -50,4 +51,9 @@ public class BitXorIns extends InstructionDefinition {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new BitXorTreeItem(ins, v1, v2));
|
stack.push(new BitXorTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.bitwise;
|
package com.jpexs.asdec.abc.avm2.instructions.bitwise;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
||||||
@@ -41,4 +42,9 @@ public class LShiftIns extends InstructionDefinition {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new LShiftTreeItem(ins, v1, v2));
|
stack.push(new LShiftTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.bitwise;
|
package com.jpexs.asdec.abc.avm2.instructions.bitwise;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
||||||
@@ -41,4 +42,9 @@ public class RShiftIns extends InstructionDefinition {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new RShiftTreeItem(ins, v1, v2));
|
stack.push(new RShiftTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.bitwise;
|
package com.jpexs.asdec.abc.avm2.instructions.bitwise;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
||||||
@@ -41,4 +42,9 @@ public class URShiftIns extends InstructionDefinition {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new URShiftTreeItem(ins, v1, v2));
|
stack.push(new URShiftTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.comparsion;
|
package com.jpexs.asdec.abc.avm2.instructions.comparsion;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -50,4 +51,9 @@ public class EqualsIns extends InstructionDefinition {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new EqTreeItem(ins, v1, v2));
|
stack.push(new EqTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.comparsion;
|
package com.jpexs.asdec.abc.avm2.instructions.comparsion;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
||||||
@@ -41,4 +42,9 @@ public class GreaterEqualsIns extends InstructionDefinition {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new GeTreeItem(ins, v1, v2));
|
stack.push(new GeTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.comparsion;
|
package com.jpexs.asdec.abc.avm2.instructions.comparsion;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
||||||
@@ -41,4 +42,9 @@ public class GreaterThanIns extends InstructionDefinition {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new LtTreeItem(ins, v1, v2));
|
stack.push(new LtTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.comparsion;
|
package com.jpexs.asdec.abc.avm2.instructions.comparsion;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
||||||
@@ -41,4 +42,9 @@ public class LessEqualsIns extends InstructionDefinition {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new LeTreeItem(ins, v1, v2));
|
stack.push(new LeTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.comparsion;
|
package com.jpexs.asdec.abc.avm2.instructions.comparsion;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
||||||
@@ -41,4 +42,9 @@ public class LessThanIns extends InstructionDefinition {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new GtTreeItem(ins, v1, v2));
|
stack.push(new GtTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.comparsion;
|
package com.jpexs.asdec.abc.avm2.instructions.comparsion;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
||||||
@@ -41,4 +42,9 @@ public class StrictEqualsIns extends InstructionDefinition {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new StrictEqTreeItem(ins, v1, v2));
|
stack.push(new StrictEqTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.construction;
|
package com.jpexs.asdec.abc.avm2.instructions.construction;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
@@ -61,4 +62,11 @@ public class ConstructIns extends InstructionDefinition {
|
|||||||
TreeItem obj = (TreeItem) stack.pop();
|
TreeItem obj = (TreeItem) stack.pop();
|
||||||
stack.push(new ConstructTreeItem(ins, obj, args));
|
stack.push(new ConstructTreeItem(ins, obj, args));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -ins.operands[0]-1+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.construction;
|
package com.jpexs.asdec.abc.avm2.instructions.construction;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
@@ -68,4 +69,17 @@ public class ConstructPropIns extends InstructionDefinition {
|
|||||||
|
|
||||||
stack.push(new ConstructPropTreeItem(ins, obj, multiname, args));
|
stack.push(new ConstructPropTreeItem(ins, obj, multiname, args));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
int ret=-ins.operands[1]-1+1;
|
||||||
|
int multinameIndex = ins.operands[0];
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsName()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsNs()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.construction;
|
package com.jpexs.asdec.abc.avm2.instructions.construction;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
@@ -61,4 +62,9 @@ public class ConstructSuperIns extends InstructionDefinition {
|
|||||||
TreeItem obj = (TreeItem) stack.pop();
|
TreeItem obj = (TreeItem) stack.pop();
|
||||||
output.add(new ConstructSuperTreeItem(ins, obj, args));
|
output.add(new ConstructSuperTreeItem(ins, obj, args));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -ins.operands[0]-1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.construction;
|
package com.jpexs.asdec.abc.avm2.instructions.construction;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
||||||
@@ -39,4 +40,11 @@ public class NewActivationIns extends InstructionDefinition {
|
|||||||
public void translate(boolean isStatic, int classIndex, java.util.HashMap<Integer, TreeItem> localRegs, Stack<TreeItem> stack, java.util.Stack<TreeItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<TreeItem> output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) {
|
public void translate(boolean isStatic, int classIndex, java.util.HashMap<Integer, TreeItem> localRegs, Stack<TreeItem> stack, java.util.Stack<TreeItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<TreeItem> output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) {
|
||||||
stack.push(new NewActivationTreeItem(ins));
|
stack.push(new NewActivationTreeItem(ins));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.construction;
|
package com.jpexs.asdec.abc.avm2.instructions.construction;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -46,4 +47,11 @@ public class NewArrayIns extends InstructionDefinition {
|
|||||||
}
|
}
|
||||||
stack.push(new NewArrayTreeItem(ins, args));
|
stack.push(new NewArrayTreeItem(ins, args));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -ins.operands[0]+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.construction;
|
package com.jpexs.asdec.abc.avm2.instructions.construction;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -41,4 +42,11 @@ public class NewCatchIns extends InstructionDefinition {
|
|||||||
int exInfo = ins.operands[0];
|
int exInfo = ins.operands[0];
|
||||||
stack.push(new ExceptionTreeItem(body.exceptions[exInfo]));
|
stack.push(new ExceptionTreeItem(body.exceptions[exInfo]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.construction;
|
package com.jpexs.asdec.abc.avm2.instructions.construction;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -39,7 +40,14 @@ public class NewClassIns extends InstructionDefinition {
|
|||||||
@Override
|
@Override
|
||||||
public void translate(boolean isStatic, int classIndex, java.util.HashMap<Integer, TreeItem> localRegs, Stack<TreeItem> stack, java.util.Stack<TreeItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<TreeItem> output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) {
|
public void translate(boolean isStatic, int classIndex, java.util.HashMap<Integer, TreeItem> localRegs, Stack<TreeItem> stack, java.util.Stack<TreeItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<TreeItem> output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) {
|
||||||
int clsIndex = ins.operands[0];
|
int clsIndex = ins.operands[0];
|
||||||
String baseType = stack.pop().toString();
|
String baseType = stack.pop().toString(constants);
|
||||||
stack.push(new UnparsedTreeItem(ins, "new class(" + clsIndex + ") extends " + baseType));
|
stack.push(new UnparsedTreeItem(ins, "new "+ abc.constants.constant_multiname[abc.instance_info[clsIndex].name_index].getName(constants) + ".class extends " + baseType));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -1+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.construction;
|
package com.jpexs.asdec.abc.avm2.instructions.construction;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -47,4 +48,11 @@ public class NewFunctionIns extends InstructionDefinition {
|
|||||||
}
|
}
|
||||||
stack.push(new NewFunctionTreeItem(ins, method_info[methodIndex].getParamStr(constants,body,abc), method_info[methodIndex].getReturnTypeStr(constants), bodyStr));
|
stack.push(new NewFunctionTreeItem(ins, method_info[methodIndex].getParamStr(constants,body,abc), method_info[methodIndex].getReturnTypeStr(constants), bodyStr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.construction;
|
package com.jpexs.asdec.abc.avm2.instructions.construction;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -49,4 +50,10 @@ public class NewObjectIns extends InstructionDefinition {
|
|||||||
}
|
}
|
||||||
stack.push(new NewObjectTreeItem(ins, args));
|
stack.push(new NewObjectTreeItem(ins, args));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -ins.operands[0]*2+1;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.executing;
|
package com.jpexs.asdec.abc.avm2.instructions.executing;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
@@ -62,4 +63,11 @@ public class CallIns extends InstructionDefinition {
|
|||||||
TreeItem function = (TreeItem) stack.pop();
|
TreeItem function = (TreeItem) stack.pop();
|
||||||
stack.push(new CallTreeItem(ins, receiver, function, args));
|
stack.push(new CallTreeItem(ins, receiver, function, args));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1-ins.operands[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.executing;
|
package com.jpexs.asdec.abc.avm2.instructions.executing;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
@@ -63,4 +64,11 @@ public class CallMethodIns extends InstructionDefinition {
|
|||||||
String methodName = method_info[methodIndex].getName(constants);
|
String methodName = method_info[methodIndex].getName(constants);
|
||||||
stack.push(new CallMethodTreeItem(ins, receiver, methodName, args));
|
stack.push(new CallMethodTreeItem(ins, receiver, methodName, args));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -1+1-ins.operands[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.executing;
|
package com.jpexs.asdec.abc.avm2.instructions.executing;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
import com.jpexs.asdec.abc.avm2.treemodel.CallPropertyTreeItem;
|
import com.jpexs.asdec.abc.avm2.treemodel.CallPropertyTreeItem;
|
||||||
@@ -50,4 +51,17 @@ public class CallPropLexIns extends CallPropertyIns {
|
|||||||
|
|
||||||
stack.push(new CallPropertyTreeItem(ins, false, receiver, multiname, args));
|
stack.push(new CallPropertyTreeItem(ins, false, receiver, multiname, args));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
int ret=-ins.operands[1]-1+1;
|
||||||
|
int multinameIndex = ins.operands[0];
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsName()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsNs()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.executing;
|
package com.jpexs.asdec.abc.avm2.instructions.executing;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
@@ -70,4 +71,17 @@ public class CallPropVoidIns extends InstructionDefinition {
|
|||||||
|
|
||||||
output.add(new CallPropertyTreeItem(ins, true, receiver, multiname, args));
|
output.add(new CallPropertyTreeItem(ins, true, receiver, multiname, args));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
int ret=-ins.operands[1]-1;
|
||||||
|
int multinameIndex = ins.operands[0];
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsName()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsNs()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.executing;
|
package com.jpexs.asdec.abc.avm2.instructions.executing;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
@@ -68,4 +69,17 @@ public class CallPropertyIns extends InstructionDefinition {
|
|||||||
|
|
||||||
stack.push(new CallPropertyTreeItem(ins, false, receiver, multiname, args));
|
stack.push(new CallPropertyTreeItem(ins, false, receiver, multiname, args));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
int ret=-ins.operands[1]-1+1;
|
||||||
|
int multinameIndex = ins.operands[0];
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsName()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsNs()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.executing;
|
package com.jpexs.asdec.abc.avm2.instructions.executing;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
@@ -63,4 +64,11 @@ public class CallStaticIns extends InstructionDefinition {
|
|||||||
String methodName = method_info[methodIndex].getName(constants);
|
String methodName = method_info[methodIndex].getName(constants);
|
||||||
stack.push(new CallStaticTreeItem(ins, receiver, methodName, args));
|
stack.push(new CallStaticTreeItem(ins, receiver, methodName, args));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -1+1-ins.operands[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.executing;
|
package com.jpexs.asdec.abc.avm2.instructions.executing;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
@@ -67,4 +68,17 @@ public class CallSuperIns extends InstructionDefinition {
|
|||||||
|
|
||||||
stack.push(new CallSuperTreeItem(ins, false, receiver, multiname, args));
|
stack.push(new CallSuperTreeItem(ins, false, receiver, multiname, args));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
int ret=-ins.operands[1]-1+1;
|
||||||
|
int multinameIndex = ins.operands[0];
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsName()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsNs()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.executing;
|
package com.jpexs.asdec.abc.avm2.instructions.executing;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
@@ -68,4 +69,17 @@ public class CallSuperVoidIns extends InstructionDefinition {
|
|||||||
output.add(new CallSuperTreeItem(ins, true, receiver, multiname, args));
|
output.add(new CallSuperTreeItem(ins, true, receiver, multiname, args));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
int ret=-ins.operands[1]-1;
|
||||||
|
int multinameIndex = ins.operands[0];
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsName()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsNs()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -50,4 +51,11 @@ public class IfEqIns extends InstructionDefinition implements IfTypeIns {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new NeqTreeItem(ins, v1, v2));
|
stack.push(new NeqTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -47,4 +48,9 @@ public class IfFalseIns extends InstructionDefinition implements IfTypeIns {
|
|||||||
//String v1 = stack.pop().toString();
|
//String v1 = stack.pop().toString();
|
||||||
//stack.push("(" + v1 + ")");
|
//stack.push("(" + v1 + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -50,4 +51,9 @@ public class IfGeIns extends InstructionDefinition implements IfTypeIns {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new LtTreeItem(ins, v1, v2));
|
stack.push(new LtTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -50,4 +51,9 @@ public class IfGtIns extends InstructionDefinition implements IfTypeIns {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new LeTreeItem(ins, v1, v2));
|
stack.push(new LeTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -50,4 +51,9 @@ public class IfLeIns extends InstructionDefinition implements IfTypeIns {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new GtTreeItem(ins, v1, v2));
|
stack.push(new GtTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -50,4 +51,9 @@ public class IfLtIns extends InstructionDefinition implements IfTypeIns {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new GeTreeItem(ins, v1, v2));
|
stack.push(new GeTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -50,4 +51,9 @@ public class IfNGeIns extends InstructionDefinition implements IfTypeIns {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new GeTreeItem(ins, v1, v2));
|
stack.push(new GeTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -50,4 +51,9 @@ public class IfNGtIns extends InstructionDefinition implements IfTypeIns {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new GtTreeItem(ins, v1, v2));
|
stack.push(new GtTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -50,4 +51,9 @@ public class IfNLeIns extends InstructionDefinition implements IfTypeIns {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new LeTreeItem(ins, v1, v2));
|
stack.push(new LeTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -50,4 +51,9 @@ public class IfNLtIns extends InstructionDefinition implements IfTypeIns {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new LtTreeItem(ins, v1, v2));
|
stack.push(new LtTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -50,4 +51,9 @@ public class IfNeIns extends InstructionDefinition implements IfTypeIns {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new EqTreeItem(ins, v1, v2));
|
stack.push(new EqTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -50,4 +51,9 @@ public class IfStrictEqIns extends InstructionDefinition implements IfTypeIns {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new StrictNeqTreeItem(ins, v1, v2));
|
stack.push(new StrictNeqTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -50,4 +51,9 @@ public class IfStrictNeIns extends InstructionDefinition implements IfTypeIns {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new StrictEqTreeItem(ins, v1, v2));
|
stack.push(new StrictEqTreeItem(ins, v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -47,4 +48,9 @@ public class IfTrueIns extends InstructionDefinition implements IfTypeIns {
|
|||||||
TreeItem v1 = (TreeItem) stack.pop();
|
TreeItem v1 = (TreeItem) stack.pop();
|
||||||
stack.push(new NotTreeItem(ins, v1));
|
stack.push(new NotTreeItem(ins, v1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
package com.jpexs.asdec.abc.avm2.instructions.jumps;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -41,4 +42,9 @@ public class LookupSwitchIns extends InstructionDefinition {
|
|||||||
int caseCount = ins.operands[1];
|
int caseCount = ins.operands[1];
|
||||||
//stack.push("switch(...)");
|
//stack.push("switch(...)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.localregs;
|
package com.jpexs.asdec.abc.avm2.instructions.localregs;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -54,4 +55,9 @@ public class GetLocal0Ins extends InstructionDefinition implements GetLocalTypeI
|
|||||||
public int getRegisterId(AVM2Instruction par0) {
|
public int getRegisterId(AVM2Instruction par0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.localregs;
|
package com.jpexs.asdec.abc.avm2.instructions.localregs;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -49,4 +50,9 @@ public class GetLocal1Ins extends InstructionDefinition implements GetLocalTypeI
|
|||||||
public int getRegisterId(AVM2Instruction par0) {
|
public int getRegisterId(AVM2Instruction par0) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.localregs;
|
package com.jpexs.asdec.abc.avm2.instructions.localregs;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -49,4 +50,9 @@ public class GetLocal2Ins extends InstructionDefinition implements GetLocalTypeI
|
|||||||
public int getRegisterId(AVM2Instruction par0) {
|
public int getRegisterId(AVM2Instruction par0) {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.localregs;
|
package com.jpexs.asdec.abc.avm2.instructions.localregs;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -51,4 +52,9 @@ public class GetLocal3Ins extends InstructionDefinition implements GetLocalTypeI
|
|||||||
public int getRegisterId(AVM2Instruction par0) {
|
public int getRegisterId(AVM2Instruction par0) {
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.localregs;
|
package com.jpexs.asdec.abc.avm2.instructions.localregs;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
@@ -53,4 +54,9 @@ public class GetLocalIns extends InstructionDefinition implements GetLocalTypeIn
|
|||||||
public int getRegisterId(AVM2Instruction ins) {
|
public int getRegisterId(AVM2Instruction ins) {
|
||||||
return ins.operands[0];
|
return ins.operands[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.localregs;
|
package com.jpexs.asdec.abc.avm2.instructions.localregs;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -62,4 +63,9 @@ public class SetLocal0Ins extends InstructionDefinition implements SetTypeIns, S
|
|||||||
public int getRegisterId(AVM2Instruction ins) {
|
public int getRegisterId(AVM2Instruction ins) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.localregs;
|
package com.jpexs.asdec.abc.avm2.instructions.localregs;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -62,4 +63,9 @@ public class SetLocal1Ins extends InstructionDefinition implements SetTypeIns, S
|
|||||||
public int getRegisterId(AVM2Instruction ins) {
|
public int getRegisterId(AVM2Instruction ins) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.localregs;
|
package com.jpexs.asdec.abc.avm2.instructions.localregs;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -62,4 +63,9 @@ public class SetLocal2Ins extends InstructionDefinition implements SetTypeIns, S
|
|||||||
public int getRegisterId(AVM2Instruction ins) {
|
public int getRegisterId(AVM2Instruction ins) {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.localregs;
|
package com.jpexs.asdec.abc.avm2.instructions.localregs;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -62,4 +63,9 @@ public class SetLocal3Ins extends InstructionDefinition implements SetTypeIns, S
|
|||||||
public int getRegisterId(AVM2Instruction ins) {
|
public int getRegisterId(AVM2Instruction ins) {
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.localregs;
|
package com.jpexs.asdec.abc.avm2.instructions.localregs;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
@@ -64,4 +65,9 @@ public class SetLocalIns extends InstructionDefinition implements SetTypeIns, Se
|
|||||||
public int getRegisterId(AVM2Instruction ins) {
|
public int getRegisterId(AVM2Instruction ins) {
|
||||||
return ins.operands[0];
|
return ins.operands[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.other;
|
package com.jpexs.asdec.abc.avm2.instructions.other;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
@@ -58,4 +59,19 @@ public class DeletePropertyIns extends InstructionDefinition {
|
|||||||
stack.add(new BooleanTreeItem(ins, Boolean.TRUE));//property successfully deleted
|
stack.add(new BooleanTreeItem(ins, Boolean.TRUE));//property successfully deleted
|
||||||
output.add(new DeletePropertyTreeItem(ins, obj, multiname));
|
output.add(new DeletePropertyTreeItem(ins, obj, multiname));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
int ret=-1+1;
|
||||||
|
int multinameIndex = ins.operands[0];
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsName()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsNs()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.other;
|
package com.jpexs.asdec.abc.avm2.instructions.other;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
@@ -53,4 +54,19 @@ public class FindPropertyIns extends InstructionDefinition {
|
|||||||
FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins);
|
FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins);
|
||||||
stack.push(new FindPropertyTreeItem(ins, multiname)); //resolve right object
|
stack.push(new FindPropertyTreeItem(ins, multiname)); //resolve right object
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
int ret=1;
|
||||||
|
int multinameIndex = ins.operands[0];
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsName()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsNs()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.other;
|
package com.jpexs.asdec.abc.avm2.instructions.other;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
@@ -52,4 +53,17 @@ public class FindPropertyStrictIns extends InstructionDefinition {
|
|||||||
FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins);
|
FullMultinameTreeItem multiname = resolveMultiname(stack, constants, multinameIndex, ins);
|
||||||
stack.push(new FindPropertyTreeItem(ins, multiname));
|
stack.push(new FindPropertyTreeItem(ins, multiname));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
int ret=1;
|
||||||
|
int multinameIndex = ins.operands[0];
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsName()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsNs()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.other;
|
package com.jpexs.asdec.abc.avm2.instructions.other;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
@@ -54,4 +55,17 @@ public class GetDescendantsIns extends InstructionDefinition {
|
|||||||
TreeItem obj = (TreeItem) stack.pop();
|
TreeItem obj = (TreeItem) stack.pop();
|
||||||
stack.push(new GetDescendantsTreeItem(ins, obj, multiname));
|
stack.push(new GetDescendantsTreeItem(ins, obj, multiname));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
int ret=-1+1;
|
||||||
|
int multinameIndex = ins.operands[0];
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsName()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsNs()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.other;
|
package com.jpexs.asdec.abc.avm2.instructions.other;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -44,4 +45,11 @@ public class GetGlobalScopeIns extends InstructionDefinition {
|
|||||||
public void translate(boolean isStatic, int classIndex, java.util.HashMap<Integer, TreeItem> localRegs, Stack<TreeItem> stack, java.util.Stack<TreeItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<TreeItem> output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) {
|
public void translate(boolean isStatic, int classIndex, java.util.HashMap<Integer, TreeItem> localRegs, Stack<TreeItem> stack, java.util.Stack<TreeItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<TreeItem> output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) {
|
||||||
stack.push(scopeStack.get(0));
|
stack.push(scopeStack.get(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.other;
|
package com.jpexs.asdec.abc.avm2.instructions.other;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -59,4 +60,11 @@ public class GetGlobalSlotIns extends InstructionDefinition {
|
|||||||
}
|
}
|
||||||
stack.push(new GetSlotTreeItem(ins, obj, slotname));
|
stack.push(new GetSlotTreeItem(ins, obj, slotname));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.other;
|
package com.jpexs.asdec.abc.avm2.instructions.other;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -43,4 +44,11 @@ public class GetLexIns extends InstructionDefinition {
|
|||||||
Multiname multiname = constants.constant_multiname[multinameIndex];
|
Multiname multiname = constants.constant_multiname[multinameIndex];
|
||||||
stack.push(new GetLexTreeItem(ins, multiname));
|
stack.push(new GetLexTreeItem(ins, multiname));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return 1; //multiname may not be runtime
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.other;
|
package com.jpexs.asdec.abc.avm2.instructions.other;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -44,4 +45,17 @@ public class GetPropertyIns extends InstructionDefinition {
|
|||||||
TreeItem obj = (TreeItem) stack.pop();
|
TreeItem obj = (TreeItem) stack.pop();
|
||||||
stack.push(new GetPropertyTreeItem(ins, obj, multiname));
|
stack.push(new GetPropertyTreeItem(ins, obj, multiname));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
int ret=-1+1;
|
||||||
|
int multinameIndex = ins.operands[0];
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsName()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsNs()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.other;
|
package com.jpexs.asdec.abc.avm2.instructions.other;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -45,4 +46,11 @@ public class GetScopeObjectIns extends InstructionDefinition {
|
|||||||
}*/
|
}*/
|
||||||
stack.push(scopeStack.get(index));
|
stack.push(scopeStack.get(index));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.other;
|
package com.jpexs.asdec.abc.avm2.instructions.other;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -59,4 +60,11 @@ public class GetSlotIns extends InstructionDefinition {
|
|||||||
}
|
}
|
||||||
stack.push(new GetSlotTreeItem(ins, obj, slotname));
|
stack.push(new GetSlotTreeItem(ins, obj, slotname));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -1+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.other;
|
package com.jpexs.asdec.abc.avm2.instructions.other;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -44,4 +45,19 @@ public class GetSuperIns extends InstructionDefinition {
|
|||||||
TreeItem obj = (TreeItem) stack.pop();
|
TreeItem obj = (TreeItem) stack.pop();
|
||||||
stack.push(new GetSuperTreeItem(ins, obj, multiname));
|
stack.push(new GetSuperTreeItem(ins, obj, multiname));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
int ret=-1+1;
|
||||||
|
int multinameIndex = ins.operands[0];
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsName()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsNs()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.other;
|
package com.jpexs.asdec.abc.avm2.instructions.other;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
||||||
@@ -42,4 +43,11 @@ public class HasNextIns extends InstructionDefinition {
|
|||||||
stack.push(new EachTreeItem(ins, curIndex, obj));
|
stack.push(new EachTreeItem(ins, curIndex, obj));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.other;
|
package com.jpexs.asdec.abc.avm2.instructions.other;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
||||||
@@ -41,4 +42,11 @@ public class InIns extends InstructionDefinition {
|
|||||||
TreeItem name = (TreeItem) stack.pop();
|
TreeItem name = (TreeItem) stack.pop();
|
||||||
stack.push(new InTreeItem(ins, name, obj));
|
stack.push(new InTreeItem(ins, name, obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.other;
|
package com.jpexs.asdec.abc.avm2.instructions.other;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -46,4 +47,17 @@ public class InitPropertyIns extends InstructionDefinition {
|
|||||||
TreeItem obj = (TreeItem) stack.pop();
|
TreeItem obj = (TreeItem) stack.pop();
|
||||||
output.add(new InitPropertyTreeItem(ins, obj, multiname, val));
|
output.add(new InitPropertyTreeItem(ins, obj, multiname, val));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
int ret=-2;
|
||||||
|
int multinameIndex = ins.operands[0];
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsName()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsNs()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.other;
|
package com.jpexs.asdec.abc.avm2.instructions.other;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
||||||
@@ -41,4 +42,11 @@ public class NextNameIns extends InstructionDefinition {
|
|||||||
//stack.push(obj + ".nextName(" + index + ")");
|
//stack.push(obj + ".nextName(" + index + ")");
|
||||||
stack.push(index);
|
stack.push(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.other;
|
package com.jpexs.asdec.abc.avm2.instructions.other;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
||||||
@@ -41,4 +42,11 @@ public class NextValueIns extends InstructionDefinition {
|
|||||||
//stack.push(obj + ".nextValue(" + index + ")");
|
//stack.push(obj + ".nextValue(" + index + ")");
|
||||||
stack.push(index);
|
stack.push(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.other;
|
package com.jpexs.asdec.abc.avm2.instructions.other;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
import com.jpexs.asdec.abc.avm2.instructions.InstructionDefinition;
|
||||||
@@ -39,4 +40,11 @@ public class ReturnValueIns extends InstructionDefinition {
|
|||||||
public void translate(boolean isStatic, int classIndex, java.util.HashMap<Integer, TreeItem> localRegs, Stack<TreeItem> stack, java.util.Stack<TreeItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<TreeItem> output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) {
|
public void translate(boolean isStatic, int classIndex, java.util.HashMap<Integer, TreeItem> localRegs, Stack<TreeItem> stack, java.util.Stack<TreeItem> scopeStack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<TreeItem> output, com.jpexs.asdec.abc.types.MethodBody body, com.jpexs.asdec.abc.ABC abc) {
|
||||||
output.add(new ReturnValueTreeItem(ins, (TreeItem) stack.pop()));
|
output.add(new ReturnValueTreeItem(ins, (TreeItem) stack.pop()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.other;
|
package com.jpexs.asdec.abc.avm2.instructions.other;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -45,4 +46,11 @@ public class SetGlobalSlotIns extends InstructionDefinition implements SetTypeIn
|
|||||||
public String getObject(Stack<TreeItem> stack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<TreeItem> output, com.jpexs.asdec.abc.types.MethodBody body) {
|
public String getObject(Stack<TreeItem> stack, ConstantPool constants, AVM2Instruction ins, MethodInfo[] method_info, List<TreeItem> output, com.jpexs.asdec.abc.types.MethodBody body) {
|
||||||
return "globalslot" + ins.operands[0];
|
return "globalslot" + ins.operands[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.other;
|
package com.jpexs.asdec.abc.avm2.instructions.other;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -54,4 +55,17 @@ public class SetPropertyIns extends InstructionDefinition implements SetTypeIns
|
|||||||
if ((!obj.toString().equals(""))) multiname = "." + multiname;
|
if ((!obj.toString().equals(""))) multiname = "." + multiname;
|
||||||
return obj + multiname;
|
return obj + multiname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
int ret=-2;
|
||||||
|
int multinameIndex = ins.operands[0];
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsName()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsNs()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.other;
|
package com.jpexs.asdec.abc.avm2.instructions.other;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -76,4 +77,11 @@ public class SetSlotIns extends InstructionDefinition implements SetTypeIns {
|
|||||||
}
|
}
|
||||||
return slotname;
|
return slotname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.other;
|
package com.jpexs.asdec.abc.avm2.instructions.other;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
import com.jpexs.asdec.abc.avm2.AVM2Code;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -54,4 +55,17 @@ public class SetSuperIns extends InstructionDefinition implements SetTypeIns {
|
|||||||
String obj = stack.get(1 + resolvedCount(constants, multinameIndex)).toString(constants);
|
String obj = stack.get(1 + resolvedCount(constants, multinameIndex)).toString(constants);
|
||||||
return obj + ".super." + multiname;
|
return obj + ".super." + multiname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
int ret=-2;
|
||||||
|
int multinameIndex = ins.operands[0];
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsName()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
if(abc.constants.constant_multiname[multinameIndex].needsNs()){
|
||||||
|
ret--;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,5 +42,10 @@ public class ThrowIns extends InstructionDefinition {
|
|||||||
output.add(new ThrowTreeItem(ins, (TreeItem) stack.pop()));
|
output.add(new ThrowTreeItem(ins, (TreeItem) stack.pop()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.jpexs.asdec.abc.avm2.instructions.stack;
|
package com.jpexs.asdec.abc.avm2.instructions.stack;
|
||||||
|
|
||||||
|
import com.jpexs.asdec.abc.ABC;
|
||||||
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
import com.jpexs.asdec.abc.avm2.ConstantPool;
|
||||||
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
import com.jpexs.asdec.abc.avm2.LocalDataArea;
|
||||||
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
import com.jpexs.asdec.abc.avm2.instructions.AVM2Instruction;
|
||||||
@@ -49,4 +50,11 @@ public class DupIns extends InstructionDefinition {
|
|||||||
stack.push(v);
|
stack.push(v);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStackDelta(AVM2Instruction ins, ABC abc) {
|
||||||
|
return -1+2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user