src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeBlockState.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
hotspot Cdiff src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeBlockState.java
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeBlockState.java
Print this page
*** 26,35 ****
--- 26,36 ----
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+ import org.graalvm.compiler.debug.DebugContext;
import org.graalvm.compiler.graph.Node;
import org.graalvm.compiler.nodes.FixedNode;
import org.graalvm.compiler.nodes.FixedWithNextNode;
import org.graalvm.compiler.nodes.StructuredGraph;
import org.graalvm.compiler.nodes.ValueNode;
*** 61,96 ****
* Usage count for the objectStates array, to avoid unneessary copying.
*/
private RefCount arrayRefCount;
private final OptionValues options;
/**
* Final subclass of PartialEscapeBlockState, for performance and to make everything behave
* nicely with generics.
*/
public static final class Final extends PartialEscapeBlockState<Final> {
! public Final(OptionValues options) {
! super(options);
}
public Final(Final other) {
super(other);
}
}
! protected PartialEscapeBlockState(OptionValues options) {
objectStates = EMPTY_ARRAY;
arrayRefCount = new RefCount();
this.options = options;
}
protected PartialEscapeBlockState(PartialEscapeBlockState<T> other) {
super(other);
adoptAddObjectStates(other);
options = other.options;
}
public ObjectState getObjectState(int object) {
ObjectState state = objectStates[object];
assert state != null;
--- 62,100 ----
* Usage count for the objectStates array, to avoid unneessary copying.
*/
private RefCount arrayRefCount;
private final OptionValues options;
+ private final DebugContext debug;
/**
* Final subclass of PartialEscapeBlockState, for performance and to make everything behave
* nicely with generics.
*/
public static final class Final extends PartialEscapeBlockState<Final> {
! public Final(OptionValues options, DebugContext debug) {
! super(options, debug);
}
public Final(Final other) {
super(other);
}
}
! protected PartialEscapeBlockState(OptionValues options, DebugContext debug) {
objectStates = EMPTY_ARRAY;
arrayRefCount = new RefCount();
this.options = options;
+ this.debug = debug;
}
protected PartialEscapeBlockState(PartialEscapeBlockState<T> other) {
super(other);
adoptAddObjectStates(other);
options = other.options;
+ debug = other.debug;
}
public ObjectState getObjectState(int object) {
ObjectState state = objectStates[object];
assert state != null;
*** 167,184 ****
* Materializes the given virtual object and produces the necessary effects in the effects list.
* This transitively also materializes all other virtual objects that are reachable from the
* entries.
*/
public void materializeBefore(FixedNode fixed, VirtualObjectNode virtual, GraphEffectList materializeEffects) {
! PartialEscapeClosure.COUNTER_MATERIALIZATIONS.increment();
List<AllocatedObjectNode> objects = new ArrayList<>(2);
List<ValueNode> values = new ArrayList<>(8);
List<List<MonitorIdNode>> locks = new ArrayList<>();
List<ValueNode> otherAllocations = new ArrayList<>(2);
List<Boolean> ensureVirtual = new ArrayList<>(2);
materializeWithCommit(fixed, virtual, objects, locks, values, ensureVirtual, otherAllocations);
- assert fixed != null;
materializeEffects.addVirtualizationDelta(-(objects.size() + otherAllocations.size()));
materializeEffects.add("materializeBefore", new Effect() {
@Override
public void apply(StructuredGraph graph, ArrayList<Node> obsoleteNodes) {
--- 171,187 ----
* Materializes the given virtual object and produces the necessary effects in the effects list.
* This transitively also materializes all other virtual objects that are reachable from the
* entries.
*/
public void materializeBefore(FixedNode fixed, VirtualObjectNode virtual, GraphEffectList materializeEffects) {
! PartialEscapeClosure.COUNTER_MATERIALIZATIONS.increment(fixed.getDebug());
List<AllocatedObjectNode> objects = new ArrayList<>(2);
List<ValueNode> values = new ArrayList<>(8);
List<List<MonitorIdNode>> locks = new ArrayList<>();
List<ValueNode> otherAllocations = new ArrayList<>(2);
List<Boolean> ensureVirtual = new ArrayList<>(2);
materializeWithCommit(fixed, virtual, objects, locks, values, ensureVirtual, otherAllocations);
materializeEffects.addVirtualizationDelta(-(objects.size() + otherAllocations.size()));
materializeEffects.add("materializeBefore", new Effect() {
@Override
public void apply(StructuredGraph graph, ArrayList<Node> obsoleteNodes) {
*** 253,270 ****
values.set(pos + i, entries[i]);
}
}
objectMaterialized(virtual, (AllocatedObjectNode) representation, values.subList(pos, pos + entries.length));
} else {
! VirtualUtil.trace(options, "materialized %s as %s", virtual, representation);
otherAllocations.add(representation);
assert obj.getLocks() == null;
}
}
protected void objectMaterialized(VirtualObjectNode virtual, AllocatedObjectNode representation, List<ValueNode> values) {
! VirtualUtil.trace(options, "materialized %s as %s with values %s", virtual, representation, values);
}
public void addObject(int virtual, ObjectState state) {
ensureSize(virtual)[virtual] = state;
}
--- 256,273 ----
values.set(pos + i, entries[i]);
}
}
objectMaterialized(virtual, (AllocatedObjectNode) representation, values.subList(pos, pos + entries.length));
} else {
! VirtualUtil.trace(options, debug, "materialized %s as %s", virtual, representation);
otherAllocations.add(representation);
assert obj.getLocks() == null;
}
}
protected void objectMaterialized(VirtualObjectNode virtual, AllocatedObjectNode representation, List<ValueNode> values) {
! VirtualUtil.trace(options, debug, "materialized %s as %s with values %s", virtual, representation, values);
}
public void addObject(int virtual, ObjectState state) {
ensureSize(virtual)[virtual] = state;
}
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeBlockState.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File