# HG changeset patch # User Doug Simon # Date 1367500372 -7200 # Node ID 51973e9ec004015e270670eefd653c248a035313 # Parent cf8104ed68ba83f608cbd1644ff422284cc3e67b added comments clarifying the difference between _exception_oop and _pending_exception in the HotSpot Thread class diff -r cf8104ed68ba -r 51973e9ec004 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java Thu May 02 14:12:24 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java Thu May 02 15:12:52 2013 +0200 @@ -179,7 +179,10 @@ public int uninitializedIdentityHashCodeValue; /** - * Offset of the pending exception field. + * Offset of the _pending_exception field in ThreadShadow (defined in exceptions.hpp). This + * field is used to propagate exceptions through C/C++ calls. + *

+ * NOTE: This is not the same as {@link #threadExceptionOopOffset}. */ public int pendingExceptionOffset; @@ -228,7 +231,15 @@ */ public int klassHasFinalizerFlag; + /** + * Offset of the _exception_oop field in Thread (defined in thread.hpp). This field is used to + * pass exception objects into and out of the runtime system during exception handling for + * compiled code. + *

+ * NOTE: This is not the same as {@link #pendingExceptionOffset}. + */ public int threadExceptionOopOffset; + public int threadExceptionPcOffset; public long cardtableStartAddress; public int cardtableShift; diff -r cf8104ed68ba -r 51973e9ec004 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java Thu May 02 14:12:24 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java Thu May 02 15:12:52 2013 +0200 @@ -64,6 +64,9 @@ public static final Object EXCEPTION_OOP_LOCATION = LocationNode.createLocation("ExceptionOop"); + /** + * @see HotSpotVMConfig#threadExceptionOopOffset + */ @Fold public static int threadExceptionOopOffset() { return config().threadExceptionOopOffset; @@ -99,6 +102,9 @@ public static final Object PENDING_EXCEPTION_LOCATION = LocationNode.createLocation("PendingException"); + /** + * @see HotSpotVMConfig#pendingExceptionOffset + */ @Fold private static int threadPendingExceptionOffset() { return config().pendingExceptionOffset; @@ -111,14 +117,20 @@ return config().threadObjectResultOffset; } + /** + * @see HotSpotVMConfig#threadExceptionOopOffset + */ public static Object readExceptionOop(Word thread) { return thread.readObject(threadExceptionOopOffset(), EXCEPTION_OOP_LOCATION); } public static Word readExceptionPc(Word thread) { - return thread.readWord(threadExceptionOopOffset(), EXCEPTION_PC_LOCATION); + return thread.readWord(threadExceptionPcOffset(), EXCEPTION_PC_LOCATION); } + /** + * @see HotSpotVMConfig#threadExceptionOopOffset + */ public static void writeExceptionOop(Word thread, Object value) { thread.writeObject(threadExceptionOopOffset(), value, EXCEPTION_OOP_LOCATION); }