Mercurial > hg > graal-compiler
diff graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotSnippetUtils.java @ 8643:3d2c2b68fe93
lower ExceptionObjectNode with a snippet (GRAAL-133)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 05 Apr 2013 02:33:42 +0200 |
parents | b6491ee579d3 |
children | 261a43921c5e |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotSnippetUtils.java Fri Apr 05 01:58:32 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotSnippetUtils.java Fri Apr 05 02:33:42 2013 +0200 @@ -62,6 +62,20 @@ return config().verifyOops; } + public static final Object EXCEPTION_OOP_LOCATION = LocationNode.createLocation("ExceptionOop"); + + @Fold + public static int threadExceptionOopOffset() { + return config().threadExceptionOopOffset; + } + + public static final Object EXCEPTION_PC_LOCATION = LocationNode.createLocation("ExceptionPc"); + + @Fold + public static int threadExceptionPcOffset() { + return config().threadExceptionPcOffset; + } + public static final Object TLAB_TOP_LOCATION = LocationNode.createLocation("TlabTop"); @Fold @@ -83,6 +97,18 @@ return config().threadTlabStartOffset; } + public static Object readExceptionOop(Word thread) { + return thread.readObject(threadExceptionOopOffset(), EXCEPTION_OOP_LOCATION); + } + + public static void writeExceptionOop(Word thread, Object value) { + thread.writeObject(threadExceptionOopOffset(), value, EXCEPTION_OOP_LOCATION); + } + + public static void writeExceptionPc(Word thread, Word value) { + thread.writeWord(threadExceptionPcOffset(), value, EXCEPTION_PC_LOCATION); + } + public static Word readTlabTop(Word thread) { return thread.readWord(threadTlabTopOffset(), TLAB_TOP_LOCATION); }