-
Notifications
You must be signed in to change notification settings - Fork 65
/
InLineLiteralsManager.class.st
121 lines (104 loc) · 3.79 KB
/
InLineLiteralsManager.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
"
An InLineLiteralsManager is a dummy class that understands the OutOfLineLiteralsManager API but does nothing. It is used to allow the Cogits to work with back-ends that generate either in-line or out-of-line literals.
"
Class {
#name : #InLineLiteralsManager,
#superclass : #VMClass,
#instVars : [
'cogit',
'objectMemory',
'objectRepresentation'
],
#category : #'VMMaker-JIT'
}
{ #category : #translation }
InLineLiteralsManager class >> isNonArgumentImplicitReceiverVariableName: aString [
^Cogit isNonArgumentImplicitReceiverVariableName: aString
]
{ #category : #initialization }
InLineLiteralsManager >> allocateLiterals: initialNumLiterals [
<inline: true>
]
{ #category : #'generate machine code' }
InLineLiteralsManager >> assertValidAnnotation: annotation for: instruction [
<var: #instruction type: #'AbstractInstruction *'>
<inline: true>
]
{ #category : #'compile abstract instructions' }
InLineLiteralsManager >> checkLiteral: literal forInstruction: anInstruction [
<var: #anInstruction type: #'AbstractInstruction *'>
<returnTypeC: #'AbstractInstruction *'>
<inline: true>
^anInstruction
]
{ #category : #'compile abstract instructions' }
InLineLiteralsManager >> checkQuickConstant: literal forInstruction: anInstruction [
<var: #anInstruction type: #'AbstractInstruction *'>
<returnTypeC: #'AbstractInstruction *'>
<inline: true>
^anInstruction
]
{ #category : #initialization }
InLineLiteralsManager >> cogit: aCogit [
<doNotGenerate>
cogit := aCogit.
objectMemory := aCogit objectMemory.
objectRepresentation := aCogit objectRepresentation.
]
{ #category : #'compile abstract instructions' }
InLineLiteralsManager >> dumpLiterals: generateBranchAround [
<inline: true>
]
{ #category : #'closed PIC parsing' }
InLineLiteralsManager >> endSizeOffset [
"return the offset need from the cPICEndSize in order to point to just after the last instruction - here that means 0"
^0
]
{ #category : #'garbage collection' }
InLineLiteralsManager >> fetchLiteralAtAnnotatedAddress: address using: instruction [
"Normally literals are embedded in instructions and the annotation is at the start of
the following instruction, to cope with literals embedded in variable-length instructions,
since, e.g. on x86, the literal typically comes at the end of the instruction."
<var: 'instruction' type: #'AbstractInstruction *'>
<inline: true>
^instruction literalBeforeFollowingAddress: address
]
{ #category : #'garbage collection' }
InLineLiteralsManager >> literalBytesFollowingBranchInClosedPIC [
^0
]
{ #category : #'garbage collection' }
InLineLiteralsManager >> literalBytesFollowingJumpInClosedPIC [
^0
]
{ #category : #testing }
InLineLiteralsManager >> mustDumpLiterals: currentOpcodeIndex [
<inline: true>
^false
]
{ #category : #'compile abstract instructions' }
InLineLiteralsManager >> resetForRecompile [
]
{ #category : #initialization }
InLineLiteralsManager >> resetLiterals [
]
{ #category : #'compile abstract instructions' }
InLineLiteralsManager >> saveForRecompile [
]
{ #category : #'garbage collection' }
InLineLiteralsManager >> storeLiteral: literal atAnnotatedAddress: address using: instruction [
"Normally literals are embedded in instructions and the annotation is at the start of
the following instruction, to cope with literals embedded in variable-length instructions,
since, e.g. on x86, the literal typically comes at the end of the instruction."
<var: 'address' type: #usqInt>
<var: 'instruction' type: #'AbstractInstruction *'>
<inline: true>
^instruction storeLiteral: literal beforeFollowingAddress: address
]
{ #category : #'compile abstract instructions' }
InLineLiteralsManager >> uniqueLiteral: literal forInstruction: anInstruction [
<var: #anInstruction type: #'AbstractInstruction *'>
<returnTypeC: #'AbstractInstruction *'>
<inline: true>
^anInstruction
]