Mercurial > hg > graal-compiler
changeset 19517:55d0b9ec7587
Replace Array.copyOf usages with System.arraycopy usages.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Thu, 19 Feb 2015 23:53:58 +0100 |
parents | cb59c8b7da46 |
children | 387d7192e18f |
files | graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeList.java |
diffstat | 4 files changed, 15 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java Thu Feb 19 23:40:21 2015 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java Thu Feb 19 23:53:58 2015 +0100 @@ -98,7 +98,9 @@ } } if (pos != vobj.entryCount()) { - values = Arrays.copyOf(values, pos); + JavaValue[] newValues = new JavaValue[pos]; + System.arraycopy(values, 0, newValues, 0, pos); + values = newValues; } } entry.getValue().setValues(values);
--- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java Thu Feb 19 23:40:21 2015 +0100 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java Thu Feb 19 23:53:58 2015 +0100 @@ -741,7 +741,9 @@ assert !isFrozen(); assert node.id() == Node.INITIAL_ID; if (nodes.length == nodesSize) { - nodes = Arrays.copyOf(nodes, (nodesSize * 2) + 1); + Node[] newNodes = new Node[(nodesSize * 2) + 1]; + System.arraycopy(nodes, 0, newNodes, 0, nodesSize); + nodes = newNodes; } int id = nodesSize; nodes[id] = node;
--- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java Thu Feb 19 23:40:21 2015 +0100 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java Thu Feb 19 23:53:58 2015 +0100 @@ -342,7 +342,9 @@ if (length == 0) { extraUsages = new Node[4]; } else if (extraUsagesCount == length) { - extraUsages = Arrays.copyOf(extraUsages, length * 2 + 1); + Node[] newExtraUsages = new Node[length * 2 + 1]; + System.arraycopy(extraUsages, 0, newExtraUsages, 0, length); + extraUsages = newExtraUsages; } extraUsages[extraUsagesCount++] = node; }
--- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeList.java Thu Feb 19 23:40:21 2015 +0100 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeList.java Thu Feb 19 23:53:58 2015 +0100 @@ -143,7 +143,9 @@ if (length == 0) { nodes = new Node[2]; } else if (size == length) { - nodes = Arrays.copyOf(nodes, nodes.length * 2 + 1); + Node[] newNodes = new Node[nodes.length * 2 + 1]; + System.arraycopy(nodes, 0, newNodes, 0, length); + nodes = newNodes; } nodes[size++] = node; update(null, (T) node); @@ -186,7 +188,9 @@ void copy(NodeList<? extends Node> other) { self.incModCount(); incModCount(); - nodes = Arrays.copyOf(other.nodes, other.size); + Node[] newNodes = new Node[other.size]; + System.arraycopy(other.nodes, 0, newNodes, 0, newNodes.length); + nodes = newNodes; size = other.size; }