use of org.graalvm.word.UnsignedWord in project graal by oracle.
the class AlignedHeapChunkMemoryWalkerAccessFeature method getCardTableLimitOffset.
/**
* What is the offset of the limit of the card table?
*/
@Fold
static UnsignedWord getCardTableLimitOffset() {
final UnsignedWord tableStart = getCardTableStartOffset();
final UnsignedWord tableSize = getCardTableSize();
final UnsignedWord tableLimit = tableStart.add(tableSize);
final UnsignedWord alignment = WordFactory.unsigned(ConfigurationValues.getObjectLayout().getAlignment());
return UnsignedUtils.roundUp(tableLimit, alignment);
}
use of org.graalvm.word.UnsignedWord in project graal by oracle.
the class AlignedHeapChunkMemoryWalkerAccessFeature method getCardTableStartOffset.
/**
* What is the offset of the start of the card table?
*/
@Fold
static UnsignedWord getCardTableStartOffset() {
/* The card remembered set table starts right after the header fields. */
final UnsignedWord headerSize = getHeaderSize();
final UnsignedWord alignment = WordFactory.unsigned(ConfigurationValues.getObjectLayout().getAlignment());
return UnsignedUtils.roundUp(headerSize, alignment);
}
use of org.graalvm.word.UnsignedWord in project graal by oracle.
the class AlignedHeapChunkMemoryWalkerAccessFeature method getObjectsStartOffset.
/**
* Where do the objects start?
*/
@Fold
static UnsignedWord getObjectsStartOffset() {
final UnsignedWord fotLimit = getFirstObjectTableLimitOffset();
final UnsignedWord alignment = WordFactory.unsigned(ConfigurationValues.getObjectLayout().getAlignment());
final UnsignedWord result = UnsignedUtils.roundUp(fotLimit, alignment);
return result;
}
use of org.graalvm.word.UnsignedWord in project graal by oracle.
the class AlignedHeapChunkMemoryWalkerAccessFeature method allocateMemory.
/**
* Allocate memory within this AlignedHeapChunk. No initialization of the memory happens here.
*/
static Pointer allocateMemory(AlignedHeader that, UnsignedWord size) {
Pointer result = WordFactory.nullPointer();
final UnsignedWord available = availableObjectMemory(that);
/* Is memory available for the requested size? */
if (size.belowOrEqual(available)) {
/* Returned memory is at the start, */
result = that.getTop();
final Pointer newTop = result.add(size);
setTopCarefully(that, newTop);
}
return result;
}
use of org.graalvm.word.UnsignedWord in project graal by oracle.
the class AlignedHeapChunkMemoryWalkerAccessFeature method getCardTableSize.
/**
* How big is the card table?
*/
@Fold
static UnsignedWord getCardTableSize() {
/* How much space is there in the chunk? */
final UnsignedWord headerSize = getHeaderSize();
final UnsignedWord available = HeapPolicy.getAlignedHeapChunkSize().subtract(headerSize);
/* How big should the table be? */
final UnsignedWord requiredSize = CardTable.tableSizeForMemorySize(available);
final UnsignedWord alignment = WordFactory.unsigned(ConfigurationValues.getObjectLayout().getAlignment());
return UnsignedUtils.roundUp(requiredSize, alignment);
}
Aggregations