01: package net.sf.jdec.jvminstructions.commands;
02:
03: import net.sf.jdec.core.DecompilerHelper;
04: import net.sf.jdec.core.LocalVariable;
05: import net.sf.jdec.core.Operand;
06: import net.sf.jdec.core.OperandStack;
07: import net.sf.jdec.reflection.Behaviour;
08: import net.sf.jdec.util.Constants;
09:
10: public class LloadCommand extends AbstractInstructionCommand {
11:
12: public LloadCommand(Behaviour context) {
13: super (context);
14:
15: }
16:
17: public int getSkipBytes() {
18: return 1;
19: }
20:
21: public void execute() {
22: int currentForIndex = getCurrentInstPosInCode();
23: byte[] info = getCode();
24: int i = currentForIndex;
25: int opValueI = info[++i];
26: if (opValueI < 0)
27: opValueI += 256;
28: OperandStack opStack = getStack();
29: LocalVariable local = DecompilerHelper.getLocalVariable(
30: opValueI, "load", "long", false, currentForIndex);
31: if (local != null) {
32: Operand op = new Operand();
33: op.setOperandType(Constants.IS_CONSTANT_LONG);
34: // (Constants.CATEGORY2);
35: StringBuffer addsub = new StringBuffer("");
36: boolean bo = DecompilerHelper.checkForPostIncrForLoadCase(
37: info, currentForIndex, "category2", true, opValueI,
38: addsub);
39: if (!bo)
40: op.setOperandValue(local.getVarName());
41: else
42: op.setOperandValue(local.getVarName()
43: + addsub.toString());
44: boolean r = false;// checkIFLoadInstIsPartOFTernaryCond(currentForIndex);
45: if (r) {
46: if (opStack.size() > 0) {
47: java.lang.String str = opStack.getTopOfStack()
48: .getOperandValue();
49: str = str + op.getOperandValue();
50: op.setOperandValue(str);
51: }
52: }
53: opStack.push(op);
54:
55: }
56: }
57:
58: }
|