|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object spiglet.translate.graph.RegisterAlloc<T,R>
T
- the type of the variables in an interference graphR
- the type of the registers that variables are allocated topublic abstract class RegisterAlloc<T,R>
This abstract class specifies the interface to analyze an interference graph and the metadata of the variables contained therein to allocate those variables to a pool of registers.
InterferenceGraph
Field Summary | |
---|---|
protected java.util.Set<R> |
registers
An unmodifiable set of general-purpose registers, for lookup reference. |
Constructor Summary | |
---|---|
RegisterAlloc(java.util.Set<R> pool)
Construct an allocator with a given pool of general purpose registers. |
Method Summary | |
---|---|
java.util.Map<T,R> |
getAllocation(FlowGraph<T> graph)
Returns the mapping of all variables to their allocated registers, given a control flow graph from which to infer. |
abstract java.util.Map<T,R> |
getAllocation(FlowGraph<T> graph,
java.util.Map<T,R> preAlloc)
Returns the mapping of all variables to their allocated registers, given a control flow graph from which to infer. |
java.util.Map<T,R> |
getRegAllocation(FlowGraph<T> graph)
Returns the mapping of only those variables that are mapped to registers, given a control flow graph from which to infer. |
abstract java.util.Map<T,R> |
getRegAllocation(FlowGraph<T> graph,
java.util.Map<T,R> preAlloc)
Returns the mapping of only those variables that are mapped to registers, given a control flow graph from which to infer. |
abstract java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.Set<R> registers
Constructor Detail |
---|
public RegisterAlloc(java.util.Set<R> pool)
pool
- the set of general registersMethod Detail |
---|
public java.util.Map<T,R> getAllocation(FlowGraph<T> graph)
null
, that means the variable
is spilled.
graph
- the control flow graph
null
if spilled)public abstract java.util.Map<T,R> getAllocation(FlowGraph<T> graph, java.util.Map<T,R> preAlloc)
null
, that means the variable
is spilled. A pre-allocation of variables to registers is also given,
to indicate to the allocator that such a mapping must remain in the
final allocation result. The returned allocation mapping also includes
the mapping in preAlloc
.
graph
- the control flow graphpreAlloc
- the pre-allocation mapping
null
if spilled)public java.util.Map<T,R> getRegAllocation(FlowGraph<T> graph)
graph
- the control flow graph
null
public abstract java.util.Map<T,R> getRegAllocation(FlowGraph<T> graph, java.util.Map<T,R> preAlloc)
preAlloc
.
graph
- the control flow graphpreAlloc
- the pre-allocation mapping
null
public abstract java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |