Mercurial > hg > graal-compiler
changeset 6368:43e274f43a9a
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
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 12 Sep 2012 23:50:52 +0200 |
parents | cc402f4396f4 |
children | b1bdefcc7777 a718f153b9f2 |
files | graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/HotSpotSnippetUtils.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewObjectSnippets.java |
diffstat | 2 files changed, 15 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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; }
--- 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) {