< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/CheckcastArrayCopyCallNode.java

Print this page

        

*** 21,36 **** * questions. */ //JaCoCo Exclude package org.graalvm.compiler.hotspot.replacements.arraycopy; - import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_UNKNOWN; - import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_UNKNOWN; import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayBaseOffset; import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayIndexScale; import org.graalvm.compiler.core.common.spi.ForeignCallDescriptor; import org.graalvm.compiler.core.common.type.StampFactory; import org.graalvm.compiler.graph.NodeClass; import org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider; import org.graalvm.compiler.hotspot.meta.HotSpotHostForeignCallsProvider; import org.graalvm.compiler.hotspot.nodes.GetObjectAddressNode; --- 21,37 ---- * questions. */ //JaCoCo Exclude package org.graalvm.compiler.hotspot.replacements.arraycopy; import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayBaseOffset; import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayIndexScale; + import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_UNKNOWN; + import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_UNKNOWN; import org.graalvm.compiler.core.common.spi.ForeignCallDescriptor; + import org.graalvm.compiler.core.common.type.PrimitiveStamp; import org.graalvm.compiler.core.common.type.StampFactory; import org.graalvm.compiler.graph.NodeClass; import org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider; import org.graalvm.compiler.hotspot.meta.HotSpotHostForeignCallsProvider; import org.graalvm.compiler.hotspot.nodes.GetObjectAddressNode;
*** 112,123 **** private ValueNode computeBase(ValueNode base, ValueNode pos) { FixedWithNextNode basePtr = graph().add(new GetObjectAddressNode(base)); graph().addBeforeFixed(this, basePtr); int shift = CodeUtil.log2(getArrayIndexScale(JavaKind.Object)); ! ValueNode scaledIndex = graph().unique(new LeftShiftNode(pos, ConstantNode.forInt(shift, graph()))); ! ValueNode offset = graph().unique(new AddNode(scaledIndex, ConstantNode.forInt(getArrayBaseOffset(JavaKind.Object), graph()))); return graph().unique(new OffsetAddressNode(basePtr, offset)); } @Override public void lower(LoweringTool tool) { --- 113,125 ---- private ValueNode computeBase(ValueNode base, ValueNode pos) { FixedWithNextNode basePtr = graph().add(new GetObjectAddressNode(base)); graph().addBeforeFixed(this, basePtr); int shift = CodeUtil.log2(getArrayIndexScale(JavaKind.Object)); ! ValueNode extendedPos = IntegerConvertNode.convert(pos, StampFactory.forKind(runtime.getTarget().wordJavaKind), graph()); ! ValueNode scaledIndex = graph().unique(new LeftShiftNode(extendedPos, ConstantNode.forInt(shift, graph()))); ! ValueNode offset = graph().unique(new AddNode(scaledIndex, ConstantNode.forIntegerBits(PrimitiveStamp.getBits(scaledIndex.stamp()), getArrayBaseOffset(JavaKind.Object), graph()))); return graph().unique(new OffsetAddressNode(basePtr, offset)); } @Override public void lower(LoweringTool tool) {
< prev index next >