8022853: add ability to load uncompressed object and Klass references in a compressed environment to Unsafe

Reviewed-by: coleenp, jrose, kvn
This commit is contained in:
Christian Thalinger 2015-04-27 09:02:48 -07:00
parent a79d202015
commit 8abeeabcef

View File

@ -183,7 +183,7 @@ public final class Unsafe {
* <p>
* Unless the reference {@code x} being stored is either null
* or matches the field type, the results are undefined.
* If the reference {@code o} is non-null, car marks or
* If the reference {@code o} is non-null, card marks or
* other store barriers for that object (if the VM requires them)
* are updated.
* @see #putInt(Object, long, int)
@ -219,6 +219,35 @@ public final class Unsafe {
/** @see #putInt(Object, long, int) */
public native void putDouble(Object o, long offset, double x);
// These read VM internal data.
/**
* Fetches an uncompressed reference value from a given native variable
* ignoring the VM's compressed references mode.
*
* @param address a memory address locating the variable
* @return the value fetched from the indicated native variable
*/
public native Object getUncompressedObject(long address);
/**
* Fetches the {@link java.lang.Class} Java mirror for the given native
* metaspace {@code Klass} pointer.
*
* @param metaspaceKlass a native metaspace {@code Klass} pointer
* @return the {@link java.lang.Class} Java mirror
*/
public native Class<?> getJavaMirror(long metaspaceKlass);
/**
* Fetches a native metaspace {@code Klass} pointer for the given Java
* object.
*
* @param o Java heap object for which to fetch the class pointer
* @return a native metaspace {@code Klass} pointer
*/
public native long getKlassPointer(Object o);
// These work on values in the C heap.
/**