Search in sources :

Example 1 with HostedByteBufferPointer

use of com.oracle.svm.core.util.HostedByteBufferPointer in project graal by oracle.

the class AlignedChunkRememberedSet method enableRememberedSet.

@Platforms(Platform.HOSTED_ONLY.class)
public static void enableRememberedSet(HostedByteBufferPointer chunk, int chunkPosition, List<ImageHeapObject> objects) {
    // Completely clean the card table and the first object table.
    CardTable.cleanTable(getCardTableStart(chunk), getCardTableSize());
    FirstObjectTable.initializeTable(getFirstObjectTableStart(chunk), getFirstObjectTableSize());
    Pointer fotStart = getFirstObjectTableStart(chunk);
    UnsignedWord objectsStartOffset = AlignedHeapChunk.getObjectsStartOffset();
    for (ImageHeapObject obj : objects) {
        long offsetWithinChunk = obj.getOffset() - chunkPosition;
        assert offsetWithinChunk > 0 && WordFactory.unsigned(offsetWithinChunk).aboveOrEqual(objectsStartOffset);
        UnsignedWord startOffset = WordFactory.unsigned(offsetWithinChunk).subtract(objectsStartOffset);
        UnsignedWord endOffset = startOffset.add(WordFactory.unsigned(obj.getSize()));
        FirstObjectTable.setTableForObject(fotStart, startOffset, endOffset);
    // The remembered set bit in the header will be set by the code that writes the objects.
    }
}
Also used : ImageHeapObject(com.oracle.svm.core.image.ImageHeapObject) UnsignedWord(org.graalvm.word.UnsignedWord) HostedByteBufferPointer(com.oracle.svm.core.util.HostedByteBufferPointer) Pointer(org.graalvm.word.Pointer) Platforms(org.graalvm.nativeimage.Platforms)

Example 2 with HostedByteBufferPointer

use of com.oracle.svm.core.util.HostedByteBufferPointer in project graal by oracle.

the class HostedImageHeapChunkWriter method enableRememberedSetForUnalignedChunk.

@Override
public void enableRememberedSetForUnalignedChunk(int chunkPosition) {
    int chunkOffset = getChunkOffsetInBuffer(chunkPosition);
    rememberedSet.enableRememberedSetForUnalignedChunk(new HostedByteBufferPointer(buffer, chunkOffset));
}
Also used : HostedByteBufferPointer(com.oracle.svm.core.util.HostedByteBufferPointer)

Example 3 with HostedByteBufferPointer

use of com.oracle.svm.core.util.HostedByteBufferPointer in project graal by oracle.

the class HostedImageHeapChunkWriter method enableRememberedSetForAlignedChunk.

@Override
public void enableRememberedSetForAlignedChunk(int chunkPosition, List<ImageHeapObject> objects) {
    int chunkOffset = getChunkOffsetInBuffer(chunkPosition);
    rememberedSet.enableRememberedSetForAlignedChunk(new HostedByteBufferPointer(buffer, chunkOffset), chunkPosition, objects);
}
Also used : HostedByteBufferPointer(com.oracle.svm.core.util.HostedByteBufferPointer)

Aggregations

HostedByteBufferPointer (com.oracle.svm.core.util.HostedByteBufferPointer)3 ImageHeapObject (com.oracle.svm.core.image.ImageHeapObject)1 Platforms (org.graalvm.nativeimage.Platforms)1 Pointer (org.graalvm.word.Pointer)1 UnsignedWord (org.graalvm.word.UnsignedWord)1