28
|
1 |
Object subclass:#JavaContext
|
32
|
2 |
instanceVariableNames:'method class sender stack frameBase pc'
|
28
|
3 |
classVariableNames:''
|
|
4 |
poolDictionaries:''
|
|
5 |
category:'Java-Support'
|
|
6 |
!
|
|
7 |
|
|
8 |
|
|
9 |
!JavaContext methodsFor:'ST context mimicri'!
|
|
10 |
|
|
11 |
argsAndVars
|
|
12 |
|args|
|
|
13 |
|
|
14 |
args := Array new:(method numArgs + method numVars).
|
41
|
15 |
method isStatic ifTrue:[
|
|
16 |
args replaceFrom:1 to:args size with:stack startingAt:frameBase.
|
|
17 |
] ifFalse:[
|
|
18 |
args replaceFrom:1 to:args size with:stack startingAt:frameBase+1.
|
|
19 |
].
|
28
|
20 |
^ args
|
|
21 |
|
|
22 |
"Created: 1.5.1996 / 17:32:44 / cg"
|
|
23 |
"Modified: 1.5.1996 / 17:41:50 / cg"
|
|
24 |
!
|
|
25 |
|
|
26 |
canReturn
|
|
27 |
^ false
|
|
28 |
|
|
29 |
"Created: 1.5.1996 / 15:05:36 / cg"
|
|
30 |
!
|
|
31 |
|
|
32 |
isBlockContext
|
|
33 |
^ false
|
|
34 |
|
|
35 |
"Created: 1.5.1996 / 15:05:26 / cg"
|
|
36 |
!
|
|
37 |
|
|
38 |
lineNumber
|
32
|
39 |
^ method lineNumberForPC:pc
|
28
|
40 |
|
|
41 |
"Created: 1.5.1996 / 15:05:47 / cg"
|
|
42 |
!
|
|
43 |
|
|
44 |
methodClass
|
|
45 |
^ class
|
|
46 |
|
|
47 |
"Created: 1.5.1996 / 15:04:17 / cg"
|
|
48 |
!
|
|
49 |
|
|
50 |
methodHome
|
|
51 |
^ self
|
|
52 |
|
|
53 |
"Created: 1.5.1996 / 15:03:43 / cg"
|
|
54 |
!
|
|
55 |
|
|
56 |
numArgs
|
|
57 |
^ method numArgs
|
|
58 |
|
|
59 |
"Created: 1.5.1996 / 15:04:35 / cg"
|
|
60 |
!
|
|
61 |
|
|
62 |
nvars
|
|
63 |
^ 0
|
|
64 |
|
|
65 |
"Created: 1.5.1996 / 15:05:03 / cg"
|
|
66 |
!
|
|
67 |
|
|
68 |
receiver
|
41
|
69 |
method isStatic ifTrue:[
|
|
70 |
^ method javaClass
|
|
71 |
].
|
28
|
72 |
^ stack at:frameBase
|
|
73 |
|
|
74 |
"Created: 1.5.1996 / 15:04:03 / cg"
|
|
75 |
"Modified: 1.5.1996 / 17:43:17 / cg"
|
|
76 |
!
|
|
77 |
|
32
|
78 |
selector
|
|
79 |
^ (method name , method signature) asSymbol "/ signatureName
|
28
|
80 |
|
|
81 |
"Created: 1.5.1996 / 15:03:03 / cg"
|
|
82 |
! !
|
|
83 |
|
|
84 |
!JavaContext methodsFor:'accessing'!
|
|
85 |
|
|
86 |
class:aJavaClass method:aJavaMethod sender:aContext stack:s frameBase:f
|
|
87 |
class := aJavaClass.
|
|
88 |
method := aJavaMethod.
|
|
89 |
sender := aContext.
|
|
90 |
stack := s.
|
|
91 |
frameBase := f
|
|
92 |
|
|
93 |
"Modified: 1.5.1996 / 17:39:34 / cg"
|
|
94 |
"Created: 1.5.1996 / 17:42:27 / cg"
|
|
95 |
!
|
|
96 |
|
|
97 |
method
|
|
98 |
^ method.
|
|
99 |
|
|
100 |
"Created: 1.5.1996 / 15:00:23 / cg"
|
|
101 |
"Modified: 1.5.1996 / 15:00:47 / cg"
|
|
102 |
!
|
|
103 |
|
32
|
104 |
pc
|
|
105 |
^ pc
|
|
106 |
!
|
|
107 |
|
28
|
108 |
sender
|
|
109 |
^ sender.
|
|
110 |
|
|
111 |
"Modified: 1.5.1996 / 15:00:47 / cg"
|
|
112 |
"Created: 1.5.1996 / 15:01:18 / cg"
|
32
|
113 |
!
|
|
114 |
|
|
115 |
setPC:anInteger
|
|
116 |
pc := anInteger
|
28
|
117 |
! !
|
|
118 |
|
|
119 |
!JavaContext methodsFor:'printing & storing'!
|
|
120 |
|
|
121 |
printString
|
|
122 |
|mS recCls|
|
|
123 |
|
41
|
124 |
mS := 'JAVA-' , class name , '::' , method signatureName.
|
28
|
125 |
|
|
126 |
(recCls := self receiver class) ~~ class ifTrue:[
|
|
127 |
^ recCls name , '>>' , mS
|
|
128 |
].
|
|
129 |
|
|
130 |
^ mS
|
|
131 |
|
|
132 |
"Created: 1.5.1996 / 15:07:43 / cg"
|
|
133 |
"Modified: 1.5.1996 / 17:58:16 / cg"
|
|
134 |
! !
|
|
135 |
|
|
136 |
!JavaContext class methodsFor:'documentation'!
|
|
137 |
|
|
138 |
version
|
41
|
139 |
^ '$Header: /home/jv/Projects/SmalltalkX/repositories/cvs/stx/libjava/JavaContext.st,v 1.3 1996/05/03 11:28:20 cg Exp $'
|
28
|
140 |
! !
|