-
Notifications
You must be signed in to change notification settings - Fork 68
/
SpurSegmentInfo.class.st
137 lines (108 loc) · 2.73 KB
/
SpurSegmentInfo.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
Class {
#name : #SpurSegmentInfo,
#superclass : #VMStructType,
#instVars : [
'segStart',
'segSize',
'swizzle',
'containsPinned',
'savedSegSize',
'lastFreeObject'
],
#category : #'VMMaker-SpurMemoryManager'
}
{ #category : #translation }
SpurSegmentInfo class >> instVarNamesAndTypesForTranslationDo: aBinaryBlock [
"Enumerate aBinaryBlock with the names and C type strings for the inst vars to include in the typedef for the reciever."
"self typedef"
self instVarNames do:
[:ivn|
aBinaryBlock
value: ivn
value: (ivn caseOf: {
['swizzle'] -> [#sqInt].
['savedSegSize'] -> [#'size_t'].
['segSize'] -> [#'size_t'].
} otherwise: [ #usqInt ])]
]
{ #category : #accessing }
SpurSegmentInfo >> containsPinned [
"Answer the value of containsPinned"
^ containsPinned
]
{ #category : #accessing }
SpurSegmentInfo >> containsPinned: anObject [
"Set the value of containsPinned"
^containsPinned := anObject
]
{ #category : #initialization }
SpurSegmentInfo >> initialize [
segSize := segStart := swizzle := 0.
containsPinned := false
]
{ #category : #accessing }
SpurSegmentInfo >> lastFreeObject [
"Answer the value of lastFreeObject"
^ lastFreeObject
]
{ #category : #accessing }
SpurSegmentInfo >> lastFreeObject: anObject [
"Set the value of lastFreeObject"
^lastFreeObject := anObject
]
{ #category : #printing }
SpurSegmentInfo >> printOn: aStream [
<doNotGenerate>
super printOn: aStream.
(self class instVarNames copyReplaceAll: #('segSize') with: #('segSize' 'segLimit')) do:
[:name| | iv |
iv := self perform: name asSymbol.
aStream space; nextPutAll: name; space; print: iv.
(iv isInteger and: [iv ~= 0]) ifTrue:
[aStream nextPut: $/. iv storeOn: aStream base: 16]]
]
{ #category : #accessing }
SpurSegmentInfo >> savedSegSize [
"Answer the value of savedSegSize"
^ savedSegSize
]
{ #category : #accessing }
SpurSegmentInfo >> savedSegSize: anObject [
"Set the value of savedSegSize"
^savedSegSize := anObject
]
{ #category : #accessing }
SpurSegmentInfo >> segLimit [
<returnTypeC: #usqInt>
^segSize + segStart
]
{ #category : #accessing }
SpurSegmentInfo >> segSize [
"Answer the value of segSize"
^ segSize
]
{ #category : #accessing }
SpurSegmentInfo >> segSize: anObject [
"Set the value of segSize"
^segSize := anObject
]
{ #category : #accessing }
SpurSegmentInfo >> segStart [
"Answer the value of segStart"
^ segStart
]
{ #category : #accessing }
SpurSegmentInfo >> segStart: anObject [
"Set the value of segStart"
^segStart := anObject
]
{ #category : #accessing }
SpurSegmentInfo >> swizzle [
"Answer the value of swizzle"
^ swizzle
]
{ #category : #accessing }
SpurSegmentInfo >> swizzle: anObject [
"Set the value of swizzle"
^swizzle := anObject
]