# HG changeset patch # User Doug Simon # Date 1416992187 -3600 # Node ID 5366863364e2b42dba8d99f140a79c4498272595 # Parent e846c9e2f0e578ee5f4676b83ec94f6331784974 removed static access to HotSpotGraalRuntime from ArrayCallCopyNode diff -r e846c9e2f0e5 -r 5366863364e2 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopyCallNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopyCallNode.java Wed Nov 26 09:50:21 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopyCallNode.java Wed Nov 26 09:56:27 2014 +0100 @@ -24,12 +24,12 @@ package com.oracle.graal.hotspot.replacements; import static com.oracle.graal.api.meta.LocationIdentity.*; -import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.api.runtime.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.type.*; +import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.nodes.*; import com.oracle.graal.nodeinfo.*; @@ -58,12 +58,15 @@ protected boolean disjoint; protected boolean uninitialized; - public static ArrayCopyCallNode create(ValueNode src, ValueNode srcPos, ValueNode dest, ValueNode destPos, ValueNode length, Kind elementKind, boolean aligned, boolean disjoint, - boolean uninitialized) { - return new ArrayCopyCallNode(src, srcPos, dest, destPos, length, elementKind, aligned, disjoint, uninitialized); + protected final HotSpotGraalRuntimeProvider runtime; + + public static ArrayCopyCallNode create(@InjectedNodeParameter HotSpotGraalRuntimeProvider runtime, ValueNode src, ValueNode srcPos, ValueNode dest, ValueNode destPos, ValueNode length, + Kind elementKind, boolean aligned, boolean disjoint, boolean uninitialized) { + return new ArrayCopyCallNode(src, srcPos, dest, destPos, length, elementKind, aligned, disjoint, uninitialized, runtime); } - protected ArrayCopyCallNode(ValueNode src, ValueNode srcPos, ValueNode dest, ValueNode destPos, ValueNode length, Kind elementKind, boolean aligned, boolean disjoint, boolean uninitialized) { + protected ArrayCopyCallNode(ValueNode src, ValueNode srcPos, ValueNode dest, ValueNode destPos, ValueNode length, Kind elementKind, boolean aligned, boolean disjoint, boolean uninitialized, + HotSpotGraalRuntimeProvider runtime) { super(StampFactory.forVoid()); assert elementKind != null; this.src = src; @@ -75,14 +78,12 @@ this.aligned = aligned; this.disjoint = disjoint; this.uninitialized = uninitialized; + this.runtime = runtime; } - public static ArrayCopyCallNode create(ValueNode src, ValueNode srcPos, ValueNode dest, ValueNode destPos, ValueNode length, Kind elementKind, boolean disjoint) { - return new ArrayCopyCallNode(src, srcPos, dest, destPos, length, elementKind, disjoint); - } - - protected ArrayCopyCallNode(ValueNode src, ValueNode srcPos, ValueNode dest, ValueNode destPos, ValueNode length, Kind elementKind, boolean disjoint) { - this(src, srcPos, dest, destPos, length, elementKind, false, disjoint, false); + public static ArrayCopyCallNode create(@InjectedNodeParameter HotSpotGraalRuntimeProvider runtime, ValueNode src, ValueNode srcPos, ValueNode dest, ValueNode destPos, ValueNode length, + Kind elementKind, boolean disjoint) { + return new ArrayCopyCallNode(src, srcPos, dest, destPos, length, elementKind, false, disjoint, false, runtime); } public ValueNode getSource() { @@ -124,7 +125,7 @@ private ValueNode computeBase(ValueNode base, ValueNode pos) { FixedWithNextNode basePtr = graph().add(GetObjectAddressNode.create(base)); graph().addBeforeFixed(this, basePtr); - ValueNode loc = IndexedLocationNode.create(getLocationIdentity(), elementKind, arrayBaseOffset(elementKind), pos, graph(), arrayIndexScale(elementKind)); + ValueNode loc = IndexedLocationNode.create(getLocationIdentity(), elementKind, runtime.getArrayBaseOffset(elementKind), pos, graph(), runtime.getArrayIndexScale(elementKind)); return graph().unique(ComputeAddressNode.create(basePtr, loc, StampFactory.forKind(Kind.Long))); } @@ -183,8 +184,8 @@ return uninitialized; } - static boolean isHeapWordAligned(JavaConstant value, Kind kind) { - return (arrayBaseOffset(kind) + (long) value.asInt() * arrayIndexScale(kind)) % heapWordSize() == 0; + boolean isHeapWordAligned(JavaConstant value, Kind kind) { + return (runtime.getArrayBaseOffset(kind) + (long) value.asInt() * runtime.getArrayIndexScale(kind)) % runtime.getConfig().heapWordSize == 0; } public void updateAlignedDisjoint() {