-
Notifications
You must be signed in to change notification settings - Fork 68
/
CogStackPageSurrogate64.class.st
152 lines (128 loc) · 4.44 KB
/
CogStackPageSurrogate64.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
"
Here's a doit to generate most of my code:
| offset crtab |
offset := 1.
crtab := String with: Character cr with: Character tab.
CogStackPage instVarNamesAndTypesForTranslationDo:
[:name :type| | isByte |
isByte := type = 'unsigned char'.
CogStackPageSurrogate64
compile: name, crtab, '^memory unsigned', (isByte ifTrue: ['ByteAt:'] ifFalse: ['LongLongAt:']), ' address + ', offset printString
classified: #accessing.
CogStackPageSurrogate64
compile: name, ': aValue', crtab, '^memory unsigned', (isByte ifTrue: ['ByteAt:'] ifFalse: ['LongLongAt:']), ' address + ', offset printString,
' put: aValue'
classified: #accessing.
offset := offset + (isByte ifTrue: [1] ifFalse: [8])].
CogStackPageSurrogate64 class compile: 'alignedByteSize', crtab, '^', (offset - 1 + 3 bitAnd: -4) printString classified: #'instance creation'
"
Class {
#name : #CogStackPageSurrogate64,
#superclass : #CogStackPageSurrogate,
#category : #'VMMaker-JITSimulation'
}
{ #category : #accessing }
CogStackPageSurrogate64 class >> alignedByteSize [
^80
]
{ #category : #accessing }
CogStackPageSurrogate64 >> baseAddress [
^memory unsignedLong64At: address + 33
]
{ #category : #accessing }
CogStackPageSurrogate64 >> baseAddress: aValue [
self assert: (address + 32 >= zoneBase and: [address + 39 < zoneLimit]).
^memory unsignedLong64At: address + 33 put: aValue
]
{ #category : #accessing }
CogStackPageSurrogate64 >> baseFP [
^memory unsignedLong64At: address + 25
]
{ #category : #accessing }
CogStackPageSurrogate64 >> baseFP: aValue [
self assert: (address + 24 >= zoneBase and: [address + 31 < zoneLimit]).
^memory unsignedLong64At: address + 25 put: aValue
]
{ #category : #accessing }
CogStackPageSurrogate64 >> headFP [
^memory unsignedLong64At: address + 17
]
{ #category : #accessing }
CogStackPageSurrogate64 >> headFP: aValue [
self assert: (address + 16 >= zoneBase and: [address + 23 < zoneLimit]).
^memory unsignedLong64At: address + 17 put: aValue
]
{ #category : #accessing }
CogStackPageSurrogate64 >> headSP [
^memory unsignedLong64At: address + 9
]
{ #category : #accessing }
CogStackPageSurrogate64 >> headSP: aValue [
self assert: (address + 8 >= zoneBase and: [address + 15 < zoneLimit]).
^memory unsignedLong64At: address + 9 put: aValue
]
{ #category : #accessing }
CogStackPageSurrogate64 >> lastAddress [
^memory unsignedLong64At: address + 49
]
{ #category : #accessing }
CogStackPageSurrogate64 >> lastAddress: aValue [
self assert: (address + 48 >= zoneBase and: [address + 55 < zoneLimit]).
^memory unsignedLong64At: address + 49 put: aValue
]
{ #category : #accessing }
CogStackPageSurrogate64 >> nextPage [
^stackPages surrogateAtAddress: (memory unsignedLong64At: address + 65)
]
{ #category : #accessing }
CogStackPageSurrogate64 >> nextPage: aValue [
self assert: (address + 64 >= zoneBase and: [address + 71 < zoneLimit]).
memory unsignedLong64At: address + 65 put: aValue asInteger.
^aValue
]
{ #category : #accessing }
CogStackPageSurrogate64 >> padToWord [
^memory longAt: address + 61
]
{ #category : #accessing }
CogStackPageSurrogate64 >> padToWord: aValue [
self assert: (address + 60 >= zoneBase and: [address + 63 < zoneLimit]).
^memory longAt: address + 61 put: aValue
]
{ #category : #accessing }
CogStackPageSurrogate64 >> prevPage [
^stackPages surrogateAtAddress: (memory unsignedLong64At: address + 73)
]
{ #category : #accessing }
CogStackPageSurrogate64 >> prevPage: aValue [
self assert: (address + 72 >= zoneBase and: [address + 79 < zoneLimit]).
memory unsignedLong64At: address + 73 put: aValue asInteger.
^aValue
]
{ #category : #accessing }
CogStackPageSurrogate64 >> realStackLimit [
^memory unsignedLong64At: address + 41
]
{ #category : #accessing }
CogStackPageSurrogate64 >> realStackLimit: aValue [
self assert: (address + 40 >= zoneBase and: [address + 47 < zoneLimit]).
^memory unsignedLong64At: address + 41 put: aValue
]
{ #category : #accessing }
CogStackPageSurrogate64 >> stackLimit [
^memory unsignedLong64At: address + 1
]
{ #category : #accessing }
CogStackPageSurrogate64 >> stackLimit: aValue [
self assert: (address + 0 >= zoneBase and: [address + 7 < zoneLimit]).
^memory unsignedLong64At: address + 1 put: aValue
]
{ #category : #accessing }
CogStackPageSurrogate64 >> trace [
^memory longAt: address + 57
]
{ #category : #accessing }
CogStackPageSurrogate64 >> trace: aValue [
self assert: (address + 56 >= zoneBase and: [address + 59 < zoneLimit]).
^memory longAt: address + 57 put: aValue
]