01: /*
02: * Dconst_0.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.Operand;
22: import net.sf.jdec.core.OperandStack;
23: import net.sf.jdec.reflection.Behaviour;
24: import net.sf.jdec.util.Constants;
25:
26: public class Dconst_0Command extends AbstractInstructionCommand {
27:
28: public Dconst_0Command(Behaviour context) {
29: super (context);
30:
31: }
32:
33: public int getSkipBytes() {
34: return 0;
35: }
36:
37: public void execute() {
38: Operand op = new Operand();
39: java.lang.String str = "" + 0.0;
40: op.setOperandValue(new Double(str));
41: op.setOperandType(Constants.IS_CONSTANT_DOUBLE);
42: OperandStack stack = getStack();
43: boolean r = false;//checkIFLoadInstIsPartOFTernaryCond(getCurrentInstPosInCode());
44: if (r) {
45: if (stack.size() > 0) {
46: java.lang.String string = stack.getTopOfStack()
47: .getOperandValue();
48: string = string + op.getOperandValue();
49: op.setOperandValue(str);
50: }
51: }
52: stack.push(op);
53: }
54:
55: }
|