-
Notifications
You must be signed in to change notification settings - Fork 68
/
ComposedMetadataStruct.class.st
62 lines (45 loc) · 1.34 KB
/
ComposedMetadataStruct.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
Class {
#name : #ComposedMetadataStruct,
#superclass : #VMStructType,
#instVars : [
'startAddress',
'dataSize'
],
#category : #'VMMaker-ImageFormat'
}
{ #category : #'simulation only' }
ComposedMetadataStruct class >> byteSizeForSimulator: aCogit [
"Answer an approximation of the byte size of an AbstractInstruction struct.
This is for estimating the alloca in allocateOpcodes:bytecodes:ifFail:"
^self instSize * (aCogit sizeof: #'void *').
]
{ #category : #translation }
ComposedMetadataStruct class >> instVarNamesAndTypesForTranslationDo: aBinaryBlock [
"enumerate aBinaryBlock with the names and C type strings for the inst vars to include in a struct of this type."
<var: #dataSize type: #size_t>
<var: #startAddress type: #squeakFileOffsetType>
aBinaryBlock
value: 'dataSize' value:'size_t';
value: 'startAddress' value:'squeakFileOffsetType'.
]
{ #category : #accessing }
ComposedMetadataStruct >> dataSize [
^ dataSize
]
{ #category : #accessing }
ComposedMetadataStruct >> dataSize: anObject [
dataSize := anObject
]
{ #category : #initialization }
ComposedMetadataStruct >> initialize [
startAddress := 0.
dataSize := 0
]
{ #category : #accessing }
ComposedMetadataStruct >> startAddress [
^ startAddress
]
{ #category : #accessing }
ComposedMetadataStruct >> startAddress: anObject [
startAddress := anObject
]