diff graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewArrayStub.java @ 7238:7f55fd5f897d

introduced graal.newArrayStub.forceSlowPath and graal.newInstanceStub.forceSlowPath system properties
author Doug Simon <doug.simon@oracle.com>
date Mon, 17 Dec 2012 11:45:09 +0100
parents 509d72a1d81b
children 885a6849ee9e
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewArrayStub.java	Mon Dec 17 11:29:06 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewArrayStub.java	Mon Dec 17 11:45:09 2012 +0100
@@ -33,6 +33,7 @@
 import com.oracle.graal.hotspot.snippets.*;
 import com.oracle.graal.snippets.*;
 import com.oracle.graal.snippets.Snippet.ConstantParameter;
+import com.oracle.graal.snippets.Snippet.Fold;
 import com.oracle.graal.snippets.Snippet.Parameter;
 import com.oracle.graal.snippets.SnippetTemplate.Key;
 
@@ -81,7 +82,7 @@
         log(log, "newArray: hub=%p\n", hub.toLong());
 
         // check that array length is small enough for fast path.
-        if (length <= MAX_ARRAY_FAST_PATH_ALLOCATION_LENGTH) {
+        if (!forceSlowPath() && length <= MAX_ARRAY_FAST_PATH_ALLOCATION_LENGTH) {
             Word memory;
             if (refillTLAB(intArrayHub, Word.fromLong(tlabIntArrayMarkWord()), tlabAlignmentReserveInHeapWords() * wordSize(), log)) {
                 memory = allocate(sizeInBytes);
@@ -98,4 +99,9 @@
         log(log, "newArray: calling new_array_slow", 0L);
         return verifyOop(NewArraySlowStubCall.call(hub, length));
     }
+
+    @Fold
+    private static boolean forceSlowPath() {
+        return Boolean.getBoolean("graal.newArrayStub.forceSlowPath");
+    }
 }