Search in sources :

Example 6 with Fold

use of org.graalvm.compiler.api.replacements.Fold 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);
}
Also used : UnsignedWord(org.graalvm.word.UnsignedWord) Fold(org.graalvm.compiler.api.replacements.Fold)

Example 7 with Fold

use of org.graalvm.compiler.api.replacements.Fold 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;
}
Also used : UnsignedWord(org.graalvm.word.UnsignedWord) Fold(org.graalvm.compiler.api.replacements.Fold)

Example 8 with Fold

use of org.graalvm.compiler.api.replacements.Fold 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);
}
Also used : UnsignedWord(org.graalvm.word.UnsignedWord) Fold(org.graalvm.compiler.api.replacements.Fold)

Example 9 with Fold

use of org.graalvm.compiler.api.replacements.Fold in project graal by oracle.

the class AlignedHeapChunkMemoryWalkerAccessFeature method getFirstObjectTableLimitOffset.

/**
 * What is the limit of the first object table?
 */
@Fold
static UnsignedWord getFirstObjectTableLimitOffset() {
    final UnsignedWord fotStart = getFirstObjectTableStartOffset();
    /* How big should the table be? */
    final UnsignedWord fotSize = getFirstObjectTableSize();
    final UnsignedWord fotLimit = fotStart.add(fotSize);
    final UnsignedWord alignment = WordFactory.unsigned(ConfigurationValues.getObjectLayout().getAlignment());
    return UnsignedUtils.roundUp(fotLimit, alignment);
}
Also used : UnsignedWord(org.graalvm.word.UnsignedWord) Fold(org.graalvm.compiler.api.replacements.Fold)

Example 10 with Fold

use of org.graalvm.compiler.api.replacements.Fold in project graal by oracle.

the class UnalignedHeapChunkMemoryWalkerAccessFeature method getCardTableStartOffset.

/*
     * Private methods for computing offsets within the chunk.
     */
/**
 * 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 = WordFactory.unsigned(SizeOf.get(UnalignedHeader.class));
    final UnsignedWord alignment = WordFactory.unsigned(ConfigurationValues.getObjectLayout().getAlignment());
    return UnsignedUtils.roundUp(headerSize, alignment);
}
Also used : UnsignedWord(org.graalvm.word.UnsignedWord) Fold(org.graalvm.compiler.api.replacements.Fold)

Aggregations

Fold (org.graalvm.compiler.api.replacements.Fold)11 UnsignedWord (org.graalvm.word.UnsignedWord)11