use of org.graalvm.word.UnsignedWord in project graal by oracle.
the class Target_java_lang_Runtime method visitRuntimeCompiledMethod.
@Override
public <T> boolean visitRuntimeCompiledMethod(T runtimeMethod, RuntimeCompiledMethodAccess<T> access) {
/* Is a runtime method allocated in some larger block of committed memory? */
final UnsignedWord size = access.getSize(runtimeMethod);
nonHeapUsed = nonHeapUsed.add(size);
nonHeapCommitted = nonHeapUsed.add(size);
return true;
}
use of org.graalvm.word.UnsignedWord in project graal by oracle.
the class Target_java_lang_Runtime method isPinned.
public boolean isPinned(Object instance) {
final ObjectHeaderImpl ohi = getObjectHeaderImpl();
final UnsignedWord headerBits = ObjectHeaderImpl.readHeaderBitsFromObject(instance);
/* The instance is pinned if it is in the image heap. */
if (ohi.isBootImageHeaderBits(headerBits)) {
return true;
}
final Space pinnedFromSpace = getOldGeneration().getPinnedFromSpace();
final Space pinnedToSpace = getOldGeneration().getPinnedToSpace();
if (ohi.isAlignedHeader(headerBits)) {
final AlignedHeapChunk.AlignedHeader aChunk = AlignedHeapChunk.getEnclosingAlignedHeapChunk(instance);
final Space space = aChunk.getSpace();
/* The instance is pinned if it is in the pinned from space. */
if ((space == pinnedFromSpace) || (space == pinnedToSpace)) {
return true;
}
}
if (ohi.isUnalignedHeader(headerBits)) {
final UnalignedHeapChunk.UnalignedHeader uChunk = UnalignedHeapChunk.getEnclosingUnalignedHeapChunk(instance);
final Space space = uChunk.getSpace();
/* The instance is pinned if it is in the pinned from space. */
if ((space == pinnedFromSpace) || (space == pinnedToSpace)) {
return true;
}
}
/* Look down the list of individually pinned objects. */
for (PinnedObjectImpl pinnedObject = getPinHead().get(); pinnedObject != null; pinnedObject = pinnedObject.getNext()) {
if (instance == pinnedObject.getObject()) {
return true;
}
}
return false;
}
use of org.graalvm.word.UnsignedWord in project graal by oracle.
the class Target_java_lang_Runtime method getUsedObjectBytes.
/**
* Return the size, in bytes, of the actual used memory, not the committed memory.
*/
public UnsignedWord getUsedObjectBytes() {
final Space youngSpace = getYoungGeneration().getSpace();
final UnsignedWord youngBytes = youngSpace.getObjectBytes();
final Space fromSpace = getOldGeneration().getFromSpace();
final UnsignedWord fromBytes = fromSpace.getObjectBytes();
final Space pinnedSpace = getOldGeneration().getPinnedFromSpace();
final UnsignedWord pinnedBytes = pinnedSpace.getObjectBytes();
final UnsignedWord result = youngBytes.add(fromBytes).add(pinnedBytes);
return result;
}
use of org.graalvm.word.UnsignedWord in project graal by oracle.
the class Target_java_lang_Runtime method visitNativeImageHeapRegion.
/*
* Implementations of methods declared by MemoryWalker.Visitor.
*/
@Override
public <T> boolean visitNativeImageHeapRegion(T bootImageHeapRegion, NativeImageHeapRegionAccess<T> access) {
final UnsignedWord size = access.getSize(bootImageHeapRegion);
heapUsed = heapUsed.add(size);
heapCommitted = heapCommitted.add(size);
return true;
}
use of org.graalvm.word.UnsignedWord in project graal by oracle.
the class HeapPolicy method setMinimumHeapSize.
/**
* Set the minimum heap size, returning the previous value.
*/
public static UnsignedWord setMinimumHeapSize(UnsignedWord value) {
final UnsignedWord result = minimumHeapSize;
minimumHeapSize = value;
return result;
}
Aggregations