src/java.base/share/classes/sun/misc/Unsafe.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/java.base/share/classes/sun/misc/Unsafe.java Tue Mar 1 08:48:31 2016
--- new/src/java.base/share/classes/sun/misc/Unsafe.java Tue Mar 1 08:48:31 2016
*** 304,313 ****
--- 304,314 ----
* ignoring the VM's compressed references mode.
*
* @param address a memory address locating the variable
* @return the value fetched from the indicated native variable
*/
+ @ForceInline
public Object getUncompressedObject(long address) {
return theInternalUnsafe.getUncompressedObject(address);
}
/**
*** 315,324 ****
--- 316,326 ----
* metaspace {@code Klass} pointer.
*
* @param metaspaceKlass a native metaspace {@code Klass} pointer
* @return the {@link java.lang.Class} Java mirror
*/
+ @ForceInline
public Class<?> getJavaMirror(long metaspaceKlass) {
return theInternalUnsafe.getJavaMirror(metaspaceKlass);
}
/**
*** 326,335 ****
--- 328,338 ----
* object.
*
* @param o Java heap object for which to fetch the class pointer
* @return a native metaspace {@code Klass} pointer
*/
+ @ForceInline
public long getKlassPointer(Object o) {
return theInternalUnsafe.getKlassPointer(o);
}
// These work on values in the C heap.
*** 490,499 ****
--- 493,503 ----
* @throws OutOfMemoryError if the allocation is refused by the system
*
* @see #getByte(long)
* @see #putByte(long, byte)
*/
+ @ForceInline
public long allocateMemory(long bytes) {
return theInternalUnsafe.allocateMemory(bytes);
}
/**
*** 520,529 ****
--- 524,534 ----
*
* @throws OutOfMemoryError if the allocation is refused by the system
*
* @see #allocateMemory
*/
+ @ForceInline
public long reallocateMemory(long address, long bytes) {
return theInternalUnsafe.reallocateMemory(address, bytes);
}
/**
*** 552,561 ****
--- 557,567 ----
*
* @throws RuntimeException if any of the arguments is invalid
*
* @since 1.7
*/
+ @ForceInline
public void setMemory(Object o, long offset, long bytes, byte value) {
theInternalUnsafe.setMemory(o, offset, bytes, value);
}
/**
*** 563,572 ****
--- 569,579 ----
* (usually zero). This provides a <em>single-register</em> addressing mode,
* as discussed in {@link #getInt(Object,long)}.
*
* <p>Equivalent to {@code setMemory(null, address, bytes, value)}.
*/
+ @ForceInline
public void setMemory(long address, long bytes, byte value) {
theInternalUnsafe.setMemory(address, bytes, value);
}
/**
*** 595,604 ****
--- 602,612 ----
*
* @throws RuntimeException if any of the arguments is invalid
*
* @since 1.7
*/
+ @ForceInline
public void copyMemory(Object srcBase, long srcOffset,
Object destBase, long destOffset,
long bytes) {
theInternalUnsafe.copyMemory(srcBase, srcOffset, destBase, destOffset, bytes);
}
*** 608,617 ****
--- 616,626 ----
* block. This provides a <em>single-register</em> addressing mode,
* as discussed in {@link #getInt(Object,long)}.
*
* Equivalent to {@code copyMemory(null, srcAddress, null, destAddress, bytes)}.
*/
+ @ForceInline
public void copyMemory(long srcAddress, long destAddress, long bytes) {
theInternalUnsafe.copyMemory(srcAddress, destAddress, bytes);
}
/**
*** 630,639 ****
--- 639,649 ----
*
* @throws RuntimeException if any of the arguments is invalid
*
* @see #allocateMemory
*/
+ @ForceInline
public void freeMemory(long address) {
theInternalUnsafe.freeMemory(address);
}
/// random queries
*** 661,670 ****
--- 671,681 ----
* the field locations in a form usable by {@link #getInt(Object,long)}.
* Therefore, code which will be ported to such JVMs on 64-bit platforms
* must preserve all bits of static field offsets.
* @see #getInt(Object, long)
*/
+ @ForceInline
public long objectFieldOffset(Field f) {
return theInternalUnsafe.objectFieldOffset(f);
}
/**
*** 682,691 ****
--- 693,703 ----
* a few bits to encode an offset within a non-array object,
* However, for consistency with other methods in this class,
* this method reports its result as a long value.
* @see #getInt(Object, long)
*/
+ @ForceInline
public long staticFieldOffset(Field f) {
return theInternalUnsafe.staticFieldOffset(f);
}
/**
*** 696,724 ****
--- 708,739 ----
* long)}. This value may be null. This value may refer to an object
* which is a "cookie", not guaranteed to be a real Object, and it should
* not be used in any way except as argument to the get and put routines in
* this class.
*/
+ @ForceInline
public Object staticFieldBase(Field f) {
return theInternalUnsafe.staticFieldBase(f);
}
/**
* Detects if the given class may need to be initialized. This is often
* needed in conjunction with obtaining the static field base of a
* class.
* @return false only if a call to {@code ensureClassInitialized} would have no effect
*/
+ @ForceInline
public boolean shouldBeInitialized(Class<?> c) {
return theInternalUnsafe.shouldBeInitialized(c);
}
/**
* Ensures the given class has been initialized. This is often
* needed in conjunction with obtaining the static field base of a
* class.
*/
+ @ForceInline
public void ensureClassInitialized(Class<?> c) {
theInternalUnsafe.ensureClassInitialized(c);
}
/**
*** 729,738 ****
--- 744,754 ----
* given class.
*
* @see #getInt(Object, long)
* @see #putInt(Object, long, int)
*/
+ @ForceInline
public int arrayBaseOffset(Class<?> arrayClass) {
return theInternalUnsafe.arrayBaseOffset(arrayClass);
}
/** The value of {@code arrayBaseOffset(boolean[].class)} */
*** 771,780 ****
--- 787,797 ----
*
* @see #arrayBaseOffset
* @see #getInt(Object, long)
* @see #putInt(Object, long, int)
*/
+ @ForceInline
public int arrayIndexScale(Class<?> arrayClass) {
return theInternalUnsafe.arrayIndexScale(arrayClass);
}
/** The value of {@code arrayIndexScale(boolean[].class)} */
*** 808,817 ****
--- 825,835 ----
* Reports the size in bytes of a native pointer, as stored via {@link
* #putAddress}. This value will be either 4 or 8. Note that the sizes of
* other primitive types (as stored in native memory blocks) is determined
* fully by their information content.
*/
+ @ForceInline
public int addressSize() {
return theInternalUnsafe.addressSize();
}
/** The value of {@code addressSize()} */
*** 819,828 ****
--- 837,847 ----
/**
* Reports the size in bytes of a native memory page (whatever that is).
* This value will always be a power of two.
*/
+ @ForceInline
public int pageSize() {
return theInternalUnsafe.pageSize();
}
*** 830,839 ****
--- 849,859 ----
/**
* Tells the VM to define a class, without security checks. By default, the
* class loader and protection domain come from the caller's class.
*/
+ @ForceInline
public Class<?> defineClass(String name, byte[] b, int off, int len,
ClassLoader loader,
ProtectionDomain protectionDomain) {
return theInternalUnsafe.defineClass(name, b, off, len, loader, protectionDomain);
}
*** 852,861 ****
--- 872,882 ----
* </ul>
* @param hostClass context for linkage, access control, protection domain, and class loader
* @param data bytes of a class file
* @param cpPatches where non-null entries exist, they replace corresponding CP entries in data
*/
+ @ForceInline
public Class<?> defineAnonymousClass(Class<?> hostClass, byte[] data, Object[] cpPatches) {
return theInternalUnsafe.defineAnonymousClass(hostClass, data, cpPatches);
}
/**
*** 867,876 ****
--- 888,898 ----
throws InstantiationException {
return theInternalUnsafe.allocateInstance(cls);
}
/** Throws the exception without telling the verifier. */
+ @ForceInline
public void throwException(Throwable ee) {
theInternalUnsafe.throwException(ee);
}
/**
*** 1107,1116 ****
--- 1129,1139 ----
* must be 1 to 3.
*
* @return the number of samples actually retrieved; or -1
* if the load average is unobtainable.
*/
+ @ForceInline
public int getLoadAverage(double[] loadavg, int nelems) {
return theInternalUnsafe.getLoadAverage(loadavg, nelems);
}
// The following contain CAS-based Java implementations used on
src/java.base/share/classes/sun/misc/Unsafe.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File