mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-13 12:38:08 +00:00
Stack<> to TranslteStack in translateInverted
This commit is contained in:
@@ -567,7 +567,7 @@ public class ABC {
|
||||
MethodBody bod=bodies.get(bodyIdxFromMethodIdx.get(script_info.get(i).init_index));
|
||||
GraphTextWriter t=new HilightedTextWriter(Configuration.getCodeFormatting(),false);
|
||||
try {
|
||||
bod.toString("script", ScriptExportMode.PCODE, false,i, 0, this, null, constants, method_info, new Stack<GraphTargetItem>(), false, t ,new ArrayList<String>(), null);
|
||||
bod.toString("script", ScriptExportMode.PCODE, false,i, 0, this, null, constants, method_info, new TranslateStack(), false, t ,new ArrayList<String>(), null);
|
||||
} catch (InterruptedException ex) {
|
||||
Logger.getLogger(ABC.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
@@ -2883,7 +2883,7 @@ public class AVM2Code implements Serializable {
|
||||
}
|
||||
}
|
||||
}
|
||||
//int cnt = removeTraps(refs, true, false, localData, new Stack<GraphTargetItem>(), new ArrayList<GraphTargetItem>(), code, code.adr2pos(addr), new HashMap<Integer, Integer>(), new HashMap<Integer, HashMap<Integer, GraphTargetItem>>(), decisions, path);
|
||||
//int cnt = removeTraps(refs, true, false, localData, new TranslateStack(), new ArrayList<GraphTargetItem>(), code, code.adr2pos(addr), new HashMap<Integer, Integer>(), new HashMap<Integer, HashMap<Integer, GraphTargetItem>>(), decisions, path);
|
||||
code.getCode().removeIgnored(constants, trait, info, body);
|
||||
return cnt;
|
||||
}
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
package com.jpexs.decompiler.flash.abc.avm2.instructions;
|
||||
|
||||
import com.jpexs.decompiler.graph.GraphTargetItem;
|
||||
import com.jpexs.decompiler.graph.TranslateStack;
|
||||
import java.util.HashMap;
|
||||
import java.util.Stack;
|
||||
|
||||
public interface IfTypeIns {
|
||||
|
||||
public abstract void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, AVM2Instruction ins);
|
||||
public abstract void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, TranslateStack stack, AVM2Instruction ins);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ import com.jpexs.decompiler.graph.ScopeStack;
|
||||
import com.jpexs.decompiler.graph.TranslateStack;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Stack;
|
||||
|
||||
public class IfEqIns extends InstructionDefinition implements IfTypeIns {
|
||||
|
||||
@@ -47,7 +46,7 @@ public class IfEqIns extends InstructionDefinition implements IfTypeIns {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, AVM2Instruction ins) {
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, TranslateStack stack, AVM2Instruction ins) {
|
||||
GraphTargetItem v2 = stack.pop();
|
||||
GraphTargetItem v1 = stack.pop();
|
||||
stack.push(new NeqAVM2Item(ins, v1, v2));
|
||||
|
||||
@@ -30,7 +30,6 @@ import com.jpexs.decompiler.graph.TranslateStack;
|
||||
import com.jpexs.decompiler.graph.model.NotItem;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Stack;
|
||||
|
||||
public class IfFalseIns extends InstructionDefinition implements IfTypeIns {
|
||||
|
||||
@@ -45,7 +44,7 @@ public class IfFalseIns extends InstructionDefinition implements IfTypeIns {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, AVM2Instruction ins) {
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, TranslateStack stack, AVM2Instruction ins) {
|
||||
//String v1 = stack.pop().toString();
|
||||
//stack.push("(" + v1 + ")");
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ import com.jpexs.decompiler.graph.ScopeStack;
|
||||
import com.jpexs.decompiler.graph.TranslateStack;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Stack;
|
||||
|
||||
public class IfGeIns extends InstructionDefinition implements IfTypeIns {
|
||||
|
||||
@@ -47,7 +46,7 @@ public class IfGeIns extends InstructionDefinition implements IfTypeIns {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, AVM2Instruction ins) {
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, TranslateStack stack, AVM2Instruction ins) {
|
||||
GraphTargetItem v2 = stack.pop();
|
||||
GraphTargetItem v1 = stack.pop();
|
||||
stack.push(new LtAVM2Item(ins, v1, v2));
|
||||
|
||||
@@ -47,7 +47,7 @@ public class IfGtIns extends InstructionDefinition implements IfTypeIns {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, AVM2Instruction ins) {
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, TranslateStack stack, AVM2Instruction ins) {
|
||||
GraphTargetItem v2 = stack.pop();
|
||||
GraphTargetItem v1 = stack.pop();
|
||||
stack.push(new LeAVM2Item(ins, v1, v2));
|
||||
|
||||
@@ -47,7 +47,7 @@ public class IfLeIns extends InstructionDefinition implements IfTypeIns {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, AVM2Instruction ins) {
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, TranslateStack stack, AVM2Instruction ins) {
|
||||
GraphTargetItem v2 = stack.pop();
|
||||
GraphTargetItem v1 = stack.pop();
|
||||
stack.push(new GtAVM2Item(ins, v1, v2));
|
||||
|
||||
@@ -31,7 +31,6 @@ import com.jpexs.decompiler.graph.ScopeStack;
|
||||
import com.jpexs.decompiler.graph.TranslateStack;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Stack;
|
||||
|
||||
public class IfLtIns extends InstructionDefinition implements IfTypeIns {
|
||||
|
||||
@@ -47,7 +46,7 @@ public class IfLtIns extends InstructionDefinition implements IfTypeIns {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, AVM2Instruction ins) {
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, TranslateStack stack, AVM2Instruction ins) {
|
||||
GraphTargetItem v2 = stack.pop();
|
||||
GraphTargetItem v1 = stack.pop();
|
||||
stack.push(new GeAVM2Item(ins, v1, v2));
|
||||
|
||||
@@ -47,7 +47,7 @@ public class IfNGeIns extends InstructionDefinition implements IfTypeIns {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, AVM2Instruction ins) {
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, TranslateStack stack, AVM2Instruction ins) {
|
||||
GraphTargetItem v2 = stack.pop();
|
||||
GraphTargetItem v1 = stack.pop();
|
||||
stack.push(new GeAVM2Item(ins, v1, v2));
|
||||
|
||||
@@ -47,7 +47,7 @@ public class IfNGtIns extends InstructionDefinition implements IfTypeIns {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, AVM2Instruction ins) {
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, TranslateStack stack, AVM2Instruction ins) {
|
||||
GraphTargetItem v2 = stack.pop();
|
||||
GraphTargetItem v1 = stack.pop();
|
||||
stack.push(new GtAVM2Item(ins, v1, v2));
|
||||
|
||||
@@ -47,7 +47,7 @@ public class IfNLeIns extends InstructionDefinition implements IfTypeIns {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, AVM2Instruction ins) {
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, TranslateStack stack, AVM2Instruction ins) {
|
||||
GraphTargetItem v2 = stack.pop();
|
||||
GraphTargetItem v1 = stack.pop();
|
||||
stack.push(new LeAVM2Item(ins, v1, v2));
|
||||
|
||||
@@ -47,7 +47,7 @@ public class IfNLtIns extends InstructionDefinition implements IfTypeIns {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, AVM2Instruction ins) {
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, TranslateStack stack, AVM2Instruction ins) {
|
||||
GraphTargetItem v2 = stack.pop();
|
||||
GraphTargetItem v1 = stack.pop();
|
||||
stack.push(new LtAVM2Item(ins, v1, v2));
|
||||
|
||||
@@ -47,7 +47,7 @@ public class IfNeIns extends InstructionDefinition implements IfTypeIns {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, AVM2Instruction ins) {
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, TranslateStack stack, AVM2Instruction ins) {
|
||||
GraphTargetItem v2 = stack.pop();
|
||||
GraphTargetItem v1 = stack.pop();
|
||||
stack.push(new EqAVM2Item(ins, v1, v2));
|
||||
|
||||
@@ -47,7 +47,7 @@ public class IfStrictEqIns extends InstructionDefinition implements IfTypeIns {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, AVM2Instruction ins) {
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, TranslateStack stack, AVM2Instruction ins) {
|
||||
GraphTargetItem v2 = stack.pop();
|
||||
GraphTargetItem v1 = stack.pop();
|
||||
stack.push(new StrictNeqAVM2Item(ins, v1, v2));
|
||||
|
||||
@@ -47,7 +47,7 @@ public class IfStrictNeIns extends InstructionDefinition implements IfTypeIns {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, AVM2Instruction ins) {
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, TranslateStack stack, AVM2Instruction ins) {
|
||||
GraphTargetItem v2 = stack.pop();
|
||||
GraphTargetItem v1 = stack.pop();
|
||||
stack.push(new StrictEqAVM2Item(ins, v1, v2));
|
||||
|
||||
@@ -45,7 +45,7 @@ public class IfTrueIns extends InstructionDefinition implements IfTypeIns {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, AVM2Instruction ins) {
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, TranslateStack stack, AVM2Instruction ins) {
|
||||
GraphTargetItem v1 = stack.pop();
|
||||
stack.push(new NotItem(ins, v1));
|
||||
}
|
||||
|
||||
@@ -43,6 +43,6 @@ public class JumpIns extends InstructionDefinition implements IfTypeIns {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, Stack<GraphTargetItem> stack, AVM2Instruction ins) {
|
||||
public void translateInverted(HashMap<Integer, GraphTargetItem> localRegs, TranslateStack stack, AVM2Instruction ins) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -826,7 +826,7 @@ public class Action implements GraphSourceItem {
|
||||
}
|
||||
if (action instanceof GraphSourceItemContainer) {
|
||||
GraphSourceItemContainer cnt = (GraphSourceItemContainer) action;
|
||||
//List<GraphTargetItem> out=actionsPartToTree(new HashMap<Integer, String>(), new HashMap<String, GraphTargetItem>(),new HashMap<String, GraphTargetItem>(), new Stack<GraphTargetItem>(), src, ip+1,endip-1 , version);
|
||||
//List<GraphTargetItem> out=actionsPartToTree(new HashMap<Integer, String>(), new HashMap<String, GraphTargetItem>(),new HashMap<String, GraphTargetItem>(), new TranslateStack(), src, ip+1,endip-1 , version);
|
||||
long endAddr = action.getAddress() + cnt.getHeaderSize();
|
||||
String cntName = cnt.getName();
|
||||
List<List<GraphTargetItem>> outs = new ArrayList<>();
|
||||
|
||||
@@ -381,7 +381,7 @@ public class Graph {
|
||||
part = part.getSubParts().get(0).nextParts.get(0);
|
||||
}
|
||||
/*localData = prepareBranchLocalData(localData);
|
||||
Stack<GraphTargetItem> st = new Stack<>();
|
||||
TranslateStack st = new TranslateStack();
|
||||
List<GraphTargetItem> output=new ArrayList<>();
|
||||
GraphPart startPart = part;
|
||||
for (int i = part.start; i <= part.end; i++) {
|
||||
|
||||
Reference in New Issue
Block a user