author | Patrik Svestka <patrik.svestka@gmail.com> |
Wed, 17 Feb 2021 15:24:09 +0100 | |
branch | jv |
changeset 4568 | 524471ef6575 |
parent 4384 | e28fcaaf93c7 |
permissions | -rw-r--r-- |
4384
e28fcaaf93c7
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
3128
diff
changeset
|
1 |
"{ Encoding: utf8 }" |
e28fcaaf93c7
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
3128
diff
changeset
|
2 |
|
24 | 3 |
" |
4 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
5 |
All Rights Reserved |
|
6 |
||
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
951 | 14 |
"{ Package: 'stx:libbasic3' }" |
15 |
||
120 | 16 |
Object subclass:#CallChain |
236 | 17 |
instanceVariableNames:'receiver selector class isBlock rest' |
18 |
classVariableNames:'' |
|
19 |
poolDictionaries:'' |
|
20 |
category:'System-Debugging-Support' |
|
22 | 21 |
! |
22 |
||
23 | 23 |
!CallChain class methodsFor:'documentation'! |
24 |
||
24 | 25 |
copyright |
26 |
" |
|
27 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
28 |
All Rights Reserved |
|
29 |
||
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
88 | 37 |
! |
38 |
||
39 |
documentation |
|
40 |
" |
|
41 |
This is is used as a companion to MessageTally. |
|
42 |
Instances of it are used to represent a calling chain. |
|
261 | 43 |
They are simply holders for some of the contexts values - no |
44 |
intelligence here. |
|
88 | 45 |
(MessageTally could have used the contexts themself, but these |
46 |
may create more overhead) |
|
236 | 47 |
|
48 |
[author:] |
|
49 |
Claus Gittinger |
|
50 |
||
51 |
[see also:] |
|
261 | 52 |
MessageTally ProfileTree |
236 | 53 |
MessageTracer |
54 |
AbstractTime |
|
88 | 55 |
" |
23 | 56 |
! ! |
57 |
||
2282 | 58 |
!CallChain class methodsFor:'instance creation'! |
59 |
||
60 |
callChainTo:aContext stopAtCallerForWhich:aBlock |
|
61 |
"entered whenever the probed block gets interrupted; |
|
62 |
generate a chain of callInfo objects to aContext" |
|
63 |
||
64 |
"{ Pragma: +optSpeed }" |
|
65 |
||
66 |
|con chain info atEnd sender home |
|
67 |
recClass selector mthdClass| |
|
68 |
||
69 |
con := aContext. |
|
70 |
con isNil ifTrue:[^ nil]. |
|
71 |
||
72 |
"/ skip any intermediate contexts |
|
73 |
[con receiver == Processor] whileTrue:[ |
|
74 |
con := con sender |
|
75 |
]. |
|
76 |
||
77 |
"got it - collect info from contexts" |
|
78 |
||
79 |
"walk up" |
|
80 |
||
81 |
con isNil ifTrue:[^ nil]. |
|
82 |
(aBlock value:con) ifTrue:[^ nil]. |
|
83 |
||
84 |
atEnd := false. |
|
85 |
||
86 |
[atEnd] whileFalse:[ |
|
87 |
con isNil ifTrue:[ |
|
88 |
atEnd := true |
|
89 |
] ifFalse:[ |
|
90 |
sender := con sender. |
|
91 |
sender isNil ifTrue:[ |
|
92 |
atEnd := true |
|
93 |
] ifFalse:[ |
|
94 |
(aBlock value:sender) ifTrue:[ |
|
95 |
atEnd := true |
|
96 |
"/ ] ifFalse:[ |
|
97 |
"/ (sender isBlockContext) ifTrue:[ |
|
98 |
"/ (aBlock value:sender sender) ifTrue:[ |
|
99 |
"/ atEnd := true |
|
100 |
"/ ] |
|
101 |
"/ ] |
|
102 |
] |
|
103 |
] |
|
104 |
]. |
|
105 |
atEnd ifFalse:[ |
|
106 |
info := self basicNew. |
|
107 |
home := con methodHome. |
|
108 |
||
109 |
home isNil ifTrue:[ |
|
110 |
recClass := UndefinedObject. |
|
111 |
selector := 'optimized'. |
|
112 |
mthdClass := UndefinedObject. |
|
113 |
] ifFalse:[ |
|
114 |
recClass := home receiver class. |
|
115 |
selector := home selector. |
|
116 |
mthdClass := home methodClass. |
|
117 |
]. |
|
118 |
||
119 |
info |
|
120 |
receiver:recClass |
|
121 |
selector:selector |
|
122 |
class:mthdClass |
|
123 |
isBlock:(con isBlockContext). |
|
124 |
info rest:chain. |
|
125 |
chain := info. |
|
126 |
con := sender |
|
127 |
] |
|
128 |
]. |
|
129 |
||
130 |
^ chain |
|
131 |
||
132 |
"Created: / 04-07-2010 / 09:43:27 / cg" |
|
133 |
! ! |
|
134 |
||
22 | 135 |
!CallChain methodsFor:'accessing'! |
136 |
||
261 | 137 |
isBlock |
138 |
"return true, if this is a callChain for a block-context" |
|
139 |
||
88 | 140 |
^ isBlock |
22 | 141 |
|
261 | 142 |
"Modified: 18.5.1996 / 18:52:05 / cg" |
22 | 143 |
! |
144 |
||
145 |
methodClass |
|
261 | 146 |
"return the contexts methods class" |
147 |
||
22 | 148 |
^ class |
261 | 149 |
|
150 |
"Modified: 18.5.1996 / 18:54:04 / cg" |
|
22 | 151 |
! |
152 |
||
88 | 153 |
receiver |
261 | 154 |
"return the contexts receiver" |
155 |
||
88 | 156 |
^ receiver |
261 | 157 |
|
158 |
"Modified: 18.5.1996 / 18:54:12 / cg" |
|
88 | 159 |
! |
160 |
||
22 | 161 |
receiver:r selector:s class:cls |
261 | 162 |
"private tally interface - set receiver, selector and class. |
163 |
the block flag is cleared." |
|
164 |
||
22 | 165 |
receiver := r. |
166 |
selector := s. |
|
167 |
class := cls. |
|
168 |
isBlock := false. |
|
261 | 169 |
|
170 |
"Modified: 18.5.1996 / 18:54:42 / cg" |
|
171 |
! |
|
172 |
||
173 |
receiver:r selector:s class:cls isBlock:blk |
|
174 |
"private tally interface - set receiver, selector, class |
|
175 |
and the block flag." |
|
176 |
||
177 |
receiver := r. |
|
178 |
selector := s. |
|
179 |
class := cls. |
|
180 |
isBlock := blk. |
|
181 |
||
182 |
"Created: 18.5.1996 / 18:52:34 / cg" |
|
183 |
"Modified: 18.5.1996 / 18:54:58 / cg" |
|
22 | 184 |
! |
185 |
||
88 | 186 |
rest |
261 | 187 |
"return the chains link" |
188 |
||
88 | 189 |
^ rest |
261 | 190 |
|
191 |
"Modified: 18.5.1996 / 18:55:24 / cg" |
|
22 | 192 |
! |
193 |
||
88 | 194 |
rest:r |
261 | 195 |
"set the chains link" |
196 |
||
88 | 197 |
rest := r. |
261 | 198 |
|
199 |
"Modified: 18.5.1996 / 18:55:19 / cg" |
|
22 | 200 |
! |
201 |
||
88 | 202 |
selector |
261 | 203 |
"return the contexts selector" |
204 |
||
88 | 205 |
^ selector |
261 | 206 |
|
207 |
"Modified: 18.5.1996 / 18:55:11 / cg" |
|
22 | 208 |
! ! |
209 |
||
210 |
!CallChain methodsFor:'comparing'! |
|
211 |
||
212 |
= someInfo |
|
261 | 213 |
"return true, if the argument chain is for the same method invocation" |
214 |
||
22 | 215 |
receiver == someInfo receiver ifFalse:[^ false]. |
216 |
selector == someInfo selector ifFalse:[^ false]. |
|
217 |
^ class == someInfo methodClass |
|
261 | 218 |
|
219 |
"Modified: 18.5.1996 / 18:55:47 / cg" |
|
951 | 220 |
! |
221 |
||
222 |
hash |
|
223 |
"return an integer useful for hashing on the receiver; |
|
224 |
redefined since = is redefined here." |
|
225 |
||
226 |
^ (receiver hash bitXor:selector hash) bitXor:class hash |
|
22 | 227 |
! ! |
88 | 228 |
|
98 | 229 |
!CallChain class methodsFor:'documentation'! |
230 |
||
231 |
version |
|
3121
19723298dd2c
Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3042
diff
changeset
|
232 |
^ '$Header: CallChain.st 1909 2012-03-31 00:14:49Z vranyj1 $' |
2282 | 233 |
! |
234 |
||
235 |
version_CVS |
|
4384
e28fcaaf93c7
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
3128
diff
changeset
|
236 |
^ '§Header: /cvs/stx/stx/libbasic3/CallChain.st,v 1.14 2010/07/04 08:06:27 cg Exp §' |
3012 | 237 |
! |
238 |
||
3121
19723298dd2c
Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3042
diff
changeset
|
239 |
version_HG |
19723298dd2c
Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3042
diff
changeset
|
240 |
|
19723298dd2c
Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3042
diff
changeset
|
241 |
^ '$Changeset: <not expanded> $' |
19723298dd2c
Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3042
diff
changeset
|
242 |
! |
19723298dd2c
Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3042
diff
changeset
|
243 |
|
3012 | 244 |
version_SVN |
4384
e28fcaaf93c7
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
3128
diff
changeset
|
245 |
^ '§Id: CallChain.st 1909 2012-03-31 00:14:49Z vranyj1 §' |
3012 | 246 |
! ! |
3121
19723298dd2c
Bugfix: reading of Java class extensions methods.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
3042
diff
changeset
|
247 |