-
Notifications
You must be signed in to change notification settings - Fork 68
/
VMSimpleStackBasedCogitCoggedMethods.class.st
59 lines (43 loc) · 1.95 KB
/
VMSimpleStackBasedCogitCoggedMethods.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
56
57
58
59
Class {
#name : #VMSimpleStackBasedCogitCoggedMethods,
#superclass : #VMSimpleStackBasedCogitAbstractTest,
#pools : [
'CogMethodConstants'
],
#category : #'VMMakerTests-JitTests'
}
{ #category : #running }
VMSimpleStackBasedCogitCoggedMethods >> setUp [
super setUp.
self setUpCogMethodEntry.
]
{ #category : #tests }
VMSimpleStackBasedCogitCoggedMethods >> testUsingEntryOffsetChecksClassRegisterAndContinue [
| cogMethod otherBlock |
otherBlock := self compile: [ cogit Nop ].
cogMethod := self generateCogMethod: [ cogit Jump: otherBlock ] selector: memory falseObject.
"Let's set the receiver class index in the classRegister"
machineSimulator classRegisterValue: (memory classIndexOf: memory nilObject).
self runFrom: cogMethod address + cogit entryOffset until: otherBlock.
self assert: machineSimulator instructionPointerRegisterValue equals: otherBlock
]
{ #category : #tests }
VMSimpleStackBasedCogitCoggedMethods >> testUsingEntryOffsetChecksClassRegisterAndGoesToAbort [
| cogMethod otherBlock |
otherBlock := self compile: [ cogit Nop ].
cogMethod := self generateCogMethod: [ cogit Jump: otherBlock ] selector: memory falseObject.
"Let's set any value in the ClassRegister"
machineSimulator classRegisterValue: 16rFF.
self runFrom: cogMethod address + cogit entryOffset until: cogit ceMethodAbortTrampoline.
self assert: machineSimulator instructionPointerRegisterValue equals: cogit ceMethodAbortTrampoline
]
{ #category : #tests }
VMSimpleStackBasedCogitCoggedMethods >> testUsingNoCheckEntryDoesNotCheckClassTag [
| cogMethod otherBlock |
otherBlock := self compile: [ cogit Nop ].
cogMethod := self generateCogMethod: [ cogit Jump: otherBlock ] selector: memory falseObject.
"Let's set any value in the ClassRegister"
machineSimulator classRegisterValue: 16rFF.
self runFrom: cogMethod address + cogit noCheckEntryOffset until: otherBlock.
self assert: machineSimulator instructionPointerRegisterValue equals: otherBlock
]