-
Notifications
You must be signed in to change notification settings - Fork 64
/
CogOutOfLineLiteralsX64Compiler.class.st
45 lines (40 loc) · 1.64 KB
/
CogOutOfLineLiteralsX64Compiler.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
Class {
#name : #CogOutOfLineLiteralsX64Compiler,
#superclass : #CogX64Compiler,
#category : #'VMMaker-JIT'
}
{ #category : #'class initialization' }
CogOutOfLineLiteralsX64Compiler class >> initializeAbstractRegistersSysV [
"Assign the abstract registers with the identities/indices of the relevant concrete registers."
super initializeAbstractRegistersSysV.
Extra6Reg := R8
]
{ #category : #'class initialization' }
CogOutOfLineLiteralsX64Compiler class >> initializeAbstractRegistersWin64 [
"Assign the abstract registers with the identities/indices of the relevant concrete registers."
super initializeAbstractRegistersWin64.
Extra6Reg := R11
]
{ #category : #testing }
CogOutOfLineLiteralsX64Compiler class >> isRISCTempRegister: reg [
"For tests to filter-out bogus values left in the RISCTempRegister, if any."
^false
]
{ #category : #'register allocation' }
CogOutOfLineLiteralsX64Compiler >> availableRegisterOrNoneFor: liveRegsMask [
"Answer an unused abstract register in the liveRegMask.
Subclasses with more registers can override to answer them.
N.B. Do /not/ allocate TempReg."
<returnTypeC: #sqInt>
(cogit register: Extra6Reg isInMask: liveRegsMask) ifFalse:
[^Extra6Reg].
^super availableRegisterOrNoneFor: liveRegsMask
]
{ #category : #testing }
CogOutOfLineLiteralsX64Compiler >> isPCDependent [
"Answer if the receiver is a pc-dependent instruction. With out-of-line literals any instruction
that refers to a literal depends on the address of the literal, so add them in addition to the jumps."
^self isJump
or: [opcode = AlignmentNops
or: [opcode ~= Literal and: [dependent notNil and: [dependent opcode = Literal]]]]
]