src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeAccessNode.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeAccessNode.java	Mon Mar 20 17:40:48 2017
--- new/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeAccessNode.java	Mon Mar 20 17:40:47 2017

*** 48,60 **** --- 48,63 ---- public static final NodeClass<UnsafeAccessNode> TYPE = NodeClass.create(UnsafeAccessNode.class); @Input ValueNode object; @Input ValueNode offset; protected final JavaKind accessKind; protected final LocationIdentity locationIdentity; + protected final boolean forceAnyLocation; ! protected UnsafeAccessNode(NodeClass<? extends UnsafeAccessNode> c, Stamp stamp, ValueNode object, ValueNode offset, JavaKind accessKind, LocationIdentity locationIdentity) { ! protected UnsafeAccessNode(NodeClass<? extends UnsafeAccessNode> c, Stamp stamp, ValueNode object, ValueNode offset, JavaKind accessKind, LocationIdentity locationIdentity, + boolean forceAnyLocation) { super(c, stamp); + this.forceAnyLocation = forceAnyLocation; assert accessKind != null; assert locationIdentity != null; this.object = object; this.offset = offset; this.accessKind = accessKind;
*** 63,72 **** --- 66,79 ---- public LocationIdentity getLocationIdentity() { return locationIdentity; } + public boolean isAnyLocationForced() { + return forceAnyLocation; + } + public ValueNode object() { return object; } public ValueNode offset() {
*** 77,87 **** --- 84,95 ---- return accessKind; } @Override public Node canonical(CanonicalizerTool tool) { ! if (this.getLocationIdentity().isAny() && offset().isConstant()) { ! if (!isAnyLocationForced() && getLocationIdentity().isAny()) { + if (offset().isConstant()) { long constantOffset = offset().asJavaConstant().asLong(); // Try to canonicalize to a field access. ResolvedJavaType receiverType = StampTool.typeOrNull(object()); if (receiverType != null) {
*** 93,103 **** --- 101,110 ---- assert !graph().isAfterFloatingReadPhase() : "cannot add more precise memory location after floating read phase"; return cloneAsFieldAccess(graph().getAssumptions(), field); } } } if (this.getLocationIdentity().isAny()) { ResolvedJavaType receiverType = StampTool.typeOrNull(object()); // Try to build a better location identity. if (receiverType != null && receiverType.isArray()) { LocationIdentity identity = NamedLocationIdentity.getArrayLocation(receiverType.getComponentType().getJavaKind()); assert !graph().isAfterFloatingReadPhase() : "cannot add more precise memory location after floating read phase";

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeAccessNode.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File