diff graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewArrayNode.java @ 16028:bca2ed3b97fd

skip initialization and use arraycopy for cloning arrays
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Wed, 04 Jun 2014 17:21:09 -0700
parents 882f4cb7cfcf
children 5d468add216f
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewArrayNode.java	Tue Jun 03 18:15:43 2014 -0700
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewArrayNode.java	Wed Jun 04 17:21:09 2014 -0700
@@ -39,7 +39,7 @@
 
     /**
      * Constructs a new NewArrayNode.
-     * 
+     *
      * @param elementType the the type of the elements of the newly created array (not the type of
      *            the array itself).
      * @param length the node that produces the length for this allocation.
@@ -49,9 +49,16 @@
         super(StampFactory.exactNonNull(elementType.getArrayClass()), length, fillContents);
     }
 
+    @NodeIntrinsic
+    static private native Object newArray(@ConstantNodeParameter Class<?> elementType, int length, @ConstantNodeParameter boolean fillContents);
+
+    public static Object newUninitializedArray(Class<?> elementType, int length) {
+        return newArray(elementType, length, false);
+    }
+
     /**
      * Gets the element type of the array.
-     * 
+     *
      * @return the element type of the array
      */
     public ResolvedJavaType elementType() {