public final class RegisterSpecList extends FixedSizeList implements TypeList
RegisterSpec instances.| Modifier and Type | Field and Description |
|---|---|
static RegisterSpecList |
EMPTY
non-null; no-element instance |
| Constructor and Description |
|---|
RegisterSpecList(int size)
Constructs an instance.
|
| Modifier and Type | Method and Description |
|---|---|
RegisterSpec |
get(int n)
Gets the indicated element.
|
int |
getRegistersSize()
Gets the minimum required register count implied by this
instance.
|
Type |
getType(int n)
Gets the indicated element.
|
int |
getWordCount()
Gets the number of 32-bit words required to hold instances of
all the elements of this list.
|
int |
indexOfRegister(int reg)
Returns the index of a RegisterSpec in this list that uses the specified
register, or -1 if none in this list uses the register.
|
static RegisterSpecList |
make(RegisterSpec spec)
Makes a single-element instance.
|
static RegisterSpecList |
make(RegisterSpec spec0,
RegisterSpec spec1)
Makes a two-element instance.
|
static RegisterSpecList |
make(RegisterSpec spec0,
RegisterSpec spec1,
RegisterSpec spec2)
Makes a three-element instance.
|
static RegisterSpecList |
make(RegisterSpec spec0,
RegisterSpec spec1,
RegisterSpec spec2,
RegisterSpec spec3)
Makes a four-element instance.
|
void |
set(int n,
RegisterSpec spec)
Sets the element at the given index.
|
RegisterSpec |
specForRegister(int reg)
Returns a RegisterSpec in this list that uses the specified register,
or null if there is none in this list.
|
RegisterSpecList |
subset(java.util.BitSet exclusionSet)
Returns a new instance, which contains a subset of the elements
specified by the given BitSet.
|
TypeList |
withAddedType(Type type)
Returns a new instance which is identical to this one, except that
the given item is appended to the end and it is guaranteed to be
immutable.
|
RegisterSpecList |
withExpandedRegisters(int base,
boolean duplicateFirst,
java.util.BitSet compatRegs)
Returns an instance that is identical to this one, except that
all incompatible register numbers are renumbered sequentially from
the given base, with the first number duplicated if indicated.
|
RegisterSpecList |
withFirst(RegisterSpec spec)
Returns a new instance, which is the same as this instance,
except that it has an additional element prepended to the original.
|
RegisterSpecList |
withOffset(int delta)
Returns an instance that is identical to this one, except that
all register numbers are offset by the given amount.
|
RegisterSpecList |
withoutFirst()
Returns a new instance, which is the same as this instance,
except that its first element is removed.
|
RegisterSpecList |
withoutLast()
Returns a new instance, which is the same as this instance,
except that its last element is removed.
|
equals, get0, getOrNull0, hashCode, set0, shrinkToFit, size, toHuman, toHuman, toString, toStringisImmutable, isMutable, setImmutable, throwIfImmutable, throwIfMutablepublic static final RegisterSpecList EMPTY
non-null; no-element instancepublic RegisterSpecList(int size)
null.size - the size of the listpublic static RegisterSpecList make(RegisterSpec spec)
spec - non-null; the elementnon-null; an appropriately-constructed instancepublic static RegisterSpecList make(RegisterSpec spec0, RegisterSpec spec1)
spec0 - non-null; the first elementspec1 - non-null; the second elementnon-null; an appropriately-constructed instancepublic static RegisterSpecList make(RegisterSpec spec0, RegisterSpec spec1, RegisterSpec spec2)
spec0 - non-null; the first elementspec1 - non-null; the second elementspec2 - non-null; the third elementnon-null; an appropriately-constructed instancepublic static RegisterSpecList make(RegisterSpec spec0, RegisterSpec spec1, RegisterSpec spec2, RegisterSpec spec3)
spec0 - non-null; the first elementspec1 - non-null; the second elementspec2 - non-null; the third elementspec3 - non-null; the fourth elementnon-null; an appropriately-constructed instancepublic Type getType(int n)
NullPointerException.public int getWordCount()
getWordCount in interface TypeList>= 0; the required number of wordspublic TypeList withAddedType(Type type)
withAddedType in interface TypeListtype - non-null; item to appendnon-null; an appropriately-constructed instancepublic RegisterSpec get(int n)
NullPointerException.n - >= 0, < size(); which elementnon-null; the indicated elementpublic RegisterSpec specForRegister(int reg)
reg - Register to findpublic int indexOfRegister(int reg)
reg - Register to findpublic void set(int n,
RegisterSpec spec)
n - >= 0, < size(); which elementspec - non-null; the value to storepublic int getRegistersSize()
>= 0; the required registers sizepublic RegisterSpecList withFirst(RegisterSpec spec)
spec - non-null; the new first spec (to prepend)non-null; an appropriately-constructed instancepublic RegisterSpecList withoutFirst()
non-null; an appropriately-constructed instancepublic RegisterSpecList withoutLast()
non-null; an appropriately-constructed instancepublic RegisterSpecList subset(java.util.BitSet exclusionSet)
exclusionSet - non-null; set of registers to excludenon-null; an appropriately-constructed instancepublic RegisterSpecList withOffset(int delta)
delta - the amount to offset the register numbers bynon-null; an appropriately-constructed instancepublic RegisterSpecList withExpandedRegisters(int base, boolean duplicateFirst, java.util.BitSet compatRegs)
base - the base register numberduplicateFirst - whether to duplicate the first numbercompatRegs - null-ok; either a non-null set of
compatible registers, or null to indicate all registers are
incompatiblenon-null; an appropriately-constructed instanceCopyright © 2020. All Rights Reserved.