01: package ch.ethz.prose.jvmai.jikesrvm.stub_weaver;
02:
03: import com.ibm.JikesRVM.VM_JVMAI;
04: import java.lang.reflect.Method;
05: import ch.ethz.jvmai.*;
06:
07: /**
08: * Concrete implementation of a CodeJoinPoint for the Jikes RVM. The structure
09: * is similar to the JVMDI implementation.
10: *
11: * However, some methods aren't implemented yet since they are not used in the
12: * JUnit tests of PROSE. These methods will throw a RuntimeException.
13: *
14: * @author Johann Gyger
15: */
16: public class CodeJoinPointImpl implements CodeJoinPoint, JoinPointKinds {
17:
18: /**
19: * The AOP tag associated with this join point.
20: */
21: public Object aopTag;
22:
23: /**
24: * Method ID of the method to which this join point belongs.
25: */
26: public int methodId = -1;
27:
28: /**
29: * Thread that came across this join point.
30: */
31: public Thread thread;
32:
33: /**
34: * Frame pointer of the method where this join point was encountered.
35: */
36: public int fp = -1;
37:
38: public Object getAopTag() {
39: return aopTag;
40: }
41:
42: public int getByteCodeIndex() {
43: throw new RuntimeException(
44: "TODO CodeJoinPointImpl.getByteCodeIndex");
45: }
46:
47: public CodeJoinPoint getEnclosingJoinPoint() {
48: return VM_JVMAI.getInstance().getEnclosingJoinPoint(this );
49: }
50:
51: public Method getMethod() {
52: return VM_JVMAI.getInstance().getMethod(this );
53: }
54:
55: public Object[] getArgs() {
56: return VM_JVMAI.getInstance().getArgs(this );
57: }
58:
59: public String getKind() {
60: return KIND_CODE_JP;
61: }
62:
63: public int getMask() {
64: return MASK_CODE_JP;
65: }
66:
67: public Signature getSignature() {
68: throw new RuntimeException(
69: "TODO CodeJoinPointImpl.getSignature");
70: }
71:
72: public JoinPointStaticPart getStaticPart() {
73: throw new RuntimeException(
74: "TODO CodeJoinPointImpl.getStaticPart");
75: }
76:
77: public Object getTarget() {
78: return VM_JVMAI.getInstance().getTarget(this );
79: }
80:
81: public Object getThis() {
82: return VM_JVMAI.getInstance().getTarget(this );
83: }
84:
85: public String toLongString() {
86: return toString();
87: }
88:
89: public String toShortString() {
90: return toString();
91: }
92:
93: }
|