mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-31 11:44:36 +00:00
AVM2 insturuction execution (without graph translate) improved
This commit is contained in:
@@ -645,41 +645,25 @@ public class AVM2Code implements Cloneable {
|
||||
LocalDataArea lda = new LocalDataArea();
|
||||
lda.localRegisters = arguments;
|
||||
try {
|
||||
while (true) {
|
||||
while (pos < code.size()) {
|
||||
AVM2Instruction ins = code.get(pos);
|
||||
if (ins.definition instanceof JumpIns) {
|
||||
pos = adr2pos(ins.getParamAsLong(constants, 0));
|
||||
continue;
|
||||
}
|
||||
if (ins.definition instanceof IfFalseIns) {
|
||||
Boolean b = (Boolean) lda.operandStack.pop();
|
||||
if (b == false) {
|
||||
pos = adr2pos(ins.getParamAsLong(constants, 0));
|
||||
} else {
|
||||
pos++;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (ins.definition instanceof IfTrueIns) {
|
||||
Boolean b = (Boolean) lda.operandStack.pop();
|
||||
if (b == true) {
|
||||
pos = adr2pos(ins.getParamAsLong(constants, 0));
|
||||
} else {
|
||||
pos++;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (ins.definition instanceof ReturnValueIns) {
|
||||
return lda.operandStack.pop();
|
||||
}
|
||||
if (ins.definition instanceof ReturnVoidIns) {
|
||||
return null;
|
||||
}
|
||||
ins.definition.execute(lda, constants, ins);
|
||||
|
||||
if (lda.jump != null) {
|
||||
pos = adr2pos(lda.jump);
|
||||
} else {
|
||||
pos++;
|
||||
}
|
||||
|
||||
if (lda.returnValue != null) {
|
||||
return lda.returnValue;
|
||||
}
|
||||
|
||||
pos++;
|
||||
}
|
||||
} catch (ConvertException e) {
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1478,10 +1462,8 @@ public class AVM2Code implements Cloneable {
|
||||
}
|
||||
//if(true) return "";
|
||||
toSourceCount++;
|
||||
if (toSourceLimit > 0) {
|
||||
if (toSourceCount >= toSourceLimit) {
|
||||
throw new ConvertException("Limit of subs(" + toSourceLimit + ") was reached", start);
|
||||
}
|
||||
if (toSourceLimit > 0 && toSourceCount >= toSourceLimit) {
|
||||
throw new ConvertException("Limit of subs(" + toSourceLimit + ") was reached", start);
|
||||
}
|
||||
List<GraphTargetItem> output = new ArrayList<>();
|
||||
int ip = start;
|
||||
|
||||
@@ -26,4 +26,19 @@ public class LocalDataArea {
|
||||
public Stack<Object> scopeStack = new Stack<>();
|
||||
|
||||
public HashMap<Integer, Object> localRegisters = new HashMap<>();
|
||||
|
||||
public Long jump;
|
||||
|
||||
public Object returnValue;
|
||||
|
||||
public String executionException;
|
||||
|
||||
public void clear() {
|
||||
operandStack.clear();
|
||||
scopeStack.clear();
|
||||
localRegisters.clear();
|
||||
jump = null;
|
||||
returnValue = null;
|
||||
executionException = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3.0 of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.abc.avm2.instructions;
|
||||
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
|
||||
@@ -84,8 +84,9 @@ public abstract class InstructionDefinition implements Serializable {
|
||||
return s.toString();
|
||||
}
|
||||
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
throw new UnsupportedOperationException("Instruction " + instructionName + " not implemented");
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
//throw new UnsupportedOperationException("Instruction " + instructionName + " not implemented");
|
||||
return false;
|
||||
}
|
||||
|
||||
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) throws InterruptedException {
|
||||
|
||||
@@ -35,11 +35,6 @@ public class Lf32Ins extends InstructionDefinition implements AlchemyTypeIns {
|
||||
super(0x38, "lf32", new int[]{}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
|
||||
GraphTargetItem ofs = stack.pop();
|
||||
|
||||
@@ -35,11 +35,6 @@ public class Lf64Ins extends InstructionDefinition implements AlchemyTypeIns {
|
||||
super(0x39, "lf64", new int[]{}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
|
||||
GraphTargetItem ofs = stack.pop();
|
||||
|
||||
@@ -35,11 +35,6 @@ public class Li16Ins extends InstructionDefinition implements AlchemyTypeIns {
|
||||
super(0x36, "li16", new int[]{}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
|
||||
GraphTargetItem ofs = stack.pop();
|
||||
|
||||
@@ -35,11 +35,6 @@ public class Li32Ins extends InstructionDefinition implements AlchemyTypeIns {
|
||||
super(0x37, "li32", new int[]{}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
|
||||
GraphTargetItem ofs = stack.pop();
|
||||
|
||||
@@ -35,11 +35,6 @@ public class Li8Ins extends InstructionDefinition implements AlchemyTypeIns {
|
||||
super(0x35, "li8", new int[]{}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
|
||||
GraphTargetItem ofs = stack.pop();
|
||||
|
||||
@@ -35,11 +35,6 @@ public class Sf32Ins extends InstructionDefinition implements AlchemyTypeIns {
|
||||
super(0x3D, "sf32", new int[]{}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
|
||||
GraphTargetItem ofs = stack.pop();
|
||||
|
||||
@@ -35,11 +35,6 @@ public class Sf64Ins extends InstructionDefinition implements AlchemyTypeIns {
|
||||
super(0x3E, "sf64", new int[]{}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
|
||||
GraphTargetItem ofs = stack.pop();
|
||||
|
||||
@@ -35,11 +35,6 @@ public class Si16Ins extends InstructionDefinition implements AlchemyTypeIns {
|
||||
super(0x3B, "si16", new int[]{}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
|
||||
GraphTargetItem ofs = stack.pop();
|
||||
|
||||
@@ -35,11 +35,6 @@ public class Si32Ins extends InstructionDefinition implements AlchemyTypeIns {
|
||||
super(0x3C, "si32", new int[]{}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
|
||||
GraphTargetItem ofs = stack.pop();
|
||||
|
||||
@@ -35,11 +35,6 @@ public class Si8Ins extends InstructionDefinition implements AlchemyTypeIns {
|
||||
super(0x3A, "si8", new int[]{}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
|
||||
GraphTargetItem ofs = stack.pop();
|
||||
|
||||
@@ -35,11 +35,6 @@ public class Sxi16Ins extends InstructionDefinition implements AlchemyTypeIns {
|
||||
super(0x52, "sxi16", new int[]{}, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
|
||||
GraphTargetItem value = stack.pop();
|
||||
|
||||
@@ -35,11 +35,6 @@ public class Sxi1Ins extends InstructionDefinition implements AlchemyTypeIns {
|
||||
super(0x50, "sxi1", new int[]{}, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
|
||||
GraphTargetItem value = stack.pop();
|
||||
|
||||
@@ -35,11 +35,6 @@ public class Sxi8Ins extends InstructionDefinition implements AlchemyTypeIns {
|
||||
super(0x51, "sxi8", new int[]{}, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
|
||||
GraphTargetItem value = stack.pop();
|
||||
|
||||
@@ -34,7 +34,7 @@ public class AddIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
Object o1 = lda.operandStack.pop();
|
||||
Object o2 = lda.operandStack.pop();
|
||||
if ((o1 instanceof Long) && ((o2 instanceof Long))) {
|
||||
@@ -53,6 +53,7 @@ public class AddIns extends InstructionDefinition {
|
||||
String s = o1.toString() + o2.toString();
|
||||
lda.operandStack.push(s);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,7 +34,7 @@ public class DecrementIIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
Object obj = lda.operandStack.pop();
|
||||
if (obj instanceof Long) {
|
||||
Long obj2 = ((Long) obj) - 1;
|
||||
@@ -47,8 +47,10 @@ public class DecrementIIns extends InstructionDefinition {
|
||||
Double obj2 = Double.parseDouble((String) obj) - 1;
|
||||
lda.operandStack.push(obj2);
|
||||
} else {
|
||||
throw new RuntimeException("Cannot decrement local register");
|
||||
lda.executionException = "Cannot decrement local register";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,7 +34,7 @@ public class DecrementIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
Object obj = lda.operandStack.pop();
|
||||
if (obj instanceof Long) {
|
||||
Long obj2 = ((Long) obj) - 1;
|
||||
@@ -47,8 +47,10 @@ public class DecrementIns extends InstructionDefinition {
|
||||
Double obj2 = Double.parseDouble((String) obj) - 1;
|
||||
lda.operandStack.push(obj2);
|
||||
} else {
|
||||
throw new RuntimeException("Cannot decrement local register");
|
||||
lda.executionException = "Cannot decrement local register";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,7 +34,7 @@ public class DivideIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
Object o2 = lda.operandStack.pop();
|
||||
Object o1 = lda.operandStack.pop();
|
||||
if ((o1 instanceof Long) && ((o2 instanceof Long))) {
|
||||
@@ -57,8 +57,10 @@ public class DivideIns extends InstructionDefinition {
|
||||
Double ret = ((Double) o1) / ((Long) o2);
|
||||
lda.operandStack.push(ret);
|
||||
} else {
|
||||
throw new RuntimeException("Cannot divide");
|
||||
lda.executionException = "Cannot divide";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,7 +34,7 @@ public class ModuloIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
Object o1 = lda.operandStack.pop();
|
||||
Object o2 = lda.operandStack.pop();
|
||||
|
||||
@@ -42,8 +42,10 @@ public class ModuloIns extends InstructionDefinition {
|
||||
Long ret = ((Long) o2) % ((Long) o1);
|
||||
lda.operandStack.push(ret);
|
||||
} else {
|
||||
throw new RuntimeException("Cannot modulo");
|
||||
lda.executionException = "Cannot modulo";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,7 +34,7 @@ public class MultiplyIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
Object o1 = lda.operandStack.pop();
|
||||
Object o2 = lda.operandStack.pop();
|
||||
if ((o1 instanceof Long) && ((o2 instanceof Long))) {
|
||||
@@ -50,8 +50,10 @@ public class MultiplyIns extends InstructionDefinition {
|
||||
Double ret = ((Double) o1) * ((Long) o2);
|
||||
lda.operandStack.push(ret);
|
||||
} else {
|
||||
throw new RuntimeException("Cannot multiply");
|
||||
lda.executionException = "Cannot multiply";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,11 +34,12 @@ public class BitAndIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
Long value2 = (Long) lda.operandStack.pop();
|
||||
Long value1 = (Long) lda.operandStack.pop();
|
||||
Long value3 = value1 & value2;
|
||||
lda.operandStack.push(value3);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,10 +34,11 @@ public class BitNotIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
Long value = (Long) lda.operandStack.pop();
|
||||
Long ret = -value;
|
||||
lda.operandStack.push(ret);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,11 +34,12 @@ public class BitOrIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
Long value2 = (Long) lda.operandStack.pop();
|
||||
Long value1 = (Long) lda.operandStack.pop();
|
||||
Long value3 = value1 | value2;
|
||||
lda.operandStack.push(value3);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,11 +34,12 @@ public class BitXorIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
Long value2 = (Long) lda.operandStack.pop();
|
||||
Long value1 = (Long) lda.operandStack.pop();
|
||||
Long value3 = value1 ^ value2;
|
||||
lda.operandStack.push(value3);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,11 +34,12 @@ public class LShiftIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
int value2 = (int) ((Long) lda.operandStack.pop() & 0x1F);
|
||||
int value1 = ((Long) lda.operandStack.pop()).intValue();
|
||||
Long value3 = (long) (value1 << value2);
|
||||
lda.operandStack.push(value3);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,11 +34,12 @@ public class RShiftIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
int value2 = (int) ((Long) lda.operandStack.pop() & 0x1F);
|
||||
int value1 = ((Long) lda.operandStack.pop()).intValue();
|
||||
Long value3 = (long) (value1 >> value2);
|
||||
lda.operandStack.push(value3);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,11 +34,12 @@ public class URShiftIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
Long value2 = ((Long) lda.operandStack.pop() & 0x1F);
|
||||
Long value1 = (Long) lda.operandStack.pop();
|
||||
Long value3 = value1 >>> value2;
|
||||
lda.operandStack.push(value3);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,11 +34,12 @@ public class EqualsIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
Object obj1 = lda.operandStack.pop();
|
||||
Object obj2 = lda.operandStack.pop();
|
||||
Boolean res = obj1.equals(obj2);
|
||||
lda.operandStack.push(res);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -45,14 +45,15 @@ public class ConstructIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
/*int argCount = ins.getParamAsLong(constants, 0).intValue();
|
||||
List<Object> passArguments = new ArrayList<Object>();
|
||||
for (int i = argCount - 1; i >= 0; i--) {
|
||||
passArguments.set(i, lda.operandStack.pop());
|
||||
}
|
||||
Object obj = lda.operandStack.pop();*/
|
||||
throw new RuntimeException("Cannot call constructor");
|
||||
lda.executionException = "Cannot call constructor";
|
||||
return false;
|
||||
//call construct property of obj
|
||||
//push new instance
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ConstructPropIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
/*int multinameIndex = ins.getParamAsLong(constants, 0).intValue();
|
||||
int argCount = ins.getParamAsLong(constants, 1).intValue();
|
||||
List<Object> passArguments = new ArrayList<Object>();
|
||||
@@ -47,7 +47,8 @@ public class ConstructPropIns extends InstructionDefinition {
|
||||
}*/
|
||||
//if multiname[multinameIndex] is runtime
|
||||
//pop(name) pop(ns)
|
||||
throw new RuntimeException("Cannot construct property");
|
||||
lda.executionException = "Cannot construct property";
|
||||
return false;
|
||||
//create property
|
||||
//push new instance
|
||||
}
|
||||
|
||||
@@ -36,14 +36,15 @@ public class ConstructSuperIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
/*int argCount = ins.getParamAsLong(constants, 0).intValue();
|
||||
List<Object> passArguments = new ArrayList<Object>();
|
||||
for (int i = argCount - 1; i >= 0; i--) {
|
||||
passArguments.set(i, lda.operandStack.pop());
|
||||
}
|
||||
Object obj = lda.operandStack.pop();*/
|
||||
throw new RuntimeException("Cannot call super constructor");
|
||||
lda.executionException = "Cannot call super constructor";
|
||||
return false;
|
||||
//call construct property of obj
|
||||
//do not push anything
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
import java.util.List;
|
||||
|
||||
public class DebugFileIns extends InstructionDefinition {
|
||||
|
||||
@@ -30,6 +29,7 @@ public class DebugFileIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
import java.util.List;
|
||||
|
||||
public class DebugIns extends InstructionDefinition {
|
||||
|
||||
@@ -30,6 +29,7 @@ public class DebugIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
import java.util.List;
|
||||
|
||||
public class DebugLineIns extends InstructionDefinition {
|
||||
|
||||
@@ -30,6 +29,7 @@ public class DebugLineIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class CallIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
/*int argCount = ins.getParamAsLong(constants, 0).intValue();
|
||||
List<Object> passArguments = new ArrayList<Object>();
|
||||
for (int i = argCount - 1; i >= 0; i--) {
|
||||
@@ -44,7 +44,8 @@ public class CallIns extends InstructionDefinition {
|
||||
}
|
||||
Object receiver = lda.operandStack.pop();
|
||||
Object function = lda.operandStack.pop();*/
|
||||
throw new RuntimeException("Call to unknown function");
|
||||
lda.executionException = "Call to unknown function";
|
||||
return false;
|
||||
//push(result)
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public class CallMethodIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
/*int methodIndex = ins.getParamAsLong(constants, 0).intValue(); //index of object's method
|
||||
int argCount = ins.getParamAsLong(constants, 1).intValue();
|
||||
List<Object> passArguments = new ArrayList<Object>();
|
||||
@@ -44,7 +44,8 @@ public class CallMethodIns extends InstructionDefinition {
|
||||
passArguments.set(i, lda.operandStack.pop());
|
||||
}
|
||||
Object receiver = lda.operandStack.pop();*/
|
||||
throw new RuntimeException("Call to unknown method");
|
||||
lda.executionException = "Call to unknown method";
|
||||
return false;
|
||||
//push(result)
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public class CallPropVoidIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
//same as callproperty
|
||||
/*
|
||||
int multinameIndex = ins.getParamAsLong(constants, 0).intValue();
|
||||
@@ -49,7 +49,8 @@ public class CallPropVoidIns extends InstructionDefinition {
|
||||
//if multiname[multinameIndex] is runtime
|
||||
//pop(name) pop(ns)
|
||||
Object obj = lda.operandStack.pop();*/
|
||||
throw new RuntimeException("Call to unknown property");
|
||||
lda.executionException = "Call to unknown property";
|
||||
return false;
|
||||
//do not push anything
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public class CallPropertyIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
/*int multinameIndex = ins.getParamAsLong(constants, 0).intValue();
|
||||
int argCount = ins.getParamAsLong(constants, 1).intValue();
|
||||
List<Object> passArguments = new ArrayList<Object>();
|
||||
@@ -47,7 +47,8 @@ public class CallPropertyIns extends InstructionDefinition {
|
||||
//if multiname[multinameIndex] is runtime
|
||||
//pop(name) pop(ns)
|
||||
Object obj = lda.operandStack.pop();*/
|
||||
throw new RuntimeException("Call to unknown property");
|
||||
lda.executionException = "Call to unknown property";
|
||||
return false;
|
||||
//push(result)
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public class CallStaticIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
/*int methodIndex = ins.getParamAsLong(constants, 0).intValue(); //index of method_info
|
||||
int argCount = ins.getParamAsLong(constants, 1).intValue();
|
||||
List<Object> passArguments = new ArrayList<Object>();
|
||||
@@ -44,7 +44,8 @@ public class CallStaticIns extends InstructionDefinition {
|
||||
passArguments.set(i, lda.operandStack.pop());
|
||||
}
|
||||
Object receiver = lda.operandStack.pop();*/
|
||||
throw new RuntimeException("Call to unknown static method");
|
||||
lda.executionException = "Call to unknown static method";
|
||||
return false;
|
||||
//push(result)
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public class CallSuperIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
/*int multinameIndex = ins.getParamAsLong(constants, 0).intValue();
|
||||
int argCount = ins.getParamAsLong(constants, 1).intValue();
|
||||
List<Object> passArguments = new ArrayList<Object>();
|
||||
@@ -47,7 +47,8 @@ public class CallSuperIns extends InstructionDefinition {
|
||||
//if multiname[multinameIndex] is runtime
|
||||
//pop(name) pop(ns)
|
||||
Object receiver = lda.operandStack.pop();*/
|
||||
throw new RuntimeException("Call to unknown super method");
|
||||
lda.executionException = "Call to unknown super method";
|
||||
return false;
|
||||
//push(result)
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public class CallSuperVoidIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
/*int multinameIndex = ins.getParamAsLong(constants, 0).intValue();
|
||||
int argCount = ins.getParamAsLong(constants, 1).intValue();
|
||||
List<Object> passArguments = new ArrayList<Object>();
|
||||
@@ -47,7 +47,8 @@ public class CallSuperVoidIns extends InstructionDefinition {
|
||||
//if multiname[multinameIndex] is runtime
|
||||
//pop(name) pop(ns)
|
||||
Object receiver = lda.operandStack.pop();*/
|
||||
throw new RuntimeException("Call to unknown super method");
|
||||
lda.executionException = "Call to unknown super method";
|
||||
return false;
|
||||
//do not push anything
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.jumps;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.AVM2LocalData;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.IfTypeIns;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
@@ -33,6 +35,15 @@ public class IfFalseIns extends InstructionDefinition implements IfTypeIns {
|
||||
super(0x12, "iffalse", new int[]{AVM2Code.DAT_OFFSET}, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
Boolean b = (Boolean) lda.operandStack.pop();
|
||||
if (b == false) {
|
||||
lda.jump = ins.getParamAsLong(constants, 0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
|
||||
GraphTargetItem v1 = stack.pop();
|
||||
|
||||
@@ -19,6 +19,8 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.jumps;
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.AVM2LocalData;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.IfTypeIns;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
@@ -33,6 +35,15 @@ public class IfTrueIns extends InstructionDefinition implements IfTypeIns {
|
||||
super(0x11, "iftrue", new int[]{AVM2Code.DAT_OFFSET}, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
Boolean b = (Boolean) lda.operandStack.pop();
|
||||
if (b == true) {
|
||||
lda.jump = ins.getParamAsLong(constants, 0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
|
||||
//String v1 = stack.pop().toString();
|
||||
|
||||
@@ -18,6 +18,8 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.jumps;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.AVM2LocalData;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2Code;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.IfTypeIns;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
@@ -34,6 +36,12 @@ public class JumpIns extends InstructionDefinition implements IfTypeIns {
|
||||
super(0x10, NAME, new int[]{AVM2Code.DAT_OFFSET}, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
lda.jump = ins.getParamAsLong(constants, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
|
||||
//stack.push(new BooleanAVM2Item(ins, Boolean.TRUE));// + ins.operands[0]);
|
||||
|
||||
@@ -36,7 +36,7 @@ public class DecLocalIIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
int locRegIndex = ins.getParamAsLong(constants, 0).intValue();
|
||||
Object obj = lda.localRegisters.get(locRegIndex);
|
||||
if (obj instanceof Long) {
|
||||
@@ -50,8 +50,10 @@ public class DecLocalIIns extends InstructionDefinition {
|
||||
Double obj2 = Double.parseDouble((String) obj) - 1;
|
||||
lda.localRegisters.put(locRegIndex, obj2);
|
||||
} else {
|
||||
throw new RuntimeException("Cannot decrement local register");
|
||||
lda.executionException = "Cannot decrement local register";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -36,7 +36,7 @@ public class DecLocalIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
int locRegIndex = ins.getParamAsLong(constants, 0).intValue();
|
||||
Object obj = lda.localRegisters.get(locRegIndex);
|
||||
if (obj instanceof Long) {
|
||||
@@ -50,8 +50,10 @@ public class DecLocalIns extends InstructionDefinition {
|
||||
Double obj2 = Double.parseDouble((String) obj) - 1;
|
||||
lda.localRegisters.put(locRegIndex, obj2);
|
||||
} else {
|
||||
throw new RuntimeException("Cannot decrement local register");
|
||||
lda.executionException = "Cannot decrement local register";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,7 +19,6 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.localregs;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import java.util.List;
|
||||
|
||||
public class GetLocal0Ins extends GetLocalTypeIns {
|
||||
|
||||
@@ -28,8 +27,9 @@ public class GetLocal0Ins extends GetLocalTypeIns {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
lda.operandStack.push(lda.localRegisters.get(0));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,7 +19,6 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.localregs;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import java.util.List;
|
||||
|
||||
public class GetLocal1Ins extends GetLocalTypeIns {
|
||||
|
||||
@@ -28,8 +27,9 @@ public class GetLocal1Ins extends GetLocalTypeIns {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
lda.operandStack.push(lda.localRegisters.get(1));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,7 +19,6 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.localregs;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import java.util.List;
|
||||
|
||||
public class GetLocal2Ins extends GetLocalTypeIns {
|
||||
|
||||
@@ -28,8 +27,9 @@ public class GetLocal2Ins extends GetLocalTypeIns {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
lda.operandStack.push(lda.localRegisters.get(2));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,7 +19,6 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.localregs;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import java.util.List;
|
||||
|
||||
public class GetLocal3Ins extends GetLocalTypeIns {
|
||||
|
||||
@@ -28,8 +27,9 @@ public class GetLocal3Ins extends GetLocalTypeIns {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
lda.operandStack.push(lda.localRegisters.get(3));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -28,8 +28,9 @@ public class GetLocalIns extends GetLocalTypeIns {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
lda.operandStack.push(lda.localRegisters.get(ins.getParamAsLong(constants, 0).intValue()));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -36,13 +36,14 @@ public class DeletePropertyIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
/*int multiIndex = ins.getParamAsLong(constants, 0).intValue();
|
||||
//if multiname[multinameIndex] is runtime
|
||||
//pop(name) pop(ns)
|
||||
Object obj = lda.operandStack.pop();
|
||||
//push true if removed*/
|
||||
throw new RuntimeException("Cannot remove property");
|
||||
lda.executionException = "Cannot remove property";
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -36,12 +36,12 @@ public class FindPropertyIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
//int multiIndex = ins.getParamAsLong(constants, 0).intValue();
|
||||
//if is runtime
|
||||
//pop(name), pop(ns)
|
||||
throw new RuntimeException("Cannot find property");
|
||||
|
||||
lda.executionException = "Cannot find property";
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -36,11 +36,12 @@ public class FindPropertyStrictIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
//int multiIndex = ins.getParamAsLong(constants, 0).intValue();
|
||||
//if is runtime
|
||||
//pop(name), pop(ns)
|
||||
throw new RuntimeException("Cannot find property");
|
||||
lda.executionException = "Cannot find property";
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -36,12 +36,13 @@ public class GetDescendantsIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
/*int multiIndex = ins.getParamAsLong(constants, 0).intValue();
|
||||
//if is runtime
|
||||
//pop(name), pop(ns)
|
||||
Object obj = lda.operandStack.pop();*/
|
||||
throw new RuntimeException("getdescendants not working");
|
||||
lda.executionException = "getdescendants not working";
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,8 +35,9 @@ public class GetGlobalScopeIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
throw new RuntimeException("getglobalscope not working");
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
lda.executionException = "getglobalscope not working";
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
import java.util.List;
|
||||
|
||||
public class LabelIns extends InstructionDefinition {
|
||||
//this can be target of branch
|
||||
@@ -30,6 +29,7 @@ public class LabelIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
import java.util.List;
|
||||
|
||||
public class NopIns extends InstructionDefinition {
|
||||
|
||||
@@ -29,6 +28,7 @@ public class NopIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ package com.jpexs.decompiler.flash.abc.avm2.instructions.other;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.ABC;
|
||||
import com.jpexs.decompiler.flash.abc.AVM2LocalData;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.model.ReturnValueAVM2Item;
|
||||
@@ -31,6 +33,12 @@ public class ReturnValueIns extends InstructionDefinition {
|
||||
super(0x48, "returnvalue", new int[]{}, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
lda.returnValue = lda.operandStack.pop();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
|
||||
output.add(new ReturnValueAVM2Item(ins, stack.pop()));
|
||||
|
||||
@@ -17,9 +17,12 @@
|
||||
package com.jpexs.decompiler.flash.abc.avm2.instructions.other;
|
||||
|
||||
import com.jpexs.decompiler.flash.abc.AVM2LocalData;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.LocalDataArea;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.instructions.InstructionDefinition;
|
||||
import com.jpexs.decompiler.flash.abc.avm2.model.ReturnVoidAVM2Item;
|
||||
import com.jpexs.decompiler.flash.ecma.Undefined;
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.TranslateStack;
|
||||
import java.util.List;
|
||||
@@ -30,6 +33,12 @@ public class ReturnVoidIns extends InstructionDefinition {
|
||||
super(0x47, "returnvoid", new int[]{}, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
lda.returnValue = Undefined.INSTANCE;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(AVM2LocalData localData, TranslateStack stack, AVM2Instruction ins, List<GraphTargetItem> output, String path) {
|
||||
output.add(new ReturnVoidAVM2Item(ins));
|
||||
|
||||
@@ -35,9 +35,4 @@ public class AbsJumpIns extends InstructionDefinition {
|
||||
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,9 +35,4 @@ public class AllocIns extends InstructionDefinition {
|
||||
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,9 +35,4 @@ public class CodeGenOpIns extends InstructionDefinition {
|
||||
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,9 +35,4 @@ public class DecodeIns extends InstructionDefinition {
|
||||
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,9 +35,4 @@ public class DoubleToAtomIns extends InstructionDefinition {
|
||||
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,9 +36,4 @@ public class FindPropGlobalIns extends InstructionDefinition {
|
||||
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,9 +36,4 @@ public class FindPropGlobalStrictIns extends InstructionDefinition {
|
||||
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,9 +36,4 @@ public class GetOuterScopeIns extends InstructionDefinition {
|
||||
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,9 +35,4 @@ public class MarkIns extends InstructionDefinition {
|
||||
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,9 +36,4 @@ public class NegatePIns extends InstructionDefinition {
|
||||
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,9 +35,4 @@ public class PrologueIns extends InstructionDefinition {
|
||||
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,9 +36,4 @@ public class PushUninitializedIns extends InstructionDefinition {
|
||||
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,9 +35,4 @@ public class SendEnterIns extends InstructionDefinition {
|
||||
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,9 +35,4 @@ public class SetPropertyLateIns extends InstructionDefinition {
|
||||
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,9 +36,4 @@ public class SubtractPIns extends InstructionDefinition {
|
||||
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,9 +35,4 @@ public class SweepIns extends InstructionDefinition {
|
||||
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,9 +35,4 @@ public class VerifyOpIns extends InstructionDefinition {
|
||||
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,9 +35,4 @@ public class VerifyPassIns extends InstructionDefinition {
|
||||
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,9 +35,4 @@ public class WbIns extends InstructionDefinition {
|
||||
public int getStackPushCount(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getScopeStackDelta(AVM2Instruction ins, ABC abc) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,10 +34,11 @@ public class DupIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
Object obj = lda.operandStack.pop();
|
||||
lda.operandStack.push(obj);
|
||||
lda.operandStack.push(obj);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,8 +34,9 @@ public class PopIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
lda.operandStack.pop();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,8 +35,9 @@ public class PopScopeIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
lda.scopeStack.pop();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,8 +35,9 @@ public class PushByteIns extends InstructionDefinition implements PushIntegerTyp
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
lda.operandStack.push(ins.getParam(constants, 0));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,8 +35,9 @@ public class PushDoubleIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
lda.operandStack.push(ins.getParam(constants, 0));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,8 +34,9 @@ public class PushFalseIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
lda.operandStack.push(Boolean.FALSE);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,8 +35,9 @@ public class PushIntIns extends InstructionDefinition implements PushIntegerType
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
lda.operandStack.push(ins.getParam(constants, 0));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -33,8 +33,9 @@ public class PushScopeIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
lda.scopeStack.push(lda.operandStack.pop());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,8 +35,9 @@ public class PushShortIns extends InstructionDefinition implements PushIntegerTy
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
lda.operandStack.push(((Number) ins.getParam(constants, 0)).longValue());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,8 +35,9 @@ public class PushStringIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
lda.operandStack.push(ins.getParam(constants, 0));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,8 +34,9 @@ public class PushTrueIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
lda.operandStack.push(Boolean.TRUE);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,8 +35,9 @@ public class PushUIntIns extends InstructionDefinition implements PushIntegerTyp
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
lda.operandStack.push(ins.getParam(constants, 0));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,11 +34,12 @@ public class SwapIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
Object obj1 = lda.operandStack.pop();
|
||||
Object obj2 = lda.operandStack.pop();
|
||||
lda.operandStack.push(obj1);
|
||||
lda.operandStack.push(obj2);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,7 +37,7 @@ public class ApplyTypeIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
int argCount = ins.getParamAsLong(constants, 0).intValue();
|
||||
List<Object> params = new ArrayList<>();
|
||||
for (int i = 0; i < argCount; i++) {
|
||||
@@ -45,6 +45,7 @@ public class ApplyTypeIns extends InstructionDefinition {
|
||||
}
|
||||
Collections.reverse(params);
|
||||
//TODO: pop type and push type<params>
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -36,13 +36,13 @@ public class AsTypeIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
//Long typeIndex = ins.getParamAsLong(constants, 0);
|
||||
Object obj = lda.operandStack.pop();
|
||||
//if multiname[typeIndex]==obj
|
||||
lda.operandStack.push(obj);
|
||||
//else push null
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,12 +34,13 @@ public class AsTypeLateIns extends InstructionDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
//Object objClass = lda.operandStack.pop();
|
||||
Object obj = lda.operandStack.pop();
|
||||
//if obj.class=objClass
|
||||
lda.operandStack.push(obj);
|
||||
//else push null
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -39,8 +39,9 @@ public class CoerceAIns extends InstructionDefinition implements CoerceOrConvert
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
//coerce any type
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -36,9 +36,10 @@ public class CoerceIns extends InstructionDefinition implements CoerceOrConvertT
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
public boolean execute(LocalDataArea lda, AVM2ConstantPool constants, AVM2Instruction ins) {
|
||||
//int multinameIndex = ins.getParamAsLong(constants, 0).intValue();
|
||||
//push and pop coerced value to specified type
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user