01: package net.sf.jdec.jvminstructions.commands;
02:
03: import java.util.Hashtable;
04:
05: import net.sf.jdec.commonutil.Numbers;
06: import net.sf.jdec.core.GlobalVariableStore;
07: import net.sf.jdec.core.Operand;
08: import net.sf.jdec.core.OperandStack;
09: import net.sf.jdec.reflection.Behaviour;
10: import net.sf.jdec.ui.util.UIUtil;
11:
12: public class SipushCommand extends AbstractInstructionCommand {
13:
14: public SipushCommand(Behaviour context) {
15: super (context);
16:
17: }
18:
19: public int getSkipBytes() {
20: return 2;
21: }
22:
23: public void execute() {
24: Hashtable pushTypes = GlobalVariableStore.getPushTypes();
25: int currentForIndex = getCurrentInstPosInCode();
26: int opValueI = getGenericFinder().getOffset(currentForIndex);
27: int sipushvalue = opValueI;
28: java.lang.String sopValueI = "";
29:
30: java.lang.String nonascii = UIUtil.getUIUtil()
31: .getInterpretNonAscii();
32: StringBuffer sbf = new StringBuffer("");
33: sopValueI = Numbers.formatCharForNonAsciiValue(opValueI, sbf);
34: if (sbf.toString().equals("nonascii")) {
35: if (nonascii.equals("true")) {
36:
37: } else {
38: sopValueI = "" + opValueI;
39: }
40: }
41: Operand op = new Operand();
42: java.lang.String tp = null;
43: if (pushTypes != null) {
44: tp = (java.lang.String) pushTypes.get(new Integer(
45: currentForIndex));
46: if (tp != null) {
47: tp = "(" + tp + ")" + sopValueI;
48: }
49:
50: }
51:
52: if (tp != null)
53:
54: op.setOperandValue(tp);// // new Integer(opValueI));
55: else
56: op.setOperandValue("" + sopValueI);
57: boolean r = false;//heckIFLoadInstIsPartOFTernaryCond(currentForIndex);
58: OperandStack opStack = getStack();
59: if (r) {
60: if (opStack.size() > 0) {
61: java.lang.String str = opStack.getTopOfStack()
62: .getOperandValue();
63: str = str + op.getOperandValue();
64: op.setOperandValue(str);
65: }
66: }
67: opStack.push(op);
68: }
69:
70: }
|