# HG changeset patch # User Roland Schatz # Date 1442937295 -7200 # Node ID f1c68b102fef3977715611a6b89a48346de75a02 # Parent 37d7baeb6d7a83603217c80981fa34f9be73b025 Avoid unnecessary array copy. diff -r 37d7baeb6d7a -r f1c68b102fef graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java Tue Sep 22 17:30:09 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java Tue Sep 22 17:54:55 2015 +0200 @@ -45,7 +45,6 @@ import jdk.internal.jvmci.hotspot.CompilerToVM; import jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntime; import jdk.internal.jvmci.hotspot.HotSpotProxified; -import jdk.internal.jvmci.hotspot.HotSpotResolvedJavaMethod; import jdk.internal.jvmci.hotspot.HotSpotStackFrameReference; import jdk.internal.jvmci.hotspot.HotSpotVMConfig; import jdk.internal.jvmci.inittimer.InitTimer; @@ -226,35 +225,18 @@ @Override public T iterateFrames(ResolvedJavaMethod[] initialMethods, ResolvedJavaMethod[] matchingMethods, int initialSkip, InspectedFrameVisitor visitor) { - final HotSpotResolvedJavaMethod[] initialMetaMethods = toHotSpotResolvedJavaMethods(initialMethods); - final HotSpotResolvedJavaMethod[] matchingMetaMethods = toHotSpotResolvedJavaMethods(matchingMethods); - CompilerToVM compilerToVM = runtime().getCompilerToVM(); - HotSpotStackFrameReference current = compilerToVM.getNextStackFrame(null, initialMetaMethods, initialSkip); + HotSpotStackFrameReference current = compilerToVM.getNextStackFrame(null, initialMethods, initialSkip); while (current != null) { T result = visitor.visitFrame(current); if (result != null) { return result; } - current = compilerToVM.getNextStackFrame(current, matchingMetaMethods, 0); + current = compilerToVM.getNextStackFrame(current, matchingMethods, 0); } return null; } - private static HotSpotResolvedJavaMethod[] toHotSpotResolvedJavaMethods(ResolvedJavaMethod[] methods) { - if (methods == null) { - return null; - } else if (methods instanceof HotSpotResolvedJavaMethod[]) { - return (HotSpotResolvedJavaMethod[]) methods; - } else { - HotSpotResolvedJavaMethod[] result = new HotSpotResolvedJavaMethod[methods.length]; - for (int i = 0; i < result.length; i++) { - result[i] = (HotSpotResolvedJavaMethod) methods[i]; - } - return result; - } - } - private long runtimeStartTime; /**