-
Notifications
You must be signed in to change notification settings - Fork 67
/
VMStackPageSurrogate.class.st
75 lines (64 loc) · 1.52 KB
/
VMStackPageSurrogate.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
Class {
#name : #VMStackPageSurrogate,
#superclass : #Object,
#instVars : [
'address',
'stackPages',
'memory',
'zoneBase',
'zoneLimit'
],
#category : #'VMMaker-InterpreterSimulation'
}
{ #category : #comparing }
VMStackPageSurrogate >> = aThing [
^aThing class = self class
and: [aThing address = address]
]
{ #category : #accessing }
VMStackPageSurrogate >> address [
^address
]
{ #category : #'instance initialization' }
VMStackPageSurrogate >> address: theAddress simulator: aCoInterpreterSimulator zoneBase: base zoneLimit: limit [
address := theAddress.
stackPages := aCoInterpreterSimulator stackPages.
memory := aCoInterpreterSimulator memoryManager.
zoneBase := base.
zoneLimit := limit
]
{ #category : #testing }
VMStackPageSurrogate >> addressIsInPage: address [
"For assert-checking"
^self lastAddress < address and: [address < self baseAddress]
]
{ #category : #accessing }
VMStackPageSurrogate >> asInteger [
^address
]
{ #category : #accessing }
VMStackPageSurrogate >> asIntegerPtr [
^address
]
{ #category : #accessing }
VMStackPageSurrogate >> asUnsignedInteger [
^address
]
{ #category : #accessing }
VMStackPageSurrogate >> asUnsignedIntegerPtr [
^address
]
{ #category : #comparing }
VMStackPageSurrogate >> hash [
^address hash
]
{ #category : #testing }
VMStackPageSurrogate >> isFree [
^self baseFP = 0
]
{ #category : #printing }
VMStackPageSurrogate >> printOn: aStream [
super printOn: aStream.
aStream nextPut: $@; print: address; nextPut: $/.
address printOn: aStream base: 16
]