-
Notifications
You must be signed in to change notification settings - Fork 65
/
VMJittedPrimitiveAtPutTest.class.st
55 lines (40 loc) · 1.28 KB
/
VMJittedPrimitiveAtPutTest.class.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Class {
#name : #VMJittedPrimitiveAtPutTest,
#superclass : #VMJittedPrimitivesTest,
#instVars : [
'stop'
],
#category : #'VMMakerTests-JitTests'
}
{ #category : #running }
VMJittedPrimitiveAtPutTest >> setUp [
super setUp.
self setUpTrampolines.
cogInitialAddress := self
compile: [
cogit objectRepresentation genPrimitiveAtPut.
stop := cogit Stop ]
bytecodes: 10.
]
{ #category : #running }
VMJittedPrimitiveAtPutTest >> setUpTrampolines [
super setUpTrampolines.
cogit ceStoreCheckTrampoline: (self compileTrampoline: [ cogit RetN: 0 ] named: #ceStoreCheckTrampoline).
]
{ #category : #tests }
VMJittedPrimitiveAtPutTest >> testPrimitiveAtPut32bitIndexableWithLargeNumberShouldStoreValue [
| integerArray offset expectedValue |
"In 32bits it should fall through, as it will need to store a LargePositiveInteger"
wordSize = 8 ifFalse: [ ^ self skip ].
integerArray := self new32BitIndexableOfSize: 3.
offset := 2.
expectedValue := 16rFFFFFFFF.
self
prepareStackForSendReceiver: integerArray
arguments: { memory integerObjectOf: offset. memory integerObjectOf: expectedValue }.
machineSimulator baseRegisterValue: cogit varBaseAddress.
self runUntilReturn.
self
assert: (memory fetchLong32: offset - 1 ofObject: integerArray)
equals: expectedValue
]