108
|
1 |
"{ Package: 'exept:regression' }"
|
|
2 |
|
158
|
3 |
"{ NameSpace: RegressionTests }"
|
|
4 |
|
108
|
5 |
TestCase subclass:#JITTest
|
246
|
6 |
instanceVariableNames:'i1 i2 i3 i4 i5 i6'
|
108
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
181
|
9 |
category:'tests-Regression'
|
108
|
10 |
!
|
|
11 |
|
|
12 |
Object subclass:#BarClass
|
|
13 |
instanceVariableNames:''
|
|
14 |
classVariableNames:''
|
|
15 |
poolDictionaries:''
|
|
16 |
privateIn:JITTest
|
|
17 |
!
|
|
18 |
|
|
19 |
Object subclass:#FooClass
|
|
20 |
instanceVariableNames:''
|
|
21 |
classVariableNames:''
|
|
22 |
poolDictionaries:''
|
|
23 |
privateIn:JITTest
|
|
24 |
!
|
|
25 |
|
|
26 |
|
|
27 |
!JITTest class methodsFor:'tests'!
|
|
28 |
|
|
29 |
cond1:arg
|
|
30 |
arg == 0 ifTrue:[
|
|
31 |
^ 'zero'
|
|
32 |
].
|
|
33 |
^ 'not zero'
|
|
34 |
|
|
35 |
"
|
|
36 |
JITTest cond1:0
|
|
37 |
"
|
|
38 |
|
|
39 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
40 |
!
|
|
41 |
|
|
42 |
cond2:arg
|
|
43 |
self size.
|
|
44 |
arg == 0 ifTrue:[
|
|
45 |
^ 'zero'
|
|
46 |
].
|
|
47 |
^ 'not zero'
|
|
48 |
|
|
49 |
"
|
|
50 |
JITTest cond2:0
|
|
51 |
"
|
|
52 |
|
|
53 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
54 |
!
|
|
55 |
|
|
56 |
send1:arg
|
|
57 |
^ self send1:arg with:(Association new) with:thisContext sender
|
|
58 |
|
|
59 |
"
|
|
60 |
JITTest send1:1
|
|
61 |
"
|
|
62 |
|
|
63 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
64 |
!
|
|
65 |
|
|
66 |
send1:arg1 with:arg2 with:arg3
|
|
67 |
self halt
|
|
68 |
|
|
69 |
"
|
|
70 |
JITTest send1:1
|
|
71 |
"
|
|
72 |
|
|
73 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
74 |
!
|
|
75 |
|
|
76 |
test1
|
|
77 |
^ 5
|
|
78 |
|
|
79 |
"
|
|
80 |
JITTest test1
|
|
81 |
"
|
|
82 |
|
|
83 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
84 |
!
|
|
85 |
|
|
86 |
test2
|
|
87 |
^ [5]
|
|
88 |
|
|
89 |
"
|
|
90 |
JITTest test2 value
|
|
91 |
"
|
|
92 |
|
|
93 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
94 |
!
|
|
95 |
|
|
96 |
test2b
|
|
97 |
^ [:a | a]
|
|
98 |
|
|
99 |
"
|
|
100 |
JITTest test2b value:1
|
|
101 |
"
|
|
102 |
|
|
103 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
104 |
!
|
|
105 |
|
|
106 |
test3
|
|
107 |
^ 256
|
|
108 |
|
|
109 |
"
|
|
110 |
JITTest test3
|
|
111 |
"
|
|
112 |
|
|
113 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
114 |
!
|
|
115 |
|
|
116 |
test4
|
|
117 |
^ 16r7FFF
|
|
118 |
|
|
119 |
"
|
|
120 |
JITTest test4
|
|
121 |
"
|
|
122 |
|
|
123 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
124 |
!
|
|
125 |
|
|
126 |
test5
|
|
127 |
^ 16rFFFF
|
|
128 |
|
|
129 |
"
|
|
130 |
JITTest test5
|
|
131 |
"
|
|
132 |
|
|
133 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
134 |
!
|
|
135 |
|
|
136 |
test5b
|
|
137 |
^ -16rFFFF
|
|
138 |
|
|
139 |
"
|
|
140 |
JITTest test5b
|
|
141 |
"
|
|
142 |
|
|
143 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
144 |
!
|
|
145 |
|
|
146 |
test5c
|
|
147 |
^ -1
|
|
148 |
|
|
149 |
"
|
|
150 |
JITTest test5c
|
|
151 |
"
|
|
152 |
|
|
153 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
154 |
!
|
|
155 |
|
|
156 |
test6
|
|
157 |
^ #hello
|
|
158 |
|
|
159 |
"
|
|
160 |
JITTest test6
|
|
161 |
"
|
|
162 |
|
|
163 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
164 |
!
|
|
165 |
|
|
166 |
test6b
|
|
167 |
^ #fooBarBazThisIsANonCommonSymbol
|
|
168 |
|
|
169 |
"
|
|
170 |
JITTest test6b
|
|
171 |
"
|
|
172 |
|
|
173 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
174 |
!
|
|
175 |
|
|
176 |
test6c
|
|
177 |
^ 123456789
|
|
178 |
|
|
179 |
"
|
|
180 |
JITTest test6c
|
|
181 |
"
|
|
182 |
|
|
183 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
184 |
!
|
|
185 |
|
|
186 |
test6d
|
|
187 |
^ 1234567890
|
|
188 |
|
|
189 |
"
|
|
190 |
JITTest test6d
|
|
191 |
"
|
|
192 |
|
|
193 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
194 |
!
|
|
195 |
|
|
196 |
test7
|
|
197 |
^ true
|
|
198 |
|
|
199 |
"
|
|
200 |
JITTest test7
|
|
201 |
"
|
|
202 |
|
|
203 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
204 |
!
|
|
205 |
|
|
206 |
test8:arg1 a:arg2 a:arg3 a:arg4
|
|
207 |
^ arg1
|
|
208 |
|
|
209 |
"
|
|
210 |
JITTest test8:1 a:2 a:3 a:4
|
|
211 |
"
|
|
212 |
|
|
213 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
214 |
!
|
|
215 |
|
|
216 |
test8b:arg1 a:arg2 a:arg3 a:arg4
|
|
217 |
^ arg2
|
|
218 |
|
|
219 |
"
|
|
220 |
JITTest test8b:1 a:2 a:3 a:4
|
|
221 |
"
|
|
222 |
|
|
223 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
224 |
!
|
|
225 |
|
|
226 |
test8c:arg1 a:arg2 a:arg3 a:arg4
|
|
227 |
^ arg3
|
|
228 |
|
|
229 |
"
|
|
230 |
JITTest test8c:1 a:2 a:3 a:4
|
|
231 |
"
|
|
232 |
|
|
233 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
234 |
!
|
|
235 |
|
|
236 |
test9:arg1
|
|
237 |
^ arg1 + 1
|
|
238 |
|
|
239 |
"
|
|
240 |
JITTest test9:0
|
|
241 |
"
|
|
242 |
|
|
243 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
244 |
! !
|
|
245 |
|
117
|
246 |
!JITTest methodsFor:'helpers'!
|
|
247 |
|
|
248 |
withWaitCursorDo:aBlock
|
|
249 |
aBlock value
|
|
250 |
|
|
251 |
"Created: / 16.11.2001 / 00:06:20 / cg"
|
|
252 |
! !
|
|
253 |
|
109
|
254 |
!JITTest methodsFor:'public - test - arithmetic'!
|
|
255 |
|
|
256 |
testAdd1
|
|
257 |
self assert:( (JITTest new add1:-1000) == -999 ).
|
|
258 |
self assert:( (JITTest new add1:-1) == 0 ).
|
|
259 |
self assert:( (JITTest new add1:0) == 1 ).
|
|
260 |
self assert:( (JITTest new add1:1) == 2 ).
|
|
261 |
self assert:( (JITTest new add1:1000) == 1001 ).
|
|
262 |
|
|
263 |
self assert:( (JITTest new add1:SmallInteger maxVal) class == LargeInteger ).
|
|
264 |
self assert:( ((JITTest new add1:SmallInteger maxVal) - 1) class == SmallInteger ).
|
|
265 |
|
|
266 |
self assert:( (JITTest new add1:-1000.0) = -999.0 ).
|
|
267 |
self assert:( (JITTest new add1:-1.0) = 0.0 ).
|
|
268 |
self assert:( (JITTest new add1:0.0) = 1.0 ).
|
|
269 |
self assert:( (JITTest new add1:1.0) = 2.0 ).
|
|
270 |
self assert:( (JITTest new add1:1000.0) = 1001.0 ).
|
|
271 |
|
|
272 |
|
|
273 |
self assert:( (JITTest new add2:-1000) = -999 ).
|
|
274 |
self assert:( (JITTest new add2:-1) = 0 ).
|
|
275 |
self assert:( (JITTest new add2:0) = 1 ).
|
|
276 |
self assert:( (JITTest new add2:1) = 2 ).
|
|
277 |
self assert:( (JITTest new add2:1000) = 1001 ).
|
|
278 |
|
|
279 |
self assert:( (JITTest new add2:-1000.0) = -999.0 ).
|
|
280 |
self assert:( (JITTest new add2:-1.0) = 0.0 ).
|
|
281 |
self assert:( (JITTest new add2:0.0) = 1.0 ).
|
|
282 |
self assert:( (JITTest new add2:1.0) = 2.0 ).
|
|
283 |
self assert:( (JITTest new add2:1000.0) = 1001.0 ).
|
|
284 |
|
|
285 |
"
|
|
286 |
self basicNew testAdd1
|
|
287 |
"
|
|
288 |
! !
|
|
289 |
|
|
290 |
!JITTest methodsFor:'public - test - blocks'!
|
|
291 |
|
|
292 |
testFindFirst
|
110
|
293 |
self assert:(self findFirst1:1) == 1.
|
|
294 |
self assert:(self findFirst1:2) == 2.
|
|
295 |
self assert:(self findFirst1:3) == 3.
|
|
296 |
self assert:(self findFirst1:4) == 4.
|
|
297 |
self assert:(self findFirst1:0) == 0.
|
|
298 |
self assert:(self findFirst1:10) == 0.
|
|
299 |
self assert:(self findFirst1:4.0) == 0.
|
|
300 |
|
|
301 |
self assert:(self findFirst2:1) == 1.
|
|
302 |
self assert:(self findFirst2:2) == 2.
|
|
303 |
self assert:(self findFirst2:3) == 3.
|
|
304 |
self assert:(self findFirst2:4) == 4.
|
|
305 |
self assert:(self findFirst2:0) == 0.
|
|
306 |
self assert:(self findFirst2:10) == 0.
|
|
307 |
self assert:(self findFirst2:4.0) == 4.
|
109
|
308 |
|
111
|
309 |
|
|
310 |
self assert:(self findFirst3:1) == 1.
|
|
311 |
self assert:(self findFirst3:2) == 2.
|
|
312 |
self assert:(self findFirst3:3) == 3.
|
|
313 |
self assert:(self findFirst3:4) == 4.
|
|
314 |
self assert:(self findFirst3:0) == 0.
|
|
315 |
self assert:(self findFirst3:10) == 0.
|
|
316 |
self assert:(self findFirst3:4.0) == 0.
|
|
317 |
|
109
|
318 |
"
|
|
319 |
self basicNew testFindFirst
|
|
320 |
"
|
|
321 |
! !
|
|
322 |
|
|
323 |
!JITTest methodsFor:'public - test - ifs'!
|
|
324 |
|
684
|
325 |
testAnd1
|
|
326 |
i1 := nil. i2 := nil.
|
|
327 |
self assert:(self tstNilAndNil2) == 1.
|
|
328 |
|
|
329 |
i1 := nil. i2 := 0.
|
|
330 |
self assert:(self tstNilAndNil2) == 0.
|
|
331 |
|
|
332 |
i1 := 0. i2 := nil.
|
|
333 |
self assert:(self tstNilAndNil2) == 0.
|
|
334 |
|
|
335 |
i1 := 0. i2 := 0.
|
|
336 |
self assert:(self tstNilAndNil2) == 0.
|
|
337 |
|
|
338 |
i1 := nil. i2 := nil.
|
|
339 |
self assert:(self tstNotNilAndNotNil2) == 0.
|
|
340 |
|
|
341 |
i1 := nil. i2 := 0.
|
|
342 |
self assert:(self tstNotNilAndNotNil2) == 0.
|
|
343 |
|
|
344 |
i1 := 0. i2 := nil.
|
|
345 |
self assert:(self tstNotNilAndNotNil2) == 0.
|
|
346 |
|
|
347 |
i1 := 0. i2 := 0.
|
|
348 |
self assert:(self tstNotNilAndNotNil2) == 1.
|
|
349 |
|
|
350 |
|
|
351 |
i1 := nil. i2 := nil.
|
|
352 |
self assert:(self tstNilAndNil3) == 1.
|
|
353 |
|
|
354 |
i1 := nil. i2 := 0.
|
|
355 |
self assert:(self tstNilAndNil3) == 0.
|
|
356 |
|
|
357 |
i1 := 0. i2 := nil.
|
|
358 |
self assert:(self tstNilAndNil3) == 0.
|
|
359 |
|
|
360 |
i1 := 0. i2 := 0.
|
|
361 |
self assert:(self tstNilAndNil3) == 0.
|
|
362 |
|
|
363 |
i1 := nil. i2 := nil.
|
|
364 |
self assert:(self tstNotNilAndNotNil3) == 0.
|
|
365 |
|
|
366 |
i1 := nil. i2 := 0.
|
|
367 |
self assert:(self tstNotNilAndNotNil3) == 0.
|
|
368 |
|
|
369 |
i1 := 0. i2 := nil.
|
|
370 |
self assert:(self tstNotNilAndNotNil3) == 0.
|
|
371 |
|
|
372 |
i1 := 0. i2 := 0.
|
|
373 |
self assert:(self tstNotNilAndNotNil3) == 1.
|
|
374 |
|
|
375 |
"
|
|
376 |
self basicNew testAnd1
|
|
377 |
"
|
|
378 |
!
|
|
379 |
|
109
|
380 |
testOr1
|
|
381 |
self assert:(self tstOr1:#Foo) == true.
|
|
382 |
self assert:(self tstOr1:#Bar) == true.
|
|
383 |
self assert:(self tstOr1:#Baz) == false.
|
|
384 |
|
|
385 |
self assert:(self tstOr1:#foo) == false.
|
|
386 |
self assert:(self tstOr1:#bar) == false.
|
|
387 |
self assert:(self tstOr1:#baz) == false.
|
|
388 |
|
|
389 |
self assert:(self tstOr2:#Foo) == true.
|
|
390 |
self assert:(self tstOr2:#Bar) == true.
|
|
391 |
self assert:(self tstOr2:#Baz) == true.
|
|
392 |
|
|
393 |
self assert:(self tstOr2:#foo) == false.
|
|
394 |
self assert:(self tstOr2:#bar) == false.
|
|
395 |
self assert:(self tstOr2:#baz) == false.
|
|
396 |
|
684
|
397 |
i1 := nil. i2 := nil.
|
|
398 |
self assert:(self tstNilOrNil2) == 1.
|
|
399 |
|
|
400 |
i1 := nil. i2 := 0.
|
|
401 |
self assert:(self tstNilOrNil2) == 1.
|
|
402 |
|
|
403 |
i1 := 0. i2 := nil.
|
|
404 |
self assert:(self tstNilOrNil2) == 1.
|
|
405 |
|
|
406 |
i1 := 0. i2 := 0.
|
|
407 |
self assert:(self tstNilOrNil2) == 0.
|
|
408 |
|
|
409 |
i1 := nil. i2 := nil.
|
|
410 |
self assert:(self tstNotNilOrNotNil2) == 0.
|
|
411 |
|
|
412 |
i1 := nil. i2 := 0.
|
|
413 |
self assert:(self tstNotNilOrNotNil2) == 1.
|
|
414 |
|
|
415 |
i1 := 0. i2 := nil.
|
|
416 |
self assert:(self tstNotNilOrNotNil2) == 1.
|
|
417 |
|
|
418 |
i1 := 0. i2 := 0.
|
|
419 |
self assert:(self tstNotNilOrNotNil2) == 1.
|
|
420 |
|
|
421 |
|
|
422 |
i1 := nil. i2 := nil.
|
|
423 |
self assert:(self tstNilOrNil3) == 1.
|
|
424 |
|
|
425 |
i1 := nil. i2 := 0.
|
|
426 |
self assert:(self tstNilOrNil3) == 1.
|
|
427 |
|
|
428 |
i1 := 0. i2 := nil.
|
|
429 |
self assert:(self tstNilOrNil3) == 1.
|
|
430 |
|
|
431 |
i1 := 0. i2 := 0.
|
|
432 |
self assert:(self tstNilOrNil3) == 0.
|
|
433 |
|
|
434 |
i1 := nil. i2 := nil.
|
|
435 |
self assert:(self tstNotNilOrNotNil3) == 0.
|
|
436 |
|
|
437 |
i1 := nil. i2 := 0.
|
|
438 |
self assert:(self tstNotNilOrNotNil3) == 1.
|
|
439 |
|
|
440 |
i1 := 0. i2 := nil.
|
|
441 |
self assert:(self tstNotNilOrNotNil3) == 1.
|
|
442 |
|
|
443 |
i1 := 0. i2 := 0.
|
|
444 |
self assert:(self tstNotNilOrNotNil3) == 1.
|
|
445 |
|
109
|
446 |
"
|
|
447 |
self basicNew testOr1
|
|
448 |
"
|
|
449 |
! !
|
|
450 |
|
117
|
451 |
!JITTest methodsFor:'public - test - misc'!
|
|
452 |
|
|
453 |
testAndGreater1
|
|
454 |
|
|
455 |
|needUpdate mTime|
|
|
456 |
|
|
457 |
i3 := '.' asFilename.
|
|
458 |
|
|
459 |
i2 := i3 modificationTime.
|
|
460 |
mTime := i3 modificationTime.
|
|
461 |
|
|
462 |
needUpdate := mTime notNil and:[mTime > i2].
|
|
463 |
|
|
464 |
"
|
|
465 |
self new testAndGreater1
|
|
466 |
"
|
|
467 |
|
|
468 |
"Created: / 16.11.2001 / 00:07:52 / cg"
|
|
469 |
"Modified: / 16.11.2001 / 00:09:23 / cg"
|
|
470 |
!
|
|
471 |
|
|
472 |
testAndGreater2
|
|
473 |
|
|
474 |
| needUpdate mTime|
|
|
475 |
|
|
476 |
i3 := '.' asFilename.
|
|
477 |
|
|
478 |
self withWaitCursorDo:[
|
|
479 |
i2 := i3 modificationTime.
|
|
480 |
mTime := i3 modificationTime.
|
|
481 |
"/ here, i2 refers to thisContext if the JITTER bug is in ...
|
|
482 |
"/ at least on win32
|
|
483 |
needUpdate := mTime notNil and:[mTime > i2].
|
|
484 |
]
|
|
485 |
|
|
486 |
"
|
|
487 |
self new testAndGreater2
|
|
488 |
"
|
|
489 |
|
|
490 |
"Created: / 16.11.2001 / 00:08:49 / cg"
|
|
491 |
"Modified: / 16.11.2001 / 00:09:29 / cg"
|
|
492 |
! !
|
|
493 |
|
108
|
494 |
!JITTest methodsFor:'test - arithmetic'!
|
|
495 |
|
|
496 |
add1:arg
|
|
497 |
^ 1 + arg
|
|
498 |
|
|
499 |
"
|
|
500 |
JITTest new add1:-1000
|
|
501 |
JITTest new add1:-1
|
|
502 |
JITTest new add1:0
|
|
503 |
JITTest new add1:1
|
|
504 |
JITTest new add1:1000
|
|
505 |
JITTest new add1:SmallInteger maxVal
|
|
506 |
|
|
507 |
JITTest new add1:-1.0
|
|
508 |
JITTest new add1:0.0
|
|
509 |
JITTest new add1:1.0
|
|
510 |
"
|
|
511 |
|
|
512 |
"Modified: / 3.6.1998 / 16:15:36 / cg"
|
|
513 |
!
|
|
514 |
|
|
515 |
add2:arg
|
|
516 |
^ 1.0 + arg
|
|
517 |
|
|
518 |
"
|
|
519 |
JITTest new add2:-1000
|
|
520 |
JITTest new add2:-1
|
|
521 |
JITTest new add2:0
|
|
522 |
JITTest new add2:1
|
|
523 |
JITTest new add2:1000
|
|
524 |
|
|
525 |
JITTest new add2:-1.0
|
|
526 |
JITTest new add2:0.0
|
|
527 |
JITTest new add2:1.0
|
|
528 |
"
|
|
529 |
!
|
|
530 |
|
|
531 |
add3:arg
|
|
532 |
^ arg + 1
|
|
533 |
|
|
534 |
"
|
|
535 |
JITTest new add3:-1000
|
|
536 |
JITTest new add3:-1
|
|
537 |
JITTest new add3:0
|
|
538 |
JITTest new add3:1
|
|
539 |
JITTest new add3:1000
|
|
540 |
|
|
541 |
JITTest new add3:-1.0
|
|
542 |
JITTest new add3:0.0
|
|
543 |
JITTest new add3:1.0
|
|
544 |
"
|
|
545 |
!
|
|
546 |
|
|
547 |
add4:arg
|
|
548 |
^ arg + 1.0
|
|
549 |
|
|
550 |
"
|
|
551 |
JITTest new add4:-1000
|
|
552 |
JITTest new add4:-1
|
|
553 |
JITTest new add4:0
|
|
554 |
JITTest new add4:1
|
|
555 |
JITTest new add4:1000
|
|
556 |
|
|
557 |
JITTest new add4:-1.0
|
|
558 |
JITTest new add4:0.0
|
|
559 |
JITTest new add4:1.0
|
|
560 |
"
|
|
561 |
!
|
|
562 |
|
|
563 |
add5:arg
|
|
564 |
^ arg + arg
|
|
565 |
|
|
566 |
"
|
|
567 |
JITTest new add5:-1000
|
|
568 |
JITTest new add5:-1
|
|
569 |
JITTest new add5:0
|
|
570 |
JITTest new add5:1
|
|
571 |
JITTest new add5:1000
|
|
572 |
|
|
573 |
JITTest new add5:-1.0
|
|
574 |
JITTest new add5:0.0
|
|
575 |
JITTest new add5:1.0
|
|
576 |
JITTest new add5:SmallInteger maxVal
|
|
577 |
JITTest new add5:SmallInteger minVal
|
|
578 |
JITTest new add5:nil
|
|
579 |
"
|
|
580 |
!
|
|
581 |
|
|
582 |
mul1:arg
|
|
583 |
^ arg * 2
|
|
584 |
|
|
585 |
"
|
|
586 |
JITTest new mul1:0
|
|
587 |
JITTest new mul1:-1
|
|
588 |
JITTest new mul1:1
|
|
589 |
JITTest new mul1:1000
|
|
590 |
JITTest new mul1:-1000
|
|
591 |
JITTest new mul1:(SmallInteger maxVal // 2 - 1)
|
|
592 |
JITTest new mul1:(SmallInteger maxVal // 2)
|
|
593 |
JITTest new mul1:(SmallInteger maxVal // 2 + 1)
|
|
594 |
JITTest new mul1:(SmallInteger maxVal // 2 + 2)
|
|
595 |
JITTest new mul1:(SmallInteger maxVal + 1)
|
|
596 |
JITTest new mul1:(SmallInteger maxVal)
|
|
597 |
JITTest new mul1:(SmallInteger minVal // 2 - 1)
|
|
598 |
JITTest new mul1:(SmallInteger minVal // 2)
|
|
599 |
JITTest new mul1:(SmallInteger minVal // 2 + 1)
|
|
600 |
JITTest new mul1:(SmallInteger minVal // 2 + 2)
|
|
601 |
JITTest new mul1:(SmallInteger minVal - 1)
|
|
602 |
JITTest new mul1:(SmallInteger minVal)
|
|
603 |
|
|
604 |
JITTest new mul1:-1.0
|
|
605 |
JITTest new mul1:0.0
|
|
606 |
JITTest new mul1:1.0
|
|
607 |
"
|
|
608 |
|
|
609 |
"Modified: / 3.6.1998 / 16:15:36 / cg"
|
|
610 |
!
|
|
611 |
|
|
612 |
mul2:arg
|
|
613 |
^ arg * 4
|
|
614 |
|
|
615 |
"
|
|
616 |
JITTest new mul2:0
|
|
617 |
JITTest new mul2:-1
|
|
618 |
JITTest new mul2:1
|
|
619 |
JITTest new mul2:1000
|
|
620 |
JITTest new mul2:-1000
|
|
621 |
JITTest new mul2:(SmallInteger maxVal // 2 - 1)
|
|
622 |
JITTest new mul2:(SmallInteger maxVal // 2)
|
|
623 |
JITTest new mul2:(SmallInteger maxVal // 2 + 1)
|
|
624 |
JITTest new mul2:(SmallInteger maxVal // 2 + 2)
|
|
625 |
JITTest new mul2:(SmallInteger maxVal + 1)
|
|
626 |
JITTest new mul2:(SmallInteger maxVal)
|
|
627 |
JITTest new mul2:(SmallInteger minVal // 2 - 1)
|
|
628 |
JITTest new mul2:(SmallInteger minVal // 2)
|
|
629 |
JITTest new mul2:(SmallInteger minVal // 2 + 1)
|
|
630 |
JITTest new mul2:(SmallInteger minVal // 2 + 2)
|
|
631 |
JITTest new mul2:(SmallInteger minVal - 1)
|
|
632 |
JITTest new mul2:(SmallInteger minVal)
|
|
633 |
|
|
634 |
JITTest new mul2:-1.0
|
|
635 |
JITTest new mul2:0.0
|
|
636 |
JITTest new mul2:1.0
|
|
637 |
"
|
|
638 |
|
|
639 |
"Modified: / 3.6.1998 / 16:15:36 / cg"
|
|
640 |
!
|
|
641 |
|
|
642 |
subtract1:arg
|
|
643 |
^ 1 - arg
|
|
644 |
|
|
645 |
"
|
|
646 |
JITTest new subtract1:-1000
|
|
647 |
JITTest new subtract1:-1
|
|
648 |
JITTest new subtract1:0
|
|
649 |
JITTest new subtract1:1
|
|
650 |
JITTest new subtract1:1000
|
|
651 |
|
|
652 |
JITTest new subtract1:-1.0
|
|
653 |
JITTest new subtract1:0.0
|
|
654 |
JITTest new subtract1:1.0
|
|
655 |
JITTest new subtract1:SmallInteger maxVal negated
|
|
656 |
JITTest new subtract1:nil
|
|
657 |
"
|
|
658 |
!
|
|
659 |
|
|
660 |
subtract2:arg
|
|
661 |
^ 1.0 - arg
|
|
662 |
|
|
663 |
"
|
|
664 |
JITTest new subtract2:-1000
|
|
665 |
JITTest new subtract2:-1
|
|
666 |
JITTest new subtract2:0
|
|
667 |
JITTest new subtract2:1
|
|
668 |
JITTest new subtract2:1000
|
|
669 |
|
|
670 |
JITTest new subtract2:-1.0
|
|
671 |
JITTest new subtract2:0.0
|
|
672 |
JITTest new subtract2:1.0
|
|
673 |
"
|
|
674 |
! !
|
|
675 |
|
|
676 |
!JITTest methodsFor:'test - bits'!
|
|
677 |
|
|
678 |
and1:arg
|
|
679 |
^ arg bitAnd:1
|
|
680 |
|
|
681 |
"
|
|
682 |
JITTest new and1:1
|
|
683 |
JITTest new and1:0
|
|
684 |
"
|
|
685 |
|
|
686 |
"Modified: / 3.6.1998 / 16:15:36 / cg"
|
|
687 |
!
|
|
688 |
|
|
689 |
or1:arg
|
|
690 |
^ arg bitOr:1
|
|
691 |
|
|
692 |
"
|
|
693 |
JITTest new or1:1
|
|
694 |
JITTest new or1:2
|
|
695 |
"
|
|
696 |
|
|
697 |
"Modified: / 3.6.1998 / 16:15:36 / cg"
|
|
698 |
!
|
|
699 |
|
|
700 |
xor1:arg
|
|
701 |
^ arg bitXor:1
|
|
702 |
|
|
703 |
"
|
|
704 |
JITTest new xor1:1
|
|
705 |
JITTest new xor1:2
|
|
706 |
"
|
|
707 |
|
|
708 |
"Modified: / 3.6.1998 / 16:15:36 / cg"
|
|
709 |
! !
|
|
710 |
|
|
711 |
!JITTest methodsFor:'test - blocks'!
|
|
712 |
|
|
713 |
block1
|
|
714 |
^ [:a | a == 0]
|
|
715 |
|
|
716 |
"
|
|
717 |
JITTest new block1
|
|
718 |
JITTest new block1 value
|
|
719 |
JITTest new block1 value:1
|
|
720 |
JITTest new block1 value:0
|
|
721 |
"
|
|
722 |
!
|
|
723 |
|
|
724 |
block10
|
|
725 |
|l|
|
|
726 |
|
|
727 |
l := 1.
|
|
728 |
^ [ [l] ]
|
|
729 |
|
|
730 |
"
|
|
731 |
JITTest new block10
|
|
732 |
"
|
|
733 |
!
|
|
734 |
|
|
735 |
block11
|
|
736 |
|l|
|
|
737 |
|
|
738 |
l := [1].
|
|
739 |
^ [ l value ]
|
|
740 |
|
|
741 |
"
|
|
742 |
JITTest new block11
|
|
743 |
"
|
|
744 |
!
|
|
745 |
|
|
746 |
block12
|
|
747 |
|b|
|
|
748 |
|
|
749 |
b := [:a | ^ a].
|
|
750 |
b value:1.
|
|
751 |
|
|
752 |
"
|
|
753 |
JITTest new block12
|
|
754 |
"
|
|
755 |
!
|
|
756 |
|
|
757 |
block2
|
|
758 |
^ [:a | 'hello']
|
|
759 |
|
|
760 |
"
|
|
761 |
JITTest new block2
|
|
762 |
JITTest new block2 value:nil
|
|
763 |
"
|
|
764 |
!
|
|
765 |
|
|
766 |
block2Arg
|
|
767 |
|b|
|
|
768 |
|
|
769 |
b := [:a :b | a].
|
|
770 |
(b value:1 value:2) printCR.
|
|
771 |
|
|
772 |
"
|
|
773 |
JITTest new block2Arg
|
|
774 |
"
|
|
775 |
!
|
|
776 |
|
|
777 |
block2ArgB
|
|
778 |
|b|
|
|
779 |
|
|
780 |
b := [:a :b | b].
|
|
781 |
(b value:1 value:2) printCR.
|
|
782 |
|
|
783 |
"
|
|
784 |
JITTest new block2ArgB
|
|
785 |
"
|
|
786 |
!
|
|
787 |
|
|
788 |
block2ArgC
|
|
789 |
|printA scale|
|
|
790 |
|
|
791 |
scale := 1.
|
|
792 |
|
|
793 |
printA :=
|
|
794 |
[:iter1 :time1 |
|
|
795 |
'block-arg1: ' print. iter1 printCR.
|
|
796 |
'block-arg2: ' print. time1 printCR.
|
|
797 |
Transcript cr.
|
|
798 |
Transcript nextPutAll: (iter1 / scale) rounded printString.
|
|
799 |
Transcript nextPutAll: ' '.
|
|
800 |
Transcript nextPutAll: time1 printString.
|
|
801 |
Transcript nextPutAll: ' '].
|
|
802 |
|
|
803 |
printA value:1 value:2.
|
|
804 |
|
|
805 |
"
|
|
806 |
JITTest new block2ArgC
|
|
807 |
"
|
|
808 |
!
|
|
809 |
|
|
810 |
block2bArg
|
|
811 |
|b|
|
|
812 |
|
|
813 |
b := [:a :b | a printCR].
|
|
814 |
b value:1 value:2.
|
|
815 |
|
|
816 |
"
|
|
817 |
JITTest new block2bArg
|
|
818 |
"
|
|
819 |
!
|
|
820 |
|
|
821 |
block2bArgB
|
|
822 |
|b|
|
|
823 |
|
|
824 |
b := [:a :b | b printCR].
|
|
825 |
b value:1 value:2.
|
|
826 |
|
|
827 |
"
|
|
828 |
JITTest new block2bArgB
|
|
829 |
"
|
|
830 |
!
|
|
831 |
|
|
832 |
block3
|
|
833 |
^ [:a | a]
|
|
834 |
|
|
835 |
"
|
|
836 |
JITTest new block3
|
|
837 |
"
|
|
838 |
!
|
|
839 |
|
|
840 |
block4
|
|
841 |
|a|
|
|
842 |
|
|
843 |
a := 5.
|
|
844 |
^ [a]
|
|
845 |
|
|
846 |
"
|
|
847 |
JITTest new block4
|
|
848 |
JITTest new block4 value
|
|
849 |
"
|
|
850 |
!
|
|
851 |
|
|
852 |
block5
|
|
853 |
^ [self foo]
|
|
854 |
|
|
855 |
"
|
|
856 |
JITTest new block5
|
|
857 |
"
|
|
858 |
!
|
|
859 |
|
|
860 |
block6
|
|
861 |
^ [^ self]
|
|
862 |
|
|
863 |
"
|
|
864 |
JITTest new block6
|
|
865 |
"
|
|
866 |
!
|
|
867 |
|
|
868 |
block7
|
|
869 |
^ [^ [^ self]]
|
|
870 |
|
|
871 |
"
|
|
872 |
JITTest new block7
|
|
873 |
"
|
|
874 |
!
|
|
875 |
|
|
876 |
block8
|
|
877 |
^ [ [^ self] ]
|
|
878 |
|
|
879 |
"
|
|
880 |
JITTest new block8
|
|
881 |
"
|
|
882 |
!
|
|
883 |
|
|
884 |
block9
|
|
885 |
|l|
|
|
886 |
|
|
887 |
l := 1.
|
|
888 |
^ [ [^ l] ]
|
|
889 |
|
|
890 |
"
|
|
891 |
JITTest new block9
|
|
892 |
"
|
|
893 |
!
|
|
894 |
|
|
895 |
falseBlock1
|
|
896 |
^ [true]
|
|
897 |
|
|
898 |
"
|
|
899 |
JITTest new falseBlock1
|
|
900 |
"
|
|
901 |
!
|
|
902 |
|
|
903 |
falseBlock2
|
|
904 |
^ [:arg | true]
|
|
905 |
|
|
906 |
"
|
|
907 |
JITTest new falseBlock2
|
|
908 |
"
|
|
909 |
!
|
|
910 |
|
110
|
911 |
findFirst1:arg
|
|
912 |
|idx|
|
|
913 |
|
|
914 |
i1 := #(1 2 3 4) asOrderedCollection.
|
|
915 |
^ i1 findFirst:[:el | el == arg]
|
|
916 |
|
|
917 |
"
|
|
918 |
self new findFirst1:1
|
|
919 |
self new findFirst1:2
|
|
920 |
self new findFirst1:3
|
|
921 |
self new findFirst1:4
|
|
922 |
self new findFirst1:0
|
|
923 |
self new findFirst1:10
|
|
924 |
self new findFirst1:4.0
|
|
925 |
"
|
|
926 |
!
|
|
927 |
|
|
928 |
findFirst2:arg
|
|
929 |
|idx|
|
|
930 |
|
|
931 |
i1 := #(1 2 3 4) asOrderedCollection.
|
|
932 |
^ i1 findFirst:[:el | el = arg]
|
|
933 |
|
|
934 |
"
|
|
935 |
self new findFirst2:1
|
|
936 |
self new findFirst2:2
|
|
937 |
self new findFirst2:3
|
|
938 |
self new findFirst2:4
|
|
939 |
self new findFirst2:0
|
|
940 |
self new findFirst2:10
|
|
941 |
self new findFirst2:4.0
|
|
942 |
"
|
|
943 |
!
|
|
944 |
|
111
|
945 |
findFirst3:arg
|
|
946 |
i1 := #(1 2 3 4) asOrderedCollection.
|
|
947 |
^ self findFirst3b:arg
|
|
948 |
|
|
949 |
"
|
|
950 |
self new findFirst3:1
|
|
951 |
self new findFirst3:2
|
|
952 |
self new findFirst3:3
|
|
953 |
self new findFirst3:4
|
|
954 |
self new findFirst3:0
|
|
955 |
self new findFirst3:10
|
|
956 |
self new findFirst3:4.0
|
|
957 |
"
|
|
958 |
!
|
|
959 |
|
|
960 |
findFirst3b:arg
|
|
961 |
^ i1 findFirst:[:el | el == arg]
|
|
962 |
|
|
963 |
"
|
|
964 |
self new findFirst3:1
|
|
965 |
self new findFirst3:2
|
|
966 |
self new findFirst3:3
|
|
967 |
self new findFirst3:4
|
|
968 |
self new findFirst3:0
|
|
969 |
self new findFirst3:10
|
|
970 |
self new findFirst3:4.0
|
|
971 |
"
|
|
972 |
!
|
|
973 |
|
108
|
974 |
nilBlock1
|
|
975 |
^ []
|
|
976 |
|
|
977 |
"
|
|
978 |
JITTest new nilBlock1
|
|
979 |
"
|
|
980 |
!
|
|
981 |
|
|
982 |
nilBlock2:arg
|
|
983 |
^ arg indexOf:4 ifAbsent:[]
|
|
984 |
|
|
985 |
|
|
986 |
"
|
|
987 |
JITTest new nilBlock2:#(1 2 3)
|
|
988 |
JITTest new nilBlock2:#(1 2 3 4)
|
|
989 |
JITTest new nilBlock2:#(1 2 3 4 5)
|
|
990 |
"
|
|
991 |
!
|
|
992 |
|
|
993 |
trueBlock1
|
|
994 |
^ [true]
|
|
995 |
|
|
996 |
"
|
|
997 |
JITTest new trueBlock1
|
|
998 |
"
|
|
999 |
!
|
|
1000 |
|
|
1001 |
zeroBlock1
|
|
1002 |
^ [0]
|
|
1003 |
|
|
1004 |
"
|
|
1005 |
JITTest new zeroBlock1
|
|
1006 |
"
|
|
1007 |
!
|
|
1008 |
|
|
1009 |
zeroBlock2:arg
|
|
1010 |
^ arg indexOf:4 ifAbsent:[0]
|
|
1011 |
|
|
1012 |
|
|
1013 |
"
|
|
1014 |
JITTest new zeroBlock2:#(1 2 3)
|
|
1015 |
JITTest new zeroBlock2:#(1 2 3 4)
|
|
1016 |
JITTest new zeroBlock2:#(1 2 3 4 5)
|
|
1017 |
"
|
|
1018 |
! !
|
|
1019 |
|
|
1020 |
!JITTest methodsFor:'test - compare'!
|
|
1021 |
|
|
1022 |
compare10:arg
|
|
1023 |
arg = 10 ifTrue:[
|
|
1024 |
^ 11
|
|
1025 |
].
|
|
1026 |
^ nil
|
|
1027 |
|
|
1028 |
"
|
|
1029 |
JITTest new compare10:nil
|
|
1030 |
JITTest new compare10:9
|
|
1031 |
JITTest new compare10:10
|
|
1032 |
JITTest new compare10:11
|
|
1033 |
JITTest new compare10:9.0
|
|
1034 |
JITTest new compare10:10.0
|
|
1035 |
JITTest new compare10:11.0
|
|
1036 |
JITTest new compare10:false
|
|
1037 |
"
|
|
1038 |
!
|
|
1039 |
|
|
1040 |
compare11:arg
|
|
1041 |
^ arg = 1
|
|
1042 |
|
|
1043 |
"
|
|
1044 |
JITTest new compare11:-1000
|
|
1045 |
JITTest new compare11:-1
|
|
1046 |
JITTest new compare11:0
|
|
1047 |
JITTest new compare11:1
|
|
1048 |
JITTest new compare11:2
|
|
1049 |
JITTest new compare11:1000
|
|
1050 |
|
|
1051 |
JITTest new compare11:-1.0
|
|
1052 |
JITTest new compare11:0.0
|
|
1053 |
JITTest new compare11:1.0
|
|
1054 |
JITTest new compare11:2.0
|
|
1055 |
JITTest new compare11:3.0
|
|
1056 |
"
|
|
1057 |
!
|
|
1058 |
|
|
1059 |
compare12:arg
|
|
1060 |
^ arg == 1
|
|
1061 |
|
|
1062 |
"
|
|
1063 |
JITTest new compare12:-1000
|
|
1064 |
JITTest new compare12:-1
|
|
1065 |
JITTest new compare12:0
|
|
1066 |
JITTest new compare12:1
|
|
1067 |
JITTest new compare12:2
|
|
1068 |
JITTest new compare12:1000
|
|
1069 |
|
|
1070 |
JITTest new compare12:-1.0
|
|
1071 |
JITTest new compare12:0.0
|
|
1072 |
JITTest new compare12:1.0
|
|
1073 |
JITTest new compare12:2.0
|
|
1074 |
JITTest new compare12:3.0
|
|
1075 |
"
|
|
1076 |
!
|
|
1077 |
|
|
1078 |
compare1:arg
|
|
1079 |
^ arg > 0
|
|
1080 |
|
|
1081 |
"
|
|
1082 |
JITTest new compare1:-1000
|
|
1083 |
JITTest new compare1:-1
|
|
1084 |
JITTest new compare1:0
|
|
1085 |
JITTest new compare1:1
|
|
1086 |
JITTest new compare1:1000
|
|
1087 |
|
|
1088 |
JITTest new compare1:-1.0
|
|
1089 |
JITTest new compare1:0.0
|
|
1090 |
JITTest new compare1:1.0
|
|
1091 |
"
|
|
1092 |
!
|
|
1093 |
|
|
1094 |
compare2:arg
|
|
1095 |
^ arg < 0
|
|
1096 |
|
|
1097 |
"
|
|
1098 |
JITTest new compare2:-1000
|
|
1099 |
JITTest new compare2:-1
|
|
1100 |
JITTest new compare2:0
|
|
1101 |
JITTest new compare2:1
|
|
1102 |
JITTest new compare2:1000
|
|
1103 |
|
|
1104 |
JITTest new compare2:-1.0
|
|
1105 |
JITTest new compare2:0.0
|
|
1106 |
JITTest new compare2:1.0
|
|
1107 |
"
|
|
1108 |
!
|
|
1109 |
|
|
1110 |
compare3:arg
|
|
1111 |
^ arg <= 0
|
|
1112 |
|
|
1113 |
"
|
|
1114 |
JITTest new compare3:-1000
|
|
1115 |
JITTest new compare3:-1
|
|
1116 |
JITTest new compare3:0
|
|
1117 |
JITTest new compare3:1
|
|
1118 |
JITTest new compare3:1000
|
|
1119 |
|
|
1120 |
JITTest new compare3:-1.0
|
|
1121 |
JITTest new compare3:0.0
|
|
1122 |
JITTest new compare3:1.0
|
|
1123 |
"
|
|
1124 |
!
|
|
1125 |
|
|
1126 |
compare4:arg
|
|
1127 |
^ arg >= 0
|
|
1128 |
|
|
1129 |
"
|
|
1130 |
JITTest new compare4:-1000
|
|
1131 |
JITTest new compare4:-1
|
|
1132 |
JITTest new compare4:0
|
|
1133 |
JITTest new compare4:1
|
|
1134 |
JITTest new compare4:1000
|
|
1135 |
|
|
1136 |
JITTest new compare4:-1.0
|
|
1137 |
JITTest new compare4:0.0
|
|
1138 |
JITTest new compare4:1.0
|
|
1139 |
"
|
|
1140 |
!
|
|
1141 |
|
|
1142 |
compare5:arg
|
|
1143 |
^ arg > 1
|
|
1144 |
|
|
1145 |
"
|
|
1146 |
JITTest new compare5:-1000
|
|
1147 |
JITTest new compare5:-1
|
|
1148 |
JITTest new compare5:0
|
|
1149 |
JITTest new compare5:1
|
|
1150 |
JITTest new compare5:2
|
|
1151 |
JITTest new compare5:1000
|
|
1152 |
|
|
1153 |
JITTest new compare5:-1.0
|
|
1154 |
JITTest new compare5:0.0
|
|
1155 |
JITTest new compare5:1.0
|
|
1156 |
JITTest new compare5:2.0
|
|
1157 |
JITTest new compare5:3.0
|
|
1158 |
"
|
|
1159 |
!
|
|
1160 |
|
|
1161 |
compare6:arg
|
|
1162 |
^ arg <= 1
|
|
1163 |
|
|
1164 |
"
|
|
1165 |
JITTest new compare6:-1000
|
|
1166 |
JITTest new compare6:-1
|
|
1167 |
JITTest new compare6:0
|
|
1168 |
JITTest new compare6:1
|
|
1169 |
JITTest new compare6:2
|
|
1170 |
JITTest new compare6:1000
|
|
1171 |
|
|
1172 |
JITTest new compare6:-1.0
|
|
1173 |
JITTest new compare6:0.0
|
|
1174 |
JITTest new compare6:1.0
|
|
1175 |
JITTest new compare6:2.0
|
|
1176 |
JITTest new compare6:3.0
|
|
1177 |
"
|
|
1178 |
!
|
|
1179 |
|
|
1180 |
compare7:arg
|
|
1181 |
^ arg < 1
|
|
1182 |
|
|
1183 |
"
|
|
1184 |
JITTest new compare7:-1000
|
|
1185 |
JITTest new compare7:-1
|
|
1186 |
JITTest new compare7:0
|
|
1187 |
JITTest new compare7:1
|
|
1188 |
JITTest new compare7:2
|
|
1189 |
JITTest new compare7:1000
|
|
1190 |
|
|
1191 |
JITTest new compare7:-1.0
|
|
1192 |
JITTest new compare7:0.0
|
|
1193 |
JITTest new compare7:1.0
|
|
1194 |
JITTest new compare7:2.0
|
|
1195 |
JITTest new compare7:3.0
|
|
1196 |
"
|
|
1197 |
!
|
|
1198 |
|
|
1199 |
compare8:arg
|
|
1200 |
^ arg >= 1
|
|
1201 |
|
|
1202 |
"
|
|
1203 |
JITTest new compare8:-1000
|
|
1204 |
JITTest new compare8:-1
|
|
1205 |
JITTest new compare8:0
|
|
1206 |
JITTest new compare8:1
|
|
1207 |
JITTest new compare8:2
|
|
1208 |
JITTest new compare8:1000
|
|
1209 |
|
|
1210 |
JITTest new compare8:-1.0
|
|
1211 |
JITTest new compare8:0.0
|
|
1212 |
JITTest new compare8:1.0
|
|
1213 |
JITTest new compare8:2.0
|
|
1214 |
JITTest new compare8:3.0
|
|
1215 |
"
|
|
1216 |
!
|
|
1217 |
|
|
1218 |
compare9:arg
|
|
1219 |
arg == 10 ifTrue:[
|
|
1220 |
^ 11
|
|
1221 |
].
|
|
1222 |
^ nil
|
|
1223 |
|
|
1224 |
"
|
|
1225 |
JITTest new compare9:nil
|
|
1226 |
JITTest new compare9:9
|
|
1227 |
JITTest new compare9:10
|
|
1228 |
JITTest new compare9:11
|
|
1229 |
JITTest new compare9:false
|
|
1230 |
"
|
|
1231 |
! !
|
|
1232 |
|
|
1233 |
!JITTest methodsFor:'test - globals'!
|
|
1234 |
|
|
1235 |
g1
|
|
1236 |
^ Array
|
|
1237 |
|
|
1238 |
"
|
|
1239 |
JITTest new g1
|
|
1240 |
"
|
|
1241 |
!
|
|
1242 |
|
|
1243 |
g1b
|
|
1244 |
^ Time
|
|
1245 |
|
|
1246 |
"
|
|
1247 |
JITTest new g1b
|
|
1248 |
"
|
|
1249 |
!
|
|
1250 |
|
|
1251 |
g2
|
|
1252 |
^ JITTest
|
|
1253 |
|
|
1254 |
"
|
|
1255 |
JITTest new g2
|
|
1256 |
"
|
|
1257 |
|
|
1258 |
"Modified: / 3.6.1998 / 15:43:14 / cg"
|
|
1259 |
!
|
|
1260 |
|
|
1261 |
g2b
|
|
1262 |
^ NonExistingClass
|
|
1263 |
|
|
1264 |
"
|
|
1265 |
JITTest new g2b
|
|
1266 |
"
|
|
1267 |
|
|
1268 |
!
|
|
1269 |
|
|
1270 |
g3
|
|
1271 |
Foo := 1.
|
|
1272 |
|
|
1273 |
"
|
|
1274 |
Smalltalk at:#Foo put:nil.
|
|
1275 |
JITTest new g3
|
|
1276 |
"
|
|
1277 |
!
|
|
1278 |
|
|
1279 |
g3b
|
|
1280 |
NonExistingGlobal := 2.
|
|
1281 |
|
|
1282 |
"
|
|
1283 |
JITTest new g3b
|
|
1284 |
"
|
|
1285 |
!
|
|
1286 |
|
|
1287 |
send1
|
|
1288 |
^ Time now
|
|
1289 |
|
|
1290 |
"
|
|
1291 |
JITTest new send1
|
|
1292 |
"
|
|
1293 |
!
|
|
1294 |
|
|
1295 |
send2
|
|
1296 |
self halt
|
|
1297 |
|
|
1298 |
"
|
|
1299 |
JITTest new send2
|
|
1300 |
"
|
|
1301 |
!
|
|
1302 |
|
|
1303 |
send3
|
|
1304 |
self send2
|
|
1305 |
|
|
1306 |
"
|
|
1307 |
JITTest new send3
|
|
1308 |
"
|
|
1309 |
!
|
|
1310 |
|
|
1311 |
send4
|
|
1312 |
self send3
|
|
1313 |
|
|
1314 |
"
|
|
1315 |
JITTest new send4
|
|
1316 |
"
|
|
1317 |
!
|
|
1318 |
|
|
1319 |
send5
|
|
1320 |
self send4
|
|
1321 |
|
|
1322 |
"
|
|
1323 |
JITTest new send5
|
|
1324 |
"
|
|
1325 |
! !
|
|
1326 |
|
|
1327 |
!JITTest methodsFor:'test - ifs'!
|
|
1328 |
|
|
1329 |
if1:aTime
|
|
1330 |
|sec min hr hrTick|
|
|
1331 |
|
|
1332 |
aTime isNil ifTrue:[^ self].
|
|
1333 |
hr := aTime hours.
|
|
1334 |
|
|
1335 |
"
|
|
1336 |
JITTest new if1:nil
|
|
1337 |
"
|
|
1338 |
!
|
|
1339 |
|
|
1340 |
tstEQ1
|
|
1341 |
^ i1 == 0
|
|
1342 |
|
|
1343 |
"
|
|
1344 |
JITTest new testEQ1
|
|
1345 |
(JITTest new) instVarAt:1 put:0; testEQ1
|
|
1346 |
"
|
|
1347 |
|
|
1348 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1349 |
!
|
|
1350 |
|
|
1351 |
tstEQ2
|
|
1352 |
^ i1 = 0
|
|
1353 |
|
|
1354 |
"
|
|
1355 |
JITTest new testEQ2
|
|
1356 |
"
|
|
1357 |
|
|
1358 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1359 |
!
|
|
1360 |
|
|
1361 |
tstEQ3
|
|
1362 |
i1 == 0 ifTrue:[^ 0] ifFalse:[
|
|
1363 |
^ 1
|
|
1364 |
|
|
1365 |
"
|
|
1366 |
JITTest new testEQ3
|
|
1367 |
(JITTest new) instVarAt:1 put:0; testEQ3
|
|
1368 |
"
|
|
1369 |
|
|
1370 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1371 |
]
|
|
1372 |
!
|
|
1373 |
|
|
1374 |
tstEQ4
|
|
1375 |
i1 == 0 ifTrue:[^ 0].
|
|
1376 |
^ 1
|
|
1377 |
|
|
1378 |
"
|
|
1379 |
JITTest new testEQ4
|
|
1380 |
(JITTest new) instVarAt:1 put:0; testEQ4
|
|
1381 |
"
|
|
1382 |
!
|
|
1383 |
|
|
1384 |
tstEQ5
|
|
1385 |
i1 = 0 ifTrue:[^ 0].
|
|
1386 |
^ 1
|
|
1387 |
|
|
1388 |
"
|
|
1389 |
JITTest new testEQ5
|
|
1390 |
"
|
|
1391 |
|
|
1392 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1393 |
!
|
|
1394 |
|
|
1395 |
tstNilAndNil
|
|
1396 |
(i1 isNil and:[i2 isNil]) ifTrue:[
|
|
1397 |
Transcript showCR:'both nil'.
|
|
1398 |
^ self
|
|
1399 |
].
|
|
1400 |
Transcript showCR:'any nonNil'
|
|
1401 |
|
|
1402 |
"
|
684
|
1403 |
JITTest new tstNilAndNil
|
108
|
1404 |
|
|
1405 |
|j|
|
|
1406 |
j := JITTest new.
|
|
1407 |
j instVarNamed:'i1' put:1.
|
684
|
1408 |
j tstNilAndNil
|
108
|
1409 |
|
|
1410 |
|j|
|
|
1411 |
j := JITTest new.
|
|
1412 |
j instVarNamed:'i2' put:1.
|
684
|
1413 |
j tstNilAndNil
|
108
|
1414 |
|
|
1415 |
|j|
|
|
1416 |
j := JITTest new.
|
|
1417 |
j instVarNamed:'i1' put:1.
|
|
1418 |
j instVarNamed:'i2' put:1.
|
684
|
1419 |
j tstNilAndNil
|
|
1420 |
"
|
|
1421 |
|
|
1422 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1423 |
!
|
|
1424 |
|
|
1425 |
tstNilAndNil2
|
|
1426 |
(i1 isNil and:[i2 isNil]) ifTrue:[
|
|
1427 |
"/ Transcript showCR:'both nil'.
|
|
1428 |
^ 1
|
|
1429 |
].
|
|
1430 |
"/ Transcript showCR:'any nonNil'
|
|
1431 |
^ 0
|
|
1432 |
|
|
1433 |
"
|
|
1434 |
JITTest new tstNilAndNil2
|
|
1435 |
|
|
1436 |
|j|
|
|
1437 |
j := JITTest new.
|
|
1438 |
j instVarNamed:'i1' put:1.
|
|
1439 |
j tstNilAndNil2
|
|
1440 |
|
|
1441 |
|j|
|
|
1442 |
j := JITTest new.
|
|
1443 |
j instVarNamed:'i2' put:1.
|
|
1444 |
j tstNilAndNil2
|
108
|
1445 |
|
684
|
1446 |
|j|
|
|
1447 |
j := JITTest new.
|
|
1448 |
j instVarNamed:'i1' put:1.
|
|
1449 |
j instVarNamed:'i2' put:1.
|
|
1450 |
j tstNilAndNil2
|
|
1451 |
"
|
|
1452 |
|
|
1453 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1454 |
!
|
|
1455 |
|
|
1456 |
tstNilAndNil3
|
|
1457 |
(i1 isNil and:[i2 isNil]) ifTrue:[
|
|
1458 |
"/ Transcript showCR:'both nil'.
|
|
1459 |
^ 1
|
|
1460 |
] ifFalse:[
|
|
1461 |
"/ Transcript showCR:'any nonNil'
|
|
1462 |
^ 0
|
|
1463 |
].
|
|
1464 |
|
|
1465 |
"
|
|
1466 |
JITTest new tstNilAndNil3
|
|
1467 |
|
|
1468 |
|j|
|
|
1469 |
j := JITTest new.
|
|
1470 |
j instVarNamed:'i1' put:1.
|
|
1471 |
j tstNilAndNil3
|
|
1472 |
|
|
1473 |
|j|
|
|
1474 |
j := JITTest new.
|
|
1475 |
j instVarNamed:'i2' put:1.
|
|
1476 |
j tstNilAndNil3
|
|
1477 |
|
|
1478 |
|j|
|
|
1479 |
j := JITTest new.
|
|
1480 |
j instVarNamed:'i1' put:1.
|
|
1481 |
j instVarNamed:'i2' put:1.
|
|
1482 |
j tstNilAndNil3
|
108
|
1483 |
"
|
|
1484 |
|
|
1485 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1486 |
!
|
|
1487 |
|
|
1488 |
tstNilOrNil
|
|
1489 |
(i1 isNil or:[i2 isNil]) ifTrue:[
|
|
1490 |
Transcript showCR:'any nil'.
|
|
1491 |
^ self
|
|
1492 |
].
|
|
1493 |
Transcript showCR:'both nonNil'
|
|
1494 |
|
|
1495 |
"
|
|
1496 |
JITTest new testNilOrNil
|
|
1497 |
|
|
1498 |
|j|
|
|
1499 |
j := JITTest new.
|
|
1500 |
j instVarNamed:'i1' put:1.
|
|
1501 |
j testNilOrNil
|
|
1502 |
|
|
1503 |
|j|
|
|
1504 |
j := JITTest new.
|
|
1505 |
j instVarNamed:'i2' put:1.
|
|
1506 |
j testNilOrNil
|
|
1507 |
|
|
1508 |
|j|
|
|
1509 |
j := JITTest new.
|
|
1510 |
j instVarNamed:'i1' put:1.
|
|
1511 |
j instVarNamed:'i2' put:1.
|
|
1512 |
j testNilOrNil
|
|
1513 |
|
|
1514 |
"
|
|
1515 |
|
|
1516 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1517 |
!
|
|
1518 |
|
684
|
1519 |
tstNilOrNil2
|
|
1520 |
(i1 isNil or:[i2 isNil]) ifTrue:[
|
|
1521 |
^ 1
|
|
1522 |
].
|
|
1523 |
^ 0
|
|
1524 |
|
|
1525 |
"
|
|
1526 |
JITTest new testNilOrNil
|
|
1527 |
|
|
1528 |
|j|
|
|
1529 |
j := JITTest new.
|
|
1530 |
j instVarNamed:'i1' put:1.
|
|
1531 |
j testNilOrNil
|
|
1532 |
|
|
1533 |
|j|
|
|
1534 |
j := JITTest new.
|
|
1535 |
j instVarNamed:'i2' put:1.
|
|
1536 |
j testNilOrNil
|
|
1537 |
|
|
1538 |
|j|
|
|
1539 |
j := JITTest new.
|
|
1540 |
j instVarNamed:'i1' put:1.
|
|
1541 |
j instVarNamed:'i2' put:1.
|
|
1542 |
j testNilOrNil
|
|
1543 |
|
|
1544 |
"
|
|
1545 |
|
|
1546 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1547 |
!
|
|
1548 |
|
|
1549 |
tstNilOrNil3
|
|
1550 |
(i1 isNil or:[i2 isNil]) ifTrue:[
|
|
1551 |
^ 1
|
|
1552 |
] ifFalse:[
|
|
1553 |
^ 0
|
|
1554 |
].
|
|
1555 |
|
|
1556 |
"
|
|
1557 |
JITTest new testNilOrNil
|
|
1558 |
|
|
1559 |
|j|
|
|
1560 |
j := JITTest new.
|
|
1561 |
j instVarNamed:'i1' put:1.
|
|
1562 |
j testNilOrNil
|
|
1563 |
|
|
1564 |
|j|
|
|
1565 |
j := JITTest new.
|
|
1566 |
j instVarNamed:'i2' put:1.
|
|
1567 |
j testNilOrNil
|
|
1568 |
|
|
1569 |
|j|
|
|
1570 |
j := JITTest new.
|
|
1571 |
j instVarNamed:'i1' put:1.
|
|
1572 |
j instVarNamed:'i2' put:1.
|
|
1573 |
j testNilOrNil
|
|
1574 |
|
|
1575 |
"
|
|
1576 |
|
|
1577 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1578 |
!
|
|
1579 |
|
108
|
1580 |
tstNotNilAndNotNil
|
|
1581 |
(i1 notNil and:[i2 notNil]) ifTrue:[
|
|
1582 |
Transcript showCR:'both notNil'.
|
|
1583 |
^ self
|
|
1584 |
].
|
|
1585 |
Transcript showCR:'any isNil'
|
|
1586 |
|
|
1587 |
"
|
684
|
1588 |
JITTest new tstNotNilAndNotNil
|
108
|
1589 |
|
|
1590 |
|j|
|
|
1591 |
j := JITTest new.
|
|
1592 |
j instVarNamed:'i1' put:1.
|
684
|
1593 |
j tstNotNilAndNotNil
|
108
|
1594 |
|
|
1595 |
|j|
|
|
1596 |
j := JITTest new.
|
|
1597 |
j instVarNamed:'i1' put:1.
|
|
1598 |
j instVarNamed:'i2' put:1.
|
684
|
1599 |
j tstNotNilAndNotNil
|
|
1600 |
"
|
|
1601 |
|
|
1602 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1603 |
!
|
|
1604 |
|
|
1605 |
tstNotNilAndNotNil2
|
|
1606 |
(i1 notNil and:[i2 notNil]) ifTrue:[
|
|
1607 |
"/ Transcript showCR:'both nil'.
|
|
1608 |
^ 1
|
|
1609 |
].
|
|
1610 |
"/ Transcript showCR:'any nonNil'
|
|
1611 |
^ 0
|
|
1612 |
|
|
1613 |
"
|
|
1614 |
JITTest new tstNotNilAndNotNil2
|
|
1615 |
|
|
1616 |
|j|
|
|
1617 |
j := JITTest new.
|
|
1618 |
j instVarNamed:'i1' put:1.
|
|
1619 |
j tstNotNilAndNotNil2
|
|
1620 |
|
|
1621 |
|j|
|
|
1622 |
j := JITTest new.
|
|
1623 |
j instVarNamed:'i2' put:1.
|
|
1624 |
j tstNotNilAndNotNil2
|
108
|
1625 |
|
684
|
1626 |
|j|
|
|
1627 |
j := JITTest new.
|
|
1628 |
j instVarNamed:'i1' put:1.
|
|
1629 |
j instVarNamed:'i2' put:1.
|
|
1630 |
j tstNotNilAndNotNil2
|
|
1631 |
"
|
|
1632 |
|
|
1633 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1634 |
!
|
|
1635 |
|
|
1636 |
tstNotNilAndNotNil3
|
|
1637 |
(i1 notNil and:[i2 notNil]) ifTrue:[
|
|
1638 |
"/ Transcript showCR:'both nil'.
|
|
1639 |
^ 1
|
|
1640 |
] ifFalse:[
|
|
1641 |
"/ Transcript showCR:'any nonNil'
|
|
1642 |
^ 0
|
|
1643 |
].
|
|
1644 |
|
|
1645 |
"
|
|
1646 |
JITTest new tstNotNilAndNotNil2
|
|
1647 |
|
|
1648 |
|j|
|
|
1649 |
j := JITTest new.
|
|
1650 |
j instVarNamed:'i1' put:1.
|
|
1651 |
j tstNotNilAndNotNil2
|
|
1652 |
|
|
1653 |
|j|
|
|
1654 |
j := JITTest new.
|
|
1655 |
j instVarNamed:'i2' put:1.
|
|
1656 |
j tstNotNilAndNotNil2
|
|
1657 |
|
|
1658 |
|j|
|
|
1659 |
j := JITTest new.
|
|
1660 |
j instVarNamed:'i1' put:1.
|
|
1661 |
j instVarNamed:'i2' put:1.
|
|
1662 |
j tstNotNilAndNotNil2
|
108
|
1663 |
"
|
|
1664 |
|
|
1665 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1666 |
!
|
|
1667 |
|
|
1668 |
tstNotNilOrNotNil
|
|
1669 |
(i1 notNil or:[i2 notNil]) ifTrue:[
|
|
1670 |
Transcript showCR:'any notNil'.
|
|
1671 |
^ self
|
|
1672 |
].
|
|
1673 |
Transcript showCR:'both nil'.
|
|
1674 |
^ 0
|
|
1675 |
|
|
1676 |
"
|
684
|
1677 |
JITTest new tstNotNilOrNotNil
|
108
|
1678 |
|
|
1679 |
|j|
|
|
1680 |
j := JITTest new.
|
|
1681 |
j instVarNamed:'i1' put:1.
|
684
|
1682 |
j tstNotNilOrNotNil
|
108
|
1683 |
|
|
1684 |
|j|
|
|
1685 |
j := JITTest new.
|
|
1686 |
j instVarNamed:'i1' put:1.
|
|
1687 |
j instVarNamed:'i2' put:1.
|
684
|
1688 |
j tstNotNilOrNotNil
|
|
1689 |
"
|
|
1690 |
|
|
1691 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1692 |
!
|
|
1693 |
|
|
1694 |
tstNotNilOrNotNil2
|
|
1695 |
(i1 notNil or:[i2 notNil]) ifTrue:[
|
|
1696 |
^ 1
|
|
1697 |
].
|
|
1698 |
^ 0
|
|
1699 |
|
|
1700 |
"
|
|
1701 |
JITTest new tstNotNilOrNotNil2
|
|
1702 |
|
|
1703 |
|j|
|
|
1704 |
j := JITTest new.
|
|
1705 |
j instVarNamed:'i1' put:1.
|
|
1706 |
j tstNotNilOrNotNil2
|
|
1707 |
|
|
1708 |
|j|
|
|
1709 |
j := JITTest new.
|
|
1710 |
j instVarNamed:'i2' put:1.
|
|
1711 |
j tstNotNilOrNotNil2
|
|
1712 |
|
|
1713 |
|j|
|
|
1714 |
j := JITTest new.
|
|
1715 |
j instVarNamed:'i1' put:1.
|
|
1716 |
j instVarNamed:'i2' put:1.
|
|
1717 |
j tstNotNilOrNotNil2
|
|
1718 |
|
|
1719 |
"
|
|
1720 |
|
|
1721 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1722 |
!
|
|
1723 |
|
|
1724 |
tstNotNilOrNotNil3
|
|
1725 |
(i1 notNil or:[i2 notNil]) ifTrue:[
|
|
1726 |
^ 1
|
|
1727 |
] ifFalse:[
|
|
1728 |
^ 0
|
|
1729 |
].
|
|
1730 |
|
|
1731 |
"
|
|
1732 |
JITTest new tstNotNilOrNotNil2
|
|
1733 |
|
|
1734 |
|j|
|
|
1735 |
j := JITTest new.
|
|
1736 |
j instVarNamed:'i1' put:1.
|
|
1737 |
j tstNotNilOrNotNil2
|
|
1738 |
|
|
1739 |
|j|
|
|
1740 |
j := JITTest new.
|
|
1741 |
j instVarNamed:'i2' put:1.
|
|
1742 |
j tstNotNilOrNotNil2
|
|
1743 |
|
|
1744 |
|j|
|
|
1745 |
j := JITTest new.
|
|
1746 |
j instVarNamed:'i1' put:1.
|
|
1747 |
j instVarNamed:'i2' put:1.
|
|
1748 |
j tstNotNilOrNotNil2
|
108
|
1749 |
|
|
1750 |
"
|
|
1751 |
|
|
1752 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1753 |
!
|
|
1754 |
|
|
1755 |
tstOr1:arg
|
|
1756 |
^ arg == #Foo or:[arg == #Bar]
|
|
1757 |
!
|
|
1758 |
|
|
1759 |
tstOr2:arg
|
|
1760 |
^ arg == #Foo or:[arg == #Bar or:[arg == #Baz]]
|
246
|
1761 |
!
|
|
1762 |
|
|
1763 |
tstOr3
|
247
|
1764 |
(i1 isNil or:[i2 isNil]) ifTrue:[^ true].
|
|
1765 |
^ (i4 isNil or:[i5 isNil]).
|
246
|
1766 |
|
|
1767 |
"
|
|
1768 |
self new tstOr3
|
|
1769 |
"
|
247
|
1770 |
!
|
|
1771 |
|
|
1772 |
tstOr4
|
|
1773 |
(i1 isNil or:[i2 isNil or:[i3 isNil]]) ifTrue:[^ true].
|
|
1774 |
^ (i4 isNil or:[i5 isNil or:[i6 isNil]]).
|
|
1775 |
|
|
1776 |
"
|
|
1777 |
self new tstOr4
|
|
1778 |
"
|
108
|
1779 |
! !
|
|
1780 |
|
|
1781 |
!JITTest methodsFor:'test - loops'!
|
|
1782 |
|
|
1783 |
loop1
|
|
1784 |
[true] whileTrue:[
|
|
1785 |
]
|
|
1786 |
|
|
1787 |
"
|
|
1788 |
JITTest new loop1
|
|
1789 |
"
|
|
1790 |
|
|
1791 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1792 |
|
|
1793 |
|
|
1794 |
!
|
|
1795 |
|
|
1796 |
loop1b
|
|
1797 |
[false] whileFalse:[
|
|
1798 |
]
|
|
1799 |
|
|
1800 |
"
|
|
1801 |
JITTest new loop1b
|
|
1802 |
"
|
|
1803 |
|
|
1804 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1805 |
|
|
1806 |
|
|
1807 |
!
|
|
1808 |
|
|
1809 |
loop1c
|
|
1810 |
[true] whileFalse:[
|
|
1811 |
]
|
|
1812 |
|
|
1813 |
"
|
|
1814 |
JITTest new loop1c
|
|
1815 |
"
|
|
1816 |
|
|
1817 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1818 |
|
|
1819 |
|
|
1820 |
!
|
|
1821 |
|
|
1822 |
loop1d
|
|
1823 |
[false] whileTrue:[
|
|
1824 |
]
|
|
1825 |
|
|
1826 |
"
|
|
1827 |
JITTest new loop1d
|
|
1828 |
"
|
|
1829 |
|
|
1830 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1831 |
|
|
1832 |
|
|
1833 |
!
|
|
1834 |
|
|
1835 |
loop1e
|
|
1836 |
[true] whileTrue
|
|
1837 |
|
|
1838 |
"
|
|
1839 |
JITTest new loop1e
|
|
1840 |
"
|
|
1841 |
|
|
1842 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1843 |
|
|
1844 |
|
|
1845 |
!
|
|
1846 |
|
|
1847 |
loop1f
|
|
1848 |
[false] whileTrue
|
|
1849 |
|
|
1850 |
"
|
|
1851 |
JITTest new loop1f
|
|
1852 |
"
|
|
1853 |
|
|
1854 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1855 |
|
|
1856 |
|
|
1857 |
!
|
|
1858 |
|
|
1859 |
loop1g
|
|
1860 |
[false] whileFalse
|
|
1861 |
|
|
1862 |
"
|
|
1863 |
JITTest new loop1g
|
|
1864 |
"
|
|
1865 |
|
|
1866 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1867 |
|
|
1868 |
|
|
1869 |
!
|
|
1870 |
|
|
1871 |
loop1h
|
|
1872 |
[true] whileFalse
|
|
1873 |
|
|
1874 |
"
|
|
1875 |
JITTest new loop1h
|
|
1876 |
"
|
|
1877 |
|
|
1878 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1879 |
|
|
1880 |
|
|
1881 |
!
|
|
1882 |
|
|
1883 |
loop2
|
|
1884 |
|i|
|
|
1885 |
|
|
1886 |
i := 5.
|
|
1887 |
[i > 0] whileTrue:[
|
|
1888 |
i printCR.
|
|
1889 |
i := i - 1.
|
|
1890 |
]
|
|
1891 |
|
|
1892 |
"
|
|
1893 |
JITTest new loop2
|
|
1894 |
"
|
|
1895 |
|
|
1896 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1897 |
|
|
1898 |
|
|
1899 |
!
|
|
1900 |
|
|
1901 |
loop2a
|
|
1902 |
|i|
|
|
1903 |
|
|
1904 |
i := 5.
|
|
1905 |
[i > 0] whileTrue:[
|
|
1906 |
i := i - 1.
|
|
1907 |
]
|
|
1908 |
|
|
1909 |
"
|
|
1910 |
JITTest new loop2a
|
|
1911 |
"
|
|
1912 |
|
|
1913 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1914 |
|
|
1915 |
|
|
1916 |
!
|
|
1917 |
|
|
1918 |
loop3
|
|
1919 |
|i|
|
|
1920 |
|
|
1921 |
i := 5.
|
|
1922 |
[i >= 0] whileTrue:[
|
|
1923 |
i printCR.
|
|
1924 |
i := i - 1.
|
|
1925 |
]
|
|
1926 |
|
|
1927 |
"
|
|
1928 |
(Delay waitForSeconds:5). JITTest new loop3
|
|
1929 |
JITTest new loop3
|
|
1930 |
"
|
|
1931 |
|
|
1932 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1933 |
|
|
1934 |
|
|
1935 |
!
|
|
1936 |
|
|
1937 |
loop4
|
|
1938 |
|i|
|
|
1939 |
|
|
1940 |
i := 5.
|
|
1941 |
[i >= 1] whileTrue:[
|
|
1942 |
i printCR.
|
|
1943 |
i := i - 1.
|
|
1944 |
]
|
|
1945 |
|
|
1946 |
"
|
|
1947 |
JITTest new loop4
|
|
1948 |
"
|
|
1949 |
|
|
1950 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1951 |
|
|
1952 |
|
|
1953 |
!
|
|
1954 |
|
|
1955 |
loop5
|
|
1956 |
5 timesRepeat:[
|
|
1957 |
'loop' printCR.
|
|
1958 |
]
|
|
1959 |
|
|
1960 |
"
|
|
1961 |
JITTest new loop5
|
|
1962 |
"
|
|
1963 |
|
|
1964 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1965 |
|
|
1966 |
|
|
1967 |
!
|
|
1968 |
|
|
1969 |
loop6
|
|
1970 |
|i|
|
|
1971 |
|
|
1972 |
i := 5.
|
|
1973 |
5 timesRepeat:[
|
|
1974 |
i := i - 1.
|
|
1975 |
'loop' print. i printCR.
|
|
1976 |
]
|
|
1977 |
|
|
1978 |
"
|
|
1979 |
JITTest new loop6
|
|
1980 |
"
|
|
1981 |
|
|
1982 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
1983 |
|
|
1984 |
|
|
1985 |
!
|
|
1986 |
|
|
1987 |
loop7
|
|
1988 |
|j|
|
|
1989 |
|
|
1990 |
j := 0.
|
|
1991 |
1 to:10000 do:[:i |
|
|
1992 |
j := j + 1.
|
|
1993 |
].
|
|
1994 |
^ j.
|
|
1995 |
|
|
1996 |
"
|
|
1997 |
JITTest new loop7
|
|
1998 |
"
|
|
1999 |
|
|
2000 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
2001 |
|
|
2002 |
|
|
2003 |
!
|
|
2004 |
|
|
2005 |
loop8
|
|
2006 |
|j|
|
|
2007 |
|
|
2008 |
j := 0.
|
|
2009 |
1 to:10000 do:[:i |
|
|
2010 |
j := j + i.
|
|
2011 |
].
|
|
2012 |
^ j.
|
|
2013 |
|
|
2014 |
"
|
|
2015 |
JITTest new loop8
|
|
2016 |
"
|
|
2017 |
|
|
2018 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
2019 |
!
|
|
2020 |
|
|
2021 |
whileLoop1
|
|
2022 |
|i|
|
|
2023 |
|
|
2024 |
i := -7.
|
|
2025 |
[i <= 16] whileTrue: [
|
|
2026 |
(i >= 1 and: [i <= 8]) ifTrue:[ 'a' printCR.].
|
|
2027 |
i >= 2 ifTrue: ['b' printCR.].
|
|
2028 |
i <= 7 ifTrue: ['c' printCR.].
|
|
2029 |
i := i + 1
|
|
2030 |
].
|
|
2031 |
|
|
2032 |
"
|
|
2033 |
self new whileLoop1
|
|
2034 |
"
|
|
2035 |
! !
|
|
2036 |
|
|
2037 |
!JITTest methodsFor:'test - misc'!
|
|
2038 |
|
|
2039 |
tstAsFloat:arg
|
|
2040 |
|foo|
|
|
2041 |
|
|
2042 |
foo := arg asFloat.
|
|
2043 |
^ foo
|
|
2044 |
|
|
2045 |
"
|
|
2046 |
self new testAsFloat:1
|
|
2047 |
self new testAsFloat:1.0
|
|
2048 |
self new testAsFloat:(1.0 asShortFloat)
|
|
2049 |
"
|
|
2050 |
|
|
2051 |
"Created: / 9.6.1998 / 20:21:51 / cg"
|
|
2052 |
"Modified: / 9.6.1998 / 20:22:40 / cg"
|
|
2053 |
!
|
|
2054 |
|
|
2055 |
tstAsInteger:arg
|
|
2056 |
|foo|
|
|
2057 |
|
|
2058 |
foo := arg asInteger.
|
|
2059 |
^ foo
|
|
2060 |
|
|
2061 |
"
|
|
2062 |
self new testAsInteger:1
|
|
2063 |
self new testAsInteger:1.0
|
|
2064 |
self new testAsInteger:(1.0 asShortFloat)
|
|
2065 |
"
|
|
2066 |
|
|
2067 |
"Created: / 9.6.1998 / 20:21:51 / cg"
|
|
2068 |
!
|
|
2069 |
|
|
2070 |
tstEven:arg
|
|
2071 |
^ arg even
|
|
2072 |
|
|
2073 |
"
|
|
2074 |
self new testEven:1
|
|
2075 |
self new testEven:2
|
|
2076 |
self new testEven:1.0
|
|
2077 |
self new testEven:2.0
|
|
2078 |
self new testEven:(SmallInteger maxVal + 1)
|
|
2079 |
self new testEven:(SmallInteger maxVal + 2)
|
|
2080 |
self new testEven:(1.0 asShortFloat)
|
|
2081 |
self new testEven:(2.0 asShortFloat)
|
|
2082 |
self new testEven:(Object new)
|
|
2083 |
"
|
|
2084 |
!
|
|
2085 |
|
|
2086 |
tstIsInteger:arg
|
|
2087 |
^ arg isInteger
|
|
2088 |
|
|
2089 |
"
|
|
2090 |
self new testIsInteger:1
|
|
2091 |
self new testIsInteger:1.0
|
|
2092 |
self new testIsInteger:(1.0 asShortFloat)
|
|
2093 |
"
|
|
2094 |
|
|
2095 |
"Modified: / 9.6.1998 / 20:22:24 / cg"
|
|
2096 |
!
|
|
2097 |
|
|
2098 |
tstIsReal:arg
|
|
2099 |
^ arg isReal
|
|
2100 |
|
|
2101 |
"
|
|
2102 |
self new testIsReal:1
|
|
2103 |
self new testIsReal:1.0
|
|
2104 |
self new testIsReal:(1.0 asShortFloat)
|
|
2105 |
"
|
|
2106 |
|
|
2107 |
"Modified: / 9.6.1998 / 20:22:24 / cg"
|
|
2108 |
"Created: / 9.6.1998 / 20:23:16 / cg"
|
|
2109 |
!
|
|
2110 |
|
|
2111 |
tstOdd:arg
|
|
2112 |
^ arg odd
|
|
2113 |
|
|
2114 |
"
|
|
2115 |
self new testOdd:1
|
|
2116 |
self new testOdd:2
|
|
2117 |
self new testOdd:1.0
|
|
2118 |
self new testOdd:2.0
|
|
2119 |
self new testOdd:(SmallInteger maxVal + 1)
|
|
2120 |
self new testOdd:(SmallInteger maxVal + 2)
|
|
2121 |
self new testOdd:(1.0 asShortFloat)
|
|
2122 |
self new testOdd:(2.0 asShortFloat)
|
|
2123 |
self new testOdd:(Object new)
|
|
2124 |
"
|
|
2125 |
!
|
|
2126 |
|
|
2127 |
tstOddEven1
|
|
2128 |
|x|
|
|
2129 |
|
|
2130 |
x := 0.
|
|
2131 |
1 to:100 do:[:i |
|
|
2132 |
i odd ifTrue:[
|
|
2133 |
x := x + 1
|
|
2134 |
] ifFalse:[x := x - 1]
|
|
2135 |
].
|
|
2136 |
^ x
|
|
2137 |
|
|
2138 |
"
|
|
2139 |
self new testOddEven1
|
|
2140 |
"
|
|
2141 |
! !
|
|
2142 |
|
|
2143 |
!JITTest methodsFor:'tests - args'!
|
|
2144 |
|
|
2145 |
runPerformTestArg
|
|
2146 |
(self perform:#'tstargs9:_:_:_:_:_:_:_:_:'
|
|
2147 |
withArguments:#(1 2 3 4 5 6 7 8 9)) ~~ 9 ifTrue:[
|
|
2148 |
self halt
|
|
2149 |
].
|
|
2150 |
(self perform:#'tstargs9_l:_:_:_:_:_:_:_:_:'
|
|
2151 |
withArguments:#(1 2 3 4 5 6 7 8 9)) ~~ 9 ifTrue:[
|
|
2152 |
self halt
|
|
2153 |
|
|
2154 |
"
|
|
2155 |
JITTest new runPerformTestArg
|
|
2156 |
"
|
|
2157 |
|
|
2158 |
"Modified: / 19.4.1999 / 22:05:29 / cg"
|
|
2159 |
]
|
|
2160 |
!
|
|
2161 |
|
|
2162 |
runTestArg
|
|
2163 |
(self tstargs1:1) ~~ 1 ifTrue:[
|
|
2164 |
self halt
|
|
2165 |
].
|
|
2166 |
(self tstargs1:nil) ~~ nil ifTrue:[
|
|
2167 |
self halt
|
|
2168 |
].
|
|
2169 |
(self tstargs2:1 _:2) ~~ 2 ifTrue:[
|
|
2170 |
self halt
|
|
2171 |
].
|
|
2172 |
(self tstargs2:2 _:1) ~~ 1 ifTrue:[
|
|
2173 |
self halt
|
|
2174 |
].
|
|
2175 |
(self
|
|
2176 |
tstargs3:1
|
|
2177 |
_:2
|
|
2178 |
_:3) ~~ 3 ifTrue:[
|
|
2179 |
self halt
|
|
2180 |
].
|
|
2181 |
(self
|
|
2182 |
tstargs3:3
|
|
2183 |
_:2
|
|
2184 |
_:1) ~~ 1 ifTrue:[
|
|
2185 |
self halt
|
|
2186 |
].
|
|
2187 |
(self
|
|
2188 |
tstargs4:1
|
|
2189 |
_:2
|
|
2190 |
_:3
|
|
2191 |
_:4) ~~ 4 ifTrue:[
|
|
2192 |
self halt
|
|
2193 |
].
|
|
2194 |
(self
|
|
2195 |
tstargs4:4
|
|
2196 |
_:3
|
|
2197 |
_:2
|
|
2198 |
_:1) ~~ 1 ifTrue:[
|
|
2199 |
self halt
|
|
2200 |
].
|
|
2201 |
(self
|
|
2202 |
tstargs5:1
|
|
2203 |
_:2
|
|
2204 |
_:3
|
|
2205 |
_:4
|
|
2206 |
_:5) ~~ 5 ifTrue:[
|
|
2207 |
self halt
|
|
2208 |
].
|
|
2209 |
(self
|
|
2210 |
tstargs5:5
|
|
2211 |
_:4
|
|
2212 |
_:3
|
|
2213 |
_:2
|
|
2214 |
_:1) ~~ 1 ifTrue:[
|
|
2215 |
self halt
|
|
2216 |
].
|
|
2217 |
(self
|
|
2218 |
tstargs6:1
|
|
2219 |
_:2
|
|
2220 |
_:3
|
|
2221 |
_:4
|
|
2222 |
_:5
|
|
2223 |
_:6) ~~ 6 ifTrue:[
|
|
2224 |
self halt
|
|
2225 |
].
|
|
2226 |
(self
|
|
2227 |
tstargs6:6
|
|
2228 |
_:5
|
|
2229 |
_:4
|
|
2230 |
_:3
|
|
2231 |
_:2
|
|
2232 |
_:1) ~~ 1 ifTrue:[
|
|
2233 |
self halt
|
|
2234 |
].
|
|
2235 |
(self
|
|
2236 |
tstargs7:1
|
|
2237 |
_:2
|
|
2238 |
_:3
|
|
2239 |
_:4
|
|
2240 |
_:5
|
|
2241 |
_:6
|
|
2242 |
_:7) ~~ 7 ifTrue:[
|
|
2243 |
self halt
|
|
2244 |
].
|
|
2245 |
(self
|
|
2246 |
tstargs7:7
|
|
2247 |
_:6
|
|
2248 |
_:5
|
|
2249 |
_:4
|
|
2250 |
_:3
|
|
2251 |
_:2
|
|
2252 |
_:1) ~~ 1 ifTrue:[
|
|
2253 |
self halt
|
|
2254 |
].
|
|
2255 |
(self
|
|
2256 |
tstargs8:1
|
|
2257 |
_:2
|
|
2258 |
_:3
|
|
2259 |
_:4
|
|
2260 |
_:5
|
|
2261 |
_:6
|
|
2262 |
_:7
|
|
2263 |
_:8) ~~ 8 ifTrue:[
|
|
2264 |
self halt
|
|
2265 |
].
|
|
2266 |
(self
|
|
2267 |
tstargs8:8
|
|
2268 |
_:7
|
|
2269 |
_:6
|
|
2270 |
_:5
|
|
2271 |
_:4
|
|
2272 |
_:3
|
|
2273 |
_:2
|
|
2274 |
_:1) ~~ 1 ifTrue:[
|
|
2275 |
self halt
|
|
2276 |
].
|
|
2277 |
(self
|
|
2278 |
tstargs9:1
|
|
2279 |
_:2
|
|
2280 |
_:3
|
|
2281 |
_:4
|
|
2282 |
_:5
|
|
2283 |
_:6
|
|
2284 |
_:7
|
|
2285 |
_:8
|
|
2286 |
_:9) ~~ 9 ifTrue:[
|
|
2287 |
self halt
|
|
2288 |
].
|
|
2289 |
(self
|
|
2290 |
tstargs9:9
|
|
2291 |
_:8
|
|
2292 |
_:7
|
|
2293 |
_:6
|
|
2294 |
_:5
|
|
2295 |
_:4
|
|
2296 |
_:3
|
|
2297 |
_:2
|
|
2298 |
_:1) ~~ 1 ifTrue:[
|
|
2299 |
self halt
|
|
2300 |
|
|
2301 |
"
|
|
2302 |
JITTest new runTestArg
|
|
2303 |
"
|
|
2304 |
|
|
2305 |
"Modified: / 19.4.1999 / 22:02:09 / cg"
|
|
2306 |
]
|
|
2307 |
!
|
|
2308 |
|
|
2309 |
runTestArg_l
|
|
2310 |
(self tstargs1_l:1) ~~ 1 ifTrue:[
|
|
2311 |
self halt
|
|
2312 |
].
|
|
2313 |
(self tstargs1_l:nil) ~~ nil ifTrue:[
|
|
2314 |
self halt
|
|
2315 |
].
|
|
2316 |
(self tstargs2_l:1 _:2) ~~ 2 ifTrue:[
|
|
2317 |
self halt
|
|
2318 |
].
|
|
2319 |
(self tstargs2_l:2 _:1) ~~ 1 ifTrue:[
|
|
2320 |
self halt
|
|
2321 |
].
|
|
2322 |
(self
|
|
2323 |
tstargs3_l:1
|
|
2324 |
_:2
|
|
2325 |
_:3) ~~ 3 ifTrue:[
|
|
2326 |
self halt
|
|
2327 |
].
|
|
2328 |
(self
|
|
2329 |
tstargs3_l:3
|
|
2330 |
_:2
|
|
2331 |
_:1) ~~ 1 ifTrue:[
|
|
2332 |
self halt
|
|
2333 |
].
|
|
2334 |
(self
|
|
2335 |
tstargs4_l:1
|
|
2336 |
_:2
|
|
2337 |
_:3
|
|
2338 |
_:4) ~~ 4 ifTrue:[
|
|
2339 |
self halt
|
|
2340 |
].
|
|
2341 |
(self
|
|
2342 |
tstargs4_l:4
|
|
2343 |
_:3
|
|
2344 |
_:2
|
|
2345 |
_:1) ~~ 1 ifTrue:[
|
|
2346 |
self halt
|
|
2347 |
].
|
|
2348 |
(self
|
|
2349 |
tstargs5_l:1
|
|
2350 |
_:2
|
|
2351 |
_:3
|
|
2352 |
_:4
|
|
2353 |
_:5) ~~ 5 ifTrue:[
|
|
2354 |
self halt
|
|
2355 |
].
|
|
2356 |
(self
|
|
2357 |
tstargs5_l:5
|
|
2358 |
_:4
|
|
2359 |
_:3
|
|
2360 |
_:2
|
|
2361 |
_:1) ~~ 1 ifTrue:[
|
|
2362 |
self halt
|
|
2363 |
].
|
|
2364 |
(self
|
|
2365 |
tstargs6_l:1
|
|
2366 |
_:2
|
|
2367 |
_:3
|
|
2368 |
_:4
|
|
2369 |
_:5
|
|
2370 |
_:6) ~~ 6 ifTrue:[
|
|
2371 |
self halt
|
|
2372 |
].
|
|
2373 |
(self
|
|
2374 |
tstargs6_l:6
|
|
2375 |
_:5
|
|
2376 |
_:4
|
|
2377 |
_:3
|
|
2378 |
_:2
|
|
2379 |
_:1) ~~ 1 ifTrue:[
|
|
2380 |
self halt
|
|
2381 |
].
|
|
2382 |
(self
|
|
2383 |
tstargs7_l:1
|
|
2384 |
_:2
|
|
2385 |
_:3
|
|
2386 |
_:4
|
|
2387 |
_:5
|
|
2388 |
_:6
|
|
2389 |
_:7) ~~ 7 ifTrue:[
|
|
2390 |
self halt
|
|
2391 |
].
|
|
2392 |
(self
|
|
2393 |
tstargs7_l:7
|
|
2394 |
_:6
|
|
2395 |
_:5
|
|
2396 |
_:4
|
|
2397 |
_:3
|
|
2398 |
_:2
|
|
2399 |
_:1) ~~ 1 ifTrue:[
|
|
2400 |
self halt
|
|
2401 |
].
|
|
2402 |
(self
|
|
2403 |
tstargs8_l:1
|
|
2404 |
_:2
|
|
2405 |
_:3
|
|
2406 |
_:4
|
|
2407 |
_:5
|
|
2408 |
_:6
|
|
2409 |
_:7
|
|
2410 |
_:8) ~~ 8 ifTrue:[
|
|
2411 |
self halt
|
|
2412 |
].
|
|
2413 |
(self
|
|
2414 |
tstargs8_l:8
|
|
2415 |
_:7
|
|
2416 |
_:6
|
|
2417 |
_:5
|
|
2418 |
_:4
|
|
2419 |
_:3
|
|
2420 |
_:2
|
|
2421 |
_:1) ~~ 1 ifTrue:[
|
|
2422 |
self halt
|
|
2423 |
].
|
|
2424 |
(self
|
|
2425 |
tstargs9_l:1
|
|
2426 |
_:2
|
|
2427 |
_:3
|
|
2428 |
_:4
|
|
2429 |
_:5
|
|
2430 |
_:6
|
|
2431 |
_:7
|
|
2432 |
_:8
|
|
2433 |
_:9) ~~ 9 ifTrue:[
|
|
2434 |
self halt
|
|
2435 |
].
|
|
2436 |
(self
|
|
2437 |
tstargs9_l:9
|
|
2438 |
_:8
|
|
2439 |
_:7
|
|
2440 |
_:6
|
|
2441 |
_:5
|
|
2442 |
_:4
|
|
2443 |
_:3
|
|
2444 |
_:2
|
|
2445 |
_:1) ~~ 1 ifTrue:[
|
|
2446 |
self halt
|
|
2447 |
|
|
2448 |
"
|
|
2449 |
JITTest new runTestArg_l
|
|
2450 |
"
|
|
2451 |
|
|
2452 |
"Modified: / 19.4.1999 / 22:02:09 / cg"
|
|
2453 |
"Created: / 19.4.1999 / 22:03:13 / cg"
|
|
2454 |
]
|
|
2455 |
!
|
|
2456 |
|
|
2457 |
tstArgEQ:arg
|
|
2458 |
arg == #'==' ifTrue:[
|
|
2459 |
^ true
|
|
2460 |
].
|
|
2461 |
arg == #'~~' ifTrue:[
|
|
2462 |
^ true
|
|
2463 |
].
|
|
2464 |
arg == #'=' ifTrue:[
|
|
2465 |
^ true
|
|
2466 |
].
|
|
2467 |
^ false
|
|
2468 |
|
|
2469 |
"
|
|
2470 |
JITTest new testArgEQ:1
|
|
2471 |
JITTest new testArgEQ:#==
|
|
2472 |
JITTest new testArgEQ:#~~
|
|
2473 |
JITTest new testArgEQ:#=
|
|
2474 |
JITTest new testArgEQ:#foo
|
|
2475 |
"
|
|
2476 |
|
|
2477 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
2478 |
!
|
|
2479 |
|
|
2480 |
tstarg1:arg
|
|
2481 |
^ arg
|
|
2482 |
|
|
2483 |
"
|
|
2484 |
JITTest new testarg1:1
|
|
2485 |
JITTest new testarg1:0
|
|
2486 |
"
|
|
2487 |
|
|
2488 |
"Created: / 16.8.1996 / 17:39:44 / cg"
|
|
2489 |
"Modified: / 3.6.1998 / 15:49:29 / cg"
|
|
2490 |
!
|
|
2491 |
|
|
2492 |
tstarg2:arg1 arg:arg2
|
|
2493 |
^ arg2
|
|
2494 |
|
|
2495 |
"
|
|
2496 |
JITTest new testarg2:1 arg:2
|
|
2497 |
JITTest new testarg2:0 arg:1
|
|
2498 |
"
|
|
2499 |
|
|
2500 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
2501 |
!
|
|
2502 |
|
|
2503 |
tstarg3:arg
|
|
2504 |
|l1|
|
|
2505 |
|
|
2506 |
l1 := 1.
|
|
2507 |
^ arg
|
|
2508 |
|
|
2509 |
"
|
|
2510 |
JITTest new testarg3:1
|
|
2511 |
JITTest new testarg3:0
|
|
2512 |
"
|
|
2513 |
|
|
2514 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
2515 |
!
|
|
2516 |
|
|
2517 |
tstarg4:arg1 arg:arg2
|
|
2518 |
|l1|
|
|
2519 |
|
|
2520 |
l1 := 1.
|
|
2521 |
^ arg1
|
|
2522 |
|
|
2523 |
"
|
|
2524 |
JITTest new testarg4:1 arg:2
|
|
2525 |
JITTest new testarg4:0 arg:1
|
|
2526 |
"
|
|
2527 |
|
|
2528 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
2529 |
!
|
|
2530 |
|
|
2531 |
tstarg5:arg1 arg:arg2
|
|
2532 |
|l1|
|
|
2533 |
|
|
2534 |
l1 := 1.
|
|
2535 |
^ arg2
|
|
2536 |
|
|
2537 |
"
|
|
2538 |
JITTest new testarg5:1 arg:2
|
|
2539 |
JITTest new testarg5:0 arg:1
|
|
2540 |
"
|
|
2541 |
|
|
2542 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
2543 |
!
|
|
2544 |
|
|
2545 |
tstargs1:a1
|
|
2546 |
^ a1
|
|
2547 |
|
|
2548 |
"
|
|
2549 |
JITTest new testargs1:1
|
|
2550 |
"
|
|
2551 |
|
|
2552 |
"Created: / 3.6.1998 / 21:04:31 / cg"
|
|
2553 |
!
|
|
2554 |
|
|
2555 |
tstargs1_l:a1
|
|
2556 |
|l|
|
|
2557 |
|
|
2558 |
l := 1.
|
|
2559 |
^ a1
|
|
2560 |
|
|
2561 |
"
|
|
2562 |
JITTest new testargs1_l:1
|
|
2563 |
"
|
|
2564 |
|
|
2565 |
"Created: / 3.6.1998 / 21:04:31 / cg"
|
|
2566 |
"Modified: / 3.6.1998 / 23:36:57 / cg"
|
|
2567 |
!
|
|
2568 |
|
|
2569 |
tstargs2:a1 _:a2
|
|
2570 |
^ a2
|
|
2571 |
|
|
2572 |
"
|
|
2573 |
JITTest new testargs2:1 _:2
|
|
2574 |
"
|
|
2575 |
|
|
2576 |
"Created: / 3.6.1998 / 21:04:42 / cg"
|
|
2577 |
"Modified: / 3.6.1998 / 21:05:56 / cg"
|
|
2578 |
!
|
|
2579 |
|
|
2580 |
tstargs2_l:a1 _:a2
|
|
2581 |
|l|
|
|
2582 |
|
|
2583 |
l := 1.
|
|
2584 |
^ a2
|
|
2585 |
|
|
2586 |
"
|
|
2587 |
JITTest new testargs2_l:1 _:2
|
|
2588 |
"
|
|
2589 |
|
|
2590 |
"Created: / 3.6.1998 / 23:37:03 / cg"
|
|
2591 |
"Modified: / 3.6.1998 / 23:37:41 / cg"
|
|
2592 |
!
|
|
2593 |
|
|
2594 |
tstargs3:a1 _:a2 _:a3
|
|
2595 |
^ a3
|
|
2596 |
|
|
2597 |
"
|
|
2598 |
JITTest new testargs3:1 _:2 _:3
|
|
2599 |
"
|
|
2600 |
|
|
2601 |
"Created: / 3.6.1998 / 21:05:14 / cg"
|
|
2602 |
!
|
|
2603 |
|
|
2604 |
tstargs3_l:a1 _:a2 _:a3
|
|
2605 |
|l|
|
|
2606 |
|
|
2607 |
l := 1.
|
|
2608 |
^ a3
|
|
2609 |
|
|
2610 |
"
|
|
2611 |
JITTest new testargs3_l:1 _:2 _:3
|
|
2612 |
"
|
|
2613 |
|
|
2614 |
"Created: / 3.6.1998 / 23:37:07 / cg"
|
|
2615 |
"Modified: / 3.6.1998 / 23:37:44 / cg"
|
|
2616 |
!
|
|
2617 |
|
|
2618 |
tstargs4:a1 _:a2 _:a3 _:a4
|
|
2619 |
^ a4
|
|
2620 |
|
|
2621 |
"
|
|
2622 |
JITTest new testargs4:1 _:2 _:3 _:4
|
|
2623 |
"
|
|
2624 |
|
|
2625 |
"Created: / 3.6.1998 / 21:05:07 / cg"
|
|
2626 |
"Modified: / 3.6.1998 / 21:05:50 / cg"
|
|
2627 |
!
|
|
2628 |
|
|
2629 |
tstargs4_l:a1 _:a2 _:a3 _:a4
|
|
2630 |
|l|
|
|
2631 |
|
|
2632 |
l := 1.
|
|
2633 |
^ a4
|
|
2634 |
|
|
2635 |
"
|
|
2636 |
JITTest new testargs4_l:1 _:2 _:3 _:4
|
|
2637 |
"
|
|
2638 |
|
|
2639 |
"Created: / 3.6.1998 / 23:37:11 / cg"
|
|
2640 |
"Modified: / 3.6.1998 / 23:37:48 / cg"
|
|
2641 |
!
|
|
2642 |
|
|
2643 |
tstargs5:a1 _:a2 _:a3 _:a4 _:a5
|
|
2644 |
^ a5
|
|
2645 |
|
|
2646 |
"
|
|
2647 |
JITTest new testargs5:1 _:2 _:3 _:4 _:5
|
|
2648 |
"
|
|
2649 |
|
|
2650 |
"Created: / 3.6.1998 / 21:05:28 / cg"
|
|
2651 |
"Modified: / 3.6.1998 / 21:05:47 / cg"
|
|
2652 |
!
|
|
2653 |
|
|
2654 |
tstargs5_l:a1 _:a2 _:a3 _:a4 _:a5
|
|
2655 |
|l|
|
|
2656 |
|
|
2657 |
l := 1.
|
|
2658 |
^ a5
|
|
2659 |
|
|
2660 |
"
|
|
2661 |
JITTest new testargs5_l:1 _:2 _:3 _:4 _:5
|
|
2662 |
"
|
|
2663 |
|
|
2664 |
"Created: / 3.6.1998 / 23:37:17 / cg"
|
|
2665 |
"Modified: / 3.6.1998 / 23:37:50 / cg"
|
|
2666 |
!
|
|
2667 |
|
|
2668 |
tstargs6:a1 _:a2 _:a3 _:a4 _:a5 _:a6
|
|
2669 |
^ a6
|
|
2670 |
|
|
2671 |
"
|
|
2672 |
JITTest new testargs6:1 _:2 _:3 _:4 _:5 _:6
|
|
2673 |
"
|
|
2674 |
|
|
2675 |
"Created: / 3.6.1998 / 21:05:44 / cg"
|
|
2676 |
!
|
|
2677 |
|
|
2678 |
tstargs6_l:a1 _:a2 _:a3 _:a4 _:a5 _:a6
|
|
2679 |
|l|
|
|
2680 |
|
|
2681 |
l := 1.
|
|
2682 |
^ a6
|
|
2683 |
|
|
2684 |
"
|
|
2685 |
JITTest new testargs6_l:1 _:2 _:3 _:4 _:5 _:6
|
|
2686 |
"
|
|
2687 |
|
|
2688 |
"Created: / 3.6.1998 / 23:37:20 / cg"
|
|
2689 |
"Modified: / 3.6.1998 / 23:37:54 / cg"
|
|
2690 |
!
|
|
2691 |
|
|
2692 |
tstargs7:a1 _:a2 _:a3 _:a4 _:a5 _:a6 _:a7
|
|
2693 |
^ a7
|
|
2694 |
|
|
2695 |
"
|
|
2696 |
JITTest new testargs7:1 _:2 _:3 _:4 _:5 _:6 _:7
|
|
2697 |
"
|
|
2698 |
|
|
2699 |
"Created: / 3.6.1998 / 21:05:44 / cg"
|
|
2700 |
"Modified: / 3.6.1998 / 21:15:35 / cg"
|
|
2701 |
!
|
|
2702 |
|
|
2703 |
tstargs7_l:a1 _:a2 _:a3 _:a4 _:a5 _:a6 _:a7
|
|
2704 |
|l|
|
|
2705 |
|
|
2706 |
l := 1.
|
|
2707 |
^ a7
|
|
2708 |
|
|
2709 |
"
|
|
2710 |
JITTest new testargs7_l:1 _:2 _:3 _:4 _:5 _:6 _:7
|
|
2711 |
"
|
|
2712 |
|
|
2713 |
"Created: / 3.6.1998 / 23:37:23 / cg"
|
|
2714 |
"Modified: / 3.6.1998 / 23:37:57 / cg"
|
|
2715 |
!
|
|
2716 |
|
|
2717 |
tstargs8:a1 _:a2 _:a3 _:a4 _:a5 _:a6 _:a7 _:a8
|
|
2718 |
^ a8
|
|
2719 |
|
|
2720 |
"
|
|
2721 |
JITTest new testargs8:1 _:2 _:3 _:4 _:5 _:6 _:7 _:8
|
|
2722 |
"
|
|
2723 |
|
|
2724 |
"Created: / 3.6.1998 / 21:15:52 / cg"
|
|
2725 |
!
|
|
2726 |
|
|
2727 |
tstargs8_l:a1 _:a2 _:a3 _:a4 _:a5 _:a6 _:a7 _:a8
|
|
2728 |
|l|
|
|
2729 |
|
|
2730 |
l := 1.
|
|
2731 |
^ a8
|
|
2732 |
|
|
2733 |
"
|
|
2734 |
JITTest new testargs8_l:1 _:2 _:3 _:4 _:5 _:6 _:7 _:8
|
|
2735 |
"
|
|
2736 |
|
|
2737 |
"Created: / 3.6.1998 / 23:37:28 / cg"
|
|
2738 |
"Modified: / 3.6.1998 / 23:38:01 / cg"
|
|
2739 |
!
|
|
2740 |
|
|
2741 |
tstargs9:a1 _:a2 _:a3 _:a4 _:a5 _:a6 _:a7 _:a8 _:a9
|
|
2742 |
^ a9
|
|
2743 |
|
|
2744 |
"
|
|
2745 |
JITTest new testargs9:1 _:2 _:3 _:4 _:5 _:6 _:7 _:8 _:9
|
|
2746 |
"
|
|
2747 |
|
|
2748 |
"Created: / 3.6.1998 / 21:05:44 / cg"
|
|
2749 |
"Modified: / 3.6.1998 / 21:16:55 / cg"
|
|
2750 |
!
|
|
2751 |
|
|
2752 |
tstargs9_l:a1 _:a2 _:a3 _:a4 _:a5 _:a6 _:a7 _:a8 _:a9
|
|
2753 |
|l|
|
|
2754 |
|
|
2755 |
l := 1.
|
|
2756 |
^ a9
|
|
2757 |
|
|
2758 |
"
|
|
2759 |
JITTest new testargs9_l:1 _:2 _:3 _:4 _:5 _:6 _:7 _:8 _:9
|
|
2760 |
"
|
|
2761 |
|
|
2762 |
"Created: / 3.6.1998 / 23:37:33 / cg"
|
|
2763 |
"Modified: / 3.6.1998 / 23:38:03 / cg"
|
|
2764 |
! !
|
|
2765 |
|
|
2766 |
!JITTest methodsFor:'tests - consts'!
|
|
2767 |
|
|
2768 |
tst10b
|
|
2769 |
^ 'hello'
|
|
2770 |
|
|
2771 |
"
|
|
2772 |
JITTest new test10b
|
|
2773 |
"
|
|
2774 |
|
|
2775 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
2776 |
!
|
|
2777 |
|
|
2778 |
tst10c
|
|
2779 |
^ 'world'
|
|
2780 |
|
|
2781 |
"
|
|
2782 |
JITTest new test10c
|
|
2783 |
JITTest new test10b
|
|
2784 |
"
|
|
2785 |
|
|
2786 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
2787 |
!
|
|
2788 |
|
|
2789 |
tst11
|
|
2790 |
i1 := 0
|
|
2791 |
|
|
2792 |
"
|
|
2793 |
JITTest new test11
|
|
2794 |
"
|
|
2795 |
|
|
2796 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
2797 |
! !
|
|
2798 |
|
|
2799 |
!JITTest methodsFor:'tests - contexts'!
|
|
2800 |
|
|
2801 |
tstContext1
|
|
2802 |
^ thisContext
|
|
2803 |
|
|
2804 |
"
|
|
2805 |
JITTest new testContext1
|
|
2806 |
ObjectMemory dumpObject: JITTest new testContext1
|
|
2807 |
"
|
|
2808 |
|
|
2809 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
2810 |
!
|
|
2811 |
|
|
2812 |
tstContext2
|
|
2813 |
^ thisContext sender
|
|
2814 |
|
|
2815 |
"
|
|
2816 |
JITTest new testContext2
|
|
2817 |
ObjectMemory dumpObject: JITTest new testContext2
|
|
2818 |
"
|
|
2819 |
|
|
2820 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
2821 |
! !
|
|
2822 |
|
|
2823 |
!JITTest methodsFor:'tests - floats'!
|
|
2824 |
|
|
2825 |
abs1:arg
|
|
2826 |
^ arg abs
|
|
2827 |
|
|
2828 |
"
|
|
2829 |
self new abs1:1
|
|
2830 |
self new abs1:-1
|
|
2831 |
self new abs1:0
|
|
2832 |
self new abs1:1.0
|
|
2833 |
self new abs1:-1.0
|
|
2834 |
self new abs1:0.0
|
|
2835 |
"
|
|
2836 |
|
|
2837 |
"Created: / 3.11.1998 / 16:14:04 / cg"
|
|
2838 |
! !
|
|
2839 |
|
|
2840 |
!JITTest methodsFor:'tests - instvars'!
|
|
2841 |
|
|
2842 |
tst10
|
|
2843 |
^ i2
|
|
2844 |
|
|
2845 |
"
|
|
2846 |
JITTest new tst10
|
|
2847 |
(JITTest new) instVarAt:2 put:555; tst10
|
|
2848 |
"
|
|
2849 |
|
|
2850 |
"Created: / 16.8.1996 / 17:39:44 / cg"
|
|
2851 |
"Modified: / 3.6.1998 / 15:49:54 / cg"
|
|
2852 |
!
|
|
2853 |
|
|
2854 |
tst12:arg
|
|
2855 |
i1 := arg.
|
|
2856 |
i2 := 0
|
|
2857 |
|
|
2858 |
"
|
|
2859 |
JITTest new tst12:1
|
|
2860 |
"
|
|
2861 |
|
|
2862 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
2863 |
!
|
|
2864 |
|
|
2865 |
tst13
|
|
2866 |
i1 := nil.
|
|
2867 |
i2 := 1
|
|
2868 |
|
|
2869 |
"
|
|
2870 |
JITTest new tst13
|
|
2871 |
(JITTest new tst12:1) tst13
|
|
2872 |
"
|
|
2873 |
|
|
2874 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
2875 |
!
|
|
2876 |
|
|
2877 |
tst13b
|
|
2878 |
i1 := nil.
|
|
2879 |
i2 := 0
|
|
2880 |
|
|
2881 |
"
|
|
2882 |
JITTest new tst13b
|
|
2883 |
"
|
|
2884 |
|
|
2885 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
2886 |
!
|
|
2887 |
|
|
2888 |
tst13c
|
|
2889 |
i1 := i2 := i3 := 0.
|
|
2890 |
i1 := nil.
|
|
2891 |
i2 := 0.
|
|
2892 |
i3 := nil
|
|
2893 |
|
|
2894 |
"
|
|
2895 |
JITTest new tst13c
|
|
2896 |
"
|
|
2897 |
|
|
2898 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
2899 |
!
|
|
2900 |
|
|
2901 |
tst14
|
|
2902 |
i1 := 1.
|
|
2903 |
i2 := 2.
|
|
2904 |
i3 := 3
|
|
2905 |
|
|
2906 |
"
|
|
2907 |
JITTest new tst14
|
|
2908 |
"
|
|
2909 |
|
|
2910 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
2911 |
!
|
|
2912 |
|
|
2913 |
tst14b
|
|
2914 |
i1 := 1.
|
|
2915 |
i2 := 1.
|
|
2916 |
i3 := 1
|
|
2917 |
|
|
2918 |
"
|
|
2919 |
JITTest new tst14b
|
|
2920 |
"
|
|
2921 |
|
|
2922 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
2923 |
!
|
|
2924 |
|
|
2925 |
tst14c
|
|
2926 |
i1 := 0.
|
|
2927 |
^ 0
|
|
2928 |
|
|
2929 |
"
|
|
2930 |
JITTest new tst14c
|
|
2931 |
"
|
|
2932 |
|
|
2933 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
2934 |
!
|
|
2935 |
|
|
2936 |
tst14d
|
|
2937 |
i1 := 1.
|
|
2938 |
i2 := 3.
|
|
2939 |
i3 := 5
|
|
2940 |
|
|
2941 |
"
|
|
2942 |
JITTest new tst14d
|
|
2943 |
"
|
|
2944 |
|
|
2945 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
2946 |
!
|
|
2947 |
|
|
2948 |
tst14e
|
|
2949 |
i1 := 1.
|
|
2950 |
i2 := 3.
|
|
2951 |
i3 := 5.
|
|
2952 |
i1 := 3.
|
|
2953 |
i2 := 1.
|
|
2954 |
i3 := 0
|
|
2955 |
|
|
2956 |
"
|
|
2957 |
JITTest new tst14e
|
|
2958 |
"
|
|
2959 |
|
|
2960 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
2961 |
!
|
|
2962 |
|
|
2963 |
tst14f
|
|
2964 |
i1 := true.
|
|
2965 |
i2 := false.
|
|
2966 |
i3 := true
|
|
2967 |
|
|
2968 |
"
|
|
2969 |
JITTest new tst14f
|
|
2970 |
"
|
|
2971 |
|
|
2972 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
2973 |
!
|
|
2974 |
|
|
2975 |
tst14g
|
|
2976 |
i1 := true.
|
|
2977 |
i2 := false.
|
|
2978 |
i3 := true.
|
|
2979 |
^ true
|
|
2980 |
|
|
2981 |
"
|
|
2982 |
JITTest new tst14g
|
|
2983 |
"
|
|
2984 |
|
|
2985 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
2986 |
!
|
|
2987 |
|
|
2988 |
tst14h
|
|
2989 |
i1 := true.
|
|
2990 |
i2 := false.
|
|
2991 |
i3 := true.
|
|
2992 |
^ false
|
|
2993 |
|
|
2994 |
"
|
|
2995 |
JITTest new tst14h
|
|
2996 |
"
|
|
2997 |
|
|
2998 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
2999 |
!
|
|
3000 |
|
|
3001 |
tst14i
|
|
3002 |
i1 := true.
|
|
3003 |
^ false
|
|
3004 |
|
|
3005 |
"
|
|
3006 |
JITTest new tst14i
|
|
3007 |
"
|
|
3008 |
|
|
3009 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3010 |
!
|
|
3011 |
|
|
3012 |
tst15
|
|
3013 |
i1 := 1.
|
|
3014 |
i2 := i1.
|
|
3015 |
i3 := i2
|
|
3016 |
|
|
3017 |
"
|
|
3018 |
JITTest new tst15
|
|
3019 |
"
|
|
3020 |
|
|
3021 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3022 |
!
|
|
3023 |
|
|
3024 |
tst16
|
|
3025 |
i1 := 1.
|
|
3026 |
i2 := 1.
|
|
3027 |
i3 := 1
|
|
3028 |
|
|
3029 |
"
|
|
3030 |
JITTest new tst16
|
|
3031 |
"
|
|
3032 |
|
|
3033 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3034 |
!
|
|
3035 |
|
|
3036 |
tst17
|
|
3037 |
i1 := 1.
|
|
3038 |
i2 := 10.
|
|
3039 |
i3 := 100
|
|
3040 |
|
|
3041 |
"
|
|
3042 |
JITTest new tst17
|
|
3043 |
"
|
|
3044 |
|
|
3045 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3046 |
!
|
|
3047 |
|
|
3048 |
tst17b
|
|
3049 |
i1 := 1.
|
|
3050 |
i2 := 10.
|
|
3051 |
i3 := 100.
|
|
3052 |
i1 := 1000
|
|
3053 |
|
|
3054 |
"
|
|
3055 |
JITTest new tst17b
|
|
3056 |
"
|
|
3057 |
|
|
3058 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3059 |
!
|
|
3060 |
|
|
3061 |
tst17c
|
|
3062 |
i1 := 1.
|
|
3063 |
i2 := 10.
|
|
3064 |
i3 := 100.
|
|
3065 |
i1 := 1000.
|
|
3066 |
i2 := 10000
|
|
3067 |
|
|
3068 |
"
|
|
3069 |
JITTest new tst17c
|
|
3070 |
"
|
|
3071 |
|
|
3072 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3073 |
!
|
|
3074 |
|
|
3075 |
tst17d
|
|
3076 |
i1 := 0.
|
|
3077 |
i2 := -1.
|
|
3078 |
i3 := 1
|
|
3079 |
|
|
3080 |
"
|
|
3081 |
JITTest new tst17d
|
|
3082 |
"
|
|
3083 |
|
|
3084 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3085 |
!
|
|
3086 |
|
|
3087 |
tst17e
|
|
3088 |
i1 := nil.
|
|
3089 |
i2 := -1
|
|
3090 |
|
|
3091 |
"
|
|
3092 |
JITTest new tst17e
|
|
3093 |
"
|
|
3094 |
|
|
3095 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3096 |
!
|
|
3097 |
|
|
3098 |
tst17f
|
|
3099 |
i2 := -1.
|
|
3100 |
i1 := nil
|
|
3101 |
|
|
3102 |
"
|
|
3103 |
JITTest new tst17f
|
|
3104 |
"
|
|
3105 |
|
|
3106 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3107 |
!
|
|
3108 |
|
|
3109 |
tst9
|
|
3110 |
^ i1
|
|
3111 |
|
|
3112 |
"
|
|
3113 |
JITTest new tst9
|
|
3114 |
"
|
|
3115 |
|
|
3116 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3117 |
!
|
|
3118 |
|
|
3119 |
tstInstStore1
|
|
3120 |
i1 := nil
|
|
3121 |
|
|
3122 |
"
|
|
3123 |
JITTest new tstInstStore1
|
|
3124 |
"
|
|
3125 |
|
|
3126 |
"Created: / 17.7.1998 / 16:42:02 / cg"
|
|
3127 |
!
|
|
3128 |
|
|
3129 |
tstInstStore2
|
|
3130 |
i1 := 1
|
|
3131 |
|
|
3132 |
"
|
|
3133 |
JITTest new tstInstStore2
|
|
3134 |
"
|
|
3135 |
|
|
3136 |
"Created: / 17.7.1998 / 16:45:51 / cg"
|
|
3137 |
!
|
|
3138 |
|
|
3139 |
tstInstStore3
|
|
3140 |
i1 := true
|
|
3141 |
|
|
3142 |
"
|
|
3143 |
JITTest new tstInstStore3
|
|
3144 |
"
|
|
3145 |
|
|
3146 |
"Created: / 17.7.1998 / 16:46:02 / cg"
|
|
3147 |
!
|
|
3148 |
|
|
3149 |
tstInstStore4
|
|
3150 |
i1 := false
|
|
3151 |
|
|
3152 |
"
|
|
3153 |
JITTest new tstInstStore4
|
|
3154 |
"
|
|
3155 |
|
|
3156 |
"Created: / 17.7.1998 / 16:46:32 / cg"
|
|
3157 |
!
|
|
3158 |
|
|
3159 |
tstInstStore5
|
|
3160 |
i1 := #at:put:
|
|
3161 |
|
|
3162 |
"
|
|
3163 |
JITTest new tstInstStore5
|
|
3164 |
"
|
|
3165 |
|
|
3166 |
"Created: / 17.7.1998 / 16:47:02 / cg"
|
|
3167 |
! !
|
|
3168 |
|
|
3169 |
!JITTest methodsFor:'tests - locals'!
|
|
3170 |
|
|
3171 |
tstLocal1
|
|
3172 |
|l1|
|
|
3173 |
|
|
3174 |
^ thisContext
|
|
3175 |
|
|
3176 |
"
|
|
3177 |
JITTest new testLocal1
|
|
3178 |
"
|
|
3179 |
|
|
3180 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3181 |
!
|
|
3182 |
|
|
3183 |
tstLocal2
|
|
3184 |
|l1 l2 l3|
|
|
3185 |
|
|
3186 |
l1 := 1.
|
|
3187 |
l2 := 2.
|
|
3188 |
l3 := 3.
|
|
3189 |
^ thisContext
|
|
3190 |
|
|
3191 |
"
|
|
3192 |
JITTest new testLocal2
|
|
3193 |
"
|
|
3194 |
|
|
3195 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3196 |
!
|
|
3197 |
|
|
3198 |
tstLocal3
|
|
3199 |
|l1|
|
|
3200 |
|
|
3201 |
^ l1
|
|
3202 |
|
|
3203 |
"
|
|
3204 |
JITTest new testLocal3
|
|
3205 |
"
|
|
3206 |
|
|
3207 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3208 |
!
|
|
3209 |
|
|
3210 |
tstLocal4
|
|
3211 |
|l1|
|
|
3212 |
|
|
3213 |
l1 := 1.
|
|
3214 |
^ l1
|
|
3215 |
|
|
3216 |
"
|
|
3217 |
JITTest new testLocal4
|
|
3218 |
"
|
|
3219 |
|
|
3220 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3221 |
!
|
|
3222 |
|
|
3223 |
tstLocal5
|
|
3224 |
|l1 l2|
|
|
3225 |
|
|
3226 |
l1 := nil.
|
|
3227 |
l2 := nil
|
|
3228 |
|
|
3229 |
"
|
|
3230 |
JITTest new testLocal5
|
|
3231 |
|
|
3232 |
|t|
|
|
3233 |
t := self new.
|
|
3234 |
Time millisecondsToRun:[
|
|
3235 |
1000000 timesRepeat:[t testLocal5]
|
|
3236 |
] 798 809 808 808 801 798 835
|
|
3237 |
"
|
|
3238 |
!
|
|
3239 |
|
|
3240 |
tstLocal6
|
|
3241 |
|l1 l2|
|
|
3242 |
|
|
3243 |
1000000 timesRepeat:[
|
|
3244 |
l1 := nil.
|
|
3245 |
l2 := nil
|
|
3246 |
]
|
|
3247 |
|
|
3248 |
"
|
|
3249 |
JITTest new testLocal5
|
|
3250 |
|
|
3251 |
|t|
|
|
3252 |
t := self new.
|
|
3253 |
Time millisecondsToRun:[
|
|
3254 |
t testLocal6
|
|
3255 |
] 38 37 38 38 38 61
|
|
3256 |
"
|
|
3257 |
! !
|
|
3258 |
|
|
3259 |
!JITTest methodsFor:'tests - return'!
|
|
3260 |
|
|
3261 |
tstBlock0
|
|
3262 |
^ [
|
|
3263 |
|l1|
|
|
3264 |
|
|
3265 |
l1 := 1.
|
|
3266 |
1
|
|
3267 |
|
|
3268 |
|
|
3269 |
"
|
|
3270 |
JITTest new testBlock0 value
|
|
3271 |
"
|
|
3272 |
|
|
3273 |
"Modified: / 3.6.1998 / 21:18:37 / cg"
|
|
3274 |
"Created: / 3.6.1998 / 21:45:26 / cg"
|
|
3275 |
]
|
|
3276 |
!
|
|
3277 |
|
|
3278 |
tstBlock1
|
|
3279 |
^ [:arg |
|
|
3280 |
|l1|
|
|
3281 |
|
|
3282 |
l1 := arg.
|
|
3283 |
arg
|
|
3284 |
|
|
3285 |
|
|
3286 |
"
|
|
3287 |
JITTest new testBlock1 value:1
|
|
3288 |
"
|
|
3289 |
|
|
3290 |
"Modified: / 3.6.1998 / 21:18:37 / cg"
|
|
3291 |
"Created: / 3.6.1998 / 21:44:26 / cg"
|
|
3292 |
]
|
|
3293 |
!
|
|
3294 |
|
|
3295 |
tstBlock10
|
|
3296 |
^ [:arg1 :arg2 :arg3 :arg4 :arg5 :arg6 :arg7 :arg8 :arg9 :arg10 |
|
|
3297 |
|l1|
|
|
3298 |
|
|
3299 |
l1 := arg10.
|
|
3300 |
arg10
|
|
3301 |
|
|
3302 |
|
|
3303 |
"
|
|
3304 |
JITTest new testBlock10
|
|
3305 |
valueWithArguments:#(1 2 3 4 5 6 7 8 9 10)
|
|
3306 |
"
|
|
3307 |
|
|
3308 |
"Modified: / 3.6.1998 / 23:22:04 / cg"
|
|
3309 |
"Created: / 3.6.1998 / 23:22:23 / cg"
|
|
3310 |
]
|
|
3311 |
!
|
|
3312 |
|
|
3313 |
tstBlock11
|
|
3314 |
^ [:arg1 :arg2 :arg3 :arg4 :arg5 :arg6 :arg7 :arg8 :arg9 :arg10 :arg11 |
|
|
3315 |
|l1|
|
|
3316 |
|
|
3317 |
l1 := arg11.
|
|
3318 |
arg11
|
|
3319 |
|
|
3320 |
|
|
3321 |
"
|
|
3322 |
JITTest new testBlock11
|
|
3323 |
valueWithArguments:#(1 2 3 4 5 6 7 8 9 10 11)
|
|
3324 |
"
|
|
3325 |
|
|
3326 |
"Modified: / 3.6.1998 / 23:22:04 / cg"
|
|
3327 |
"Created: / 3.6.1998 / 23:22:43 / cg"
|
|
3328 |
]
|
|
3329 |
!
|
|
3330 |
|
|
3331 |
tstBlock12
|
|
3332 |
^ [:arg1 :arg2 :arg3 :arg4 :arg5 :arg6 :arg7 :arg8 :arg9 :arg10 :arg11 :arg12 |
|
|
3333 |
|l1|
|
|
3334 |
|
|
3335 |
l1 := arg12.
|
|
3336 |
arg12
|
|
3337 |
|
|
3338 |
|
|
3339 |
"
|
|
3340 |
JITTest new testBlock12
|
|
3341 |
valueWithArguments:#(1 2 3 4 5 6 7 8 9 10 11 12)
|
|
3342 |
"
|
|
3343 |
|
|
3344 |
"Modified: / 3.6.1998 / 23:22:04 / cg"
|
|
3345 |
"Created: / 3.6.1998 / 23:23:01 / cg"
|
|
3346 |
]
|
|
3347 |
!
|
|
3348 |
|
|
3349 |
tstBlock13
|
|
3350 |
^ [:arg1 :arg2 :arg3 :arg4 :arg5 :arg6 :arg7 :arg8 :arg9 :arg10 :arg11 :arg12 :arg13 |
|
|
3351 |
|l1|
|
|
3352 |
|
|
3353 |
l1 := arg13.
|
|
3354 |
arg13
|
|
3355 |
|
|
3356 |
|
|
3357 |
"
|
|
3358 |
JITTest new testBlock13
|
|
3359 |
valueWithArguments:#(1 2 3 4 5 6 7 8 9 10 11 12 13)
|
|
3360 |
"
|
|
3361 |
|
|
3362 |
"Modified: / 3.6.1998 / 23:22:04 / cg"
|
|
3363 |
"Created: / 3.6.1998 / 23:23:21 / cg"
|
|
3364 |
]
|
|
3365 |
!
|
|
3366 |
|
|
3367 |
tstBlock2
|
|
3368 |
^ [:arg1 :arg2 |
|
|
3369 |
|l1|
|
|
3370 |
|
|
3371 |
l1 := arg2.
|
|
3372 |
arg2
|
|
3373 |
|
|
3374 |
|
|
3375 |
"
|
|
3376 |
JITTest new testBlock2 value:1 value:2
|
|
3377 |
"
|
|
3378 |
|
|
3379 |
"Created: / 3.6.1998 / 21:46:35 / cg"
|
|
3380 |
"Modified: / 3.6.1998 / 21:46:53 / cg"
|
|
3381 |
]
|
|
3382 |
!
|
|
3383 |
|
|
3384 |
tstBlock3
|
|
3385 |
^ [:arg1 :arg2 :arg3 |
|
|
3386 |
|l1|
|
|
3387 |
|
|
3388 |
l1 := arg3.
|
|
3389 |
arg3
|
|
3390 |
|
|
3391 |
|
|
3392 |
"
|
|
3393 |
JITTest new testBlock3 value:1 value:2 value:3
|
|
3394 |
"
|
|
3395 |
|
|
3396 |
"Modified: / 3.6.1998 / 21:18:37 / cg"
|
|
3397 |
"Created: / 3.6.1998 / 21:46:49 / cg"
|
|
3398 |
]
|
|
3399 |
!
|
|
3400 |
|
|
3401 |
tstBlock4
|
|
3402 |
^ [:arg1 :arg2 :arg3 :arg4 |
|
|
3403 |
|l1|
|
|
3404 |
|
|
3405 |
l1 := arg4.
|
|
3406 |
arg4
|
|
3407 |
|
|
3408 |
|
|
3409 |
"
|
|
3410 |
JITTest new testBlock4 value:1 value:2 value:3 value:4
|
|
3411 |
"
|
|
3412 |
|
|
3413 |
"Modified: / 3.6.1998 / 21:18:37 / cg"
|
|
3414 |
"Created: / 3.6.1998 / 21:47:07 / cg"
|
|
3415 |
]
|
|
3416 |
!
|
|
3417 |
|
|
3418 |
tstBlock5
|
|
3419 |
^ [:arg1 :arg2 :arg3 :arg4 :arg5 |
|
|
3420 |
|l1|
|
|
3421 |
|
|
3422 |
l1 := arg5.
|
|
3423 |
arg5
|
|
3424 |
|
|
3425 |
|
|
3426 |
"
|
|
3427 |
JITTest new testBlock5 value:1 value:2 value:3 value:4 value:5
|
|
3428 |
"
|
|
3429 |
|
|
3430 |
"Modified: / 3.6.1998 / 21:18:37 / cg"
|
|
3431 |
"Created: / 3.6.1998 / 21:47:23 / cg"
|
|
3432 |
]
|
|
3433 |
!
|
|
3434 |
|
|
3435 |
tstBlock7
|
|
3436 |
^ [:arg1 :arg2 :arg3 :arg4 :arg5 :arg6 :arg7 |
|
|
3437 |
|l1|
|
|
3438 |
|
|
3439 |
l1 := arg7.
|
|
3440 |
arg7
|
|
3441 |
|
|
3442 |
|
|
3443 |
"
|
|
3444 |
JITTest new testBlock7 value:1 value:2 value:3 value:4 value:5 value:6 value:7
|
|
3445 |
"
|
|
3446 |
|
|
3447 |
"Modified: / 3.6.1998 / 21:18:37 / cg"
|
|
3448 |
"Created: / 3.6.1998 / 21:47:53 / cg"
|
|
3449 |
]
|
|
3450 |
!
|
|
3451 |
|
|
3452 |
tstBlock8
|
|
3453 |
^ [:arg1 :arg2 :arg3 :arg4 :arg5 :arg6 :arg7 :arg8 |
|
|
3454 |
|l1|
|
|
3455 |
|
|
3456 |
l1 := arg8.
|
|
3457 |
arg8
|
|
3458 |
|
|
3459 |
|
|
3460 |
"
|
|
3461 |
JITTest new testBlock8 value:1 value:2 value:3 value:4 value:5 value:6 value:7 value:8
|
|
3462 |
"
|
|
3463 |
|
|
3464 |
"Created: / 3.6.1998 / 21:46:49 / cg"
|
|
3465 |
"Modified: / 3.6.1998 / 22:41:58 / cg"
|
|
3466 |
]
|
|
3467 |
!
|
|
3468 |
|
|
3469 |
tstBlock9
|
|
3470 |
^ [:arg1 :arg2 :arg3 :arg4 :arg5 :arg6 :arg7 :arg8 :arg9 |
|
|
3471 |
|l1|
|
|
3472 |
|
|
3473 |
l1 := arg9.
|
|
3474 |
arg9
|
|
3475 |
|
|
3476 |
|
|
3477 |
"
|
|
3478 |
JITTest new testBlock9
|
|
3479 |
valueWithArguments:#(1 2 3 4 5 6 7 8 9)
|
|
3480 |
"
|
|
3481 |
|
|
3482 |
"Created: / 3.6.1998 / 21:46:49 / cg"
|
|
3483 |
"Modified: / 3.6.1998 / 23:22:04 / cg"
|
|
3484 |
]
|
|
3485 |
!
|
|
3486 |
|
|
3487 |
tstBlockRet
|
|
3488 |
1 to:10 do:[:i |
|
|
3489 |
i == 5 ifTrue:[^ i]
|
|
3490 |
|
|
3491 |
|
|
3492 |
"
|
|
3493 |
JITTest new testBlockRet
|
|
3494 |
"
|
|
3495 |
|
|
3496 |
"Modified: / 3.6.1998 / 23:22:04 / cg"
|
|
3497 |
"Created: / 3.6.1998 / 23:23:21 / cg"
|
|
3498 |
]
|
|
3499 |
!
|
|
3500 |
|
|
3501 |
tstSelf1:a1 arg:a2 arg:a3 arg:a4
|
|
3502 |
^ self
|
|
3503 |
|
|
3504 |
"
|
|
3505 |
JITTest new testSelf1:1 arg:2 arg:3 arg:4
|
|
3506 |
JITTest new testSelf1:0 arg:1 arg:2 arg:3
|
|
3507 |
"
|
|
3508 |
|
|
3509 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3510 |
!
|
|
3511 |
|
|
3512 |
tstSelf2:a1 arg:a2 arg:a3 arg:a4
|
|
3513 |
|local1|
|
|
3514 |
|
|
3515 |
^ self
|
|
3516 |
|
|
3517 |
"
|
|
3518 |
JITTest new testSelf2:1 arg:2 arg:3 arg:4
|
|
3519 |
JITTest new testSelf2:0 arg:1 arg:2 arg:3
|
|
3520 |
"
|
|
3521 |
|
|
3522 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3523 |
!
|
|
3524 |
|
|
3525 |
tstSelf3:a1 arg:a2 arg:a3 arg:a4
|
|
3526 |
|local1|
|
|
3527 |
|
|
3528 |
local1 := 1.
|
|
3529 |
^ self
|
|
3530 |
|
|
3531 |
"
|
|
3532 |
JITTest new testSelf3:1 arg:2 arg:3 arg:4
|
|
3533 |
JITTest new testSelf3:0 arg:1 arg:2 arg:3
|
|
3534 |
"
|
|
3535 |
|
|
3536 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3537 |
!
|
|
3538 |
|
|
3539 |
tstSelf3_1:a1 arg:a2 arg:a3
|
|
3540 |
^ self
|
|
3541 |
|
|
3542 |
"
|
|
3543 |
JITTest new testSelf3_1:1 arg:2 arg:3
|
|
3544 |
JITTest new testSelf3_1:0 arg:1 arg:2
|
|
3545 |
"
|
|
3546 |
|
|
3547 |
"Modified: / 3.6.1998 / 21:18:37 / cg"
|
|
3548 |
"Created: / 3.6.1998 / 21:19:14 / cg"
|
|
3549 |
!
|
|
3550 |
|
|
3551 |
tstSelf3_2:a1 arg:a2 arg:a3
|
|
3552 |
|local1|
|
|
3553 |
|
|
3554 |
^ self
|
|
3555 |
|
|
3556 |
"
|
|
3557 |
JITTest new testSelf3_2:1 arg:2 arg:3
|
|
3558 |
JITTest new testSelf3_2:0 arg:1 arg:2
|
|
3559 |
"
|
|
3560 |
|
|
3561 |
"Created: / 3.6.1998 / 21:19:23 / cg"
|
|
3562 |
!
|
|
3563 |
|
|
3564 |
tstSelf3_3:a1 arg:a2 arg:a3
|
|
3565 |
|local1|
|
|
3566 |
|
|
3567 |
local1 := 1.
|
|
3568 |
^ self
|
|
3569 |
|
|
3570 |
"
|
|
3571 |
JITTest new testSelf3_3:1 arg:2 arg:3
|
|
3572 |
JITTest new testSelf3_3:0 arg:1 arg:2
|
|
3573 |
"
|
|
3574 |
|
|
3575 |
"Created: / 3.6.1998 / 21:19:34 / cg"
|
|
3576 |
!
|
|
3577 |
|
|
3578 |
tstSelf3_4:a1 arg:a2 arg:a3
|
|
3579 |
|local1|
|
|
3580 |
|
|
3581 |
local1 := self.
|
|
3582 |
^ local1
|
|
3583 |
|
|
3584 |
"
|
|
3585 |
JITTest new testSelf3_4:1 arg:2 arg:3
|
|
3586 |
JITTest new testSelf3_4:0 arg:1 arg:2
|
|
3587 |
"
|
|
3588 |
|
|
3589 |
"Created: / 3.6.1998 / 21:19:44 / cg"
|
|
3590 |
!
|
|
3591 |
|
|
3592 |
tstSelf4:a1 arg:a2 arg:a3 arg:a4
|
|
3593 |
|local1|
|
|
3594 |
|
|
3595 |
local1 := self.
|
|
3596 |
^ local1
|
|
3597 |
|
|
3598 |
"
|
|
3599 |
JITTest new testSelf4:1 arg:2 arg:3 arg:4
|
|
3600 |
JITTest new testSelf4:0 arg:1 arg:2 arg:3
|
|
3601 |
"
|
|
3602 |
|
|
3603 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3604 |
!
|
|
3605 |
|
|
3606 |
tstSelf4_1:a1 arg:a2 arg:a3 arg:a4
|
|
3607 |
^ self
|
|
3608 |
|
|
3609 |
"
|
|
3610 |
JITTest new testSelf4_1:1 arg:2 arg:3 arg:4
|
|
3611 |
JITTest new testSelf4_1:0 arg:1 arg:2 arg:3
|
|
3612 |
"
|
|
3613 |
|
|
3614 |
"Created: / 3.6.1998 / 21:18:26 / cg"
|
|
3615 |
"Modified: / 3.6.1998 / 21:18:37 / cg"
|
|
3616 |
!
|
|
3617 |
|
|
3618 |
tstSelf4_2:a1 arg:a2 arg:a3 arg:a4
|
|
3619 |
|local1|
|
|
3620 |
|
|
3621 |
^ self
|
|
3622 |
|
|
3623 |
"
|
|
3624 |
JITTest new testSelf4_2:1 arg:2 arg:3 arg:4
|
|
3625 |
JITTest new testSelf4_2:0 arg:1 arg:2 arg:3
|
|
3626 |
"
|
|
3627 |
|
|
3628 |
"Created: / 3.6.1998 / 21:18:33 / cg"
|
|
3629 |
!
|
|
3630 |
|
|
3631 |
tstSelf4_3:a1 arg:a2 arg:a3 arg:a4
|
|
3632 |
|local1|
|
|
3633 |
|
|
3634 |
local1 := 1.
|
|
3635 |
^ self
|
|
3636 |
|
|
3637 |
"
|
|
3638 |
JITTest new testSelf4_3:1 arg:2 arg:3 arg:4
|
|
3639 |
JITTest new testSelf4_3:0 arg:1 arg:2 arg:3
|
|
3640 |
"
|
|
3641 |
|
|
3642 |
"Created: / 3.6.1998 / 21:18:42 / cg"
|
|
3643 |
!
|
|
3644 |
|
|
3645 |
tstSelf4_4:a1 arg:a2 arg:a3 arg:a4
|
|
3646 |
|local1|
|
|
3647 |
|
|
3648 |
local1 := self.
|
|
3649 |
^ local1
|
|
3650 |
|
|
3651 |
"
|
|
3652 |
JITTest new testSelf4_4:1 arg:2 arg:3 arg:4
|
|
3653 |
JITTest new testSelf4_4:0 arg:1 arg:2 arg:3
|
|
3654 |
"
|
|
3655 |
|
|
3656 |
"Created: / 3.6.1998 / 21:18:46 / cg"
|
|
3657 |
! !
|
|
3658 |
|
|
3659 |
!JITTest methodsFor:'tests - sends'!
|
|
3660 |
|
|
3661 |
ilcTest1
|
|
3662 |
"check ilc caching"
|
|
3663 |
|
|
3664 |
|arr i|
|
|
3665 |
|
|
3666 |
arr := Array new:10000.
|
|
3667 |
1 to:10000 do:[:i |
|
|
3668 |
i odd ifTrue:[
|
|
3669 |
arr at:i put:FooClass new
|
|
3670 |
] ifFalse:[
|
|
3671 |
arr at:i put:BarClass new.
|
|
3672 |
]
|
|
3673 |
].
|
|
3674 |
|
|
3675 |
i := 1.
|
|
3676 |
[i <= 10] whileTrue:[
|
|
3677 |
|el expect|
|
|
3678 |
|
|
3679 |
i printCR.
|
|
3680 |
el := arr at:i.
|
|
3681 |
el printCR.
|
|
3682 |
|
|
3683 |
i odd ifTrue:[
|
|
3684 |
expect := #Foo
|
|
3685 |
] ifFalse:[
|
|
3686 |
expect := #Bar
|
|
3687 |
].
|
|
3688 |
expect printCR.
|
|
3689 |
el whatAreYou ~~ expect ifTrue:[
|
|
3690 |
"/ self halt
|
|
3691 |
].
|
|
3692 |
i print. ' ' print. el printCR.
|
|
3693 |
i := i + 1.
|
|
3694 |
].
|
|
3695 |
|
|
3696 |
"/ i := 1.
|
|
3697 |
"/ [i <= arr size] whileTrue:[
|
|
3698 |
"/ |el expect|
|
|
3699 |
"/
|
|
3700 |
"/ el := arr at:i.
|
|
3701 |
"/
|
|
3702 |
"/ i odd ifTrue:[
|
|
3703 |
"/ expect := #Foo
|
|
3704 |
"/ ] ifFalse:[
|
|
3705 |
"/ expect := #Bar
|
|
3706 |
"/ ].
|
|
3707 |
"/ el whatAreYou ~~ expect ifTrue:[
|
|
3708 |
"/ self halt
|
|
3709 |
"/ ].
|
|
3710 |
"/i print. ' ' print. el printCR.
|
|
3711 |
"/ i := i + 1.
|
|
3712 |
"/ ].
|
|
3713 |
"/
|
|
3714 |
"/ 1 to:arr size do:[:i |
|
|
3715 |
"/ |el expect|
|
|
3716 |
"/
|
|
3717 |
"/ el := arr at:i.
|
|
3718 |
"/
|
|
3719 |
"/ i odd ifTrue:[
|
|
3720 |
"/ expect := #Foo
|
|
3721 |
"/ ] ifFalse:[
|
|
3722 |
"/ expect := #Bar
|
|
3723 |
"/ ].
|
|
3724 |
"/ el whatAreYou ~~ expect ifTrue:[
|
|
3725 |
"/ self halt
|
|
3726 |
"/ ].
|
|
3727 |
"/i print. ' ' print. el printCR.
|
|
3728 |
"/ ].
|
|
3729 |
"/
|
|
3730 |
"/ arr keysAndValuesDo:[:i :el |
|
|
3731 |
"/ |expect|
|
|
3732 |
"/
|
|
3733 |
"/ i odd ifTrue:[
|
|
3734 |
"/ expect := #Foo
|
|
3735 |
"/ ] ifFalse:[
|
|
3736 |
"/ expect := #Bar
|
|
3737 |
"/ ].
|
|
3738 |
"/ el whatAreYou ~~ expect ifTrue:[
|
|
3739 |
"/ self halt
|
|
3740 |
"/ ].
|
|
3741 |
"/i print. ' ' print. el printCR.
|
|
3742 |
"/ ].
|
|
3743 |
|
|
3744 |
"
|
|
3745 |
JITTest new ilcTest1
|
|
3746 |
Time millisecondsToRun:[self new ilcTest1]
|
|
3747 |
"
|
|
3748 |
|
|
3749 |
"Modified: / 4.6.1998 / 12:13:27 / cg"
|
|
3750 |
!
|
|
3751 |
|
|
3752 |
ilcTest1b
|
|
3753 |
"check ilc caching"
|
|
3754 |
|
|
3755 |
|el1 el2|
|
|
3756 |
|
|
3757 |
el1 := FooClass new.
|
|
3758 |
el2 := BarClass new.
|
|
3759 |
|
|
3760 |
el1 whatAreYou printCR. el2 whatAreYou printCR. el1 whatAreYou printCR. el2 whatAreYou printCR.
|
|
3761 |
|
|
3762 |
"
|
|
3763 |
JITTest new ilcTest1b
|
|
3764 |
"
|
|
3765 |
|
|
3766 |
"Modified: / 4.6.1998 / 12:13:27 / cg"
|
|
3767 |
!
|
|
3768 |
|
|
3769 |
ilcTest1c
|
|
3770 |
"check simple send"
|
|
3771 |
|
|
3772 |
|el|
|
|
3773 |
|
|
3774 |
el := FooClass new.
|
|
3775 |
el whatAreYou printCR.
|
|
3776 |
el whatAreYou printCR.
|
|
3777 |
|
|
3778 |
"
|
|
3779 |
JITTest new ilcTest1c
|
|
3780 |
"
|
|
3781 |
|
|
3782 |
"Modified: / 4.6.1998 / 12:13:27 / cg"
|
|
3783 |
!
|
|
3784 |
|
|
3785 |
ilcTest1d
|
|
3786 |
"check simple send"
|
|
3787 |
|
|
3788 |
|el1 el2|
|
|
3789 |
|
|
3790 |
el1 := FooClass new.
|
|
3791 |
el2 := BarClass new.
|
|
3792 |
el1 whatAreYou printCR.
|
|
3793 |
el2 whatAreYou printCR.
|
|
3794 |
el1 whatAreYou printCR.
|
|
3795 |
el2 whatAreYou printCR.
|
|
3796 |
|
|
3797 |
"
|
|
3798 |
JITTest new ilcTest1d
|
|
3799 |
"
|
|
3800 |
|
|
3801 |
"Modified: / 4.6.1998 / 12:13:27 / cg"
|
|
3802 |
!
|
|
3803 |
|
|
3804 |
tst44:arg
|
|
3805 |
|l1 l2|
|
|
3806 |
|
|
3807 |
l1 := 1.
|
|
3808 |
l2 := 2.
|
|
3809 |
^ l1 + l2 + arg + 1
|
|
3810 |
|
|
3811 |
"
|
|
3812 |
JITTest new tst44:3
|
|
3813 |
"
|
|
3814 |
|
|
3815 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3816 |
!
|
|
3817 |
|
|
3818 |
tst50
|
|
3819 |
self tst51
|
|
3820 |
|
|
3821 |
"
|
|
3822 |
JITTest new tst50
|
|
3823 |
"
|
|
3824 |
|
|
3825 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3826 |
!
|
|
3827 |
|
|
3828 |
tst51
|
|
3829 |
self abs
|
|
3830 |
|
|
3831 |
"
|
|
3832 |
JITTest new tst51
|
|
3833 |
"
|
|
3834 |
|
|
3835 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3836 |
!
|
|
3837 |
|
|
3838 |
tst52
|
|
3839 |
^ self abs
|
|
3840 |
|
|
3841 |
"
|
|
3842 |
JITTest new tst52
|
|
3843 |
"
|
|
3844 |
|
|
3845 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3846 |
!
|
|
3847 |
|
|
3848 |
tst53:arg1 with:arg2
|
|
3849 |
^ arg1 abs + arg2 abs
|
|
3850 |
|
|
3851 |
"
|
|
3852 |
JITTest new tst53:5 with:7
|
|
3853 |
JITTest new tst53:-5 with:7
|
|
3854 |
JITTest new tst53:5 with:-7
|
|
3855 |
JITTest new tst53:-5 with:-7
|
|
3856 |
"
|
|
3857 |
|
|
3858 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3859 |
!
|
|
3860 |
|
|
3861 |
tst54
|
|
3862 |
'hello' printCR
|
|
3863 |
|
|
3864 |
"
|
|
3865 |
JITTest new tst54
|
|
3866 |
"
|
|
3867 |
|
|
3868 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3869 |
!
|
|
3870 |
|
|
3871 |
tstILC1
|
|
3872 |
|x|
|
|
3873 |
|
|
3874 |
1 to:4 do:[:i |
|
|
3875 |
i == 1 ifTrue:[
|
|
3876 |
x := self
|
|
3877 |
].
|
|
3878 |
i == 2 ifTrue:[
|
|
3879 |
x := nil
|
|
3880 |
].
|
|
3881 |
i == 3 ifTrue:[x := 1].
|
|
3882 |
i == 4 ifTrue:[
|
|
3883 |
x := true
|
|
3884 |
].
|
|
3885 |
x tstInstStore1
|
|
3886 |
|
|
3887 |
"
|
|
3888 |
JITTest new tstILC1
|
|
3889 |
"
|
|
3890 |
|
|
3891 |
"Created: / 16.8.1996 / 17:39:44 / cg"
|
|
3892 |
"Modified: / 17.7.1998 / 16:45:27 / cg"
|
|
3893 |
]
|
|
3894 |
!
|
|
3895 |
|
|
3896 |
tstPlus1
|
|
3897 |
|l1 l2|
|
|
3898 |
|
|
3899 |
l1 := 1.
|
|
3900 |
l2 := 2.
|
|
3901 |
^ l1 + l2
|
|
3902 |
|
|
3903 |
"
|
|
3904 |
JITTest new tstPlus1
|
|
3905 |
"
|
|
3906 |
|
|
3907 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3908 |
!
|
|
3909 |
|
|
3910 |
tstPlusArg1:arg
|
|
3911 |
^ arg + 1
|
|
3912 |
|
|
3913 |
"
|
|
3914 |
JITTest new tstPlusArg1:1
|
|
3915 |
JITTest new tstPlusArg1:SmallInteger maxVal
|
|
3916 |
"
|
|
3917 |
|
|
3918 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3919 |
!
|
|
3920 |
|
|
3921 |
tstPlusUndef1
|
|
3922 |
|l1 l2|
|
|
3923 |
|
|
3924 |
^ l1 + l2
|
|
3925 |
|
|
3926 |
"
|
|
3927 |
JITTest new tstPlusUndef1
|
|
3928 |
"
|
|
3929 |
|
|
3930 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3931 |
!
|
|
3932 |
|
|
3933 |
tstPlusUndef2
|
|
3934 |
|l1 l2|
|
|
3935 |
|
|
3936 |
l1 := 1.
|
|
3937 |
^ l1 + l2
|
|
3938 |
|
|
3939 |
"
|
|
3940 |
JITTest new tstPlusUndef2
|
|
3941 |
"
|
|
3942 |
|
|
3943 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3944 |
!
|
|
3945 |
|
|
3946 |
tstPlusUndef3
|
|
3947 |
|l1 l2|
|
|
3948 |
|
|
3949 |
l1 := 1.
|
|
3950 |
^ l1 + l2
|
|
3951 |
|
|
3952 |
"
|
|
3953 |
JITTest new tstPlusUndef3
|
|
3954 |
"
|
|
3955 |
|
|
3956 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3957 |
!
|
|
3958 |
|
|
3959 |
tstSend2
|
|
3960 |
^ self tstSend2Helper:1 with:2
|
|
3961 |
|
|
3962 |
"
|
|
3963 |
JITTest new tstSend2
|
|
3964 |
JITTest new tstSend3
|
|
3965 |
JITTest new tstSend2Helper:1 with:2
|
|
3966 |
JITTest new tstSend2Helper2:1 with:2
|
|
3967 |
"
|
|
3968 |
|
|
3969 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3970 |
!
|
|
3971 |
|
|
3972 |
tstSend2Helper2:arg1 with:arg2
|
|
3973 |
^ arg2
|
|
3974 |
|
|
3975 |
"
|
|
3976 |
JITTest new tstSend3
|
|
3977 |
"
|
|
3978 |
|
|
3979 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3980 |
!
|
|
3981 |
|
|
3982 |
tstSend2Helper:arg1 with:arg2
|
|
3983 |
^ arg1
|
|
3984 |
|
|
3985 |
"
|
|
3986 |
JITTest new tstSend2
|
|
3987 |
"
|
|
3988 |
|
|
3989 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
3990 |
!
|
|
3991 |
|
|
3992 |
tstSend3
|
|
3993 |
^ self tstSend2Helper2:1 with:2
|
|
3994 |
|
|
3995 |
"
|
|
3996 |
JITTest new tstSend3
|
|
3997 |
"
|
|
3998 |
|
|
3999 |
"Created: 16.8.1996 / 17:39:44 / cg"
|
|
4000 |
! !
|
|
4001 |
|
|
4002 |
!JITTest::BarClass methodsFor:'queries'!
|
|
4003 |
|
|
4004 |
whatAreYou
|
|
4005 |
^ #Bar
|
|
4006 |
|
|
4007 |
"Created: / 4.6.1998 / 12:05:50 / cg"
|
|
4008 |
!
|
|
4009 |
|
|
4010 |
whatAreYou2
|
920
|
4011 |
^ (self class nameWithoutPrefix copyButLast:5) asSymbol
|
108
|
4012 |
|
|
4013 |
"Created: / 4.6.1998 / 12:08:34 / cg"
|
|
4014 |
"Modified: / 4.6.1998 / 12:10:15 / cg"
|
|
4015 |
! !
|
|
4016 |
|
|
4017 |
!JITTest::FooClass methodsFor:'queries'!
|
|
4018 |
|
|
4019 |
whatAreYou
|
|
4020 |
^ #Foo
|
|
4021 |
|
|
4022 |
"Created: / 4.6.1998 / 12:05:58 / cg"
|
|
4023 |
!
|
|
4024 |
|
|
4025 |
whatAreYou2
|
920
|
4026 |
^ (self class nameWithoutPrefix copyButLast:5) asSymbol
|
108
|
4027 |
|
|
4028 |
"Created: / 4.6.1998 / 12:08:59 / cg"
|
|
4029 |
"Modified: / 4.6.1998 / 12:10:19 / cg"
|
|
4030 |
! !
|
|
4031 |
|
|
4032 |
!JITTest class methodsFor:'documentation'!
|
|
4033 |
|
|
4034 |
version
|
|
4035 |
^ '$Header$'
|
685
|
4036 |
!
|
|
4037 |
|
|
4038 |
version_CVS
|
|
4039 |
^ '$Header$'
|
108
|
4040 |
! !
|
920
|
4041 |
|