# HG changeset patch # User Doug Simon # Date 1347486652 -7200 # Node ID 43e274f43a9ae247fcd173ddbb22fa46b5c73655 # Parent cc402f4396f417cb365b5fb4d6128ddd401df6a1 made NewObjectSnippets optionally load the initial mark word when initializing an object - this is disabled until the bug triggered in lusearch by this change is fixed diff -r cc402f4396f4 -r 43e274f43a9a graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/HotSpotSnippetUtils.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/HotSpotSnippetUtils.java Wed Sep 12 23:50:37 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/HotSpotSnippetUtils.java Wed Sep 12 23:50:52 2012 +0200 @@ -82,6 +82,11 @@ } @Fold + static int initialMarkWordOffset() { + return HotSpotGraalRuntime.getInstance().getConfig().initialMarkWordOffset; + } + + @Fold static int markOffset() { return HotSpotGraalRuntime.getInstance().getConfig().markOffset; } diff -r cc402f4396f4 -r 43e274f43a9a graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewObjectSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewObjectSnippets.java Wed Sep 12 23:50:37 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewObjectSnippets.java Wed Sep 12 23:50:52 2012 +0200 @@ -161,10 +161,16 @@ private static final int MAX_UNROLLED_OBJECT_ZEROING_SIZE = 10 * wordSize(); /** + * Setting this to false causes (as yet inexplicable) crashes on lusearch. + */ + private static final boolean USE_STATIC_INITIAL_MARK_WORD = true; + + /** * Formats some allocated memory with an object header zeroes out the rest. */ - private static void formatObject(Object hub, int size, Word memory, Word headerPrototype, boolean fillContents) { - storeObject(memory, 0, markOffset(), headerPrototype); + private static void formatObject(Object hub, int size, Word memory, Word staticInitialMarkWord, boolean fillContents) { + Word initialMarkWord = USE_STATIC_INITIAL_MARK_WORD ? staticInitialMarkWord : loadWord(asWord(hub), initialMarkWordOffset()); + storeObject(memory, 0, markOffset(), initialMarkWord); storeObject(memory, 0, hubOffset(), hub); if (fillContents) { if (size <= MAX_UNROLLED_OBJECT_ZEROING_SIZE) { @@ -185,8 +191,8 @@ /** * Formats some allocated memory with an object header zeroes out the rest. */ - private static void formatArray(Object hub, int size, int length, int headerSize, Word memory, Word headerPrototype, boolean fillContents) { - storeObject(memory, 0, markOffset(), headerPrototype); + private static void formatArray(Object hub, int size, int length, int headerSize, Word memory, Word initialMarkWord, boolean fillContents) { + storeObject(memory, 0, markOffset(), initialMarkWord); storeObject(memory, 0, hubOffset(), hub); storeInt(memory, 0, arrayLengthOffset(), length); if (fillContents) {