changeset 23186:c37db3aa7e43

MoveProfiling: minor improvement.
author Josef Eisl <josef.eisl@jku.at>
date Fri, 11 Dec 2015 16:29:17 +0100
parents 8e0474380822
children e660e8431be0
files graal/com.oracle.graal.lir/src/com/oracle/graal/lir/profiling/MoveProfiling.java
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/profiling/MoveProfiling.java	Tue Dec 15 17:20:29 2015 +0100
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/profiling/MoveProfiling.java	Fri Dec 11 16:29:17 2015 +0100
@@ -155,10 +155,11 @@
                     increments.add(new ConstantValue(target.getLIRKind(JavaKind.Int), JavaConstant.forInt(i)));
                 }
             }
-            String[] groups = new String[names.size()];
-            Arrays.fill(groups, "MoveOperations");
-            if (names.size() > 0) { // Don't pollute LIR when nothing has to be done
-                LIRInstruction inst = counterFactory.createMultiBenchmarkCounter(names.toArray(new String[0]), groups, increments.toArray(new Value[0]));
+            int size = names.size();
+            if (size > 0) { // Don't pollute LIR when nothing has to be done
+                String[] groups = new String[size];
+                Arrays.fill(groups, "MoveOperations");
+                LIRInstruction inst = counterFactory.createMultiBenchmarkCounter(names.toArray(new String[size]), groups, increments.toArray(new Value[size]));
                 assert inst != null;
                 buffer.init(instructions);
                 buffer.append(1, inst);