protected class PartialEscapeClosure.MergeProcessor extends EffectsClosure.MergeProcessor
Modifier and Type | Field and Description |
---|---|
private HashMap<Object,ValuePhiNode> |
materializedPhis |
private boolean |
needsCaching |
private Map<ValuePhiNode,VirtualObjectNode> |
valueObjectVirtuals |
private Map<ValueNode,ValuePhiNode[]> |
valuePhis |
afterMergeEffects, mergeEffects, newState
Constructor and Description |
---|
MergeProcessor(Block mergeBlock) |
Modifier and Type | Method and Description |
---|---|
protected <T> PhiNode |
getPhi(T virtual,
Stamp stamp) |
private <T> PhiNode |
getPhiCached(T virtual,
Stamp stamp) |
private VirtualObjectNode |
getValueObjectVirtual(ValuePhiNode phi,
VirtualObjectNode virtual) |
private VirtualObjectNode |
getValueObjectVirtualCached(ValuePhiNode phi,
VirtualObjectNode virtual) |
private PhiNode[] |
getValuePhis(ValueNode key,
int entryCount) |
private PhiNode[] |
getValuePhisCached(ValueNode key,
int entryCount) |
private int[] |
intersectVirtualObjects(PartialEscapeBlockState<?>[] states) |
protected void |
merge(List<BlockT> statesList)
Merge all predecessor block states into one block state.
|
private boolean |
mergeObjectEntry(IntFunction<Integer> objectIdFunc,
PartialEscapeBlockState<?>[] states,
PhiNode phi,
int entryIndex)
Fill the inputs of the PhiNode corresponding to one
Kind.Object entry in the
virtual object. |
private boolean |
mergeObjectStates(int resultObject,
int[] sourceObjects,
PartialEscapeBlockState<?>[] states)
Try to merge multiple virtual object states into a single object state.
|
private boolean |
processPhi(ValuePhiNode phi,
PartialEscapeBlockState<?>[] states,
int[] mergedVirtualObjects)
Examine a PhiNode and try to replace it with merging of virtual objects if all its inputs
refer to virtual object states.
|
commitEnds, createValuePhi, getPhis, getPhiValueAt, getPredecessor, getStateIndex, graph, setPhiInput, toString
private HashMap<Object,ValuePhiNode> materializedPhis
private Map<ValueNode,ValuePhiNode[]> valuePhis
private Map<ValuePhiNode,VirtualObjectNode> valueObjectVirtuals
private final boolean needsCaching
public MergeProcessor(Block mergeBlock)
private <T> PhiNode getPhiCached(T virtual, Stamp stamp)
private PhiNode[] getValuePhis(ValueNode key, int entryCount)
private PhiNode[] getValuePhisCached(ValueNode key, int entryCount)
private VirtualObjectNode getValueObjectVirtual(ValuePhiNode phi, VirtualObjectNode virtual)
private VirtualObjectNode getValueObjectVirtualCached(ValuePhiNode phi, VirtualObjectNode virtual)
protected void merge(List<BlockT> statesList)
merge
in class EffectsClosure.MergeProcessor
statesList
- the predecessor block states of the mergeprivate int[] intersectVirtualObjects(PartialEscapeBlockState<?>[] states)
private boolean mergeObjectStates(int resultObject, int[] sourceObjects, PartialEscapeBlockState<?>[] states)
long
or double
values occupying two
int
slots in such a way that that their values cannot be merged using PhiNodes.states
- the predecessor block states of the mergeprivate boolean mergeObjectEntry(IntFunction<Integer> objectIdFunc, PartialEscapeBlockState<?>[] states, PhiNode phi, int entryIndex)
Kind.Object
entry in the
virtual object.private boolean processPhi(ValuePhiNode phi, PartialEscapeBlockState<?>[] states, int[] mergedVirtualObjects)
phi
- the PhiNode that should be processedstates
- the predecessor block states of the mergemergedVirtualObjects
- the set of virtual objects that exist in all incoming states,
and therefore also exist in the merged state