01: /*
02: * DloadCommand.java Copyright (c) 2006,07 Swaroop Belur
03: *
04: * This program is free software; you can redistribute it and/itor
05: * modify it under the terms of the GNU General Public License
06: * as published by the Free Software Foundation; either version 2
07: * of the License, or (at your option) any later version.
08:
09: * This program is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: * GNU General Public License for more details.
13:
14: * You should have received a copy of the GNU General Public License
15: * along with this program; if not, write to the Free Software
16: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17: *
18: */
19: package net.sf.jdec.jvminstructions.commands;
20:
21: import net.sf.jdec.core.DecompilerHelper;
22: import net.sf.jdec.core.LocalVariable;
23: import net.sf.jdec.core.Operand;
24: import net.sf.jdec.core.OperandStack;
25: import net.sf.jdec.reflection.Behaviour;
26:
27: public class Dload_0Command extends AbstractInstructionCommand {
28:
29: public Dload_0Command(Behaviour context) {
30: super (context);
31:
32: }
33:
34: public int getSkipBytes() {
35: return 0;
36: }
37:
38: public void execute() {
39: int currentForIndex = getCurrentInstPosInCode();
40: int index = 0;
41: OperandStack stack = getStack();
42: LocalVariable local = DecompilerHelper.getLocalVariable(index,
43: "load", "double", true, currentForIndex);
44: if (local != null) {
45: Operand op = new Operand();
46: byte[] info = getCode();
47: StringBuffer addsub = new StringBuffer("");
48: boolean bo = DecompilerHelper.checkForPostIncrForLoadCase(
49: info, currentForIndex, "category2", false, index,
50: addsub);
51: if (!bo)
52: op.setOperandValue(local.getVarName());
53: else
54: op.setOperandValue(local.getVarName()
55: + addsub.toString());
56:
57: boolean r = false;// checkIFLoadInstIsPartOFTernaryCond(currentForIndex);
58: if (r) {
59: if (stack.size() > 0) {
60: java.lang.String str = stack.getTopOfStack()
61: .getOperandValue();
62: str = str + op.getOperandValue();
63: op.setOperandValue(str);
64: }
65: }
66: stack.push(op);
67:
68: }
69:
70: }
71:
72: }
|