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: /*
11: * Aload_1Command.java Copyright (c) 2006,07 Swaroop Belur
12: *
13: * This program is free software; you can redistribute it and/or
14: * modify it under the terms of the GNU General Public License
15: * as published by the Free Software Foundation; either version 2
16: * of the License, or (at your option) any later version.
17:
18: * This program is distributed in the hope that it will be useful,
19: * but WITHOUT ANY WARRANTY; without even the implied warranty of
20: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21: * GNU General Public License for more details.
22:
23: * You should have received a copy of the GNU General Public License
24: * along with this program; if not, write to the Free Software
25: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26: *
27: */
28:
29: /**
30: * @author swaroop belur
31: * @since 1.2.1
32: */
33: public class Aload_1Command extends AbstractInstructionCommand {
34:
35: public Aload_1Command(Behaviour context) {
36: super (context);
37: }
38:
39: public int getSkipBytes() {
40: return 0;
41: }
42:
43: public void execute() {
44: OperandStack opStack = getContext().getOpStack();
45: int currentForIndex = getCurrentInstPosInCode();
46: LocalVariable local = DecompilerHelper.getLocalVariable(1,
47: "load", "java.lang.Object", true, currentForIndex);
48: if (local == null) {
49: local = new LocalVariable();
50: local.setVarName("this");
51: }
52:
53: Operand op = new Operand();
54: op.setOperandName(local.getVarName());
55: op.setOperandValue(local.getVarName());
56: op.setOperandType(Constants.IS_OBJECT_REF);
57: boolean r = false;//checkIFLoadInstIsPartOFTernaryCond(currentForIndex);
58: if (r) {
59: if (opStack.size() > 0) {
60: String str = opStack.getTopOfStack().getOperandValue();
61: str = str + op.getOperandValue();
62: op.setOperandValue(str);
63: }
64: }
65:
66: opStack.push(op);
67: op.setClassType(local.getDataType());
68: }
69: }
|