src/share/classes/sun/misc/Unsafe.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/classes/sun/misc/Unsafe.java Mon Aug 19 14:02:51 2013
--- new/src/share/classes/sun/misc/Unsafe.java Mon Aug 19 14:02:51 2013
*** 184,194 ****
--- 184,194 ----
/**
* Stores a reference value into a given Java variable.
* <p>
* Unless the reference <code>x</code> being stored is either null
* or matches the field type, the results are undefined.
! * If the reference <code>o</code> is non-null, card marks or
* other store barriers for that object (if the VM requires them)
* are updated.
* @see #putInt(Object, int, int)
*/
public native void putObject(Object o, long offset, Object x);
*** 432,441 ****
--- 432,503 ----
public native double getDouble(long address);
/** @see #putByte(long, byte) */
public native void putDouble(long address, double x);
/**
+ * Possible storage modes for references.
+ *
+ * The {@link StorageMode#DEFAULT} storage mode uses the JVM's setting for the respective
+ * storage class.
+ */
+ public enum StorageMode {
+ DEFAULT,
+ UNCOMPRESSED_OOP,
+ COMPRESSED_OOP,
+ UNCOMPRESSED_KLASS,
+ COMPRESSED_KLASS;
+
+ static {
+ for (StorageMode mode : StorageMode.values()) {
+ setStorageModeConstant(mode.name(), mode.ordinal());
+ }
+ };
+ }
+
+ /**
+ * Tell the JVM about the storage mode values.
+ */
+ private static native void setStorageModeConstant(String name, int ordinal);
+
+ /**
+ * Fetches a reference value from a given Java variable using the given storage mode.
+ * @see #getInt(Object, long)
+ * @since 1.8
+ */
+ public native Object getObject(Object o, long offset, StorageMode mode);
+
+ /**
+ * Stores a reference value into a given Java variable using the given storage mode.
+ * <p>
+ * Unless the reference <code>x</code> being stored is either null
+ * or matches the field type, the results are undefined.
+ * If the reference <code>o</code> is non-null, card marks or
+ * other store barriers for that object (if the VM requires them)
+ * are updated.
+ * @see #putInt(Object, int, int)
+ * @since 1.8
+ */
+ public native void putObject(Object o, long offset, Object x, StorageMode mode);
+
+ /**
+ * Fetches a meta data reference value from a given Java variable using the given storage mode.
+ * @see #getInt(Object, long)
+ * @since 1.8
+ */
+ public native long getMetadata(Object o, long offset, StorageMode mode);
+
+ /**
+ * Stores a meta data reference value into a given Java variable using the given storage mode.
+ * <p>
+ * Unless the reference <code>x</code> being stored is either null
+ * or matches the field type, the results are undefined.
+ * @see #putInt(Object, int, int)
+ * @since 1.8
+ */
+ public native void putMetadata(Object o, long offset, long x, StorageMode mode);
+
+ /**
* Fetches a native pointer from a given memory address. If the address is
* zero, or does not point into a block obtained from {@link
* #allocateMemory}, the results are undefined.
*
* <p> If the native pointer is less than 64 bits wide, it is extended as
src/share/classes/sun/misc/Unsafe.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File