01: package net.sf.jdec.jvminstructions.commands;
02:
03: import net.sf.jdec.core.GlobalVariableStore;
04: import net.sf.jdec.core.Operand;
05: import net.sf.jdec.reflection.Behaviour;
06: import net.sf.jdec.util.Util;
07:
08: public class MonitorEnterCommand extends AbstractInstructionCommand {
09:
10: public MonitorEnterCommand(Behaviour context) {
11: super (context);
12:
13: }
14:
15: public int getSkipBytes() {
16: return 0;
17: }
18:
19: public void execute() {
20: Operand op = getStack().getTopOfStack();
21: String tempString = "synchronized(" + op.getOperandValue()
22: + ")\n{\n";
23: Behaviour behavior = getContext();
24: behavior.appendToBuffer(Util
25: .formatDecompiledStatement(tempString));
26: GlobalVariableStore
27: .setCurrentMonitorEnterPos(getCurrentInstPosInCode());
28:
29: }
30:
31: }
|