# HG changeset patch # User Doug Simon # Date 1367956267 -7200 # Node ID c010001c38ce0837e205dec4c1ac49d964e22bd9 # Parent 19c5a07c7843a34aa57ba8de236476e39ad9c737 updated javadoc for HotSpotInstalledCode to document why the nmethod::_graal_installed_code can only be a weak reference diff -r 19c5a07c7843 -r c010001c38ce graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotInstalledCode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotInstalledCode.java Tue May 07 12:03:21 2013 -0700 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotInstalledCode.java Tue May 07 21:51:07 2013 +0200 @@ -32,9 +32,14 @@ import com.oracle.graal.hotspot.*; /** - * Implementation of {@link InstalledCode} for HotSpot. Stores a reference to the nmethod which - * contains the compiled code. The nmethod also stores a weak reference to the HotSpotCompiledMethod - * instance which is necessary to keep the nmethod from being unloaded. + * Implementation of {@link InstalledCode} for HotSpot. If the code is installed as an nmethod (as + * opposed to some other subclass of CodeBlob such as RuntimeStub), then the nmethod stores a weak + * reference to an instance of this class. This is necessary to keep the nmethod from being unloaded + * while the associated {@link HotSpotInstalledCode} instance is alive. + *

+ * Note that there is no (current) way for the reference from an nmethod to a + * {@link HotSpotInstalledCode} instance to be anything but weak. This is due to the fact that + * HotSpot does not treat nmethods as strong GC roots. */ public class HotSpotInstalledCode extends CompilerObject implements InstalledCode { @@ -84,7 +89,7 @@ @Override public String toString() { - return String.format("InstalledCode[method=%s, codeBlob=0x%x]", method, codeBlob); + return String.format("InstalledCode[method=%s, codeBlob=0x%x, isDefault=%b, isNmethod=%b]", method, codeBlob, isDefault, isNmethod); } @Override