# HG changeset patch # User Doug Simon # Date 1384437737 -3600 # Node ID 5a51864f30889c02f70cbb7ec873d7ce8282df1a # Parent 0b7172f093d05908646db3d6284d1957a3caf312 moved raw memory TLAB allocation routine into NewInstanceStub and unsnippetized it diff -r 0b7172f093d0 -r 5a51864f3088 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java Wed Nov 13 11:14:31 2013 -0800 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java Thu Nov 14 15:02:17 2013 +0100 @@ -80,23 +80,6 @@ public static final ProfileMode PROFILE_MODE = ProfileMode.Total; - @Snippet - public static Word allocate(int size) { - Word thread = thread(); - Word top = readTlabTop(thread); - Word end = readTlabEnd(thread); - Word newTop = top.add(size); - /* - * this check might lead to problems if the TLAB is within 16GB of the address space end - * (checked in c++ code) - */ - if (probability(FAST_PATH_PROBABILITY, newTop.belowOrEqual(end))) { - writeTlabTop(thread, newTop); - return top; - } - return Word.zero(); - } - @Fold private static String createName(String path, String typeContext) { switch (PROFILE_MODE) { diff -r 0b7172f093d0 -r 5a51864f3088 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 Wed Nov 13 11:14:31 2013 -0800 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewInstanceStub.java Thu Nov 14 15:02:17 2013 +0100 @@ -26,8 +26,8 @@ import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; import static com.oracle.graal.hotspot.nodes.DirectCompareAndSwapNode.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; -import static com.oracle.graal.hotspot.replacements.NewObjectSnippets.*; import static com.oracle.graal.hotspot.stubs.StubUtil.*; +import static com.oracle.graal.nodes.extended.BranchProbabilityNode.*; import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; @@ -73,6 +73,22 @@ return args; } + private static Word allocate(int size) { + Word thread = thread(); + Word top = readTlabTop(thread); + Word end = readTlabEnd(thread); + Word newTop = top.add(size); + /* + * this check might lead to problems if the TLAB is within 16GB of the address space end + * (checked in c++ code) + */ + if (probability(FAST_PATH_PROBABILITY, newTop.belowOrEqual(end))) { + writeTlabTop(thread, newTop); + return top; + } + return Word.zero(); + } + @Fold private static boolean logging() { return Boolean.getBoolean("graal.logNewInstanceStub"); @@ -190,7 +206,7 @@ end = top.add(tlabRefillSizeInBytes.subtract(alignmentReserveInBytes)); initializeTlab(thread, top, end); - return allocate(sizeInBytes); + return NewInstanceStub.allocate(sizeInBytes); } else { return Word.zero(); }