# HG changeset patch # User Doug Simon # Date 1355741109 -3600 # Node ID 7f55fd5f897d751a80ccaf1f608a27770dc1ce2e # Parent 509d72a1d81bcb980abd6e001ef527600c4476fb introduced graal.newArrayStub.forceSlowPath and graal.newInstanceStub.forceSlowPath system properties diff -r 509d72a1d81b -r 7f55fd5f897d graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewArrayStub.java --- 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"); + } } diff -r 509d72a1d81b -r 7f55fd5f897d graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewInstanceStub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewInstanceStub.java Mon Dec 17 11:29:06 2012 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewInstanceStub.java Mon Dec 17 11:45:09 2012 +0100 @@ -34,8 +34,7 @@ import com.oracle.graal.hotspot.nodes.*; import com.oracle.graal.hotspot.snippets.*; import com.oracle.graal.snippets.*; -import com.oracle.graal.snippets.Snippet.ConstantParameter; -import com.oracle.graal.snippets.Snippet.Parameter; +import com.oracle.graal.snippets.Snippet.*; import com.oracle.graal.snippets.SnippetTemplate.Key; /** @@ -70,7 +69,7 @@ @ConstantParameter("intArrayHub") Word intArrayHub, @ConstantParameter("log") boolean log) { int sizeInBytes = loadIntFromWord(hub, klassInstanceSizeOffset()); - if (inlineContiguousAllocationSupported()) { + if (!forceSlowPath() && inlineContiguousAllocationSupported()) { if (loadIntFromWord(hub, klassStateOffset()) == klassStateFullyInitialized()) { Word memory; if (refillTLAB(intArrayHub, Word.fromLong(tlabIntArrayMarkWord()), tlabAlignmentReserveInHeapWords() * wordSize(), log)) { @@ -204,6 +203,11 @@ } } + @Fold + private static boolean forceSlowPath() { + return Boolean.getBoolean("graal.newInstanceStub.forceSlowPath"); + } + static void log(boolean enabled, String format, long value) { if (enabled) { Log.printf(format, value);