use of com.oracle.svm.core.annotate.Uninterruptible in project graal by oracle.
the class ThreadLocalAllocation method allocateSmallArray.
@Uninterruptible(reason = "Holds uninitialized memory, modifies TLAB")
private static Object allocateSmallArray(DynamicHub hub, int length, UnsignedWord size, ThreadLocalAllocation.Descriptor tlab, boolean rememberedSet, AlignedHeader newChunk) {
registerNewAllocationChunk(tlab, newChunk);
/*
* Allocate the memory. We must have a chunk, because we just registered one and we are
* still in the same block of uninterruptible code.
*/
Pointer memory = allocateMemory(tlab, size);
assert memory.isNonNull();
/* Install the DynamicHub and length, and zero the elements. */
return KnownIntrinsics.formatArray(memory, hub.asClass(), length, rememberedSet, false);
}
use of com.oracle.svm.core.annotate.Uninterruptible in project graal by oracle.
the class ThreadLocalAllocation method retireAllocationChunk.
/**
* Retire the current allocation chunk of current TLAB.
*/
@Uninterruptible(reason = "Modifies TLAB")
private static void retireAllocationChunk(Descriptor tlab) {
Pointer allocationTop = tlab.getAllocationTop(TOP_IDENTITY);
if (allocationTop.isNonNull()) {
AlignedHeader alignedChunk = tlab.getAlignedChunk();
assert alignedChunk.getTop().isNull();
assert alignedChunk.getEnd().equal(tlab.getAllocationEnd(END_IDENTITY));
/*
* While the aligned chunk is the allocation chunk its top value is always 'null' and it
* doesn't reflect the upper limit of allocated memory. The 'top' is stored in the TLAB
* and only set in the top aligned chunk when it is retired.
*/
alignedChunk.setTop(allocationTop);
tlab.setAllocationTop(WordFactory.nullPointer(), TOP_IDENTITY);
tlab.setAllocationEnd(WordFactory.nullPointer(), END_IDENTITY);
}
}
use of com.oracle.svm.core.annotate.Uninterruptible in project graal by oracle.
the class ThreadLocalAllocation method allocateNewInstanceUninterruptibly.
@Uninterruptible(reason = "Holds uninitialized memory, modifies TLAB")
private static Object allocateNewInstanceUninterruptibly(DynamicHub hub, ThreadLocalAllocation.Descriptor tlab, boolean rememberedSet, UnsignedWord size, AlignedHeader newChunk) {
registerNewAllocationChunk(tlab, newChunk);
/*
* Allocate the memory. We must have a chunk, because we just registered one and we are
* still in the same block of uninterruptible code.
*/
Pointer memory = allocateMemory(tlab, size);
assert memory.isNonNull();
/* Install the DynamicHub and zero the fields. */
return KnownIntrinsics.formatObject(memory, hub.asClass(), rememberedSet);
}
use of com.oracle.svm.core.annotate.Uninterruptible in project graal by oracle.
the class ThreadLocalAllocation method popFromThreadLocalFreeList.
/**
* Pop an aligned chunk from the thread-local list of free chunks, or null if the list is empty.
*/
@Uninterruptible(reason = "Pops from the free list that is drained, at a safepoint, by garbage collections.")
private static AlignedHeader popFromThreadLocalFreeList() {
final AlignedHeader result = freeList.get();
if (result.isNonNull()) {
final AlignedHeader next = result.getNext();
result.setNext(WordFactory.nullPointer());
freeList.set(next);
}
return result;
}
use of com.oracle.svm.core.annotate.Uninterruptible in project graal by oracle.
the class AllocationSnippets method doCloneUninterruptibly.
@Uninterruptible(reason = "Copies via Pointers")
private static // TODO: What if the bytes being written need remembered set operations?
Object doCloneUninterruptibly(Object thisObject, Object thatObject, UnsignedWord firstFieldOffset, UnsignedWord size) {
Pointer thatMemory = Word.objectToUntrackedPointer(thatObject);
/*
* Copy the thisObj over thatMemory. Excluding the hub to make sure that no GC-relevant
* header bits are transfered from thisObj to the clone.
*/
Pointer thisMemory = Word.objectToUntrackedPointer(thisObject);
UnsignedWord offset = firstFieldOffset;
while (offset.belowThan(size)) {
thatMemory.writeWord(offset, thisMemory.readWord(offset));
offset = offset.add(ConfigurationValues.getTarget().wordSize);
}
final Object result = thatMemory.toObjectNonNull();
return result;
}
Aggregations