src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualizerToolImpl.java
equal
deleted
inserted
replaced
24 |
24 |
25 import static org.graalvm.compiler.core.common.GraalOptions.MaximumEscapeAnalysisArrayLength; |
25 import static org.graalvm.compiler.core.common.GraalOptions.MaximumEscapeAnalysisArrayLength; |
26 |
26 |
27 import java.util.List; |
27 import java.util.List; |
28 |
28 |
|
29 import org.graalvm.compiler.core.common.spi.ArrayOffsetProvider; |
29 import org.graalvm.compiler.core.common.spi.ConstantFieldProvider; |
30 import org.graalvm.compiler.core.common.spi.ConstantFieldProvider; |
30 import org.graalvm.compiler.debug.DebugContext; |
31 import org.graalvm.compiler.debug.DebugContext; |
31 import org.graalvm.compiler.graph.Node; |
32 import org.graalvm.compiler.graph.Node; |
32 import org.graalvm.compiler.graph.spi.CanonicalizerTool; |
33 import org.graalvm.compiler.graph.spi.CanonicalizerTool; |
33 import org.graalvm.compiler.nodes.ConstantNode; |
34 import org.graalvm.compiler.nodes.ConstantNode; |
104 } |
105 } |
105 |
106 |
106 @Override |
107 @Override |
107 public ConstantFieldProvider getConstantFieldProvider() { |
108 public ConstantFieldProvider getConstantFieldProvider() { |
108 return constantFieldProvider; |
109 return constantFieldProvider; |
|
110 } |
|
111 |
|
112 @Override |
|
113 public ArrayOffsetProvider getArrayOffsetProvider() { |
|
114 return loweringProvider; |
109 } |
115 } |
110 |
116 |
111 public void reset(PartialEscapeBlockState<?> newState, ValueNode newCurrent, FixedNode newPosition, GraphEffectList newEffects) { |
117 public void reset(PartialEscapeBlockState<?> newState, ValueNode newCurrent, FixedNode newPosition, GraphEffectList newEffects) { |
112 deleted = false; |
118 deleted = false; |
113 state = newState; |
119 state = newState; |
158 } else if (entryKind == JavaKind.Int && (accessKind == JavaKind.Long || accessKind == JavaKind.Double) && offset % 8 == 0) { |
164 } else if (entryKind == JavaKind.Int && (accessKind == JavaKind.Long || accessKind == JavaKind.Double) && offset % 8 == 0) { |
159 /* |
165 /* |
160 * Special case: Allow storing a single long or double value into two consecutive |
166 * Special case: Allow storing a single long or double value into two consecutive |
161 * int slots. |
167 * int slots. |
162 */ |
168 */ |
163 int nextIndex = virtual.entryIndexForOffset(offset + 4, JavaKind.Int); |
169 int nextIndex = virtual.entryIndexForOffset(getArrayOffsetProvider(), offset + 4, JavaKind.Int); |
164 if (nextIndex != -1) { |
170 if (nextIndex != -1) { |
165 canVirtualize = true; |
171 canVirtualize = true; |
166 assert nextIndex == index + 1 : "expected to be sequential"; |
172 assert nextIndex == index + 1 : "expected to be sequential"; |
167 getDebug().log(DebugContext.DETAILED_LEVEL, "virtualizing %s for double word stored in two ints", current); |
173 getDebug().log(DebugContext.DETAILED_LEVEL, "virtualizing %s for double word stored in two ints", current); |
168 } |
174 } |